Skip to content

Commit

Permalink
Merge pull request #102 from apriha/develop
Browse files Browse the repository at this point in the history
v4.1.3
  • Loading branch information
apriha authored Jan 24, 2022
2 parents 98c67b5 + c1c0401 commit 3be7a99
Show file tree
Hide file tree
Showing 13 changed files with 523 additions and 441 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-python@v2
- name: Install Black
run: |
pip install black==19.10b0
pip install black
- name: Lint with Black
run: |
black --check --diff .
Expand All @@ -47,24 +47,21 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: 3.6
job_id: 0
- os: ubuntu-latest
python-version: 3.7
job_id: 1
job_id: 0
- os: ubuntu-latest
python-version: 3.8
job_id: 2
job_id: 1
- os: ubuntu-latest
python-version: 3.9
job_id: 3
job_id: 2
- os: macos-latest
python-version: 3.9
job_id: 4
job_id: 3
- os: windows-latest
python-version: 3.9
job_id: 5
job_id: 4

steps:
- uses: actions/checkout@v2
Expand All @@ -80,7 +77,7 @@ jobs:
# so this ensures all Python versions will be periodically integration tested with the
# resource servers
env:
NUM_JOBS: 6
NUM_JOBS: 5
JOB_ID: ${{ matrix.job_id }}
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/master' }}
shell: bash
Expand Down
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-20.04
tools:
python: "3.9"

sphinx:
configuration: docs/conf.py

formats: all

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pytest = "*"
pytest-cov = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
black = "==19.10b0"
black = "==21.12b0"

[packages]
lineage = {editable = true,path = "."}
Expand Down
811 changes: 430 additions & 381 deletions Pipfile.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Also see the `installation documentation <https://lineage.readthedocs.io/en/stab

Dependencies
------------
``lineage`` requires `Python <https://www.python.org>`_ 3.6.1+ and the following Python packages:
``lineage`` requires `Python <https://www.python.org>`_ 3.7.1+ and the following Python packages:

- `numpy <https://numpy.org>`_
- `pandas <https://pandas.pydata.org>`_
Expand Down Expand Up @@ -74,9 +74,9 @@ Create an ``Individual`` in the context of the ``lineage`` framework to interact
``User662`` dataset:

>>> user662 = l.create_individual('User662', ['resources/662.23andme.340.txt.gz', 'resources/662.ftdna-illumina.341.csv.gz'])
Loading SNPs('resources/662.23andme.340.txt.gz')
Merging SNPs('resources/662.ftdna-illumina.341.csv.gz')
SNPs('resources/662.ftdna-illumina.341.csv.gz') has Build 36; remapping to Build 37
Loading SNPs('662.23andme.340.txt.gz')
Merging SNPs('662.ftdna-illumina.341.csv.gz')
SNPs('662.ftdna-illumina.341.csv.gz') has Build 36; remapping to Build 37
Downloading resources/NCBI36_GRCh37.tar.gz
27 SNP positions were discrepant; keeping original positions
151 SNP genotypes were discrepant; marking those as null
Expand Down Expand Up @@ -113,7 +113,7 @@ Compare Individuals
Let's create another ``Individual`` for the ``User663`` dataset:

>>> user663 = l.create_individual('User663', 'resources/663.23andme.305.txt.gz')
Loading SNPs('resources/663.23andme.305.txt.gz')
Loading SNPs('663.23andme.305.txt.gz')

Now we can perform some analysis between the ``User662`` and ``User663`` datasets.

Expand Down Expand Up @@ -201,10 +201,10 @@ For this example, let's create two more ``Individuals`` for the ``User4583`` and
datasets:

>>> user4583 = l.create_individual('User4583', 'resources/4583.ftdna-illumina.3482.csv.gz')
Loading SNPs('resources/4583.ftdna-illumina.3482.csv.gz')
Loading SNPs('4583.ftdna-illumina.3482.csv.gz')

