| Bio::DB::Tagger(3pm) | User Contributed Perl Documentation | Bio::DB::Tagger(3pm) |
Bio::DB::Tagger -- Simple object tagging system
use Bio::DB::Tagger;
my $tagger = Bio::DB::Tagger->new(-dsn => 'dbi:mysql:tagdb',
-create => 1);
$tagger->add_tags(-object => $object_name,
-tags => \@tags);
$tagger->set_tags(-object => $object_name,
-key => $object_key,
-tags => \@tags);
$tagger->add_tag(-object => $object_name,
-tag => 'venue',
-value => 'mermaid parade',
-author => 'lincoln.stein@gmail.com');
$tagger->add_tag(-object => $object_name,
-tag => $tag);
$tagger->add_tag($object_name => $tag);
$tagger->clear_tags($object_name); # delete all tags attached to object
$tagger->delete_tag($object_name,$tag_name [,$value]); # delete one tag attached to object
$tagger->nuke_tag($tag_name); # delete this tag completely
$tagger->nuke_object($object_name);
$tagger->nuke_author($author_name);
my @tags = $tagger->get_tags($object_name [,$author]);
print "first tag = $tags[0]\n"; # Tag stringify interface
print "tag value = ",$tags[0]->value,"\n"; # object interface
print "tag author= ",$tags[0]->author,"\n"; # object interface
my $hasit = $tagger->has_tag($object_name,$tag);
my @objects = $tagger->search_tag($tag);
my @tags = $tagger->tags;
my $iterator = $tagger->tag_match('prefix');
while (my $tag = $iterator->next_tag) { }
This is a simple object tagger interface that provides relational support for tagging objects (identified by string IDs) with arbitrary string tags.
-dsn <dsn> A DBI data source, possibly including host and
password information
-create <0|1> If true, then database will be initialized with a
new schema. Database must already exist.
The dsn can be a preopened database handle or a dbi: data source string.
$tagger->add_tag($object_name=>$tag);
Add a Bio::DB::Tagger::Tag to the object named "$object_name".
$tagger->add_tag(-object => $object_name,
-tag => $tag);
The same as above using -option syntax.
$tagger->add_tag(-object => $object_name,
-tag => $tagname,
-value => $tagvalue,
-author => $authorname);
Generate the tag from the options provided in -tag, -value (optional) and -author (optional), and then add the tag to the object.
Returns true on success.
Arguments: -object Name of the object to tag.
-tags List of Bio::DB::Tagger::Tag objects
Returns true on success.
Arguments: -object Name of the object to tag.
-tag A Bio::DB::Tagger::Tag object, or tag name
Returns true on success.
Bio::Graphics::Browser, Bio::DB::SeqFeature::Store
Lincoln Stein <lincoln.stein@gmail.com>.
Copyright (c) 2009 Ontario Institute for Cancer Research
This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.
| 2024-03-31 | perl v5.38.2 |