KeyError: "no key 'chr11' in database <SequenceFileDB 'hg38.fa’>" in python
1
0
Entering edit mode
9.4 years ago
wrel2015 • 0

Hi

I am getting an error while executing the parse_hgvs_name function of the "pyhgvs" module currently known as "hgvs" found at https://github.com/counsyl/hgvs. "pygr" module is also used here and the error message is pasted below. Note that the genome object has keys that include '11'.

>>> chrom, offset, ref, alt = pyhgvs.parse_hgvs_name('NM_000352.3:c.215A>G', genome, get_transcript=get_transcript)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".local/lib/python3.3/site-packages/pyhgvs-0.9.4-py3.3.egg/pyhgvs/__init__.py", line 1365, in parse_hgvs_name
  File ".local/lib/python3.3/site-packages/pyhgvs-0.9.4-py3.3.egg/pyhgvs/__init__.py", line 665, in get_vcf_allele
  File ".local/lib/python3.3/site-packages/pyhgvs-0.9.4-py3.3.egg/pyhgvs/__init__.py", line 510, in get_genomic_sequence
  File "pygr-0.8.2-py2.6-linux-x86_64.egg/pygr/seqdb.py", line 322, in __getitem__
KeyError: "no key 'chr11' in database <SequenceFileDB 'hg38.fa'>"

Thank you for your help

software-error pyhgvs python • 2.9k views
ADD COMMENT
7
Entering edit mode
9.4 years ago
cyril-cros ▴ 950

I think that some genome only use the chromosome number and not the 'chrXxxx' format. The key that is missing is 'chr11' and not just '11', see if some headers contain it.

ADD COMMENT
0
Entering edit mode

Thanks cyril-cros! It took me a while to rename the fasta headers in the genome file to chr[\d+|\D+] format but I did and now the function works.

ADD REPLY

Login before adding your answer.

Traffic: 2126 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6