Entering edit mode
5.8 years ago
phylofun
▴
50
What tool in Picard will tell me the number of reads that mapped to my reference sequences? I would like to use this program (not SAMtools) to identify the percentage of mapped reads (i.e. number of reads mapped/number of total reads).
I'm getting this error when I use that tool:
ERROR: Record 1, Read name M00366:9:000000000-A89UT:1:1103:22880:8023, Alignment start should != 0 because reference name != *.
Hello,
which version of picard are you using?
fin swimmer
Latest release of Picard: version 2.18.27
Ok, let's have a look at the reads. Please post the output of:
(Why is picard making this so complicated? Same thing using
samtools
:$ samtools view -h input.bam|grep "M00366:9:000000000-A89UT:1:1103:22880:8023"
)I get the same error as before if I use picard ViewSam. However, if I use samtools view, I get:
I just used samtools flagstat command and was able to get % reads mapped. However, should I expect to get the same or different result using CollectAlignmentSummaryMetrics?
Hello again,
you should expect the same result. But your
bam
lines are somewhat weird. For the first read the POS is0
. This would be valid, if the read is unmapped but the mate could be mapped. But this isn't given by theFLAG
values is column 2.How have you done the alignment?
fin swimmer
I did the alignment with bwa aln and bwa sampe (a long time ago)
Hello again,
to fix the wrong bam file you can do this:
Make sure you have a current version of
samtools
You will receive the warning:
You don't need to care about it, because this is what we expected.
fin swimmer