in reply to Re^3: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
in thread Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl

thanks! but after fixing that I get this: Undefined subroutine &main::write_sequence called at .... line 20.
  • Comment on Re^4: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
  • Download Code

Replies are listed 'Best First'.
Re^5: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
by 1nickt (Canon) on Mar 21, 2016 at 05:33 UTC

    Do you have a sub called write_sequence in your main package? No. So you can't call it!

    Perhaps your object has a method of that name?

    Edit: Find where you copy-pasted write_sequence from and refer to the docs for that module. You'll need to use the module in your program. I leave it to you to figure out which module it is. Hint: it's not ... LOL, just saw you figured it out. Nice!


    The way forward always starts with a minimal test.
      All it needed was to add use Bio:perl; and now works!

      thanks!!

Re^5: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
by kevbot (Vicar) on Mar 21, 2016 at 05:39 UTC
    You have not written a subroutine for write_sequence and the Bio::DB::Genbank module does not provide this method. It's likely that you want to add this to your code:
    use Bio::Perl;
    as the Bio::Perl module does provide a write_sequence method. I recommend that you carefully read the documentation for Bio::DB::Genbank and Bio::Perl.
Re^5: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
by AnomalousMonk (Archbishop) on Mar 21, 2016 at 05:36 UTC

    I haven't read the Bio::DB::GenBank documentation (please feel free to do so ;-), but I suspect that write_sequence is a method of that class and so maybe needs to be called something like
        $gb->write_sequence( ">>roar.fa", 'fasta', $seq );


    Give a man a fish:  <%-{-{-{-<