pharm_variants.csv¶
One row is (variant, drug, genotype) → response, at a PharmGKB evidence level. It is a distinct
table rather than columns on variants.csv so that a module carrying no drug annotations carries no
drug columns — one CSV, one concern.
genotype is part of the identity, not decoration. PharmGKB publishes a clinical annotation per
genotype: a summary names variant and drug, and the child rows give one annotation per call, usually
three. They are not variations on one finding — they are distinct and sometimes opposed ones, so
collapsing them to the variant loses the direction of the effect.
evidence_level is PharmGKB's axis and recommendation_strength is CPIC's. They are not two
spellings of confidence and must not be filled from one another.
Identity¶
| Row model | PharmVariantRow (just_dna_format.pgx) |
| Becomes | pharm_variants.parquet — lead parquet: pharm_variants.parquet |
| Authored or derived | authored — a person writes it (a drafter may append rows) |
| Draftable | yes — draft can append rows |
| Drafted by | clinpgx (clinpgx_draft, projection, matched on rsid, chrom, start, ref, drug, genotype, phenotype_category, annotation_id) |
| Natural key | variant_key, drug, genotype, phenotype_category, annotation_id |
| Fact signature | no |
| In the attestation binding | yes — manifest.inputs[] |
| Requires at least one of | rsid or chrom+start |
Columns¶
| Column | Type | Required | Values | Meaning |
|---|---|---|---|---|
rsid |
str | None |
optional | dbSNP id of the variant, e.g. rs9923231 | |
chrom |
str | None |
optional | Chromosome (position-only variants) | |
start |
int | None |
optional | 1-based position, VCF POS convention (position-only) — CPIC/PharmVar publish this convention and it is stored as-is; do not subtract one | |
ref |
str | None |
optional | Reference allele (position-only) | |
gene |
str | None |
optional | Gene symbol, e.g. VKORC1 | |
requires_callable |
bool | None |
optional | True when a consumer must prove this position was callable before concluding that the sample carries this row's genotype — the reference-homozygote row is the case, since a variant-only callset emits no record for it and absence is not the call. False records that no such proof is needed, which is the ordinary case for a genotype carrying an alternate allele. Empty says nothing either way, and is not False. | |
genotype |
str | None |
optional | Genotype the response applies to, canonical sorted form, e.g. C/T, or a single allele where the contig is hemizygous or haploid. An allele is bases, or a symbolic/structural allele carrying its length ( |
|
drug |
str |
required | Drug the response annotation is about, e.g. warfarin | |
phenotype_category |
str | None |
optional | one of: dosage, efficacy, metabolism_pk, other, pd, toxicity |
What kind of effect this is (VALID_PHENOTYPE_CATEGORIES; multi-valued via [,;|]). Part of the identity — one variant+drug carries separate efficacy, toxicity and metabolism annotations. |
annotation_id |
str | None |
optional | The source's own accession for this annotation, e.g. a PharmGKB clinical-annotation id. Optional, and the tie-break of last resort in the duplicate key — like PgsRow.pgs_id, a source accession is a legitimate identity for a curated record. |
|
response |
str | None |
optional | Drug response / phenotype, free-form (e.g. 'reduced dose requirement') | |
evidence_level |
str | None |
optional | one of: 1A, 1B, 2A, 2B, 3, 4 |
PharmGKB clinical-annotation evidence level (1A..4) |
pmid |
str | None |
optional | Optional PubMed id grounding THIS row's claim — the literature behind this drug/genotype response, which studies.csv cannot express because a study row attaches to the whole variant. Free-form like StudyRow.pmid (9545397, [PMID: 9545397], a ;-joined list). The pharm row cites; studies.csv and literature.csv describe. Separate from evidence_level, which grades evidence rather than pointing at it. |
|
trait_efo_id |
str | None |
optional | Optional trait ontology id(s), for cross-module join | |
conclusion |
str |
required | Human-readable interpretation |
Generated from the row model at build time — reference.authoring_reference(), the same answer describe_table gives an authoring tool. Nothing on this page is hand-kept.