#!/usr/bin/perl
#split_fasta.pl version 1.0
#This script accepts a file consisting of multiple FASTA formatted sequence records.
#It splits the file into multiple new files, each consisting of a subset of the original records.
#
#There are three command line options:
#
#-i input file.
#-o output file prefix. This script will append numbers to this prefix name so that each created file is unique.
#-n the number of sequences to place in each output file.
#
#Example usage:
#
#perl split_fasta.pl -i sample_in.txt -o new_sequences -n 100
#
#Written by Paul Stothard, Canadian Bioinformatics Help Desk.
#
#stothard@ualberta.ca
use strict;
use warnings;
#Command line processing.
use Getopt::Long;
my $inputFile;
my $outputFile;
my $numberToCopy;
Getopt::Long::Configure ('bundling');
GetOptions ('i|input_file=s' => \$inputFile,
'o|output_file_prefix=s' => \$outputFile,
'n|number=i' => \$numberToCopy);
if(!defined($inputFile)) {
die ("Usage: split_fasta.pl -i -o