From 3a211d5e30bdd41005ff819c7b3b386bad807ba6 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:23:34 -0700 Subject: [PATCH 01/50] migrate to pyproject.toml since setup.py will be deprecated --- pyproject.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..eb6d3475 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "trtools" +authors = [ + {name = "Melissa Gymrek", email = "mgymrek@ucsd.edu"}, +] +description = "Toolkit for genome-wide analysis of STRs" +readme = "README.rst" +requires-python = ">=3.5" +license = {text = "MIT"} +license-files = ["LICENSE.txt"] +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3.5", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Bio-Informatics", +] +dependencies = [ + "cyvcf2", + "matplotlib", + "numpy", + "pandas", + "pybedtools", + "pysam", + "scikit-learn", + "scipy", + "statsmodels", +] +dynamic = ["version"] + +[tool.setuptools] +packages = ["trtools"] +script-files = ["trtools/testsupport/test_trtools.sh", "scripts/trtools_prep_beagle_vcf.sh"] + +[project.scripts] +dumpSTR = "trtools.dumpSTR:run" +mergeSTR = "trtools.mergeSTR:run" +statSTR = "trtools.statSTR:run" +compareSTR = "trtools.compareSTR:run" +qcSTR = "trtools.qcSTR:run" +associaTR = "trtools.associaTR:run" + +[tool.setuptools.dynamic] +version = {attr = "trtools.version"} + +[project.urls] +Homepage = "https://trtools.readthedocs.org" +Documentation = "https://trtools.readthedocs.org" +Repository = "https://github.com/gymrek-lab/trtools.git" +Changelog = "https://github.com/gymrek-lab/trtools/blob/master/RELEASE_NOTES.rst" From 287c1cc6d41557ddcf299a27f1b9f07d76e1beab Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:24:21 -0700 Subject: [PATCH 02/50] Delete setup.py --- setup.py | 72 -------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index bfb4deb8..00000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -import os -from setuptools import setup, find_packages - -DESCRIPTION = "Toolkit for genome-wide analysis of STRs" -LONG_DESCRIPTION = DESCRIPTION -NAME = "trtools" -AUTHOR = "Melissa Gymrek" -AUTHOR_EMAIL = "mgymrek@ucsd.edu" -MAINTAINER = "Melissa Gymrek" -MAINTAINER_EMAIL = "mgymrek@ucsd.edu" -DOWNLOAD_URL = 'http://github.com/gymreklab/TRTools' -LICENSE = 'MIT' - -# version-keeping code based on pybedtools -curdir = os.path.abspath(os.path.dirname(__file__)) -MAJ = 5 -MIN = 0 -REV = 2 -VERSION = '%d.%d.%d' % (MAJ, MIN, REV) -with open(os.path.join(curdir, 'trtools/version.py'), 'w') as fout: - fout.write( - "\n".join(["", - "# THIS FILE IS GENERATED FROM SETUP.PY", - "version = '{version}'", - "__version__ = version"]).format(version=VERSION) - ) - -setup(name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - maintainer=MAINTAINER, - maintainer_email=MAINTAINER_EMAIL, - url=DOWNLOAD_URL, - download_url=DOWNLOAD_URL, - license=LICENSE, - python_requires='>=3.5', - packages=find_packages(), - include_package_data=True, - license_file="LICENSE.txt", - scripts=[ - "trtools/testsupport/test_trtools.sh", - 'scripts/trtools_prep_beagle_vcf.sh' - ], - entry_points={ - 'console_scripts': [ - 'dumpSTR=trtools.dumpSTR:run', - 'mergeSTR=trtools.mergeSTR:run', - 'statSTR=trtools.statSTR:run', - 'compareSTR=trtools.compareSTR:run', - 'qcSTR=trtools.qcSTR:run', - 'associaTR=trtools.associaTR:run' - ], - }, - install_requires=['cyvcf2', - 'matplotlib', - 'numpy', - 'pandas', - 'pybedtools', - 'pysam', - 'scikit-learn', - 'scipy', - 'statsmodels'], - classifiers=['Development Status :: 4 - Beta',\ - 'Programming Language :: Python :: 3.5',\ - 'License :: OSI Approved :: MIT License',\ - 'Operating System :: OS Independent',\ - 'Intended Audience :: Science/Research',\ - 'Topic :: Scientific/Engineering :: Bio-Informatics'] - ) From 756ab8f811a5ede7ed2a8431e284f524f4eb0052 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:27:58 -0700 Subject: [PATCH 03/50] fix deprecations in .readthedocs.yml --- .readthedocs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index a8601014..e4d98637 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,6 +5,11 @@ # Required version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "3.5" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: doc/conf.py From f04876558f3b164e01ed1d75501574b8b9cbbb1d Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:30:08 -0700 Subject: [PATCH 04/50] upgrade to python 3.8 in readthedocs build --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index e4d98637..e128cbf7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,7 +8,7 @@ version: 2 build: os: "ubuntu-22.04" tools: - python: "3.5" + python: "3.8" # Build documentation in the docs/ directory with Sphinx sphinx: From b843aad15677485b647d27b36cb32c7104450dcb Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:34:44 -0700 Subject: [PATCH 05/50] change python to mambaforge since we use a conda env see https://docs.readthedocs.io/en/stable/config-file/v2.html#conda --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index e128cbf7..51b8d710 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,7 +8,7 @@ version: 2 build: os: "ubuntu-22.04" tools: - python: "3.8" + python: "mambaforge-22.9" # Build documentation in the docs/ directory with Sphinx sphinx: From aa1e4e78f3e80dd7becc9ca482e113a4adab5213 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:41:47 -0700 Subject: [PATCH 06/50] add sphinx-rtd-theme to readthedocs conda env --- .readthedocs_conda_env.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs_conda_env.yml b/.readthedocs_conda_env.yml index b972c0c1..ca70838a 100644 --- a/.readthedocs_conda_env.yml +++ b/.readthedocs_conda_env.yml @@ -2,7 +2,7 @@ name: trtools_3.6 channels: - conda-forge - bioconda - - defaults + - nodefaults dependencies: - python=3.6 - sphinx=3.0.4 @@ -17,4 +17,4 @@ dependencies: - scikit-learn - sphinx-autodoc-typehints - cyvcf2 - + - sphinx_rtd_theme From 45f5beda96b9ab8c6cb392b6ac1c28243488adf5 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:46:26 -0700 Subject: [PATCH 07/50] fix install directions to use conda-forge --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index faa62dbb..aa1ea2fb 100644 --- a/README.rst +++ b/README.rst @@ -33,13 +33,13 @@ With conda :: - conda install -c bioconda trtools + conda install -c conda-forge -c bioconda trtools Optionally install :code:`bcftools` which is used to prepare input files for TRTools by running: :: - conda install -c bioconda bcftools + conda install -c conda-forge -c bioconda bcftools Note: Bioconda only supports python versions 3.6-3.8 currently, so that is all TRTools supports in conda. From 4945cf991cee665f6473983e52d060711913af1e Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:50:50 -0700 Subject: [PATCH 08/50] can we get by without any warnings? --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 51b8d710..7d0baa34 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,6 +13,7 @@ build: # Build documentation in the docs/ directory with Sphinx sphinx: configuration: doc/conf.py + fail_on_warning: true # Optionally build your docs in additional formats such as PDF formats: From 7bc05e37179ddd1e57d8b60d961ec93acb34bdf0 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:57:49 -0700 Subject: [PATCH 09/50] add statsmodels to rtd for associaTR --- .readthedocs_conda_env.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs_conda_env.yml b/.readthedocs_conda_env.yml index ca70838a..8f8992ba 100644 --- a/.readthedocs_conda_env.yml +++ b/.readthedocs_conda_env.yml @@ -18,3 +18,4 @@ dependencies: - sphinx-autodoc-typehints - cyvcf2 - sphinx_rtd_theme + - statsmodels From 62810439a576742d1ad65a67b3f080a0c05b76df Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:07:56 -0700 Subject: [PATCH 10/50] remove now unnecessary fixed_sidebar option the option was specific to alabaster but we changed to rtd in #179 --- doc/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 060dfa32..6874733d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -73,9 +73,6 @@ 'searchbox.html' ] } -html_theme_options = { - 'fixed_sidebar' : True -} # Add any paths that contain custom static files (such as style sheets) here, From 08f350f1a96cd9ad1b31efb3f843cc73bcabe888 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:13:44 -0700 Subject: [PATCH 11/50] try to resolve rtd warnings by removing trtools.compareSTR.Tuple --- trtools/compareSTR/compareSTR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trtools/compareSTR/compareSTR.py b/trtools/compareSTR/compareSTR.py index 77fef1ff..c8ad324b 100644 --- a/trtools/compareSTR/compareSTR.py +++ b/trtools/compareSTR/compareSTR.py @@ -29,7 +29,7 @@ import trtools.utils.utils as utils from trtools import __version__ -from typing import List, Any, Callable, Tuple, Optional +from typing import List, Any, Callable, Optional def GetFormatFields(format_fields, format_binsizes, format_fileoption, vcfreaders): From 9f8467077052da819421c43b256a2cd351e0eca4 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:22:31 -0700 Subject: [PATCH 12/50] try to create pytest github action --- .github/workflows/tests.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..f27665fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Test with pytest + +on: [pull_request, workflow_call] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Setup Python # Set Python version + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + # Install pip and pytest + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov + - name: Test with pytest + run: python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml + - name: Upload pytest test results + uses: actions/upload-artifact@v3 + with: + name: pytest-results-${{ matrix.python-version }} + path: junit/test-results-${{ matrix.python-version }}.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} From 90d1585dcbc1ae2f132479681c225435cc33eeee Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:23:53 -0700 Subject: [PATCH 13/50] remove deprecated py3.6 from ci --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f27665fa..3c0efd8c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 From 38565e8eb2f2e73cd0cb555200b2773d1e08f852 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:28:21 -0700 Subject: [PATCH 14/50] try to install trtools within CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c0efd8c..9bca2945 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-cov + pip install pytest pytest-cov trtools - name: Test with pytest run: python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml - name: Upload pytest test results From aaddb387cb4964d7bfc766a1f9f5eff9f91d3e1e Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:43:44 -0700 Subject: [PATCH 15/50] try to resolve failing test ERROR trtools/testsupport/sample_vcfs/associaTR/generate_traits.py - FileNotFoundError: [Errno 2] No such file or directory: 'samples.txt' --- trtools/testsupport/sample_vcfs/associaTR/generate_traits.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trtools/testsupport/sample_vcfs/associaTR/generate_traits.py b/trtools/testsupport/sample_vcfs/associaTR/generate_traits.py index 1ec68e81..80861ad8 100755 --- a/trtools/testsupport/sample_vcfs/associaTR/generate_traits.py +++ b/trtools/testsupport/sample_vcfs/associaTR/generate_traits.py @@ -1,11 +1,14 @@ #!/usr/bin/env python3 +import pathlib import numpy as np import numpy.random seed = 2 -with open('samples.txt') as samples_file: +SCRIPT_DIR = pathlib.Path(__file__).parent.resolve() + +with open(SCRIPT_DIR / 'samples.txt') as samples_file: samples = np.array([int(sample.strip()) for sample in samples_file.readlines() if 'IID' not in sample]) n_samples = len(samples) From 61a22dfdc3034df6ee480d8dbdc8bf05a6ad9ba2 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:50:45 -0700 Subject: [PATCH 16/50] try to resolve another error in the CI ERROR trtools/testsupport/sample_vcfs/associaTR/make_dosages.py - OSError: Error opening many_samples_biallelic.vcf.gz --- trtools/testsupport/sample_vcfs/associaTR/make_dosages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py index ed9ca996..d9f0c181 100755 --- a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py +++ b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import pathlib import random import cyvcf2 @@ -9,9 +10,11 @@ random.seed(11) +SCRIPT_DIR = pathlib.Path(__file__).parent.resolve() + # biallelic -vcf = cyvcf2.VCF('many_samples_biallelic.vcf.gz') +vcf = cyvcf2.VCF(str(SCRIPT_DIR / 'many_samples_biallelic.vcf.gz')) samples = vcf.samples with open('gp_dosages.tsv', 'w') as gp_out, open('ap1_dosages.tsv', 'w') as ap1_out, open('ap2_dosages.tsv', 'w') as ap2_out: From eed6e1b70c18d48e14921d52ccd920635d331e23 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:08:57 -0700 Subject: [PATCH 17/50] add bcftools and friends to CI env --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9bca2945..d075f08f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + $CONDA/bin/conda install -y -n base -c conda-forge -c bioconda bcftools # Install pip and pytest - name: Install dependencies run: | From eac68c06571d13913152f4469b018360534e5917 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:44:50 -0700 Subject: [PATCH 18/50] check whether bcftools is installed --- .github/workflows/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d075f08f..937ae7fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,17 +16,19 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install test dependencies run: | # $CONDA is an environment variable pointing to the root of the miniconda directory $CONDA/bin/conda install -y -n base -c conda-forge -c bioconda bcftools # Install pip and pytest - - name: Install dependencies + - name: Install pytest and trtools run: | python -m pip install --upgrade pip pip install pytest pytest-cov trtools - name: Test with pytest - run: python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml + run: | + bcftools --help + python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml - name: Upload pytest test results uses: actions/upload-artifact@v3 with: From b6bf0ca31d8bd2385f0427ea4404f82d134a7948 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:09:32 -0700 Subject: [PATCH 19/50] try to use mamba instead of pure python --- .github/workflows/tests.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 937ae7fa..58c182f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,18 +12,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python # Set Python version - uses: actions/setup-python@v4 + - name: Set up mamba + uses: conda-incubator/setup-miniconda@v2 with: + activate-environment: test + auto-activate-base: false python-version: ${{ matrix.python-version }} - - name: Install test dependencies - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - $CONDA/bin/conda install -y -n base -c conda-forge -c bioconda bcftools - # Install pip and pytest + miniforge-version: latest + miniforge-variant: Mambaforge + use-mamba: true + - name: Install conda dependencies + run: conda install -c conda-forge -c bioconda bcftools pip - name: Install pytest and trtools run: | - python -m pip install --upgrade pip pip install pytest pytest-cov trtools - name: Test with pytest run: | From ab73fbcb121c2c0ee879ad7e769de7735d10e75d Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:18:08 -0700 Subject: [PATCH 20/50] add bash -el to all conda steps as seen here: https://github.com/conda-incubator/setup-miniconda#example-1-basic-usage --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 58c182f1..bbea1423 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,12 +21,17 @@ jobs: miniforge-version: latest miniforge-variant: Mambaforge use-mamba: true + mamba-version: "*" - name: Install conda dependencies - run: conda install -c conda-forge -c bioconda bcftools pip + shell: bash -el {0} + run: | + mamba install -c conda-forge -c bioconda bcftools pip - name: Install pytest and trtools + shell: bash -el {0} run: | pip install pytest pytest-cov trtools - name: Test with pytest + shell: bash -el {0} run: | bcftools --help python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml From 1fdf8e5cb445469e3eab26d5956efe1c8b5d8802 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:40:50 -0700 Subject: [PATCH 21/50] try to execute all of make_dosages.py in its dir --- trtools/testsupport/sample_vcfs/associaTR/make_dosages.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py index d9f0c181..a53233f1 100755 --- a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py +++ b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -import pathlib import random +import pathlib import cyvcf2 import numpy as np @@ -91,11 +91,11 @@ 'tabix -f many_samples_biallelic_dosages.vcf.gz ' '"' ) -sp.run(cmd, shell = True, check=True) +sp.run(cmd, shell = True, check=True, cwd=str(SCRIPT_DIR)) # multiallelic -vcf = cyvcf2.VCF('many_samples_multiallelic.vcf.gz') +vcf = cyvcf2.VCF(str(SCRIPT_DIR / 'many_samples_multiallelic.vcf.gz')) samples = vcf.samples with open('ap1_multi_dosages.tsv', 'w') as ap1_out, open('ap2_multi_dosages.tsv', 'w') as ap2_out: @@ -142,5 +142,5 @@ 'tabix -f many_samples_multiallelic_dosages.vcf.gz ' '"' ) -sp.run(cmd, shell = True, check=True) +sp.run(cmd, shell = True, check=True, cwd=str(SCRIPT_DIR)) From 09289ea85221c4ab5127419b0b10893102a2e7a6 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:52:06 -0700 Subject: [PATCH 22/50] ensure the current directory is used for all output from make_dosages --- trtools/testsupport/sample_vcfs/associaTR/make_dosages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py index a53233f1..1d8fa699 100755 --- a/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py +++ b/trtools/testsupport/sample_vcfs/associaTR/make_dosages.py @@ -17,7 +17,7 @@ vcf = cyvcf2.VCF(str(SCRIPT_DIR / 'many_samples_biallelic.vcf.gz')) samples = vcf.samples -with open('gp_dosages.tsv', 'w') as gp_out, open('ap1_dosages.tsv', 'w') as ap1_out, open('ap2_dosages.tsv', 'w') as ap2_out: +with open(str(SCRIPT_DIR / 'gp_dosages.tsv'), 'w') as gp_out, open(str(SCRIPT_DIR / 'ap1_dosages.tsv'), 'w') as ap1_out, open(str(SCRIPT_DIR / 'ap2_dosages.tsv'), 'w') as ap2_out: for var in vcf: gp_out.write('{}\t{}\t{}'.format(var.CHROM, var.POS, var.POS)) ap1_out.write('{}\t{}\t{}'.format(var.CHROM, var.POS, var.POS)) @@ -98,7 +98,7 @@ vcf = cyvcf2.VCF(str(SCRIPT_DIR / 'many_samples_multiallelic.vcf.gz')) samples = vcf.samples -with open('ap1_multi_dosages.tsv', 'w') as ap1_out, open('ap2_multi_dosages.tsv', 'w') as ap2_out: +with open(str(SCRIPT_DIR / 'ap1_multi_dosages.tsv'), 'w') as ap1_out, open(str(SCRIPT_DIR / 'ap2_multi_dosages.tsv'), 'w') as ap2_out: for var in vcf: ap1_out.write('{}\t{}\t{}'.format(var.CHROM, var.POS, var.POS)) ap2_out.write('{}\t{}\t{}'.format(var.CHROM, var.POS, var.POS)) From 8fd0724093bb1118f51722a5c7e9cb01f2b01c92 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:26:48 -0700 Subject: [PATCH 23/50] fix faulty doctests --- trtools/utils/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trtools/utils/utils.py b/trtools/utils/utils.py index 3324422f..cec3307c 100644 --- a/trtools/utils/utils.py +++ b/trtools/utils/utils.py @@ -186,7 +186,7 @@ def GetEntropy(allele_freqs: Dict[Any, float]) -> float: Examples -------- >>> GetEntropy({0:0.5, 1:0.5}) - 1 + 1.0 """ if not ValidateAlleleFreqs(allele_freqs): return np.nan @@ -209,7 +209,7 @@ def GetMean(allele_freqs): Examples -------- - >>> GetMean({0:0, 1:1}) + >>> GetMean({0:0.5, 1:0.5}) 0.5 """ if not ValidateAlleleFreqs(allele_freqs): @@ -356,7 +356,7 @@ def GetCanonicalMotif(repseq): Examples -------- >>> GetCanonicalMotif("TG") - "AC" + 'AC' """ repseq = repseq.upper() # Get canonical sequence of each strand @@ -389,7 +389,7 @@ def GetCanonicalOneStrand(repseq): Examples -------- >>> GetCanonicalOneStrand("CAG") - "AGC" + 'AGC' """ repseq = repseq.upper() size = len(repseq) @@ -421,7 +421,7 @@ def ReverseComplement(seq): Examples -------- >>> ReverseComplement("AGGCT") - "AGCCT" + 'AGCCT' """ seq = seq.upper() newseq = "" From 980f4fe510cc5a997c6064d19f5dc14087db57d7 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:38:22 -0700 Subject: [PATCH 24/50] require min coverage of 90% --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bbea1423..b0ed459e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,8 +33,7 @@ jobs: - name: Test with pytest shell: bash -el {0} run: | - bcftools --help - python -m pytest --cov=. --cov-report term-missing --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml + python -m pytest --cov=. --cov-report term-missing --cov-fail-under 90 --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml - name: Upload pytest test results uses: actions/upload-artifact@v3 with: From 43d75c6aac039b04d95d72941c46a0e6ba6568b8 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:45:31 -0700 Subject: [PATCH 25/50] oops - current coverage is 89.77% --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0ed459e..df10b6d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: - name: Test with pytest shell: bash -el {0} run: | - python -m pytest --cov=. --cov-report term-missing --cov-fail-under 90 --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml + python -m pytest --cov=. --cov-report term-missing --cov-fail-under 89 --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml - name: Upload pytest test results uses: actions/upload-artifact@v3 with: From d839fae20507014ee65d003f5f8487c79ce97f3c Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:18:33 -0700 Subject: [PATCH 26/50] move license_files to setuptools section --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eb6d3475..357833d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,6 @@ description = "Toolkit for genome-wide analysis of STRs" readme = "README.rst" requires-python = ">=3.5" license = {text = "MIT"} -license-files = ["LICENSE.txt"] classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3.5", @@ -36,6 +35,7 @@ dynamic = ["version"] [tool.setuptools] packages = ["trtools"] script-files = ["trtools/testsupport/test_trtools.sh", "scripts/trtools_prep_beagle_vcf.sh"] +license-files = ["LICENSE.txt"] [project.scripts] dumpSTR = "trtools.dumpSTR:run" From 6485243b4406e94ca8f617695c065a980bfab77b Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:39:24 -0700 Subject: [PATCH 27/50] infer version from git tags instead --- pyproject.toml | 3 --- trtools/__init__.py | 10 +++++++++- trtools/version.py | 4 ---- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 trtools/version.py diff --git a/pyproject.toml b/pyproject.toml index 357833d0..c43ac716 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,9 +45,6 @@ compareSTR = "trtools.compareSTR:run" qcSTR = "trtools.qcSTR:run" associaTR = "trtools.associaTR:run" -[tool.setuptools.dynamic] -version = {attr = "trtools.version"} - [project.urls] Homepage = "https://trtools.readthedocs.org" Documentation = "https://trtools.readthedocs.org" diff --git a/trtools/__init__.py b/trtools/__init__.py index 1f567094..82b20208 100644 --- a/trtools/__init__.py +++ b/trtools/__init__.py @@ -1,2 +1,10 @@ -from .version import __version__ +try: + from importlib.metadata import version, PackageNotFoundError +except ImportError: + # handles py < 3.8, since importlib.metadata was introduced in py3.8 + from importlib_metadata import version, PackageNotFoundError + try: + __version__ = version(__name__) + except PackageNotFoundError: + __version__ = "unknown" diff --git a/trtools/version.py b/trtools/version.py deleted file mode 100644 index e4741ae5..00000000 --- a/trtools/version.py +++ /dev/null @@ -1,4 +0,0 @@ - -# THIS FILE IS GENERATED FROM SETUP.PY -version = '5.0.2' -__version__ = version \ No newline at end of file From 2a42c413a22c152abdfefce3c2c4650d94badce0 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:47:44 -0700 Subject: [PATCH 28/50] generate version.py file at installation --- .gitignore | 1 + pyproject.toml | 3 +++ trtools/__init__.py | 11 +---------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index fcb2afaf..4010ead1 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ c57* build/ dist/ env.yaml +trtools/version.py # Files generated by examples NA12878_eh_reader.vcf.gz diff --git a/pyproject.toml b/pyproject.toml index c43ac716..ba51877d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,9 @@ packages = ["trtools"] script-files = ["trtools/testsupport/test_trtools.sh", "scripts/trtools_prep_beagle_vcf.sh"] license-files = ["LICENSE.txt"] +[tool.setuptools_scm] +version_file = "trtools/version.py" + [project.scripts] dumpSTR = "trtools.dumpSTR:run" mergeSTR = "trtools.mergeSTR:run" diff --git a/trtools/__init__.py b/trtools/__init__.py index 82b20208..58f3ace6 100644 --- a/trtools/__init__.py +++ b/trtools/__init__.py @@ -1,10 +1 @@ -try: - from importlib.metadata import version, PackageNotFoundError -except ImportError: - # handles py < 3.8, since importlib.metadata was introduced in py3.8 - from importlib_metadata import version, PackageNotFoundError - - try: - __version__ = version(__name__) - except PackageNotFoundError: - __version__ = "unknown" +from .version import __version__ From cf3af2ea96f2d0f298f7e3127abfb86d9e2d00e1 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:58:02 -0700 Subject: [PATCH 29/50] use editable install instaed --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df10b6d4..b5fa985b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,8 +3,8 @@ name: Test with pytest on: [pull_request, workflow_call] jobs: - build: - + tests: + name: Test with py${{ matrix.python }} runs-on: ubuntu-latest strategy: matrix: @@ -25,11 +25,11 @@ jobs: - name: Install conda dependencies shell: bash -el {0} run: | - mamba install -c conda-forge -c bioconda bcftools pip + mamba install -c conda-forge -c bioconda bcftools pip pytest pytest-cov - name: Install pytest and trtools shell: bash -el {0} run: | - pip install pytest pytest-cov trtools + pip install -e . - name: Test with pytest shell: bash -el {0} run: | From a804f990dfc870d03417cbf976bac77f7c9e93f9 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:05:37 -0700 Subject: [PATCH 30/50] upgrade pip before installing --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5fa985b..51a8e705 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: [pull_request, workflow_call] jobs: tests: - name: Test with py${{ matrix.python }} + name: Test with py${{ matrix.python-version }} runs-on: ubuntu-latest strategy: matrix: @@ -29,6 +29,7 @@ jobs: - name: Install pytest and trtools shell: bash -el {0} run: | + python -m pip install --upgrade pip pip install -e . - name: Test with pytest shell: bash -el {0} From 31734314152ab3d02cd788cf9d202318a0e0038f Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:16:04 -0700 Subject: [PATCH 31/50] ensure setuptools-scm is up to date --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 51a8e705..8a692519 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: - name: Install pytest and trtools shell: bash -el {0} run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools wheel setuptools-scm pip install -e . - name: Test with pytest shell: bash -el {0} From cbbb2044a9d766ca88b98ce574ef20f945e8c915 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:23:50 -0700 Subject: [PATCH 32/50] drop support for py 3.7 in CI b/c setuptools-scm doesn't support automated versioning for py 3.7 The version_file option was added as support for py3.7 was dropped: https://github.com/pypa/setuptools_scm/releases/tag/v8.0.0 --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a692519..8b85dd0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 @@ -22,11 +22,11 @@ jobs: miniforge-variant: Mambaforge use-mamba: true mamba-version: "*" - - name: Install conda dependencies + - name: Install test dependencies shell: bash -el {0} run: | mamba install -c conda-forge -c bioconda bcftools pip pytest pytest-cov - - name: Install pytest and trtools + - name: Upgrade pip and install our package shell: bash -el {0} run: | python -m pip install --upgrade pip setuptools wheel setuptools-scm From b11c129ee092495c901d66e034571f0bd49541fa Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:35:56 -0700 Subject: [PATCH 33/50] try to make readthedocs use editable install https://github.com/readthedocs/readthedocs.org/issues/6243#issuecomment-1094680856 --- .readthedocs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 7d0baa34..efde16c2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,6 +9,8 @@ build: os: "ubuntu-22.04" tools: python: "mambaforge-22.9" + commands: + - pip install -e . # Build documentation in the docs/ directory with Sphinx sphinx: From 95fedf0a2c20ea0e9aa23ba1a44d7d69061a0064 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:55:00 -0700 Subject: [PATCH 34/50] try to generate required html output --- .readthedocs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index efde16c2..828092ad 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -11,6 +11,8 @@ build: python: "mambaforge-22.9" commands: - pip install -e . + - (cd doc && make clean && make html) + - mv doc/_build $READTHEDOCS_OUTPUT # Build documentation in the docs/ directory with Sphinx sphinx: From 38eac3e38374b6c90d6be8f12a80783965186fe0 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:09:41 -0700 Subject: [PATCH 35/50] use temp dirty version when installing package in RTD --- .readthedocs.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 828092ad..8a7885b2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,10 +9,8 @@ build: os: "ubuntu-22.04" tools: python: "mambaforge-22.9" - commands: - - pip install -e . - - (cd doc && make clean && make html) - - mv doc/_build $READTHEDOCS_OUTPUT + pre_install: + - SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+dirty" # Build documentation in the docs/ directory with Sphinx sphinx: From 2a5ada012aa9e825875ccf0353caa36bcc3cc2bd Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:11:08 -0700 Subject: [PATCH 36/50] oops revise RTD config to include jobs section --- .readthedocs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 8a7885b2..b4336b20 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,8 +9,9 @@ build: os: "ubuntu-22.04" tools: python: "mambaforge-22.9" - pre_install: - - SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+dirty" + jobs: + pre_install: + - SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+dirty" # Build documentation in the docs/ directory with Sphinx sphinx: From ab755947e38596f59b0d20d16bb426c3ebe02d65 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:19:29 -0700 Subject: [PATCH 37/50] handle edge cases where version cannot be determined since this happens when someone does "pip install ." instead of "pip install -e ." (ie the editable version) https://github.com/pypa/setuptools_scm/issues/357 --- trtools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trtools/__init__.py b/trtools/__init__.py index 58f3ace6..a9a9f2a2 100644 --- a/trtools/__init__.py +++ b/trtools/__init__.py @@ -1 +1,4 @@ -from .version import __version__ +try: + from .version import __version__ +except ModuleNotFoundError: + __version__ == "unknown" From fb2260053d4a9ad656a12e40aae441d315604c10 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:23:01 -0700 Subject: [PATCH 38/50] ugh use = not == --- .readthedocs.yml | 3 --- trtools/__init__.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index b4336b20..7d0baa34 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,9 +9,6 @@ build: os: "ubuntu-22.04" tools: python: "mambaforge-22.9" - jobs: - pre_install: - - SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+dirty" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/trtools/__init__.py b/trtools/__init__.py index a9a9f2a2..e6d1bc83 100644 --- a/trtools/__init__.py +++ b/trtools/__init__.py @@ -1,4 +1,4 @@ try: from .version import __version__ except ModuleNotFoundError: - __version__ == "unknown" + __version__ = "unknown" From 4c4e2247dcc07863472873ede9fcdcdc1ef814fa Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:34:53 -0700 Subject: [PATCH 39/50] simply try removing version declaration in doc/conf.py --- .github/workflows/tests.yml | 4 ++++ PUBLISHING.rst | 5 +---- doc/conf.py | 5 ----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b85dd0c..681f0d51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,6 +2,10 @@ name: Test with pytest on: [pull_request, workflow_call] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: tests: name: Test with py${{ matrix.python-version }} diff --git a/PUBLISHING.rst b/PUBLISHING.rst index a27ae5ed..2753e56b 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -22,7 +22,7 @@ New Dependencies ---------------- If you've added dependencies to trtools or its tests, those dependencies should be listed in - * setup.py + * pyproject.toml * the .readthedocs_conda_env.yml file in the root of the repository that's used for building TRTool's Read The Docs webpage. * the appropriate section of the bioconda recipe (see below) @@ -45,9 +45,6 @@ Then go through the steps of merging the changes into the master branch: #. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. -#. Update the version number in setup.py -#. Run ``python setup.py sdist bdist_wheel`` (this ensures that trtools/version.py contains the updated version number) -#. Commit the changes to setup.py and trtools/version.py and push them. #. Submit a pull request from develop into master on the github webiste. #. If the code review and travis checks pass, merge the pull request. #. Tag the merge commit with the package version in vX.Y.Z format. (For more details on tagging, see `below`) diff --git a/doc/conf.py b/doc/conf.py index 6874733d..0ac50598 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,7 +13,6 @@ import os import sys sys.path.insert(0, os.path.abspath('..')) -import trtools.version # -- Project information ----------------------------------------------------- @@ -21,10 +20,6 @@ copyright = '2020, Gymreklab' author = 'Gymreklab' -# The full version, including alpha/beta/rc tags -version = trtools.version.version -release = trtools.version.version - master_doc = 'index' # -- General configuration --------------------------------------------------- From af035425ed52af1844d0ca321b51cca424c4b4fa Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:46:41 -0700 Subject: [PATCH 40/50] also perform command line tests --- .github/workflows/tests.yml | 4 ++++ PUBLISHING.rst | 13 +++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 681f0d51..3d7d3fb6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,10 @@ jobs: shell: bash -el {0} run: | python -m pytest --cov=. --cov-report term-missing --cov-fail-under 89 --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml + - name: Test command line + shell: bash -el {0) + run: | + ./test/cmdline_tests.sh - name: Upload pytest test results uses: actions/upload-artifact@v3 with: diff --git a/PUBLISHING.rst b/PUBLISHING.rst index 2753e56b..aa2d8f0e 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -42,7 +42,6 @@ Once changes have been made to develop that are ready to be published, first cho Then go through the steps of merging the changes into the master branch: -#. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. #. Submit a pull request from develop into master on the github webiste. @@ -53,15 +52,9 @@ Then go through the steps of publishing the changed code to PyPI: 1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. 2. Run :code:`rm -rf build dist *.egg-info` to make sure all previous build artifacts are removed -3. Run :code:`python setup.py sdist bdist_wheel` to build the package. - - This will create the warning:: - - UserWarning: Unknown distribution option: 'license_file' warnings.warn(msg) - - You can ignore this warning: the 'license_file' option is necessary for creating the build artifacts - -4. Run :code:`twine upload dist/*` to upload the build to PyPI +3. Run :code:`pip install build` to build the package. +4. Run :code:`python -m build --wheel --sdist` to create the package distribution files. +5. Run :code:`twine upload dist/*` to upload the distribution to PyPI Lastly, the change needs to be published to bioconda. From a2f0c57354837700cac8d59964e48934c2336076 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:55:39 -0700 Subject: [PATCH 41/50] remove travis config --- .github/workflows/tests.yml | 2 +- .travis.yml | 55 ------------------------------------- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d7d3fb6..3cc3e1c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,7 @@ jobs: run: | python -m pytest --cov=. --cov-report term-missing --cov-fail-under 89 --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml - name: Test command line - shell: bash -el {0) + shell: bash -el {0} run: | ./test/cmdline_tests.sh - name: Upload pytest test results diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 503e49ff..00000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -language: python - -jobs: - include: - - os: linux - python: 3.5 - - os: linux - python: 3.6 - - os: osx - osx_image: xcode12 - language: generic - env: PYTHON=36 - before_install: - - pip3 install virtualenv - - virtualenv -p python3 ~/venv - - source ~/venv/bin/activate - - python --version - - pip install -U --upgrade pip - - pip install -U pytest - - pip install -U pytest-cov - - pip install -U codecov - - pip install -U virtualenv - - wget https://github.com/samtools/bcftools/releases/download/1.10.2/bcftools-1.10.2.tar.bz2 - - tar -jvxf bcftools-1.10.2.tar.bz2 - - cd bcftools-1.10.2 && make && sudo make install && cd .. - - wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2 - - tar -jvxf htslib-1.10.2.tar.bz2 - - cd htslib-1.10.2 && make && sudo make install && cd .. - -before_install: # for linux jobs - - sudo apt-get update - # attempt to get cyvcf2 working, it requires a SHA256 'symbol' - - sudo apt-get -y install -y libcrypto++-dev libssl-dev libcurl4-openssl-dev - - python --version - - pip install -U --upgrade pip - - pip install -U pytest - - pip install -U pytest-cov - - pip install -U codecov - - pip install -U virtualenv - - wget https://github.com/samtools/bcftools/releases/download/1.10.2/bcftools-1.10.2.tar.bz2 - - tar -jvxf bcftools-1.10.2.tar.bz2 - - cd bcftools-1.10.2 && make && sudo make install && cd .. - - wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2 - - tar -jvxf htslib-1.10.2.tar.bz2 - - cd htslib-1.10.2 && make && sudo make install && cd .. - -install: - - pip install . - -script: - - python -m pytest --cov=. - - sh test/cmdline_tests.sh - -after_success: - - codecov From f592ede98862827191c800147f717b63d126ac22 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:10:07 -0700 Subject: [PATCH 42/50] update badge on README --- .github/workflows/tests.yml | 2 +- README.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3cc3e1c7..7907016c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Test with pytest +name: Tests on: [pull_request, workflow_call] diff --git a/README.rst b/README.rst index aa1ea2fb..499c91fb 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,8 @@ .. a location that the doc/index.rst uses for including this file .. before_header -.. image:: https://travis-ci.org/gymreklab/TRTools.svg?branch=master - :target: https://travis-ci.org/gymreklab/TRTools +.. image:: https://github.com/gymrek-lab/trtools/workflows/Tests/badge.svg + :target: https://github.com/gymrek-lab/trtools/workflows/Tests/badge.svg .. image:: https://codecov.io/gh/gymreklab/TRTools/branch/master/graph/badge.svg From c3b19ef5855e3049b406412bb88199e789e40e42 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:41:23 -0800 Subject: [PATCH 43/50] clarify how versioning works in the new system --- PUBLISHING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PUBLISHING.rst b/PUBLISHING.rst index aa2d8f0e..ebcb21fc 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -45,14 +45,14 @@ Then go through the steps of merging the changes into the master branch: #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. #. Submit a pull request from develop into master on the github webiste. -#. If the code review and travis checks pass, merge the pull request. +#. If the code review checks pass, merge the pull request. #. Tag the merge commit with the package version in vX.Y.Z format. (For more details on tagging, see `below`) Then go through the steps of publishing the changed code to PyPI: 1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. 2. Run :code:`rm -rf build dist *.egg-info` to make sure all previous build artifacts are removed -3. Run :code:`pip install build` to build the package. +3. Run :code:`pip install build` to build the package with the version number you just tagged. 4. Run :code:`python -m build --wheel --sdist` to create the package distribution files. 5. Run :code:`twine upload dist/*` to upload the distribution to PyPI From a3c2d2af68b8c08d79b6b0a93c8b7e4fec7c8133 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:46:20 -0800 Subject: [PATCH 44/50] add directions to test again before publishing --- PUBLISHING.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/PUBLISHING.rst b/PUBLISHING.rst index ebcb21fc..60fb514a 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -44,6 +44,7 @@ Then go through the steps of merging the changes into the master branch: #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. +#. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. #. Submit a pull request from develop into master on the github webiste. #. If the code review checks pass, merge the pull request. #. Tag the merge commit with the package version in vX.Y.Z format. (For more details on tagging, see `below`) From ea4dab272acd63155ab039f7a2164ce1e7a8c8f3 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:57:02 -0800 Subject: [PATCH 45/50] remove stray tag --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ba51877d..ca8ea65b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ readme = "README.rst" requires-python = ">=3.5" license = {text = "MIT"} classifiers = [ - "Development Status :: 4 - Beta", "Programming Language :: Python :: 3.5", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", From ba7c8b6a046a59ba7508d8338e13879fe0ddf030 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:05:12 -0800 Subject: [PATCH 46/50] add list of author names --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ca8ea65b..0e8b9c7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,10 @@ build-backend = "setuptools.build_meta" name = "trtools" authors = [ {name = "Melissa Gymrek", email = "mgymrek@ucsd.edu"}, + {name = "Nima Mousavi"}, + {name = "Jonathan Margoliash"}, + {name = "Aarushi Sehgal"}, + {name = "Arya Massarat"}, ] description = "Toolkit for genome-wide analysis of STRs" readme = "README.rst" From cc774ec302d3c3237515d5bbfb8a7cfb08d9b14c Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:27:05 -0800 Subject: [PATCH 47/50] oops - update build command --- PUBLISHING.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PUBLISHING.rst b/PUBLISHING.rst index 60fb514a..2f0ed716 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -53,8 +53,7 @@ Then go through the steps of publishing the changed code to PyPI: 1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. 2. Run :code:`rm -rf build dist *.egg-info` to make sure all previous build artifacts are removed -3. Run :code:`pip install build` to build the package with the version number you just tagged. -4. Run :code:`python -m build --wheel --sdist` to create the package distribution files. +3. Run :code:`python -m build` to build the package with the version number you just tagged. (Note: you might need to run :code:`pip install build` to install ``build`` first.) 5. Run :code:`twine upload dist/*` to upload the distribution to PyPI Lastly, the change needs to be published to bioconda. From d82ed73b12ac5691b6eb562022d005d74b2c21fb Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Wed, 8 Nov 2023 06:42:29 -0800 Subject: [PATCH 48/50] add rest of names to authors list --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e8b9c7f..cb868396 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,10 @@ authors = [ {name = "Nima Mousavi"}, {name = "Jonathan Margoliash"}, {name = "Aarushi Sehgal"}, - {name = "Arya Massarat"}, + {name = "Andrew Shen"}, + {name = "Neha Pusarla"}, + {name = "Shubham Saini"}, + {name = "Richard Yanicky"}, ] description = "Toolkit for genome-wide analysis of STRs" readme = "README.rst" From 2362461bbd09da1dee2e2258b2868f4c058f38ca Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:29:07 -0800 Subject: [PATCH 49/50] reinstate original authors list and clarify tagging --- PUBLISHING.rst | 12 ++++++------ pyproject.toml | 8 +------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/PUBLISHING.rst b/PUBLISHING.rst index 2f0ed716..fdf9e6f3 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -31,29 +31,29 @@ If you've added dependencies to trtools or its tests, those dependencies should Publishing Steps ---------------- -Once changes have been made to develop that are ready to be published, first choose the new version number. Then set up the environment you're going to publish TRTools from: +Once changes have been made to develop that are ready to be published, first choose the new version number according to `semantic versioning `_. Then set up the environment you're going to publish TRTools from: #. Create a clean environment. #. Install setuptools with version >= 40.8.0 -#. Additionally, install ``pytest``, ``wheel`` and ``twine`` -#. Clone the `trtools repo `_ +#. Additionally, install ``pytest``, ``wheel``, ``build``, and ``twine`` +#. Clone the `trtools repo `_ #. Check out the develop branch #. Run :code:`pip install --upgrade pip && pip install -e .` Then go through the steps of merging the changes into the master branch: +#. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. -#. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. #. Submit a pull request from develop into master on the github webiste. #. If the code review checks pass, merge the pull request. #. Tag the merge commit with the package version in vX.Y.Z format. (For more details on tagging, see `below`) Then go through the steps of publishing the changed code to PyPI: -1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. +1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. Note that the most recent commit *must* be tagged. 2. Run :code:`rm -rf build dist *.egg-info` to make sure all previous build artifacts are removed -3. Run :code:`python -m build` to build the package with the version number you just tagged. (Note: you might need to run :code:`pip install build` to install ``build`` first.) +3. Run :code:`python -m build` to build the package with the version number you just tagged. (Note: you might need to install ``build`` first.) 5. Run :code:`twine upload dist/*` to upload the distribution to PyPI Lastly, the change needs to be published to bioconda. diff --git a/pyproject.toml b/pyproject.toml index cb868396..a829ca58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,6 @@ build-backend = "setuptools.build_meta" name = "trtools" authors = [ {name = "Melissa Gymrek", email = "mgymrek@ucsd.edu"}, - {name = "Nima Mousavi"}, - {name = "Jonathan Margoliash"}, - {name = "Aarushi Sehgal"}, - {name = "Andrew Shen"}, - {name = "Neha Pusarla"}, - {name = "Shubham Saini"}, - {name = "Richard Yanicky"}, ] description = "Toolkit for genome-wide analysis of STRs" readme = "README.rst" @@ -44,6 +37,7 @@ script-files = ["trtools/testsupport/test_trtools.sh", "scripts/trtools_prep_bea license-files = ["LICENSE.txt"] [tool.setuptools_scm] +# generated automatically by setuptools when running pip install -e or python -m build version_file = "trtools/version.py" [project.scripts] From 32f96a9b3cc7403587420b0bb2249fd24968e1d4 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:35:21 -0800 Subject: [PATCH 50/50] replace all references to old repo url --- Dockerfile | 2 +- README.rst | 12 ++++++------ RELEASE_NOTES.rst | 4 ++-- doc/VIGNETTE-AFREQ.rst | 2 +- doc/VIGNETTE-COMPARE-CALLERS.rst | 2 +- doc/VIGNETTE-COMPARE.rst | 2 +- doc/VIGNETTE-FILTER-QC.rst | 2 +- doc/VIGNETTE-STATSTR.rst | 2 +- pyproject.toml | 1 + trtools/associaTR/README.rst | 2 +- trtools/compareSTR/README.rst | 2 +- trtools/dumpSTR/README.rst | 2 +- trtools/mergeSTR/README.rst | 2 +- trtools/qcSTR/README.rst | 2 +- trtools/statSTR/README.rst | 2 +- trtools/testsupport/test_trtools.sh | 2 +- 16 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14ac4f7b..ef5e4607 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN ldconfig WORKDIR .. # Download and install TRTools -RUN git clone https://github.com/gymreklab/TRTools +RUN git clone https://github.com/gymrek-lab/TRTools WORKDIR TRTools RUN python3 setup.py install WORKDIR .. diff --git a/README.rst b/README.rst index 499c91fb..74a73ae6 100644 --- a/README.rst +++ b/README.rst @@ -6,8 +6,8 @@ :target: https://github.com/gymrek-lab/trtools/workflows/Tests/badge.svg -.. image:: https://codecov.io/gh/gymreklab/TRTools/branch/master/graph/badge.svg - :target: https://codecov.io/gh/gymreklab/TRTools +.. image:: https://codecov.io/gh/gymrek-lab/TRTools/branch/master/graph/badge.svg + :target: https://codecov.io/gh/gymrek-lab/TRTools .. a location that the doc/index.rst uses for including this file @@ -64,10 +64,10 @@ Note: TRTools installation may fail for pip version 10.0.1, hence the need to up From source ^^^^^^^^^^^ -To install from source (only recommended for development) download the TRTools repository from `github `_, +To install from source (only recommended for development) download the TRTools repository from `github `_, checkout the branch you're interested in, and run the following command from the base directory of the repo. e.g.:: - git clone https://github.com/gymreklab/TRTools + git clone https://github.com/gymrek-lab/TRTools cd TRTools/ pip install --upgrade pip pip install -e . @@ -129,7 +129,7 @@ Development Notes Contact Us ---------- -Please submit an issue on the `trtools github `_ +Please submit an issue on the `trtools github `_ .. _Contributing: @@ -137,7 +137,7 @@ Contributing ------------ We appreciate contributions to TRTools. If you would like to contribute a fix or new feature, follow these guidelines: -1. Consider `discussing `_ your solution with us first so we can provide help or feedback if necessary. +1. Consider `discussing `_ your solution with us first so we can provide help or feedback if necessary. #. Install TRTools from source `as above `_. #. Additionally, install :code:`pytest`, `pytest-cov `_ and :code:`sphinx>=3` in your environment. #. Fork the TRTools repository. diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 619e9179..488fcbfe 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -79,7 +79,7 @@ Misc: Bug fixes: -* https://github.com/gymreklab/TRTools/issues/146 fixed record positions being compared twice +* https://github.com/gymrek-lab/TRTools/issues/146 fixed record positions being compared twice * CompareSTR: Decision on which records are comparable is now based on data from harmonized TRRecords, and not from the records directly from VCF readers. Thanks to this, HipSTR records which have different starting positions, but position of their repeat is at the same position are compared correctly (harmonization step removes this difference). @@ -92,7 +92,7 @@ Bug fixes: Bug fixes: -* https://github.com/gymreklab/TRTools/issues/143 Fix HipstrMinSuppReads filter when +* https://github.com/gymrek-lab/TRTools/issues/143 Fix HipstrMinSuppReads filter when there are called samples but none have ALLREADS 4.0.0 diff --git a/doc/VIGNETTE-AFREQ.rst b/doc/VIGNETTE-AFREQ.rst index 6bb839e7..ab5be707 100644 --- a/doc/VIGNETTE-AFREQ.rst +++ b/doc/VIGNETTE-AFREQ.rst @@ -3,7 +3,7 @@ Plotting allele length distributions by population group Tools used: mergeSTR, statSTR -This vignette shows how to use :code:`mergeSTR` to merge two VCF files and :code:`statSTR` to plot allele frequencies across different sample groups for an example TR locus. It uses the example VCF files :code:`ceu_ex.vcf.gz` and :code:`yri_ex.vcf.gz` available at https://github.com/gymreklab/TRTools/tree/master/example-files. These VCFs were generated by GangSTR on samples sequenced by the 1000 Genomes Project. They have already been sorted and indexed. +This vignette shows how to use :code:`mergeSTR` to merge two VCF files and :code:`statSTR` to plot allele frequencies across different sample groups for an example TR locus. It uses the example VCF files :code:`ceu_ex.vcf.gz` and :code:`yri_ex.vcf.gz` available at https://github.com/gymrek-lab/TRTools/tree/master/example-files. These VCFs were generated by GangSTR on samples sequenced by the 1000 Genomes Project. They have already been sorted and indexed. After downloading the VCF files, we can use :code:`mergeSTR` to merge them into a single VCF:: diff --git a/doc/VIGNETTE-COMPARE-CALLERS.rst b/doc/VIGNETTE-COMPARE-CALLERS.rst index 452ed6f3..e1bc948d 100644 --- a/doc/VIGNETTE-COMPARE-CALLERS.rst +++ b/doc/VIGNETTE-COMPARE-CALLERS.rst @@ -3,7 +3,7 @@ Comparing TR calls across different genotypers Tools used: mergeSTR, compareSTR -This vignette shows how to use :code:`mergeSTR` to merge VCFs from multiple samples into a single VCF, and :code:`compareSTR` to compare VCF files generated by different genotypers (HipSTR and ExpansionHunter) using the same set of reference TRs. In this example, we use VCF files available at https://github.com/gymreklab/TRTools/tree/master/example-files: +This vignette shows how to use :code:`mergeSTR` to merge VCFs from multiple samples into a single VCF, and :code:`compareSTR` to compare VCF files generated by different genotypers (HipSTR and ExpansionHunter) using the same set of reference TRs. In this example, we use VCF files available at https://github.com/gymrek-lab/TRTools/tree/master/example-files: * :code:`NA12878_chr21_eh.sorted.vcf.gz`, :code:`NA12891_chr21_eh.sorted.vcf.gz`, and :code:`NA12892_chr21_eh.sorted.vcf.gz` generated using ExpansionHunter on three separate samples * :code:`trio_chr21_hipstr.sorted.vcf.gz` generated using HipSTR run jointly on all three samples. diff --git a/doc/VIGNETTE-COMPARE.rst b/doc/VIGNETTE-COMPARE.rst index 5b49f293..2810edd5 100644 --- a/doc/VIGNETTE-COMPARE.rst +++ b/doc/VIGNETTE-COMPARE.rst @@ -3,7 +3,7 @@ Comparing TR calls across different parameter sets Tools used: compareSTR -This vignette shows how to use :code:`compareSTR` to compare two VCF files generated using the same set of reference TRs. In this example, we use VCF files :code:`c57_ex1.vcf.gz` and :code:`c57_ex2.vcf.gz` available at https://github.com/gymreklab/TRTools/tree/master/example-files. These VCF files were generated by GangSTR on a mouse dataset using two different sets of stutter parameters. +This vignette shows how to use :code:`compareSTR` to compare two VCF files generated using the same set of reference TRs. In this example, we use VCF files :code:`c57_ex1.vcf.gz` and :code:`c57_ex2.vcf.gz` available at https://github.com/gymrek-lab/TRTools/tree/master/example-files. These VCF files were generated by GangSTR on a mouse dataset using two different sets of stutter parameters. To run :code:`compareSTR`:: diff --git a/doc/VIGNETTE-FILTER-QC.rst b/doc/VIGNETTE-FILTER-QC.rst index d687a12b..a695ea63 100644 --- a/doc/VIGNETTE-FILTER-QC.rst +++ b/doc/VIGNETTE-FILTER-QC.rst @@ -3,7 +3,7 @@ Filtering and QC of VCFs Tools used: dumpSTR, qcSTR -This vignette shows how to use :code:`dumpSTR` to filter a VCF and :code:`qcSTR` to visualize some basic QC metrics. For this example, we use the file :code:`trio_chr21_popstr.sorted.vcf.gz` available at https://github.com/gymreklab/TRTools/tree/master/example-files. This file was generated on samples NA12878, NA12891, and NA12892 using popSTR. +This vignette shows how to use :code:`dumpSTR` to filter a VCF and :code:`qcSTR` to visualize some basic QC metrics. For this example, we use the file :code:`trio_chr21_popstr.sorted.vcf.gz` available at https://github.com/gymrek-lab/TRTools/tree/master/example-files. This file was generated on samples NA12878, NA12891, and NA12892 using popSTR. First, let's perform some filtering on the VCF:: diff --git a/doc/VIGNETTE-STATSTR.rst b/doc/VIGNETTE-STATSTR.rst index aea2f513..7704d1e5 100644 --- a/doc/VIGNETTE-STATSTR.rst +++ b/doc/VIGNETTE-STATSTR.rst @@ -3,7 +3,7 @@ Computing per-locus TR statistics Tools used: mergeSTR, statSTR -This vignette shows how to use :code:`mergeSTR` to merge two VCF files and :code:`statSTR` to compute statistics across different sample groups for an example TR locus. It uses the example VCF files :code:`ceu_ex.vcf.gz` and :code:`yri_ex.vcf.gz` available at https://github.com/gymreklab/TRTools/tree/master/example-files. These VCFs were generated by GangSTR on samples sequenced by the 1000 Genomes Project. They have already been sorted and indexed. +This vignette shows how to use :code:`mergeSTR` to merge two VCF files and :code:`statSTR` to compute statistics across different sample groups for an example TR locus. It uses the example VCF files :code:`ceu_ex.vcf.gz` and :code:`yri_ex.vcf.gz` available at https://github.com/gymrek-lab/TRTools/tree/master/example-files. These VCFs were generated by GangSTR on samples sequenced by the 1000 Genomes Project. They have already been sorted and indexed. After downloading the VCF files, we can use :code:`mergeSTR` to merge them into a single VCF:: diff --git a/pyproject.toml b/pyproject.toml index a829ca58..3b5e6cc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta" name = "trtools" authors = [ {name = "Melissa Gymrek", email = "mgymrek@ucsd.edu"}, + {name = "Gymrek Lab"}, ] description = "Toolkit for genome-wide analysis of STRs" readme = "README.rst" diff --git a/trtools/associaTR/README.rst b/trtools/associaTR/README.rst index 2e0a7946..14df88e5 100644 --- a/trtools/associaTR/README.rst +++ b/trtools/associaTR/README.rst @@ -127,7 +127,7 @@ Example Commands ---------------- Below is an :code:`associaTR` example. For this example no TRs causally impact the simulated phenotype. -Data files for this example can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Data files for this example can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: associaTR \ association_results.tsv \ diff --git a/trtools/compareSTR/README.rst b/trtools/compareSTR/README.rst index 5b264aa3..e66b35f5 100644 --- a/trtools/compareSTR/README.rst +++ b/trtools/compareSTR/README.rst @@ -95,7 +95,7 @@ CompareSTR requires input files to be compressed and indexed. Use the following Example Commands ---------------- -Below are :code:`compareSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Below are :code:`compareSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: # AdVNTR (comparing a file against itself. Not very interesting. Just for demonstration) # Note, you first need to reheader files to add required contig lines to VCF headers diff --git a/trtools/dumpSTR/README.rst b/trtools/dumpSTR/README.rst index 1ec44f20..18bcee94 100644 --- a/trtools/dumpSTR/README.rst +++ b/trtools/dumpSTR/README.rst @@ -150,7 +150,7 @@ DumpSTR outputs the following files: Example Commands ---------------- -Below are :code:`dumpSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Below are :code:`dumpSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: # AdVNTR dumpSTR --vcf NA12878_chr21_advntr.sorted.vcf.gz --advntr-min-call-DP 100 --out test_dumpstr_advntr diff --git a/trtools/mergeSTR/README.rst b/trtools/mergeSTR/README.rst index 3ffc0883..b648a07f 100644 --- a/trtools/mergeSTR/README.rst +++ b/trtools/mergeSTR/README.rst @@ -84,7 +84,7 @@ MergeSTR requires the input file to be compressed and indexed. Use the following Example Commands ---------------- -Below are :code:`mergeSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Below are :code:`mergeSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: # AdVNTR # Note, you first need to reheader files to add required contig lines to VCF headers diff --git a/trtools/qcSTR/README.rst b/trtools/qcSTR/README.rst index 1f485c78..538113ea 100644 --- a/trtools/qcSTR/README.rst +++ b/trtools/qcSTR/README.rst @@ -149,7 +149,7 @@ These additional options can be used to customize reference bias plots. Example Commands ---------------- -Below are :code:`qcSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Below are :code:`qcSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: # AdVNTR qcSTR --vcf NA12878_chr21_advntr.sorted.vcf.gz --out test_qc_advntr diff --git a/trtools/statSTR/README.rst b/trtools/statSTR/README.rst index 8fd85660..dc256ec9 100644 --- a/trtools/statSTR/README.rst +++ b/trtools/statSTR/README.rst @@ -78,7 +78,7 @@ If multiple sample groups are specified, instead there is one additional column Example Commands ---------------- -Below are :code:`statSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymreklab/TRTools/tree/master/example-files:: +Below are :code:`statSTR` examples using VCFs from supported TR genotypers. Data files can be found at https://github.com/gymrek-lab/TRTools/tree/master/example-files:: # AdVNTR statSTR --vcf NA12878_chr21_advntr.sorted.vcf.gz \ diff --git a/trtools/testsupport/test_trtools.sh b/trtools/testsupport/test_trtools.sh index 2e836e5c..bc6945e4 100755 --- a/trtools/testsupport/test_trtools.sh +++ b/trtools/testsupport/test_trtools.sh @@ -16,7 +16,7 @@ if [ ! -d "$TMP" ] ; then mkdir $TMP pushd $TMP git init . - git remote add origin -f https://github.com/gymreklab/TRTools.git + git remote add origin -f https://github.com/gymrek-lab/TRTools.git git pull origin master popd echo "Download done"