#! /usr/bin/perl -w #Script was written by CSR on 11.17.06 #Modified by CSR on 10.21.08 #Input = Sequences in FASTA format. #Ouput = Column 1 = SeqIDs, Column 2 = sequence length (bp or aa). #Usage = ./fasta_length1.0.pl [filename] use strict; use Bio::SeqIO; #load the file my $fastafile = shift or die "WARNING: COULD NOT OPEN FASTA FILE\nUSAGE: ./fasta_length1.0.pl filename\n"; my $in = Bio::SeqIO-> new(-format => 'fasta' , -file => $fastafile); #determine the length of each sequence while( my $seqobj = $in->next_seq ) { print $seqobj->display_id, "\t", $seqobj->length, "\n"; }