Hi,
I am having trouble with BAM file manipulation. Using samtools version: 0.1.19+ , I get the following error messages when trying to index a sorted BAM file:
[bam_index_core] read 'HWI-ST1144:470:H88C0ADXX:1:1101:15534:7325' mapped to 'gi|11497060|ref|NC_000948.1|' at POS 0 to -1 has BIN 4680 but should be 266824
[bam_index_core] Fix it by using BAM->SAM->BAM to force a recalculation of the BIN field
[bam_index_build2] fail to index the BAM file.
I have tried to convert to BAM->SAM->BAM with:
samtools view -h Sample_Bbcap9_005_004.sort.bam | samtools view -hbS - > test.bam
But this does not solve the problem and I continue to get the same erros.
I also tried using an earlier version of Samtools, samtools-0.1.8, and though this allowed me to index the BAM file, I ran into errors when I tried to do any follow-up analysis
bedtools intersect -abam test.bam -b $BED ?
Error: Invalid record in file test.sort.bam. Record is
gi|11497060|ref|NC_000948.1| -1 75 HWI-ST1144:470:H88C0ADXX:1:2202:10057:82693/2 37 +
Please let me know if I am doing something obviously wrong, any help is much appreciated!
Best,
I am having trouble with BAM file manipulation. Using samtools version: 0.1.19+ , I get the following error messages when trying to index a sorted BAM file:
[bam_index_core] read 'HWI-ST1144:470:H88C0ADXX:1:1101:15534:7325' mapped to 'gi|11497060|ref|NC_000948.1|' at POS 0 to -1 has BIN 4680 but should be 266824
[bam_index_core] Fix it by using BAM->SAM->BAM to force a recalculation of the BIN field
[bam_index_build2] fail to index the BAM file.
I have tried to convert to BAM->SAM->BAM with:
samtools view -h Sample_Bbcap9_005_004.sort.bam | samtools view -hbS - > test.bam
But this does not solve the problem and I continue to get the same erros.
I also tried using an earlier version of Samtools, samtools-0.1.8, and though this allowed me to index the BAM file, I ran into errors when I tried to do any follow-up analysis
bedtools intersect -abam test.bam -b $BED ?
Error: Invalid record in file test.sort.bam. Record is
gi|11497060|ref|NC_000948.1| -1 75 HWI-ST1144:470:H88C0ADXX:1:2202:10057:82693/2 37 +
Please let me know if I am doing something obviously wrong, any help is much appreciated!
Best,
Comment