This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I have a fasta file with 2000 sequences (big.fasta) and a text file with 70 sequence ids (ids.txt). How can I remove (or cut and paste) the sequences in ids.txt from the big.fasta file?

I have a fasta file with 2000 sequences (big.fasta) with transcripts.

I also have a text file with 70 sequence ids (ids.txt) present between those 2000 sequences.

I want to remove the sequences in ids.txt from the big.fasta file; thus creating a fasta file with 1930 sequences free of the ids from ids.txt.

Also, if possible can I cut and paste those 70 sequences from the 2000 sequences file to some other fasta file?

I am a novice with no prior experience in these matters. Kindly help.

bash rna-seq bioperl samtools perl

1 answer

This would work:

git clone https://github.com/BioInf-Wuerzburg/SeqFilter.git
cd SeqFilter
make  # just fetches some libraries, no root or anything required

bin/SeqFilter big.fasta --ids idx.txt --ids-exclude --out big-filtered.fasta

Log in to answer this question.