This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help understanding the bam file generated from BLASR alignment

Hi, I used blasr aligner to align a pacbio dataset against a reference. I used *.bax.h5 files for the alignemnt. Since there were three *.bax.h5 file for a single sample I used the command as follows:

blasr m160128_145513_42215_c100901562550000001823208404291605_s1_p0.1.bax.h5 m160128_145513_42215_c100901562550000001823208404291605_s1_p0.1.bax.h5 m160128_145513_42215_c100901562550000001823208404291605_s1_p0.1.bax.h5 query.fasta -sam  -unaligned unaligned.reads -nproc 8 -out output.sam

I converted the sam to bam and sorted it. Now, when I check the bam file for the counts of read mapped/unmapped, I get something like this:

samtools view -c -F 4 output.sorted.bam 

12978

but when I use a different approach of counting reads I get 3 different values:

samtools view -F 4 output.sorted.bam | wc

12978  298494 9212184

I am not able to understand if these 3 values belong to individual *.bax.h5 I originally used in the mapping or this something else?

Or

is there any other way to use 3 bax.h5 file together in the same mapping step?

Thanks

blasr bam mapping pacbio

For the second part, you make a file with the list of files to align in it, with the suffix of the file .fofn .

-mark

1 answer

man wc

12978 is the number of lines and exactly what samtools view -c ... reported.

298494 is the number of words. This is useless.

9212184 is the number of characters. This is useless.

You probably wanted wc -l rather than just wc.

Ahh silly me. Thanks Devon.

For the second query, can you suggest if using .bax.h5 files this way is the correct way? I have checked the docs but couldn't find anything as how to use multi .bax.h5 files in mapping. The other way I think of is to map individual .bax.h5 files and merge the bam files together.

I unfortunately have no experience with pacbio .bax.h5 files, so I can't give a useful reply. If you create a new question with just that then I expect someone more familiar with pacbio will reply.

Log in to answer this question.