This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract fastq reads by lists of sequences

Hello,

I have lists of sequence which I would like to find fastq reads that contain these sequences.

Is there a tool or any possible programming to find fastq reads from specific lists of sequences??

My lists of sequences look like following,

GATAAAAAAAAAAAAAAAC
GATAAAAAAAAAAAAAACC
GATAAAAAAAAAAAAAATC
GATAAAAAAAAAAAAAAGC
GATAAAAAAAAAAAAACAC
GATAAAAAAAAAAAAACCC
GATAAAAAAAAAAAAACTC
GATAAAAAAAAAAAAATAC
GATAAAAAAAAAAAAATCC
GATAAAAAAAAAAAAATGC
GATAAAAAAAAAAAAAGAC
GATAAAAAAAAAAAAAGCC
GATAAAAAAAAAAAAAGGC
GATAAAAAAAAAAAACAAC
GATAAAAAAAAAAAACACC
GATAAAAAAAAAAAACCAC
GATAAAAAAAAAAAACCCC
GATAAAAAAAAAAAACCTC
GATAAAAAAAAAAAATAAC
GATAAAAAAAAAAAATCAC
GATAAAAAAAAAAAATTAC
GATAAAAAAAAAAAAGAAC
GATAAAAAAAAAAAAGACC
GATAAAAAAAAAAACAAAC
GATAAAAAAAAAAACCCCC
GATAAAAAAAAAAATAAAC
GATAAAAAAAAAAAGAAAC
GATAAAAAAAAAACAAAAC

. . . .

I have used grep to do this one by one but it's taking too long (I have 40k 19mers).

grep -A 2 -B 1 "CTCAAAAAAAAACAAAGGA" input.fastq |grep -v "^\-\-$" > output.fastq

Also, there is a problem with overlapping reads.

fastq ngs genome genomics

You can use grep -f file

-f, --file=FILE obtain PATTERN from FILE

So if you have a file with single pattern per line grep will pull out all sequences for all patterns.

thanks a lot!! I tried the code below and it's not working, could you please have a look??

grep -A 2 -B 1 -f list.txt input.fastq |grep -v "^\-\-$" > output.fastq

Looks right

the output fastqs seems to be empty :(

0 answers

No answers yet.

Log in to answer this question.