Skip to content

Commit de490dd

Browse files
authored
Merge pull request #71 from sbslee/0.19.0-dev
0.19.0 dev
2 parents 6f57af0 + 191308b commit de490dd

10 files changed

+1947
-30
lines changed

CHANGELOG.rst

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
*********
33

4+
0.19.0 (2022-09-13)
5+
-------------------
6+
7+
* Add new method :meth:`api.core.has_sv`.
8+
* Update :meth:`api.core.sort_alleles` method to handle ``'Indeterminate'`` haplotype call when ``by='name'``.
9+
* Update :meth:`api.utils.estimate_phase_beagle` method to handle situations where there are overlapping samples between input VCF and reference panel -- i.e. users are no longer required to change sample names. Before this update, the Beagle program would throw an error if there were overlapping samples (e.g. 1KGP samples). From now on, offending samples will be temporarily renamed before statistical phasing.
10+
* Add new methods :meth:`api.core.load_recommendation_table` and :meth:`api.core.get_recommendation`.
11+
412
0.18.0 (2022-08-12)
513
-------------------
614

README.rst

+26-6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ Below is an incomplete list of publications which have used PyPGx:
154154
- Wroblewski et al., 2022. `Pharmacogenetic variation in Neanderthals and Denisovans and implications for human health and response to medications <https://doi.org/10.1101/2021.11.27.470071>`__. bioRxiv.
155155
- Botton et al., 2020. `Phased Haplotype Resolution of the SLC6A4 Promoter Using Long-Read Single Molecule Real-Time (SMRT) Sequencing <https://doi.org/10.3390/genes11111333>`__. Genes.
156156

157+
Support PyPGx
158+
=============
159+
160+
If you find my work useful, please consider becoming a `sponsor <https://github.com/sponsors/sbslee>`__.
161+
157162
Installation
158163
============
159164

@@ -671,22 +676,22 @@ genotype results from PyPGx.
671676
- \*10;\*74;\*2;
672677
- ;
673678
- \*4:22-42524947-C-T:0.913;\*10:22-42523943-A-G,22-42526694-G-A:1.0,1.0;\*74:22-42525821-G-T:1.0;\*2:default;
674-
- DeletionHet
679+
- WholeDel1
675680
* - NA19207
676681
- \*2x2/\*10
677682
- Normal Metabolizer
678683
- \*10;\*2;
679684
- \*2;
680685
- ;
681686
- \*10:22-42523943-A-G,22-42526694-G-A:0.361,0.25;\*2:default;
682-
- Duplication
687+
- WholeDup1
683688

684689
This list explains each of the columns in the example results.
685690

686-
- **Genotype**: Diplotype call. This simply combines the two top-ranked star alleles from **Haplotype1** and **Haplotype2** with '/'.
691+
- **Genotype**: Diplotype call. When there is no SV this simply combines the two top-ranked star alleles from **Haplotype1** and **Haplotype2** with the delimiter '/'. In the presence of SV the final diplotype is determined using one of the genotypers in the ``pypgx.api.genotype`` module (e.g. `CYP2D6Genotyper <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.genotype.CYP2D6Genotyper>`__).
687692
- **Phenotype**: Phenotype call.
688-
- **Haplotype1**, **Haplotype2**: List of candidate star alleles for each haplotype. For example, if a given haplotype contains three variants 22-42523943-A-G, 22-42524947-C-T, and 22-42526694-G-A, then it will get assigned ``*4;*10;`` because the haplotype pattern can fit both \*4 (22-42524947-C-T) and \*10 (22-42523943-A-G and 22-42526694-G-A). Note that \*4 comes first before \*10 because it has higher priority for reporting purposes (see the ``pypgx.sort_alleles`` `method <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.core.sort_alleles>`__ for detailed implementation).
689-
- **AlternativePhase**: List of star alleles that could be missed due to potentially incorrect statistical phasing. For example, let's assume that statistical phasing has put 22-42526694-G-A for **Haplotype1** and 22-42523805-C-T for **Haplotype2**. Even though the two variants are in trans orientation, PyPGx will also consider alternative phase in case the two variants are actually in cis orientation, resulting in ``*69;`` as **AlternativePhase** because \*69 is defined by 22-42526694-G-A and 22-42523805-C-T.
693+
- **Haplotype1**, **Haplotype2**: List of candidate star alleles for each haplotype. For example, if a given haplotype contains three variants ``22-42523943-A-G``, ``22-42524947-C-T``, and ``22-42526694-G-A``, then it will get assigned ``*4;*10;`` because the haplotype pattern can fit both \*4 (``22-42524947-C-T``) and \*10 (``22-42523943-A-G`` and ``22-42526694-G-A``). Note that \*4 comes first before \*10 because it has higher priority for reporting purposes (see the ``pypgx.sort_alleles`` `method <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.core.sort_alleles>`__ for detailed implementation).
694+
- **AlternativePhase**: List of star alleles that could be missed due to potentially incorrect statistical phasing. For example, let's assume that statistical phasing has put ``22-42526694-G-A`` for **Haplotype1** and ``22-42523805-C-T`` for **Haplotype2**. Even though the two variants are in trans orientation, PyPGx will also consider alternative phase in case the two variants are actually in cis orientation, resulting in ``*69;`` as **AlternativePhase** because \*69 is defined by ``22-42526694-G-A`` and ``22-42523805-C-T``.
690695
- **VariantData**: Information for SNVs/indels used to define observed star alleles, including allele fraction which is important for allelic decomposition after identifying CNV (e.g. the sample NA19207). In some situations, there will not be any variants for a given star allele because the allele itself is "default" allele for the selected reference assembly (e.g. GRCh37 has \*2 as default while GRCh38 has \*1).
691696
- **CNV**: Structural variation call. See the `Structural variation detection <https://pypgx.readthedocs.io/en/latest/readme.html#structural-variation-detection>`__ section for more details.
692697

