hgvs2spdi
Quick Start
- Command:
... | hgvs2spdi [transform.tsv] - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/hgvs2spdi - Output: formatted XML with
Id,Hgvs, andSpdifields
When To Use This Tool
- Convert HGVS records produced inside an EDirect pipeline into SPDI coordinates.
- Resolve CDS-relative HGVS notations against transcript-specific coding-start offsets.
- Keep working in XML-based NCBI tooling instead of manually translating coordinates.
- Reuse a cached transform table when you want to avoid repeated live accession lookups.
Common Patterns
# 1) Convert HGVS extracted from dbSNP docsum records
efetch -db snp -id 11549407 -format docsum |
xtract -rec HGVS -pattern DocumentSummary -wrp Id -element Id -rst -hgvs DOCSUM |
hgvs2spdi
# 2) Use a precomputed accession-to-offset transform file
xtract -rec HGVS -pattern DocumentSummary -wrp Id -element Id -rst -hgvs DOCSUM < input.xml |
hgvs2spdi cds_offsets.tsv
# 3) Inspect the resulting SPDI XML
... | hgvs2spdi | xtract -pattern Variant -element Accession,Position,Deleted,Inserted,Spdi
Recommended Workflow
- Feed the tool HGVS XML, not raw HGVS strings.
- Decide whether to let the wrapper compute transcript offsets live or to pass an existing
accession<TAB>offsettable as the optional positional file argument. - Inspect the emitted
HgvsandSpdifields together before downstream storage or querying. - Cache transform tables when converting many transcript-relative HGVS records from the same accession set.
Guardrails
hgvs2spdireads its HGVS records from stdin; a positional file argument is only for the optional transform table.- There is no real help path;
hgvs2spdi --helpwith empty stdin exits silently. - Without a transform file, the wrapper performs live
efetch/gbf2xmllookups to derive CDS-start offsets for transcript accessions. - The transform table is expected to contain
Accession<TAB>offsetrows suitable forxtract -transform. - Output is XML, not a bare
accession:position:deleted:insertedtext line. - The wrapper depends on sibling EDirect helpers such as
xtract,print-columns,gbf2xml, andtransmutebeing onPATH.