This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter Fastq file by seq

Dear All: Does anyone know an efficient tool or script that removes certain reads with from Fastq file when it matches specific sequence? this means : if the reads contain my sequence so the entire read should be completely removed from the FASTQ file.

Many many thanks

ngs python r bioconductor

1 answer

Use seqkit grep:

$ zcat input.fq.gz | seqkit grep -v -s -i -p aggcg

This will remove all reads containing "aggcg".

thank you so much .. is there any option to remove the read of the same fragment from both paired-end FASTQ?

You could use repair.sh from BBtools to remove the corresponding paired read after removing your reads of interest in one of the files:

$ repair.sh in=input_1.fq.gz in2=input_2.fq.gz out=out_1.fq.gz out2=out_2.fq.gz

this is awesome .. thank you so much

Log in to answer this question.