Hi guys, I'm new to this community.
I have two fastq files per sample from our Illumina platform with the forward and reverse reads. I cut the reads in both files so that only the segment in the middle where the two reads overlap is left ( around 100bp). I would like to use forward and reverse reads for error-correction. I want to look at each position and only keep the bases where forward and reverse read show the same base.
First I aligned both files seperately using bwa.
Now I would like to open both aligned bam files in pysam and compare forward and reverse read with each other. How can I achieve this? I think I would probably have to sort the bam files by read name and then go through both files in parallel. But this seems clumsy and error-prone to me. Is there a way in pysam to get corresponding forward and reverse reads from two bam files?
Thank you very much in advance.