CrossMap
CrossMap copied to clipboard
gvcf KeyError: '>'
hi wang i crossmap gvcf 2 hg38
CrossMap.py gvcf /disk/reference/liftover_ref/hg19ToHg38.over.chain M248.g.vcf.gz /storage/data/reference/update_gatk_v0/Homo_sapiens_assembly38.fasta crossmap_HG38/M248.g.vcf.gz_HG38.g.vcf.gz --compress --chromid l
version = 0.6.6
2023-11-07 05:04:03 [INFO] Updating contig field ...
2023-11-07 05:04:03 [INFO] Lifting over ...
Traceback (most recent call last):
File "/home/solivehong/miniconda3/envs/bio_base/bin/CrossMap.py", line 329, in <module>
crossmap_gvcf_file(mapping = mapTree, infile= in_file, outfile = out_file, liftoverfile = chain_file, refgenome = genome_file, noCompAllele = args.no_comp_alleles, compress = args.compression, cstyle = args.cstyle)
File "/home/solivehong/miniconda3/envs/bio_base/lib/python3.11/site-packages/cmmodule/mapgvcf.py", line 228, in crossmap_gvcf_file
fields[4] = revcomp_DNA(alt_allele, True) + ',<NON_REF>'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/solivehong/miniconda3/envs/bio_base/lib/python3.11/site-packages/cmmodule/utils.py", line 94, in revcomp_DNA
return ''.join([complement[base] for base in reversed(seq)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/solivehong/miniconda3/envs/bio_base/lib/python3.11/site-packages/cmmodule/utils.py", line 94, in <listcomp>
return ''.join([complement[base] for base in reversed(seq)])
~~~~~~~~~~^^^^^^
KeyError: '>'
I check mapgvcf.py and see split, unsuccessful
pip install crossmap==0.6.1 is work best solivehong
Hi Solivehong Genotypes in the "ALT" field can only be IUPAC characters plus dot (.), dash (-) and star (*). please double-check.
Liguo
@liguowang show me error line
chr1 14542 . A G,<NON_REF>
This the normal GVCF line,for mine mind
A quick fix is replacing the <NON_REF> with "." or "-". Or you can reinstall CrossMap using: pip3 install git+https://github.com/liguowang/CrossMap.git
. please let me know if the problem persists.
Hi Liguowang,
I have the same error with "<CN2>" in the "ALT" column, Do you suggest replacing the entire thing with either "." or "-"? or should I just remove "<" and ">" but that would lead to the column being "CN2" which is also not an acceptable parameter?
Thanks!
Did you use the most recent version of CrossMap? Yes, you could try to replace "<NON_REF>" with "." or "-" to see how it works. My impression is that the recent version should be able to handle "<NON_REF>" (at least for the VCF command).
I tried installing the latest version and it worked! Thanks :D