[Bioperl-l] Newbie question on Bio::SeqIO

Adam Sjøgren asjo at koldfront.dk
Wed Jan 26 22:30:10 UTC 2011


On Wed, 26 Jan 2011 14:05:08 -0800 (PST), JayPea wrote:

> #!/usr/bin/perl
> use Bio::Perl;
> use Bio::SeqIO;

> my $seqio_obj = Bio::SeqIO->new(-file => "dna.fa",
>                                 -format => 'Fasta');
> my $output = $seqio_obj->subseq(1,20);

Try replacing that line by these two:

 my $seq=$seqio_obj->next_seq;
 my $output=$seq->subseq(1,20);

> print "$output\n";

 See "perldoc Bio::SeqIO" :-)


Also: Never forget to start your scripts with "use strict; use
warnings;" - a great way to avoid typos and stuff.


  Best regards,

    Adam

-- 
 "Här kommer rädslan, gamle vän                               Adam Sjøgren
  När alla fjärilar i magen vaknar upp                   asjo at koldfront.dk
  Viskar välkommen hem"




More information about the Bioperl-l mailing list