I am trying to run velocyto on my BAM file, however I was getting some errors that implied a truncation or corruption of the BAM file. I tested that this wasn't velocyto related by running samtools index on the file, which achieved a highly similar error (below), so it's most likely the file itself which is the problem.
samtools index WT_UT_possorted_genome_bam.bam [E::bgzf_uncompress] Inflate operation failed: progress temporarily not possible, or in() / out() returned an error [E::bgzf_read] Read block operation failed with error 1 after 0 of 4 bytes samtools index: failed to create index for "WT_UT_possorted_genome_bam.bam"
I've tried some suggested approaches for checking the state of my BAM including samtools quickcheck -v (seems fine) and manually checking for the correct BAM footer (matches what it should look like):
tail -c 28 WT_UT_possorted_genome_bam.bam | hexdump -C 00000000 1f 8b 08 04 00 00 00 00 00 ff 06 00 42 43 02 00 |............BC..| 00000010 1b 00 03 00 00 00 00 00 00 00 00 00 |............| 0000001c
I would ask is the file definitely corrupted, and if not is there any way to check further or fix the file?
Poster suggested solutions:
samtools quickcheck -qvvv WT_UT_possorted_genome_bam.bam verbosity set to 3 checking WT_UT_possorted_genome_bam.bam opened WT_UT_possorted_genome_bam.bam WT_UT_possorted_genome_bam.bam is sequence data WT_UT_possorted_genome_bam.bam has 66 targets in header. WT_UT_possorted_genome_bam.bam has good EOF block.
Just displaying command and error content (several lines of BAM output follow this error):
samtools view WT_UT_possorted_genome_bam.bam | tail [E::bgzf_uncompress] Inflate operation failed: progress temporarily not possible, or in() / out() returned an error [E::bgzf_read] Read block operation failed with error 1 after 0 of 4 bytes [main_samview] truncated file.