This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem in generating hc.readcount files using bam-readcount

Hi, I want to run fpfilter (VarScan false-positive filter) to remove false positives from the vcf files; however I stuck in the step of generating readcount from my vcf file. This is my command:

bam-readcount  -f hg38.fa  -q 1  -b 20  -l all.Somatic.hc.var  tumor.sorted.bam > all.Somatic.hc.readcount

I get this error:

Minimum mapping quality is set to 1
[bam_index_load] fail to load BAM index.
BAM indexing file is not available.

Can anyone help me out? Thanks!

bam-readcount hc.readcount file bam index

1 answer

Index the Bam file as clearly stated in the error message. samtools index in.bam

Thank you ATpoint, I did your suggestion but still I get error. I indexed the sorted.bam file samtools index tumor.sorted.bam and put the output tumor.sorted.bam.bai in the command

bam-readcount  -f hg38.fa  -q 1  -b 20  -l all.Somatic.hc.var  tumor.sorted.bam.bai > all.Somatic.hc.readcount

I got this error:

[bam_header_read] EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
Segmentation fault (core dumped)

Any help?

No, you supply the Bam file in the command. The index file only needs to be present in the same directory. Please spend some time on searching around for the basics of NGS file formats and its usage.

Log in to answer this question.