I want to remove singletons from a bam-file.
This is for paired-end data but I'm also fine with a method that only works on single-end sequencing, because ultimately I will only use the 5 prime mates anyway.
What I mean by singleton: if the 1st mate aligns anywhere on the genome, and there is no other 1st mate of a different pair starting at the exact same basepair, then it's a singleton.
I just want to remove those and be left with a bam-file which only contains 1st-mates that have at least one other 1st mate starting from the exact same position.
P.S. When using samtools flagstat, there is one line with info on singletons. What does "singleton" mean in the flagstat-sense I wonder, is this the same type of singletons I described above?
--
I use samtools-0.1.12a
This is for paired-end data but I'm also fine with a method that only works on single-end sequencing, because ultimately I will only use the 5 prime mates anyway.
What I mean by singleton: if the 1st mate aligns anywhere on the genome, and there is no other 1st mate of a different pair starting at the exact same basepair, then it's a singleton.
I just want to remove those and be left with a bam-file which only contains 1st-mates that have at least one other 1st mate starting from the exact same position.
P.S. When using samtools flagstat, there is one line with info on singletons. What does "singleton" mean in the flagstat-sense I wonder, is this the same type of singletons I described above?
--
I use samtools-0.1.12a