[Bioperl-guts-l] [14820] bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm: added get_feature_by_primary_id() method
Lincoln Stein
lstein at dev.open-bio.org
Fri Aug 22 09:32:01 EDT 2008
Revision: 14820
Author: lstein
Date: 2008-08-22 09:31:59 -0400 (Fri, 22 Aug 2008)
Log Message:
-----------
added get_feature_by_primary_id() method
Modified Paths:
--------------
bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm
Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm 2008-08-21 21:04:51 UTC (rev 14819)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store.pm 2008-08-22 13:31:59 UTC (rev 14820)
@@ -51,6 +51,9 @@
# ...by attribute
@features = $db->get_features_by_attribute({description => 'protein kinase'})
+ # ...by primary id
+ @features = $db->get_feature_by_primary_id(42); # note no plural!!!
+
# ...by the GFF "Note" field
@result_list = $db->search_notes('kinase');
@@ -622,6 +625,25 @@
}
}
+=head2 get_feature_by_primary_id
+
+ Title : get_feature_by_primary_id
+ Usage : $feature = $db->get_feature_by_primary_id($primary_id)
+ Function: fetch a feature from the database using its primary ID
+ Returns : a feature
+ Args : primary ID of desired feature
+ Status : public
+
+This method returns a previously-stored feature from the database
+using its primary ID. If the primary ID is invalid, it returns
+undef. This method is identical to fetch().
+
+=cut
+
+sub get_feature_by_primary_id {
+ shift->fetch(@_);
+}
+
=head2 fetch_many
Title : fetch_many
More information about the Bioperl-guts-l
mailing list