[BioSQL-l] Load seqfeature from biosql database with perl
Michael Cipriano
mjcipriano at lbl.gov
Fri Feb 24 01:29:21 UTC 2006
Ah, I think I figured it out.
my $seqfeature_id = '401138';
my $adaptor = $seqdb_obj->get_object_adaptor("Bio::SeqFeatureI");
my $query = Bio::DB::Query::BioQuery->new(
-datacollections=>["Bio::SeqFeatureI t1"],
-where => ["t1.Bio::SeqFeatureI
= ?"]);
my $qres = $adaptor->find_by_query($query, -name=>'FIND FEATURE BY
SEQ',
-values=>[$seqfeature_id]);
while(my $loc = $qres->next_object())
{
my $obj = $loc;
print $obj->primary_key() . "\n";
print 'location:' . $obj->location->to_FTstring() . "\n";
$obj->add_tag_value("test", "moretest");
foreach my $tag ($obj->get_all_tags())
{
print " Values for tag $tag: ";
print join(' ',$obj->get_tag_values($tag));
print "\n";
}
print "------------------\n";
}
This seems to work
On Wed, 2006-02-22 at 16:58 -0800, Michael Cipriano wrote:
> Hello BioSQLers,
>
> I have a simple question (I hope), Can I easily load a seqfeature from a
> biosql database into a perl Bio::SeqFeatureI object? I have the
> database value for the seqfeature.seqfeature_id and would like to load
> it using this alone.
>
> I do not want to have to load the whole bioentry object then search for
> the feature, I just want the feature object since the bioentry is a
> whole genome and loading that will take more time then necessary.
>
> I have searched the documentation and have even tried looking through
> the code for the modules, but could not find an easy fast method.
>
> Please reply directly to me as well as the list as I am not a list
> member.
>
> Thanks for your help,
>
>
> Michael Cipriano
>
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biosql-l
More information about the BioSQL-l
mailing list