Have you ever wanted to get the sequences in your fasta file that are longer than a certain length? Try this short script:
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!