Hi,
I'm new using samtools and I'm sorry in advance if my question has an
obvious answer... I did not manage to find any solution online or in the
samtools documentation.
I've been trying to filter the reads in a BAM file by the reference
name. This field appears in the 3rd column of the header in the bam
file. I checked my BAM file and it seems correct.
This is an example of one read in my file:
> f5f22aad-bb4a-4ec6-805c-4f290cf5d116 16 MA1#0001 51 60 35S188M1D11M76S * 0 0
> ATTGCTAATGATACGGCGACCACCGAGATCTACACGTTCAGAGTTCTACAGTCCGACGATCCATTGTTCACCTCACGCAGACGAGCTCTTAGACAAGTGACAGTGTCCACTCGAGACTGGATATTCTCCAGTTACATACCAATAATAACAAATACTTAACATTGTACAAGAATACCCGATTCTGCGTCCAACCTCATTGAAACCCTCCTTTGGGTGGAATTCTGGGTGCCAAGGAATCCAGTCACCACGATATCTCGTATGCCGTCTTCTGCTTGAGCAATACGTAACTGAACGAAGTGCCGACAAAAGA
>
> 4>?ABEEEDC@@@?@>>>>>A@?ABBCAAAABCBCCDBBBDBDCBABA@@ABCCCC?>>>>HDDCDAAAA@@@@@@BCBBAABCCD?==<<?@ABCBC@@??>?@BBICBBABFHFDDDIQHHEEDCCDCBBCBCDDDEGFHHGEDDEGIEEEEEECCC@@AACLEFCBBBBAAABCGIKB@?>>?B@>>>>ADBCCCA?;;;<>ACC?>>?A?>??<=,++(78;:2-,+(''((+-2CBAB?>???FCB?>?@?DEC::::D///,-...-?>GEFDAAAAH6555;50,*'%$#"""##$$####""
> NM:i:1 ms:i:392 AS:i:392 nn:i:0 tp:A:P cm:i:31 s1:i:168 s2:i:51 de:f:0.005
> rl:i:18
where MA1#0001 is the name of one of my references.
I was trying to filter the file by reference name with no luck (always
empty outputs). I checked the statistics then using the following line:
> samtools idxstats my_file.bam
The output shows 0 reads mapped to every reference, here a fragment of
the output:
> MA1#0001 300 1099 0
> MA1#0002 300 2325 0
> MA1#0003 300 3757 0
> MA1#0004 300 1686 0
> MA1#0005 300 1856 0
> MA1#0006 300 3051 0
> MA1#0007 300 2965 0
Any idea about why this is happening an how to solve it? Many thanks!!
Cheers,
Eva
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help