Entering edit mode
6.7 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?