How to subset a FASTQ file based on a list of sequences
I have a file1.txt (one sequence per line) which I want to use as a reference to filter out entries from a file.fastq. To clarify, I want to keep the file.fastq entries that perfectly match the sequences in file1.txt
I know BBMap has filterbyname.sh for filtering by ID's. Is there some tool that I could use for sequence based filtering? Thanks in advance :)
• 2,494 views
•
link
1 answer
You can use Bowtie2. Set parameters for as strict an alignment as you like, then use the --al option to write a fastq file for the successful alignments and the --un option to write a fastq file for the unsuccessful alignments.
• 0 views
•
link
Log in to answer this question.
Slightly convoluted. You may be able to use BBMap to align against those sequences. Set
minid=0.95and collect sequences that do not map by usingoutu=in a file. Then filter those out of the original file.There are lots of ways to code this. Have you tried anything, or have any coding/command line experience?
I do have command line experience. Can you suggest a code?