[Bioperl-l] Problems with my first Bioperl Script

Marc Logghe Marc.Logghe at devgen.com
Wed Feb 26 20:08:28 EST 2003


You need Bio::SeqIO for that, at least I suppose you are dealing with a
fasta formatted sequence. THis makes your script like:
#!/usr/bin/perl

use Bio::SeqIO;

my $in = new Bio::SeqIO ( -format => 'fasta',
                                   -file   => 't.fasta');
my $out = new Bio::SeqIO;
$i=1;

while ($seq = $io->next_seq)
{
  print "$i\n";
  $out->write_seq($seq->trunc(42, 420));
  $i++;
}
HTH,
Marc

> -----Original Message-----
> From: Brian Carlson [mailto:bcarlson at genetics.emory.edu]
> Sent: woensdag 26 februari 2003 19:00
> To: bioperl mail list
> Subject: [Bioperl-l] Problems with my first Bioperl Script
> 
> 
> Here's my script
> 
> 
> #!/usr/bin/perl
> 
> use Bio::SearchIO;
> 
> my $searchio = new Bio::SearchIO ( -format => 'fasta',
>                                    -file   => 't.fasta');
> $i=1;
> 
> while ($result = $searchio->next_result)
> {
>   print "$i\n";
>   $i++;
> }
> 
> 
> When I run this, I get:  unreognized FASTA Family report file
> 
> What could cause this?
> 
> FYI:
> I'm trying to get fimilar with BioPerl.  What I'm moving towards
> is the ability to enter a base-pair range, and get the sequence
> from the fasta.  Simple stuff hopefully.
> 
> Thanks,
> Brian
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 


More information about the Bioperl-l mailing list