@@ -849,7 +854,7 @@ We can obtain allele function for the CYP2D6 gene:
849854
>>> pypgx.get_function('CYP2D6', '*140')
850855
'Unknown Function'
851856
852-
We can predict phenotype for the CYP2D6 gene based on two haplotype calls:
857+
We can predict phenotype for CYP2D6 based on two haplotype calls:
853858

854859
.. code:: python3
855860
@@ -862,3 +867,18 @@ We can predict phenotype for the CYP2D6 gene based on two haplotype calls:
862867
'Indeterminate'
863868
>>> pypgx.predict_phenotype('CYP2D6', '*1', '*1x2') # Gene duplication
864869
'Ultrarapid Metabolizer'
870+
871+
We can also obtain recommendation (e.g. CPIC) for certain drug-phenotype combination:
872+
873+
.. code:: python3
874+
875+
>>> import pypgx
876+
>>> # Codeine, an opiate and prodrug of morphine, is metabolized by CYP2D6
877+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Normal Metabolizer')
878+
'Use codeine label recommended age- or weight-specific dosing.'
879+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Ultrarapid Metabolizer')
880+
'Avoid codeine use because of potential for serious toxicity. If opioid use is warranted, consider a non-tramadol opioid.'
881+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Poor Metabolizer')
882+
'Avoid codeine use because of possibility of diminished analgesia. If opioid use is warranted, consider a non-tramadol opioid.'
883+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Indeterminate')
884+
'None'

docs/create.py

