This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting longest read from fastq file

Hello All,

I want to extract the longest read from a fastq file. I am not aware of any way to do it. Could someone help me here?

TIA

fastq

Try searching for Extracting longest read from fastq file. I've found some good results.

1 answer

gunzip -c in.fq.gz | paste - - - - | awk -F '\t' '{L=length($2);if(L>M) {M=L;R=$0;}} END {print R;}' | tr "\t" "\n"

Log in to answer this question.