.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::DB::Tagger 3pm" .TH Bio::DB::Tagger 3pm "2018-10-03" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::DB::Tagger \-\- Simple object tagging system .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Bio::DB::Tagger; \& my $tagger = Bio::DB::Tagger\->new(\-dsn => \*(Aqdbi:mysql:tagdb\*(Aq, \& \-create => 1); \& \& $tagger\->add_tags(\-object => $object_name, \& \-tags => \e@tags); \& \& $tagger\->set_tags(\-object => $object_name, \& \-key => $object_key, \& \-tags => \e@tags); \& \& $tagger\->add_tag(\-object => $object_name, \& \-tag => \*(Aqvenue\*(Aq, \& \-value => \*(Aqmermaid parade\*(Aq, \& \-author => \*(Aqlincoln.stein@gmail.com\*(Aq); \& \& $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]\en"; # Tag stringify interface \& print "tag value = ",$tags[0]\->value,"\en"; # object interface \& print "tag author= ",$tags[0]\->author,"\en"; # 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(\*(Aqprefix\*(Aq); \& while (my $tag = $iterator\->next_tag) { } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a simple object tagger interface that provides relational support for tagging objects (identified by string IDs) with arbitrary string tags. .SS "\s-1METHODS\s0" .IX Subsection "METHODS" .ie n .IP "$tagger = Bio::DB::Tagger\->new(@args)" 4 .el .IP "\f(CW$tagger\fR = Bio::DB::Tagger\->new(@args)" 4 .IX Item "$tagger = Bio::DB::Tagger->new(@args)" Constructor for the tagger class. Arguments are: .Sp .Vb 2 \& \-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. .Ve .Sp The dsn can be a preopened database handle or a dbi: data source string. .ie n .IP "@objects = $tagger\->search_tag($tag [,$value])" 4 .el .IP "\f(CW@objects\fR = \f(CW$tagger\fR\->search_tag($tag [,$value])" 4 .IX Item "@objects = $tagger->search_tag($tag [,$value])" .PD 0 .ie n .IP "$object_arrayref = $tagger\->search_tag($tag [,$value])" 4 .el .IP "\f(CW$object_arrayref\fR = \f(CW$tagger\fR\->search_tag($tag [,$value])" 4 .IX Item "$object_arrayref = $tagger->search_tag($tag [,$value])" .PD Return all object names and keys that are tagged with \*(L"$tag\*(R", optionally qualified by tag value \f(CW$value\fR. .ie n .IP "$boolean = $tagger\->has_tag($object,$tag [,$value])" 4 .el .IP "\f(CW$boolean\fR = \f(CW$tagger\fR\->has_tag($object,$tag [,$value])" 4 .IX Item "$boolean = $tagger->has_tag($object,$tag [,$value])" Returns true if indicated object has the indicated tag, or the indicated combination of tag and value. .ie n .IP "@tags = $tagger\->get_tag($object,$tag)" 4 .el .IP "\f(CW@tags\fR = \f(CW$tagger\fR\->get_tag($object,$tag)" 4 .IX Item "@tags = $tagger->get_tag($object,$tag)" Returns all the tags of type \f(CW$tag\fR. .ie n .IP "$tags = $tagger\->\fItags()\fR" 4 .el .IP "\f(CW$tags\fR = \f(CW$tagger\fR\->\fItags()\fR" 4 .IX Item "$tags = $tagger->tags()" .PD 0 .ie n .IP "@tags = $tagger\->\fItags()\fR" 4 .el .IP "\f(CW@tags\fR = \f(CW$tagger\fR\->\fItags()\fR" 4 .IX Item "@tags = $tagger->tags()" .PD Return a list of all tags in the database. In a list context, returns the list of tags. In an array context, returns an array ref. .ie n .IP "$iterator = $tagger\->tag_match('prefix')" 4 .el .IP "\f(CW$iterator\fR = \f(CW$tagger\fR\->tag_match('prefix')" 4 .IX Item "$iterator = $tagger->tag_match('prefix')" Returns an iterator that matches all tags beginning with 'prefix' (case insensitive). Call \f(CW$iterator\fR\->\fInext_tag()\fR to get the next match. .ie n .IP "$iterator = $tagger\->tag_match('prefix')" 4 .el .IP "\f(CW$iterator\fR = \f(CW$tagger\fR\->tag_match('prefix')" 4 .IX Item "$iterator = $tagger->tag_match('prefix')" Returns an iterator that matches all tags beginning with 'prefix' (case insensitive). Call \f(CW$iterator\fR\->\fInext_tag()\fR to get the next match. .ie n .IP "$tags = $tagger\->\fItag_counts()\fR" 4 .el .IP "\f(CW$tags\fR = \f(CW$tagger\fR\->\fItag_counts()\fR" 4 .IX Item "$tags = $tagger->tag_counts()" .PD 0 .ie n .IP "@tags = $tagger\->\fItag_counts()\fR" 4 .el .IP "\f(CW@tags\fR = \f(CW$tagger\fR\->\fItag_counts()\fR" 4 .IX Item "@tags = $tagger->tag_counts()" .PD Return a set of Bio::DB::Tagger::Tag objects representing all known tags. The tag values correspond to the number of times that tag has been used to tag objects. .ie n .IP "$result = $tagger\->add_tag(@args);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->add_tag(@args);" 4 .IX Item "$result = $tagger->add_tag(@args);" Add a tag to the database. The following forms are accepted: .Sp .Vb 1 \& $tagger\->add_tag($object_name=>$tag); .Ve .Sp Add a Bio::DB::Tagger::Tag to the object named \*(L"$object_name\*(R". .Sp .Vb 2 \& $tagger\->add_tag(\-object => $object_name, \& \-tag => $tag); .Ve .Sp The same as above using \-option syntax. .Sp .Vb 4 \& $tagger\->add_tag(\-object => $object_name, \& \-tag => $tagname, \& \-value => $tagvalue, \& \-author => $authorname); .Ve .Sp Generate the tag from the options provided in \fB\-tag\fR, \fB\-value\fR (optional) and \fB\-author\fR (optional), and then add the tag to the object. .Sp Returns true on success. .ie n .IP "$result = $tagger\->set_tags(@args);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->set_tags(@args);" 4 .IX Item "$result = $tagger->set_tags(@args);" Set the tags of an object, replacing all previous tags. .Sp Arguments: \fB\-object\fR Name of the object to tag. \fB\-tags\fR List of Bio::DB::Tagger::Tag objects .Sp Returns true on success. .ie n .IP "$result = $tagger\->set_tag(@args);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->set_tag(@args);" 4 .IX Item "$result = $tagger->set_tag(@args);" Set a tag, replacing all previous tags of the same name. .Sp Arguments: \fB\-object\fR Name of the object to tag. \fB\-tag\fR A Bio::DB::Tagger::Tag object, or tag name .Sp Returns true on success. .ie n .IP "$result = $tagger\->clear_tags($objectname);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->clear_tags($objectname);" 4 .IX Item "$result = $tagger->clear_tags($objectname);" Clear all tags from the indicated object. Returns true if the operation was successful. .ie n .IP "$result = $tagger\->delete_tag($objectname,$tagname [,$tagvalue]);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->delete_tag($objectname,$tagname [,$tagvalue]);" 4 .IX Item "$result = $tagger->delete_tag($objectname,$tagname [,$tagvalue]);" Clear the one tag from the indicated object, filtering by tagname, optionally by value. .ie n .IP "$result = $tagger\->nuke_object($objectname);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->nuke_object($objectname);" 4 .IX Item "$result = $tagger->nuke_object($objectname);" Removes the object named \f(CW$objectname\fR. Returns true if the operation was successful. .ie n .IP "$result = $tagger\->nuke_author($authorname);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->nuke_author($authorname);" 4 .IX Item "$result = $tagger->nuke_author($authorname);" Removes the author named \f(CW$authorname\fR. Returns true if the operation was successful. .ie n .IP "$result = $tagger\->nuke_tag($tagname);" 4 .el .IP "\f(CW$result\fR = \f(CW$tagger\fR\->nuke_tag($tagname);" 4 .IX Item "$result = $tagger->nuke_tag($tagname);" Removes the tag named \f(CW$tagname\fR. Returns true if the operation was successful. .ie n .IP "@tags = $tagger\->get_tags($object_name [,$author])" 4 .el .IP "\f(CW@tags\fR = \f(CW$tagger\fR\->get_tags($object_name [,$author])" 4 .IX Item "@tags = $tagger->get_tags($object_name [,$author])" Return all tags assigned to the indicated object, optionally filtering by the author. .ie n .IP "$oid = $tagger\->object_to_id($objectname [,$create] [,$key])" 4 .el .IP "\f(CW$oid\fR = \f(CW$tagger\fR\->object_to_id($objectname [,$create] [,$key])" 4 .IX Item "$oid = $tagger->object_to_id($objectname [,$create] [,$key])" Fetch the object id (oid) of the object named \*(L"$objectname\*(R". If the object doesn't exist, and \f(CW$create\fR is true, will create a new entry for the object in the database. .ie n .IP "$tid = $tagger\->tag_to_id($tagname [,$create])" 4 .el .IP "\f(CW$tid\fR = \f(CW$tagger\fR\->tag_to_id($tagname [,$create])" 4 .IX Item "$tid = $tagger->tag_to_id($tagname [,$create])" Fetch the tag id (tid) of the object named \*(L"$tagname\*(R". If the tag doesn't exist, and \f(CW$create\fR is true, will create a new entry for the tag in the database. .ie n .IP "$aid = $tagger\->author_to_id($authorname [,$create])" 4 .el .IP "\f(CW$aid\fR = \f(CW$tagger\fR\->author_to_id($authorname [,$create])" 4 .IX Item "$aid = $tagger->author_to_id($authorname [,$create])" Fetch the author id (aid) of the object named \*(L"$authorname\*(R". If the tag doesn't exist, and \f(CW$create\fR is true, will create a new entry for the author in the database. .ie n .IP "$dbh = $tagger\->dbh" 4 .el .IP "\f(CW$dbh\fR = \f(CW$tagger\fR\->dbh" 4 .IX Item "$dbh = $tagger->dbh" Return underlying \s-1DBI\s0 handle. .ie n .IP "$tagger\->initialize" 4 .el .IP "\f(CW$tagger\fR\->initialize" 4 .IX Item "$tagger->initialize" Initialize the database with a fresh schema. .SH "SEE ALSO" .IX Header "SEE ALSO" Bio::Graphics::Browser, Bio::DB::SeqFeature::Store .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein . .PP Copyright (c) 2009 Ontario Institute for Cancer Research .PP This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the \s-1GPL\s0 (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to \s-1LICENSE\s0 for the full license text. In addition, please see \s-1DISCLAIMER\s0.txt for disclaimers of warranty.