Using Bio::SeqIO to write with fasta format
0
0
Entering edit mode
6.8 years ago
mahmood.nt • 0

I want to write some outputs to a file. I can use the standard perl functions but it seems that Bio::SeqIO also does such thing. However, there are some problems with that.

my $chromosome_output= Bio::SeqIO->new(
    -file => ">myfile.fasta",
    -format => 'Fasta'
);
my $gene_adaptor = $registry->get_adaptor('human', 'core', 'Gene');
my @genes = @{ $gene_adaptor->fetch_all_by_external_name("BRCA2") };
my $gene  = @genes[0];
$chromosome_output->write_seq($gene->seq());

But I get

------------- EXCEPTION -------------
MSG: Did not provide a valid Bio::PrimarySeqI object
STACK Bio::SeqIO::fasta::write_seq /opt/perl/lib/site_perl/5.14.2/Bio/SeqIO/fasta.pm:217
STACK toplevel test.pl:31
-------------------------------------

Any idea?

bioperl fasta • 1.4k views
ADD COMMENT

Login before adding your answer.

Traffic: 2517 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6