fasta splitter

January Weiner 3 jweiner1 at ix.urz.uni-heidelberg.de
Mon Oct 7 11:47:33 UTC 2002


Hello,

> almost, but not quite. This converts one file to many files containg one
> sequence. I need something like a conversion of one file containing 1000
> seqs to 10 files each  containing 100 seqs

I wrote you a simple perl script which should do the job.  Save it to a
file and make it executable (I think you are using a Unix-based system,
aren't you?) with chmod a+x split.pl.  To be on the safe side, put it in a
new directory, and copy your sequence file to the same directory.  Now run

./split.pl <filename> <number of sequences>

...where filename is the name of the file containing your 1000+ sequences,
and <number of sequences> is the number of sequences you wish to have in
each produced file.  The produced file will have the same name as the
original file with the appendix .1, .2, .3 etc.

I tried the script and it seems to work fine.  Meet the power of Perl :-)

Regards,
j.

----)-\//-///-----------------------------------January-Weiner-3-------
Technologists often forget the general user. Technology is only as good as
the user experience. That is something that technology groups very often
forget... [ Linus Torvalds, taken from the GNOME Usability Project ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: split.pl
Type: application/x-perl
Size: 849 bytes
Desc: 
URL: <http://lists.open-bio.org/pipermail/emboss/attachments/20021007/304bd4fb/attachment.pl>


More information about the EMBOSS mailing list