<p>I have data in paired-end as well as single-end format for the same sample.I would like to split those two files into two per each, where one contains sequences that have 5' end and the other one has 3' ends.</p>
<p>So the paired end data has R1 and R2, if R1 is first, it has 5' ends and if not, it has 3' ends? And I'd do the same thing for the single end data.</p>
<p>I'm using samtools and pysam.</p>

CC BY-SA 4.0
2023-02-12T12:50:27.723Z
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Community
CC BY-SA 4.0
2023-02-12T19:16:14.830Z
It's unclear what you're asking. Sequences are almost always written out to files in the 5' to 3' direction.
gringer
<samtools><pysam>
How do I filter reads from a bamfile based on 5' and 3' ends?
# How do I filter reads from a bamfile based on 5' and 3' ends?

(Asked by: username_0 on 2023-02-12)

I have data in paired-end as well as single-end format for the same sample.I would like to split those two files into two per each, where one contains sequences that have 5' end and the other one has 3' ends.

So the paired end data has R1 and R2, if R1 is first, it has 5' ends and if not, it has 3' ends? And I'd do the same thing for the single end data.

I'm using samtools and pysam.

**Tags:** samtools, pysam
> **Comments:**
> **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
> **username_2**: It's unclear what you're asking. Sequences are almost always written out to files in the 5' to 3' direction.  

---

## 0 answers

