Divide reads to shorter reads in Fastq file
2
0
Entering edit mode
16 months ago

Hi

Is there package/software/python module that takes each read in Fastq file and divide it to 2 shorter reads? In my case, take 150 bp read and divide into 75 bp 2 reads.

Fastq • 520 views
ADD COMMENT
1
Entering edit mode
16 months ago
gunzip -c in.fa.gz | paste - - - - | awk -F '\t' '{L=length($2);printf("%s\n%s\n+\n%s\n",$1,substr($2,1,L/2),substr($4,1,L/2)); printf("%s\n%s\n+\n%s\n",$1,substr($2,L/2+1),substr($4,L/2+1));}'
ADD COMMENT
1
Entering edit mode
16 months ago
GenoMax 141k

Using reformat.sh from BBMap suite (two steps):

reformat.sh -Xmx2g in=read.fastq.gz out=left_75bp.fastq.gz  forcetrimright=74

reformat.sh -Xmx2g in=read.fastq.gz out=right_75bp.fastq.gz  forcetrimleft=74
ADD COMMENT

Login before adding your answer.

Traffic: 2067 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