This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Failed to liftover from hg38 to hg19

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?

crossmap picard

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?

0 answers

No answers yet.

Log in to answer this question.