I have sam and bam files for the chimeric reads, which come from two different parts of the genome (For example, the first half of the read from part of Chromosome 1 and the second half of the read from part of Chromosome 3). I have removed the low mapping quality reads (MAPQ <= 30) and reads with high mismatches. This might result in some unpaired reads which need to be removed before further analysis. May I ask whether there is any way to remove the unpaired reads in sam/bam files? Thanks!
-f option of
samtools view is for flags and can be used to filter reads in bam/sam file matching certain criteria such as properly paired reads (
samtools view -f 0x2 -b in.bam > out.bam