Skip to main content

Parser to match CYP2D6 parsing reccomendations by PharmVar.

Project description

CYP2D6 Parser

The CYP2D6 parser utilizies the recommendations by PharmVar to organize CYP2D6 haplotypes and genotypes. The parsing and sorting of these haplotypes appears simple but many edge cases exist. This tool helps to facillitate the genotype reporting process by providing a standardized approach for reporting haplotypes.

Current tool outputs supported:

  1. Aldy
  2. Cyrius
  3. PyPGx
  4. Stargazer
  5. StellarPGx

Installation

Installation can be acheived using pip or any other package manager of your choosing

pip install cyp2d6_parser 

Parsing genotypes

API

import cyp2d6_parser

# Provide a genotype. If a caller is known, you can provide it to aid in some parsing
# otherwise just a genotype is fine too, but a warning will be reported
results = cyp2d6_parser.parse_genotype(genotype="*1/*10+*36")

# Provide a file. If supplying a file or directory, must identify the type of caller used
results = cyp2d6_parser.parse_genotype(file='aldy_results.tsv', caller='aldy')

# Can also provide a directory of files using glob patterns
results = cyp2d6_parser.parse_genotype(dir_='aldy_results/*.tsv', caller='aldy', output_file='results.tsv')


# parse_genotype above will report activity score and phenotype
result = cyp2d6_parser.get_activity_score(genotype='*1/*10+*36')

result = cyp2d6_parser.get_phenotype(genotype='*1/*10+*36')
result = cyp2d6_parser.get_phenotype(activity_score=2)

CLI

python3 -m cyp2d6_parser genotype --genotype_call "*1/*10+*36"

python3 -m cyp2d6_parser --caller aldy genotype --file aldy_results.tsv

python3 -m cyp2d6_parser --caller aldy genotype --dir aldy_results/*.tsv -o results.tsv

python3 -m cyp2d6_parser activity --genotype_call "*1/*10+*36"

python3 -m cyp2d6_parser phenotype --genotype_call "*1/*10+*36"
python3 -m cyp2d6_parser phenotype --activity_score 2

Interpreting output from parse_genotype

  1. sample_id - File name or left blank
  2. genotype_raw - Genotype(s) used as input, semicolon delimited
  3. genotype - Parsed and organized genotype according to PharmVar reccomendations. Retired alleles are converted to the new allele name (Ex: *57 -> *36). If you would like to report retired alleles, an option is available. Suballeles names are removed (Ex: *4.001 -> *4). If a single genotype cannot be resolved, Indeterminate/Indeterminate is reported.
  4. activity_score - Total activity score for the reported genotype
  5. phenotype - Phenotype based on activity score
  6. copy_number - Total number of copies in genotype only if the genotype is not Indeterminate. The only allele which does not count towards total copy number is *5 (gene deletion).
  7. possible_genotype - If the input genotypes cannot be resolved to a single genotype, all possible genotypes are reported in this field as semicolon delimited.
  8. possible_activity_score - If all possible genotypes resolve to a single activity score, then an activity score is reported
  9. possible_phenotype - If all possible activity scores resolve to a single phenotype, then the phenotype is reported. The activity score field can be blank with a possible phenotype. Ex:
    • possible_genotypes: *1/*1;*1/*10
    • possible_activity_score: not reported because possible values are 2 and 1.25
    • possible_phenotype: CYP2D6 Normal Metabolizer

Bugs and desired features

Please report any bugs and/or desired features to either the github issues page or to andrew.haddad@pitt.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cyp2d6_parser-2.0.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cyp2d6_parser-2.0.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file cyp2d6_parser-2.0.1.tar.gz.

File metadata

  • Download URL: cyp2d6_parser-2.0.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for cyp2d6_parser-2.0.1.tar.gz
Algorithm Hash digest
SHA256 7ca83a97de8550ef4cfedf21356878b7499e11c9b718d6a2ad6eb78a7fedc91d
MD5 f85fc7a2ea84865c043f82aa6066c89b
BLAKE2b-256 e4eec0f2de4d3626f5cd7e435d78168632d8ed8873bb0dae90e9dab474e7ae41

See more details on using hashes here.

File details

Details for the file cyp2d6_parser-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: cyp2d6_parser-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for cyp2d6_parser-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f690831b3d2fe8b9f8ee52ff43855a3081c02fc8fe1528f902ff5fb73a01ca21
MD5 4d2bda6004566b74520cdb749d7fda7d
BLAKE2b-256 3efa3a8e4ffac51414f6afb378a9857954be44f22744a0790a8a03b2a129e1dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page