This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trim 100bp PE sequencing to 50bp reads

Hello, we're doing some QC for future sequencing and want to have an empirical comparison of 100bp SE reads with 50bp PE reads. Starting with 100bp PE reads, how can I trim the fastq file to the first 50 bases? (i.e. retain the first 50 characters for each even-number row). Thanks!

unix bash sequencing fastq

2 answers

Using reformat.sh from BBMap suite:

reformat.sh -Xmx4g in1=R1.fq.gz in2=R2.fq.gz out1=trim_R1.fq.gz out2=trim_R2.fq.gz forcetrimright=50

seqtk (LINK) by Heng Li:

seqtk trimfq -e 50 R1.fq > R1_trim.fq
$ cutadapt -l 50 -o out1.fq -p out2.fq input_R1.fastq input_R2.fastq
$ cutadapt -l 50 -o out1.fq  input_R1.fastq 

if SE fastq headers are not 50 characters long, you can try this: colrm 51 < test_R1.fastq > out_R1.fastq. colrm is available most of the *buntu distros.

Log in to answer this question.