This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Divide reads to shorter reads in Fastq file

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

2 answers

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));}'

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

Log in to answer this question.