Length Filter a Fasta

Have you ever wanted to get the sequences in your fasta file that are longer than a certain length?  Try this short script:
lengthfilterpic
To execute this script, first write up the commands in a text editor like XCode, emacs, or TextWrangler and save the script as a python code named “length_filter.py”.   Then, enter the directory that contains the python script and enter the following command in your terminal:
python length_filter.py n inputfastafile outputfile
where n is an integer of the minimum length of sequence you want kept in the output file.
Happy fasta filtering!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s