PharmCAT (Pharmacogenomics Clinical Annotation Tool)

repository·development·Indexed 41 days ago

https://github.com/pharmgkb/pharmcat

A bioinformatics pipeline (version 3.4.0) that translates genetic variant data from VCF files into actionable clinical pharmacogenomic (PGx) phenotypes and drug-prescribing recommendations. It utilizes a two-phase process of genotyping/haplotype inference and phenotyping/reporting based on CPIC, DPWG, and FDA-approved drug labels. The pipeline is implemented in WDL 1.0 and can be executed using Cromwell, Terra, or AnVIL.

Tokens
48.3K
Snippets
95
Records
189
Agent score
48%

What's inside PharmCAT

  1. What is PharmCAT?

    development

    PharmCAT (Pharmacogenomics Clinical Annotation Tool) is a bioinformatics tool designed to analyze genetic variants to predict drug response and tailor medical treatment.

    The tool operates in two primary phases:

    1. Genotype/Haplotype Inference: Processes VCF files (from NGS or genotyping) to identify pharmacogenomic (PGx) genotypes and infer haplotypes (star alleles).
    2. Phenotype/Recommendation Prediction: Uses pharmacogene diplotypes to predict PGx phenotypes and reports drug-prescribing recommendations based on:
      • CPIC guidelines
      • ClinPGx-annotated DPWG guidelines
      • ClinPGx-annotated FDA-approved drug labels
  2. Overview of PharmCAT

    development

    PharmCAT (Pharmacogenomics Clinical Annotation Tool) is a bioinformatics tool designed to analyze genetic variants to predict drug response and tailor medical treatment based on an individual's genetic profile.

    The tool operates in two distinct phases:

    1. Genotype and Haplotype Inference: It processes VCF files (from NGS or genotyping) to identify pharmacogenomic (PGx) genotypes and infer haplotypes (typically star alleles).
    2. Phenotype Prediction and Reporting: It uses pharmacogene diplotypes (maternal and paternal star allele combinations) to predict PGx phenotypes. It then reports drug-prescribing recommendations derived from:
      • CPIC guidelines
      • ClinPGx-annotated DPWG guidelines
      • ClinPGx-annotated FDA-approved drug labels
  3. Understand PharmCAT input and output file structures

    development

    PharmCAT processes genomic data through a pipeline consisting of several modules. To run a complete analysis, you typically provide a single-sample VCF file and optionally a file containing outside diplotype calls.

    Input Files

    • VCF File: A properly formatted single-sample VCF file with all positions specified. This is the primary source of variant data.
    • Outside Call File: An optional file (TSV format) used to specify diplotype calls that may not be captured in the VCF, such as specific CYP2D6 calls.

    Output Files by Module

    • Named Allele Matcher: Produces HTML and JSON files detailing how the VCF data matches haplotype definitions.
    • Phenotyper: Produces a JSON file that assigns function and metabolizer values by combining Named Allele Matcher data with outside call data.
    • Reporter: Produces an HTML report for human reading, a JSON file for machine parsing, and a TSV file (calls-only report) containing phenotype information matched to CPIC guideline data.
  4. What is the PharmCAT VCF Preprocessor?

    development

    The PharmCAT VCF Preprocessor is a script designed to prepare VCF files for use with PharmCAT by ensuring they comply with PharmCAT's VCF Requirements.

    Key functions include:

    1. Stripping non-PGx positions: Removes variants that are not relevant to pharmacogenomics.
    2. Reference Genome Management: Automatically downloads the necessary Human Reference Genome Sequence FASTA and index files from the NIH FTP site if they are not provided.
    3. VCF Normalization: Standardizes the VCF into a parsimonious, left-aligned variant representation format.
    4. Multiallelic Normalization: Adjusts multiallelic variant representations to meet PharmCAT's expectations.
    5. Sample Filtering: Optionally filters data for a specific subset of samples.

    Outputs:

    • A PharmCAT-ready VCF file.
    • A report identifying missing pharmacogenomics core allele defining positions found in the input.
  5. Handle complex diplotype entries in frequency analysis

    development

    When performing frequency analysis, be aware of how the Source Diplotype column handles ambiguous or multi-variant calls:

    1. Ambiguous Diplotypes (OR): If the Named Allele Matcher cannot determine a single diplotype (due to unphased or incomplete data), entries are concatenated with OR (e.g., *4/[*6 + *10] OR *6/[*4 + *10]). These should be treated as unknown for frequency analysis.
    2. Multi-variant Genes (AND): For specific genes like DPYD and RYR1 that use two low-function variants, calls are separated with AND (e.g., c.775A>G AND c.1627A>G (*5)). For frequency analysis, all alleles in these entries should be counted.
  6. How PharmCAT handles gene matching

    development

    PharmCAT uses a Named Allele Matcher to process gene data. The system categorizes genes into two groups based on how they are processed:

    1. Genes PharmCAT will attempt to match: The Named Allele Matcher searches the provided sample file for locations associated with these genes and attempts to match them to known allele definitions automatically.
    2. Genes handled by outside callers: PharmCAT does not perform automatic allele matching for these genes (with the exception of CYP2D6 if research mode is enabled). Instead, you must use external tools to generate calls and then supply those calls to PharmCAT to enable recommendation matching.

    Common external tools for these genes include:

    • Stargazer or StellarPGx: For CYP2D6 diplotype calls.
    • Optitype: For HLA calls.
  7. Understand PharmCAT Input Requirements

    development

    PharmCAT processes genetic variation using two primary input types:

    1. VCF Files: Used to identify pharmacogenomic (PGx) genotypes and infer haplotypes (star alleles). VCF files must meet specific VCF Requirements.
    2. Outside Call Files: Used when PharmCAT cannot call certain genes directly from VCF data (e.g., CYP2D6, HLA-A, and HLA-B) or when you want to provide diplotype calls made by an external tool. These files follow the Outside Call Format.

    Use Outside Call files if you need to generate guideline recommendations for genes that require specialized calling methods or if you already have verified diplotype data.

  8. Advanced Usage: Decomposing the PharmCAT Pipeline

    development

    While the pharmcat_pipeline script is recommended for most users due to its simplicity, the system is composed of modular components that can be run independently for more control:

    • VCF Preprocessor: A standalone component for preparing VCF data.
    • Core PharmCAT Tool: The central engine, which is itself composed of multiple modules that can be executed individually.

    To use these components directly instead of the unified pipeline, refer to the documentation for Running the VCF Preprocessor or Running PharmCAT. This approach is useful if you are setting up PharmCAT in a custom environment without Docker.

  9. Configure guideline sources and gene lists

    development

    The script can filter data based on guideline sources using the -gs flag. If you do not specify genes manually via -g, the script uses the following default gene sets:

    CPIC (Default) ABCG2, CACNA1S, CFTR, CYP2B6, CYP2C9, CYP2C19, CYP3A5, CYP4F2, DPYD, G6PD, IFNL3, NAT2, NUDT15, RYR1, SLCO1B1, TPMT, UGT1A1, VKORC1, CYP2D6, HLA-A, HLA-B, MT-RNR1

    DPWG ABCG2, CYP2B6, CYP2C9, CYP2C19, CYP3A4, CYP3A5, DPYD, NUDT15, SLCO1B1, TPMT, UGT1A1, VKORC1, CYP2D6

  10. How PharmCAT modules work together

    development

    PharmCAT is composed of three distinct modules that form a pipeline. You can run the full pipeline or execute individual modules by specifying their respective flags.

    1. Named Allele Matcher: Takes a VCF file and identifies diplotypes. Output: JSON results.
    2. Phenotyper: Takes diplotypes (from the Matcher or an outside call file) and determines phenotype information. Output: JSON results.
    3. Reporter: Takes Phenotyper JSON results and generates a human-readable HTML or JSON report with drug annotations.

    Pipeline Flow: VCF file $\rightarrow$ Named Allele Matcher $\rightarrow$ Phenotyper (optionally accepts outside call file) $\rightarrow$ Reporter $\rightarrow$ HTML report.