<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Kylie,<div><br></div><div>I think the length() method is what you're after:</div><div><br></div><div>....</div><div>my $sequence_length = $seq_obj->length();</div><div><br></div><div>....</div><div><br></div><div>in your case. Have a look at:</div><div><br></div><div><a href="http://www.google.com.au/url?sa=t&rct=j&q=seqio%20howto&source=web&cd=1&ved=0CB0QFjAA&url=http://www.bioperl.org/wiki/HOWTO:SeqIO&ei=DSDLTvTkJsuXiQfK953QDg&usg=AFQjCNFTKx7q1Xizo6Yley-pPzzAj9QxEg">HOWTO:SeqIO - BioPerl</a></div><div><br></div><div>and,</div><div><br></div><div><a href="http://www.google.com.au/url?sa=t&rct=j&q=seqio%20howto&source=web&cd=2&ved=0CCgQFjAB&url=http://www.bioperl.org/wiki/HOWTO:Beginners&ei=DSDLTvTkJsuXiQfK953QDg&usg=AFQjCNHxTocvCZ4q_9b1R-4TrBaU2ShtTA">HOWTO:Beginners - BioPerl</a></div><div><br></div><div>for some more general stuff.</div><div><br></div><div><br></div><div>Regards,</div><div>Liam.</div><div><br></div><div><br></div><div><br><div><div>On 22/11/2011, at 1:23 PM, Kylie Goodyear wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br>This may seem like a stupid question but I am just learning bioperl<br>and I am trying to figure out how to get a count of all the characters<br>in my FASTA file. I manged to get the number of sequences using the<br>following. Is there a way to tell bioperl to count the characters?<br><br>#!/usr/bin/perl -w<br>#Defines perl modules<br>#Bio::Seq deal with sequences and their features<br>use Bio::Seq;<br>#Bio::SeqIO handles reading and parsing of sequences of many different<br>formats<br>use Bio::SeqIO;<br>#Read FASTA file<br>$seqio_obj = Bio::SeqIO->new(-file => "DNA_sequences.fasta", -format<br>=> "fasta" );<br>#Count how many sequences are present in file<br>my $count=0;<br>while (my $seq_obj = $seqio_obj->next_seq) {<br> $count++;<br>}<br>#Display the number of sequences present<br>print "There are $count sequences present.\n";<br><br><br>_______________________________________________<br>Bioperl-l mailing list<br><a href="mailto:Bioperl-l@lists.open-bio.org">Bioperl-l@lists.open-bio.org</a><br>http://lists.open-bio.org/mailman/listinfo/bioperl-l<br></div></blockquote></div><br></div></body></html>