I want to process both reads in a paired-end read simultaneously, but don't know how to do this efficiently.If I use for read in bam_file:
and bam_file.mate(read)
, each read is Iteratived twice, so is there an efficient way to iterate through paired-end reads in pysam?
each _alignment_
sort your bam by read-name, remove secondary and supplementary alignments.