[Bioperl-l] Parsing "PCR_primers" tag from GenBank file
Horacio Montenegro
h.montenegro at gmail.com
Sat Jun 13 23:34:18 UTC 2015
hi,
I am trying to parse a GenBank file to extract primers and other
info, outputting it separated with tabs. However, some records have
two "PCR_primers" tags, and they are not being separated. The
"satellite" tag also is doubled, but each one is being correctly
separated with tabs. How can I manage to output each primer pair
separated?
thanks, Horacio
One example of a record with two "PCR_primers" tags is Accession
GQ344853, GI 282937571. Bellow is the code snippet to reproduce the
behaviour:
#!/usr/bin/env perl
use Bio::DB::EUtilities;
use Bio::SeqIO;
my $seqio_object = Bio::SeqIO->new(-file => 'GQ344853.gb' );
while (my $seq = $seqio_object->next_seq) {
print $seq->primary_id, "\t", $seq->length, "\t";
for my $feat_object ($seq->get_SeqFeatures) {
print $feat_object->get_tag_values("satellite"), "\t" if
($feat_object->has_tag("satellite"));
print $feat_object->get_tag_values("PCR_primers"), "\t" if
($feat_object->has_tag('PCR_primers'));
}
print "\n";
}
More information about the Bioperl-l
mailing list