+26-6
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@
181181
- Wroblewski et al., 2022. `Pharmacogenetic variation in Neanderthals and Denisovans and implications for human health and response to medications <https://doi.org/10.1101/2021.11.27.470071>`__. bioRxiv.
182182
- Botton et al., 2020. `Phased Haplotype Resolution of the SLC6A4 Promoter Using Long-Read Single Molecule Real-Time (SMRT) Sequencing <https://doi.org/10.3390/genes11111333>`__. Genes.
183183
184+
Support PyPGx
185+
=============
186+
187+
If you find my work useful, please consider becoming a `sponsor <https://github.com/sponsors/sbslee>`__.
188+
184189
Installation
185190
============
186191
@@ -698,22 +703,22 @@
698703
- \*10;\*74;\*2;
699704
- ;
700705
- \*4:22-42524947-C-T:0.913;\*10:22-42523943-A-G,22-42526694-G-A:1.0,1.0;\*74:22-42525821-G-T:1.0;\*2:default;
701-
- DeletionHet
706+
- WholeDel1
702707
* - NA19207
703708
- \*2x2/\*10
704709
- Normal Metabolizer
705710
- \*10;\*2;
706711
- \*2;
707712
- ;
708713
- \*10:22-42523943-A-G,22-42526694-G-A:0.361,0.25;\*2:default;
709-
- Duplication
714+
- WholeDup1
710715
711716
This list explains each of the columns in the example results.
712717
713-
- **Genotype**: Diplotype call. This simply combines the two top-ranked star alleles from **Haplotype1** and **Haplotype2** with '/'.
718+
- **Genotype**: Diplotype call. When there is no SV this simply combines the two top-ranked star alleles from **Haplotype1** and **Haplotype2** with the delimiter '/'. In the presence of SV the final diplotype is determined using one of the genotypers in the ``pypgx.api.genotype`` module (e.g. `CYP2D6Genotyper <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.genotype.CYP2D6Genotyper>`__).
714719
- **Phenotype**: Phenotype call.
715-
- **Haplotype1**, **Haplotype2**: List of candidate star alleles for each haplotype. For example, if a given haplotype contains three variants 22-42523943-A-G, 22-42524947-C-T, and 22-42526694-G-A, then it will get assigned ``*4;*10;`` because the haplotype pattern can fit both \*4 (22-42524947-C-T) and \*10 (22-42523943-A-G and 22-42526694-G-A). Note that \*4 comes first before \*10 because it has higher priority for reporting purposes (see the ``pypgx.sort_alleles`` `method <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.core.sort_alleles>`__ for detailed implementation).
716-
- **AlternativePhase**: List of star alleles that could be missed due to potentially incorrect statistical phasing. For example, let's assume that statistical phasing has put 22-42526694-G-A for **Haplotype1** and 22-42523805-C-T for **Haplotype2**. Even though the two variants are in trans orientation, PyPGx will also consider alternative phase in case the two variants are actually in cis orientation, resulting in ``*69;`` as **AlternativePhase** because \*69 is defined by 22-42526694-G-A and 22-42523805-C-T.
720+
- **Haplotype1**, **Haplotype2**: List of candidate star alleles for each haplotype. For example, if a given haplotype contains three variants ``22-42523943-A-G``, ``22-42524947-C-T``, and ``22-42526694-G-A``, then it will get assigned ``*4;*10;`` because the haplotype pattern can fit both \*4 (``22-42524947-C-T``) and \*10 (``22-42523943-A-G`` and ``22-42526694-G-A``). Note that \*4 comes first before \*10 because it has higher priority for reporting purposes (see the ``pypgx.sort_alleles`` `method <https://pypgx.readthedocs.io/en/latest/api.html#pypgx.api.core.sort_alleles>`__ for detailed implementation).
721+
- **AlternativePhase**: List of star alleles that could be missed due to potentially incorrect statistical phasing. For example, let's assume that statistical phasing has put ``22-42526694-G-A`` for **Haplotype1** and ``22-42523805-C-T`` for **Haplotype2**. Even though the two variants are in trans orientation, PyPGx will also consider alternative phase in case the two variants are actually in cis orientation, resulting in ``*69;`` as **AlternativePhase** because \*69 is defined by ``22-42526694-G-A`` and ``22-42523805-C-T``.
717722
- **VariantData**: Information for SNVs/indels used to define observed star alleles, including allele fraction which is important for allelic decomposition after identifying CNV (e.g. the sample NA19207). In some situations, there will not be any variants for a given star allele because the allele itself is "default" allele for the selected reference assembly (e.g. GRCh37 has \*2 as default while GRCh38 has \*1).
718723
- **CNV**: Structural variation call. See the `Structural variation detection <https://pypgx.readthedocs.io/en/latest/readme.html#structural-variation-detection>`__ section for more details.
719724
@@ -817,7 +822,7 @@
817822
>>> pypgx.get_function('CYP2D6', '*140')
818823
'Unknown Function'
819824
820-
We can predict phenotype for the CYP2D6 gene based on two haplotype calls:
825+
We can predict phenotype for CYP2D6 based on two haplotype calls:
821826
822827
.. code:: python3
823828
@@ -830,6 +835,21 @@
830835
'Indeterminate'
831836
>>> pypgx.predict_phenotype('CYP2D6', '*1', '*1x2') # Gene duplication
832837
'Ultrarapid Metabolizer'
838+
839+
We can also obtain recommendation (e.g. CPIC) for certain drug-phenotype combination:
840+
841+
.. code:: python3
842+
843+
>>> import pypgx
844+
>>> # Codeine, an opiate and prodrug of morphine, is metabolized by CYP2D6
845+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Normal Metabolizer')
846+
'Use codeine label recommended age- or weight-specific dosing.'
847+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Ultrarapid Metabolizer')
848+
'Avoid codeine use because of potential for serious toxicity. If opioid use is warranted, consider a non-tramadol opioid.'
849+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Poor Metabolizer')
850+
'Avoid codeine use because of possibility of diminished analgesia. If opioid use is warranted, consider a non-tramadol opioid.'
851+
>>> pypgx.get_recommendation('codeine', 'CYP2D6', 'Indeterminate')
852+
'None'
833853
""".format(**d)
834854

835855
readme_file = f'{core.PROGRAM_PATH}/README.rst'

0 commit comments

Comments
 (0)