>>> user4584 = l.create_individual('User4584', 'resources/4584.ftdna-illumina.3483.csv.gz')
Loading SNPs('resources/4584.ftdna-illumina.3483.csv.gz')
Loading SNPs('4584.ftdna-illumina.3483.csv.gz')

Now let's find the shared genes, specifying a
`population-specific <https://www.internationalgenome.org/faq/which-populations-are-part-your-study/>`_
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx==4.4.0
sphinx-rtd-theme==1.0.0
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand All @@ -115,6 +114,6 @@
keywords="dna genes genetics genealogy snps chromosomes genotype "
"bioinformatics ancestry",
install_requires=["numpy", "pandas", "matplotlib", "atomicwrites", "snps"],
python_requires=">=3.6.1",
python_requires=">=3.7.1",
platforms=["any"],
)
14 changes: 7 additions & 7 deletions src/lineage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


class Lineage:
""" Object used to interact with the `lineage` framework. """
"""Object used to interact with the `lineage` framework."""

def __init__(
self,
Expand All @@ -61,7 +61,7 @@ def __init__(
parallelize=False,
processes=os.cpu_count(),
):
""" Initialize a ``Lineage`` object.
"""Initialize a ``Lineage`` object.
Parameters
----------
Expand All @@ -80,7 +80,7 @@ def __init__(
self._parallelizer = Parallelizer(parallelize=parallelize, processes=processes)

def create_individual(self, name, raw_data=(), **kwargs):
""" Initialize an individual in the context of the `lineage` framework.
"""Initialize an individual in the context of the `lineage` framework.
Parameters
----------
Expand All @@ -104,7 +104,7 @@ def create_individual(self, name, raw_data=(), **kwargs):
return Individual(name, raw_data, **kwargs)

def download_example_datasets(self):
""" Download example datasets from `openSNP <https://opensnp.org>`_.
"""Download example datasets from `openSNP <https://opensnp.org>`_.
Per openSNP, "the data is donated into the public domain using `CC0 1.0
<http://creativecommons.org/publicdomain/zero/1.0/>`_."
Expand All @@ -130,7 +130,7 @@ def download_example_datasets(self):
def find_discordant_snps(
self, individual1, individual2, individual3=None, save_output=False
):
""" Find discordant SNPs between two or three individuals.
"""Find discordant SNPs between two or three individuals.
Parameters
----------
Expand Down Expand Up @@ -282,7 +282,7 @@ def find_shared_dna(
save_output=True,
genetic_map="HapMap2",
):
""" Find the shared DNA between individuals.
"""Find the shared DNA between individuals.
Computes the genetic distance in centiMorgans (cMs) between SNPs using the specified genetic
map. Applies thresholds to determine the shared DNA. Plots shared DNA. Optionally determines
Expand Down Expand Up @@ -696,7 +696,7 @@ def _is_one_individual_male(self, individuals):
return False

def _compute_snp_distances(self, task):
""" Compute genetic distance in cMs between SNPs.
"""Compute genetic distance in cMs between SNPs.
Parameters
----------
Expand Down
6 changes: 3 additions & 3 deletions src/lineage/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


class Individual(SNPs):
""" Object used to represent and interact with an individual.
"""Object used to represent and interact with an individual.
The ``Individual`` object maintains information about an individual. The object provides
methods for loading an individual's genetic data (SNPs) and normalizing it for use with the
Expand All @@ -42,7 +42,7 @@ class Individual(SNPs):
"""

def __init__(self, name, raw_data=(), **kwargs):
""" Initialize an ``Individual`` object.
"""Initialize an ``Individual`` object.
Parameters
----------
Expand Down Expand Up @@ -85,7 +85,7 @@ def __repr__(self):

@property
def name(self):
""" Get this ``Individual``'s name.
"""Get this ``Individual``'s name.
Returns
-------
Expand Down
Loading

0 comments on commit 3be7a99

Please sign in to comment.