Question: Failed to liftover from hg38 to hg19
0
gravatar for BAGeno
2.1 years ago by
BAGeno170
BAGeno170 wrote:

Hi,

I am converting my file from hg38 to hg19. For this purpose I used crossmap and picard LiftoverVcf. But I am getting this error when I run crossmap.

Traceback (most recent call last):
  File "/home/linux/anaconda3/bin/CrossMap.py", line 1760, in <module>
    crossmap_vcf_file(mapping = mapTree, infile= in_file, outfile = out_file, liftoverfile = sys.argv[2], refgenome = genome_file)
  File "/home/linux/anaconda3/bin/CrossMap.py", line 384, in crossmap_vcf_file
    for line in ireader.reader(infile):
  File "/home/linux/anaconda3/lib/python3.6/site-packages/cmmodule/ireader.py", line 27, in reader
    yield l.decode('utf8').strip().replace("\r", "")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 636: invalid start byte

This is my command.

CrossMap.py vcf UCSC_chain/hg38ToHg19.over.chain.gz Input.vcf.gz hg19.fa Output.liftover.vcf

And picard LiftoverVcf does not liftover any variant. This is my picard command.

java  -Xmx12G -jar picard.jar LiftoverVcf I=Input.vcf.gz O=Ouput.liftover.vcf CHAIN=hg38ToHg19.over.chain.gz REJECT=rejected_variants.vcf R=hg19.fa

What should I do to resolve this error?

picard crossmap • 1.6k views
ADD COMMENTlink modified 10 months ago by Biostar ♦♦ 20 • written 2.1 years ago by BAGeno170

Hello. I am attempting to convert from hg38 to hg19. My results so far are picard rejects all.

CrossMap.py does convert some but fails because of this in the chain file.

File "/usr/local/bin/CrossMap.py", line 1932, in <module> crossmap_vcf_file(mapping = mapTree, infile= in_file, outfile = out_file, liftoverfile = sys.argv[2], refgenome = genome_file) File "/usr/local/bin/CrossMap.py", line 605, in crossmap_vcf_file fields[3] = refFasta.fetch(target_chr,target_start,target_end).upper() File "pysam/libcfaidx.pyx", line 303, in pysam.libcfaidx.FastaFile.fetch KeyError: "sequence 'chr1_gl000192_random' not present"

Does anyone know of a way around this issue?

ADD REPLYlink written 10 months ago by richyanicky10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1749 users visited in the last hour
_