[Bioperl-l] How do you pull features out of a genbank file
Richard Adams
Richard.Adams at ed.ac.uk
Fri Sep 12 05:15:10 EDT 2003
Wes,
This should work:
my $seq = $seq_in->next_seq();
## now get an array of all seq features
my @fts = $seq->all_SeqFeatures;
#and array of alleles
my @allele = grep {$_->primary_tag eq 'variation'} @fts;
for my $var (@allele) {
print "residue ", $var->start, " has alternative nucleotide ",
($var->each_tag_value('replace'))[0], "\n";
}
There is a good explanation of these methods in Bio::SeqFeatureI and
Bio::SeqFeature::Generic documentation
Richard
--
Dr Richard Adams
Bioinformatician,
Psychiatric Genetics Group,
Medical Genetics,
Molecular Medicine Centre,
Western General Hospital,
Crewe Rd West,
Edinburgh UK
EH4 2XU
Tel: 44 131 651 1084
richard.adams at ed.ac.uk
More information about the Bioperl-l
mailing list