How to split fastq file containing Forward and Reverse reads to two files Forward and Reverse
1
0
Entering edit mode
4.1 years ago
Bioinfo ▴ 20

Hello everyone ,

I have fastq file containing both Forward and reverse reads an di want to split this file to two files Forward and Reverse

can you tell me please how to do that ?

Thank you very much

sequencing genome alignment Assembly • 8.8k views
ADD COMMENT
0
Entering edit mode

Do you really mean forward and reverse, and not read 1 and read and read 2? read1 and read2 can likely be split by their names. forward and reverse can only be determined after alignment.

ADD REPLY
0
Entering edit mode

Thank you for your response

well , because i did alignement of my reads (two files R1 and R2 ) and i transfered the output of bowtie2 (sam file ) to bam file , and from bam file i extracted unmapped reads (bam format ) and i transfered this last one to fastq and now i want to split this file to forward and reverse to do assemblage next ( my goal is to do assembly of the unmapped reads )

Sorry for late reply

ADD REPLY
0
Entering edit mode

You can also use samtools fastq to convert your unmapped.bam file to fastq.

ADD REPLY
0
Entering edit mode

yees i ve got fastq file and i wat to split it to two files forward and reverse

ADD REPLY
0
Entering edit mode

You can't identify what direction the read goes from the fastq. However, the bam file will tell you forward or reverse.

ADD REPLY
0
Entering edit mode

If you mean forward (= R1 read) and reverse (=R2 read) then splitting the interleaved files is fine. Otherwise you can't find the information about which strand they come from since the reads are unmapped.

ADD REPLY
1
Entering edit mode
4.1 years ago
GenoMax 141k

If your reads are interleaved (1_R1,1_R2,2_R1,2_R2 etc) then you can use reformat.sh from BBMap suite.

reformat.sh in=original.fq out1=R1.fq out2=R2.fq
ADD COMMENT
0
Entering edit mode

Thank you very much for your answer

ADD REPLY
0
Entering edit mode

What if reads are not interleaved? Like merged fastq file by "cat" R1 and R2? 1_R1, 2_R1, 3_R1...and then 1_R2, 2_R2, 3_R2...

R1: @A00821:139:HNTJGDSXX:1:1101:5159:1031 1:N:0:TGGTCATC+CCTAGTCA

R2: @A00920:68:HNV3TDSXX:3:2678:32832:37059 2:N:0:AAGGTTCG+CACGTCAT

ADD REPLY
0
Entering edit mode

You could simply split the file in two pieces. Assuming the read numbers in two files matched before they were cated.

ADD REPLY
0
Entering edit mode

yeah, that works.

ADD REPLY

Login before adding your answer.

Traffic: 2646 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6