Pages

How to Split Multi line FASTA Files with PERL Script

Recently someone anonymous (surprisingly most of the reader who comment on this blog are anonymous) asked for a PERL script to split a multi line fasta file to induvidual fasta file with single sequence. Some times if you have hundreds of sequences in a single file and want them to handle separately or in smaller size them it is really helpful to split them or separate them in several files. SO PERL scripts given below do the same job to split big multi line fasta files to small fasta files.

Script: split_fasta.pl

Uses

perl split_fasta.pl -i input.txt -o result.txt -n 1000

The best thing about this script is that you can control the number of sequence per file you want. For example, if you have 60,000 sequences in a files and you will run the command given above so it will create 6,000 different files.