From ac2173ee4164c23aac4b329a4a907b60a39d7898 Mon Sep 17 00:00:00 2001 From: Rafael Goncalves Date: Tue, 1 Oct 2024 17:01:07 -0400 Subject: [PATCH] Update documentation --- .github/workflows/mapper-test.yml | 76 ------------------------------- README-UI.md | 2 +- README.md | 22 +++++++-- docs/source/conf.py | 1 - setup.py | 4 +- text2term/config.py | 2 +- 6 files changed, 21 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/mapper-test.yml diff --git a/.github/workflows/mapper-test.yml b/.github/workflows/mapper-test.yml deleted file mode 100644 index bedb94b..0000000 --- a/.github/workflows/mapper-test.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Mapper Test - -on: - push: - branches: [task5-workflow] - pull_request: - branches: [task5-workflow] - -jobs: - run_mapper: - runs-on: ubuntu-latest - name: Run Tests - steps: - - uses: actions/checkout@v2 - name: Checkout out mapper repository - - uses: actions/checkout@v2 - name: Checkout test repository - with: - path: tests - repository: "ccb-hms/ontology-mapper-tests" - token: ${{ secrets.MAPPER_TESTING }} - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Run mapper on UK Biobank source terms - run: | - python3 text2term.py -s $source_path -t $target_path -min 0 -o "./tests/mapper-outputs/ukb-efo/${GITHUB_SHA}.csv" - env: - source_path: ./tests/data/ukb-efo/terms.txt - # https://github.com/EBISPOT/efo/releases/tag/v2019-03-18 - # 2019-03-18 EFO 2.106, as referenced by: - # https://github.com/EBISPOT/EFO-UKB-mappings/blob/master/ISMB_Mapping_UK_Biobank_to_EFO.pdf - # page 2, footnote 9 - target_path: ./tests/data/ukb-efo/efo-v2019-03-18.owl - - name: Setup summary spreadsheet row - run: | - if grep -q "," <<< "${{ github.event.head_commit.message }}" - then - MSG='"${{ github.event.head_commit.message }}"' - else - MSG='${{ github.event.head_commit.message }}' - fi - echo -n "${GITHUB_REF},${GITHUB_SHA},${MSG},ukb-efo/${GITHUB_SHA}.csv," >> $summary_path - working-directory: tests - env: - summary_path: summary.csv - - name: Run coverage__one_error script - run: | - python3 $script_path - working-directory: tests/compare-scripts - env: - script_path: coverage_one_error.py - - name: Commit changes to tests repo - run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add mapper-outputs/* - git add summary.csv - git commit -m "Add files" - working-directory: tests - - name: Push changes - uses: ad-m/github-push-action@master - with: - repository: "ccb-hms/ontology-mapper-tests" - github_token: ${{ secrets.MAPPER_TESTING }} - directory: "tests" diff --git a/README-UI.md b/README-UI.md index 7846136..39846ac 100644 --- a/README-UI.md +++ b/README-UI.md @@ -1,5 +1,5 @@ # ontology-mapper-ui -The following information pertains to the text2term UI, which is written [here](https://github.com/ccb-hms/ontology-mapper-ui) and runs online [here](https://text2term.hms.harvard.edu/). It supports fewer features than the base package does, but provides a user interface for non-programmers. +The following information pertains to the text2term UI, which is written [here](https://github.com/rsgoncalves/text2term-ui) and runs online [here](https://text2term.hms.harvard.edu/). It supports fewer features than the base package does, but provides a user interface for non-programmers. ### Running Locally via Node + Python diff --git a/README.md b/README.md index ff61ac8..7421a09 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ PyPI - + PyPI - License - - Tests + + Tests arXiv preprint @@ -80,7 +80,19 @@ dfo = mondo.map_terms(source_terms=["asthma", "acute bronchitis"]) ### Examples of Command Line Interface Use -To show a help message describing all arguments type into a terminal: +To use text2term from the command-line, the current working folder (in the command line) must be the folder containing the text2term package. This can be achieved as follows: + +Identify where pip installed text2term using: +```pip show texterm``` + +Change to the directory specified in the “Location” field, e.g.: + +```cd /opt/homebrew/lib/python3.9/site-packages``` + +> [!NOTE] +> If the tool is cloned from GitHub and then installed using `pip install path/to/text2term`—where `path/to/text2term` is the cloned folder containing `setup.py`—then text2term can be called from that folder + +Then you can run text2term commands from the terminal. For example, to show a help message describing all arguments type into a terminal: ```shell python text2term --help ``` @@ -205,7 +217,7 @@ text2term.cache_ontology(ontology_url, ontology_acronym="", base_iris=()) ``` This caches a single ontology from a URL or file path, and takes an optional acronym that will be used to reference the cached ontology later. If no acronym is given, the URL is used as the name. -It is also possible to cache multiple ontologies, whose names and URLs are specified in a table formatted as such `acronym,version,url`. An example is provided in [resources/ontologies.csv](https://github.com/ccb-hms/ontology-mapper/blob/main/text2term/resources/ontologies.csv): +It is also possible to cache multiple ontologies, whose names and URLs are specified in a table formatted as such `acronym,version,url`. An example is provided in [resources/ontologies.csv](https://github.com/rsgoncalves/text2term/blob/main/text2term/resources/ontologies.csv): ```python text2term.cache_ontology_set(ontology_registry_path) ``` diff --git a/docs/source/conf.py b/docs/source/conf.py index 5713476..a7af36f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,6 @@ html_theme = 'pyramid' html_static_path = ['_static'] -# html_logo = "ccb_logo.jpg" html_theme_options = { 'sidebarwidth': 280 } diff --git a/setup.py b/setup.py index 7455ca3..aedfe5a 100644 --- a/setup.py +++ b/setup.py @@ -13,12 +13,12 @@ install_requires=requirements, packages=find_packages(), include_package_data=True, - url='https://github.com/ccb-hms/ontology-mapper', + url='https://github.com/rsgoncalves/text2term', license='MIT', description=description, long_description=long_description, long_description_content_type='text/markdown', - author='Center for Computational Biomedicine, Harvard Medical School', + author='Rafael Goncalves, Jason Payne', author_email='rsgoncalves@gmx.com', classifiers=[ 'Development Status :: 4 - Beta', diff --git a/text2term/config.py b/text2term/config.py index f045f1a..12865f4 100644 --- a/text2term/config.py +++ b/text2term/config.py @@ -1 +1 @@ -VERSION = "4.2.1" +VERSION = "4.3.0"