This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any tool that can search for a pattern (while allowing mismatch) in fastq file?

Hi,

I want to compare the accuracy of different trimming tools. I want to search for adapter sequence in the trimmed fastq file. I tried using grep command as mentioned below, but it's looking only for exact match. When I searched with part of the adapter sequence, I can see more results, and all the matches are near the sequence end, hence, I think they are most likely from adapter sequence.

$ zcat sample1_tool1_trimmed.fastq | grep "AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC" | wc -l
$ 28
$ zcat sample1_tool1_trimmed.fastq | grep "AGATCGGAAGAGCA" | wc -l
$ 143

Is there any tool that can search for adapter sequence in fastq file while allowing mismatch? Also, this is one time analysis, hence, it's completely fine if the tool takes more time to run.

And, thank you for your suggestion in advance. :)

next-generation-sequencing trimming-tools

2 answers

There are plenty. Check out agrep.

Also, not sure what your goal is. What you're doing is trying to find adapters in your sequencing reads. That's exactly what adapter trimming tools like cutadapt do. Kind of a strange way to do benchmarking by writing a poor man's version of cutadapt (which will certainly have false negatives since you're not doing an alignment strategy). Benchmarking should be done against some sort of ground truth, which you can generate by simulation.

you can try seqkit, bbmap

Log in to answer this question.