This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem with using flagstat after bowtie2 alignment

I'm running bowtie2 to align multiple samples to one reference genome, and then run samtools flagstats to output the results. All but two samples have aligned and I've managed to run flagstat on them.

For those two samples, when I run flagstat, I first get:

[W::bam_hdr_read] EOF marker is absent. The input is probably truncated.

Then, after a while, I get

[E::bgzf_read_block] Filed to read BGZF block data at offset *, expected *bytes; hread returned *
[E::bgzf_read] Read block operation failed with error 4 after 0 of 4 bytes

The code I use to align reads to the reference

bowtie2 -x $ref_path -1 $file/*_1.fastq -2 $file/*_2.fastq | samtools view -bS -> "bowtie/$file.aligned.bam"
echo Finished

I passed the script to Sun Grid Engine job system, and got the corresponding output and error - both were empty. The last line, echo Finished should have been in the output, but but wasn't there. I suspect that alignment failed

bowtie2 samtools flagstat

0 answers

No answers yet.

Log in to answer this question.