This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract fasta sequnces not matching a list

Hey guys,

I know it's possible to use seqtk subseq to extract fasta files matching a list. Now, is there a way to extract those fasta files that don't match the exact fasta headers on the list? Thanks!

assembly sequence

Looks like you already have a solution. In general, this boils down to list manipulation. If you have a list of all sequences and a list of those that you don't want (those to exclude), grepping the two files using a -v option will give you their difference that can be used in normal fashion.

grep -v -f partial.lst full.lst > diff.lst

1 answer

You can use faSomeRecords from Jim Kent's utils for that.

faSomeRecords - Extract multiple fa records
usage:
   faSomeRecords in.fa listFile out.fa
options:
   -exclude - output sequences not in the list file.

Log in to answer this question.