[Bioperl-l] write protein sequence by Bio::SeqIO
suhoiy
suhoiy@21cn.com
Fri, 8 Nov 2002 12:10:36 GMT
Hello all,
I am sorry to bother you. There is a problem in my code. I want to write a protein
sequence in genbank format, but the code change it to nucleic acid sequence. For
example:
========
my $in = Bio::SeqIO->new( '-format' => 'genbank',
'-file' => 'sample.genpept',
);
my $out = Bio::SeqIO->new('-format' => 'genbank',
'-file' => '>sampleout.genpept',
);
my $seq = $in->next_seq;
$out->write_seq($seq);
========
the locus line of origin sequence is:
LOCUS 108_LYCES 102 aa linear PLN 15-JUL-1999
while the locus line of the output sequence is:
LOCUS 108_LYCES 102 bp linear linear PLN 15-JUL-1999
I use bioperl 1.0.2. there are these lines in the write_seq method in Bio::SeqIO::genbank:
========
if( !$seq->can('molecule') || ! defined ($mol = $seq->molecule()) ) {
$mol = $seq->alphabet || 'DNA';
}
========
many thanks for your help!
suhoiy