angelina.Z.H
angelina.Z.H

Reputation: 1

MapDamage [E::fai_retrieve] Failed to retrieve block: unexpected end of file, in snakemake pipeline

I don't know what to check next to solve the issues. I trie to re install mapdamage et transforme the .bam to .sam to check the file which seems fine.

And I still have the issue :

rule MapDammage:
    input: /*/hg19.fa, 06_MapDammage/*/HgSim.*.nodup.RG.bam
    output: 06_MapDammage/*.results/HgSim.*.rescaled
    jobid: 14
    wildcards: sample=HgSim.*

16:12:40 mapdamage.main INFO Started with the command: /usr/local/bin/mapDamage --input 06_MapDammage/HgSim.*.bam --reference /*/hg19.fa --folder 06_MapDammage/*.results --rescale-out 06_MapDammage/*.results/HgSim.*.rescaled
16:12:40 mapdamage.reader INFO Found 1 libraries in BAM file
16:12:40 mapdamage.main INFO Reading from '06_MapDammage/*/HgSim.*.bam'
16:12:40 mapdamage.main INFO Writing results to '06_MapDammage/HgSim.*.results/'
[E::fai_retrieve] Failed to retrieve block: unexpected end of file
Traceback (most recent call last):
  File "/usr/local/bin/mapDamage", line 11, in <module>
    load_entry_point('mapdamage==2.2.1', 'console_scripts', 'mapDamage')()
  File "/usr/local/lib/python3.8/dist-packages/mapdamage-2.2.1-py3.8-linux-x86_64.egg/mapdamage/main.py", line 269, in entry_point
    return main(sys.argv[1:])
  File "/usr/local/lib/python3.8/dist-packages/mapdamage-2.2.1-py3.8-linux-x86_64.egg/mapdamage/main.py", line 176, in main
    (before, after) = mapdamage.align.get_around(
  File "/usr/local/lib/python3.8/dist-packages/mapdamage-2.2.1-py3.8-linux-x86_64.egg/mapdamage/align.py", line 32, in get_around
    before = ref.fetch(chrom, pos_before, coord_min).upper()
  File "pysam/libcfaidx.pyx", line 319, in pysam.libcfaidx.FastaFile.fetch
ValueError: failure when retrieving sequence on 'X'

Do you have an idea what could be wrong ?

Upvotes: 0

Views: 301

Answers (1)

codeman51
codeman51

Reputation: 156

Not sure how you generated alignments, but I'd recommend checking that your chromosome names are consistent between your BAM file (run samtools -H to see the header) and your fasta file. This can cause issues sometimes.

Upvotes: 0

Related Questions