I have removed duplicates from my bam file (not secondary, nor suplementary alignments), and then I have looked for some repeated qnames
(to assess the failure of a program) and I've found a lot of them. All of them has TLEN
equal to 0.
As an example: this is part of a bed file that a generate from the bam.
CHR Start End QNAME PNEXT TLEN
12 86945793 86945944 A05325:240:SS348DSZX:2:5105:12246:3790 90044835 0
4 168461445 168461485 A05325:240:SS348DSZX:2:5105:12246:3790 90044835 0
And those are these reads in the original bam:
A05325:240:SS348DSZX:2:5105:12246:3790 2177 4 168461445 0 111H40M 11 90044835 0 ATAAAATTAAAAAAATAAAAAAATTAAAAAAAAAAAAAAA :,F,F,,FF:FF,F,,F,FFFF,,F,F,:,:,FFFFFFFF NM:i:2 MD:Z:28T8G2 MC:Z:151M AS:i:32 XS:i:31 RG:Z:HM327DSXX.3 SA:Z:12,86945793,+,20S37M94S,1,1;
A05325:240:SS348DSZX:2:5105:12246:3790 129 12 86945793 1 20S37M94S 11 90044835 0 ATGGTGAAAAAACAAATTATTTAAAAAAATCAAAAAAAAAAAAAAAACCAAAAAACATAAAAAAAAGGGCAGTAATTTTATTCATGGGGTCAAACAAAAAAAAAGCATAATATAAAATTAAAAAAATAAAAAAATTAAAAAAAAAAAAAAA FF,,,:,F,F,,,,F,,,,,,,F,FFFF:,:FFFF:FFF,FF::F,:,,FFFF,,,F,FF::,,F,::,,,,F,,F:FF,,,,,,,F::F,F,,,,F,FFFFF:,F,,F,,:,F,F,,FF:FF,F,,F,FFFF,,F,F,:,:,FFFFFFFF NM:i:1 MD:Z:9G27 MC:Z:151M AS:i:32 XS:i:29 RG:Z:HM327DSXX.3 SA:Z:4,168461445,+,111S40M,0,2;
This are the commands used to remove duplicates:
samtools view -F 1024 -bo filtered.bam original.bam
The commands used to generate this bed were:
samtools view sample.bam | awk '{ print $3, $4, $4+length($10), $1, $8, $9}' > sample.bed
Why do I present those alignments?
TSLEN
is off the top of my head. Googling around I found biostars.org/p/78878 , maybe you are talking about TLEN (e.g. "TLEN: signed observed Template LENgth")? Have you already filtered alternate mappings from the BAM? $\endgroup$