.\" 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::SeqFeature::Store::Alias 3pm" .TH Bio::DB::SeqFeature::Store::Alias 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::SeqFeature::Store::Alias \-\- override feature type, method, source and attribute fields .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # override feature type, method, source and attribute fields \& # with the contents of a simple text index file \& \& use Bio::DB::SeqFeature::Store::Alias; \& use Bio::DB::SeqFeature::Store; \& my $db = Bio::DB::SeqFeature::Store\->new(\-adaptor=>\*(AqDBI::mysql\*(Aq, \& \-dsn =>\*(Aqtestdb\*(Aq); \& my $meta = Bio::DB::SeqFeature::Store::Alias\->new(\-store => $db, \& \-index => \*(Aq/usr/local/testdb/meta.index\*(Aq, \& \-default_type => \*(Aqexample_feature\*(Aq, \& ); \& my @features = $meta\->get_seq_stream(\-seq_id => \*(AqI\*(Aq, \& \-attributes => {foo => \*(Aqbar\*(Aq}); .Ve .PP meta.index has the following structure .PP .Vb 9 \& [feature_name_1] \& :dbid = f101 \& :selected = 1 \& display_name = My First Feature \& type = some_type1 \& method = my_method1 \& source = my_source1 \& some_attribute = value1 \& another_attribute = value2 \& \& [feature_name_2] \& :dbid = f102 \& :selected = 1 \& display_name = My Second Feature \& type = some_type2 \& method = my_method2 \& source = my_source2 \& some_attribute = value3 \& another_attribute = value4 \& \& [feature_name_3] \& :dbid = f103 \& type = some_type2 \& method = my_method2 \& source = my_source2 \& some_attribute = value5 \& another_attribute = value6 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module can be used as a wrapper around any BioPerl database that supports the \fIget_feature_by_name()\fR method. It allows you to dynamically override the type, source, method and display name of each feature, as well as to assign new metadata attributes to each one. .PP It is used by GBrowse to create subtracks for tracks that have a small number of named features, primarily wiggle tracks. .SS "Metadata Format" .IX Subsection "Metadata Format" The wrapper is associated with a text file that contains metadata about each feature. You can use any name for the text file, but it must follow this format: .PP .Vb 8 \& [feature_name_1] \& :dbid = f101 \& :selected = 1 \& type = some_type1 \& method = my_method1 \& source = my_source1 \& some_attribute = value1 \& another_attribute = value2 \& \& [feature_name_2] \& :dbid = f102 \& :selected = 1 \& type = some_type2 \& method = my_method2 \& source = my_source2 \& some_attribute = value3 \& another_attribute = value4 \& \& [feature_name_3] \& :dbid = f103 \& type = some_type2 \& method = my_method2 \& source = my_source2 \& some_attribute = value5 \& another_attribute = value6 .Ve .PP Each [stanza] begins with the name of a feature as it is represented in the underlying database. A call to the database's \&\fIget_feature_by_name()\fR method with the [stanza] heading contents (e.g. \*(L"feature_name_2\*(R") and a genomic position should return one and only one feature. .PP Below each [stanza] heading are a series of tag=value pairs. The following tag names have special meaning: .PP .Vb 10 \& :dbid Unique identifier for the feature, used by GBrowse to process \& clicks on the feature. \& :selected If true, this subtrack is selected by default when the \& containing track is turned on. \& display_name Display name for the feature. If not present, will \& default to the feature\*(Aqs native display name \& (i.e. the one in the [stanza]). \& type What is returned by calling the feature\*(Aqs type() \& method. \& method What is returned by calling the feature\*(Aqs method() \& method. \& source What is returned by calling the feature\*(Aqs source() \& method. \& score What is returned by calling the feature\*(Aqs score() method. .Ve .PP Any other tags become sortable attributes which are displayed by the GBrowse subtrack selection dialog box. For this to work properly, each tag must be present in each stanza. Tags that are present in some stanzas and not others are ignored. .SH "METHODS" .IX Header "METHODS" .ie n .SS "$aliasdb = Bio::DB::SeqFeature::Store::Alias\->new(\-metadata=>$path,\-store=>$db,\-type=>$type)" .el .SS "\f(CW$aliasdb\fP = Bio::DB::SeqFeature::Store::Alias\->new(\-metadata=>$path,\-store=>$db,\-type=>$type)" .IX Subsection "$aliasdb = Bio::DB::SeqFeature::Store::Alias->new(-metadata=>$path,-store=>$db,-type=>$type)" \&\fInew()\fR creates the Alias database. The arguments are: .PP .Vb 5 \& \-metadata Full path to the metadata file. \& \-store Previously opened handle to the feature database \& (e.g. Bio::SeqFeature::Store, Bio::DB::GFF, \& Bio::DB::Chado) \& \-type Default type to use for features in this database. .Ve .ie n .SS "$type = $aliasdb\->default_type([$type])" .el .SS "\f(CW$type\fP = \f(CW$aliasdb\fP\->default_type([$type])" .IX Subsection "$type = $aliasdb->default_type([$type])" Gets or sets the default type. .ie n .SS "$store = $aliasdb\->store" .el .SS "\f(CW$store\fP = \f(CW$aliasdb\fP\->store" .IX Subsection "$store = $aliasdb->store" Gets the underlying feature database specified during \fInew()\fR (immutable). .ie n .SS "$index = $aliasdb\->index" .el .SS "\f(CW$index\fP = \f(CW$aliasdb\fP\->index" .IX Subsection "$index = $aliasdb->index" Returns the path to the metadata description file. .ie n .SS "$meta = $aliasdb\->metadata" .el .SS "\f(CW$meta\fP = \f(CW$aliasdb\fP\->metadata" .IX Subsection "$meta = $aliasdb->metadata" Return a hashref in which the keys are the feature IDs (or an arbitrary numeric value if :dbid was not specified), and the values are a hashref of attribute/value pairs. .ie n .SS "$f = $aliasdb\->get_feature($name)" .el .SS "\f(CW$f\fP = \f(CW$aliasdb\fP\->get_feature($name)" .IX Subsection "$f = $aliasdb->get_feature($name)" Calls the underlying database's \fIget_feature_by_name()\fR method and returns a list of response. .ie n .SS "@f = $aliasdb\->features(@args)" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->features(@args)" .IX Subsection "@f = $aliasdb->features(@args)" Same as calling the underlying database's \fIfeatures()\fR method, except that the values you specified in the metadata file for display_name, type, method, source, score and other attributes will override the original values. .ie n .SS "$segment = $aliasdb\->segment(@args)" .el .SS "\f(CW$segment\fP = \f(CW$aliasdb\fP\->segment(@args)" .IX Subsection "$segment = $aliasdb->segment(@args)" Creates a segment object (see Bio::DB::SeqFeature::Store\->\fIsegment()\fR), which records a genomic range for use in further query refinement: .PP .Vb 2 \& $chr1 = $aliasdb\->segment(\-seqid=>\*(Aqchr1\*(Aq); \& @f = $chr1\->features; .Ve .ie n .SS "$iterator = $aliasdb\->get_seq_stream(@args)" .el .SS "\f(CW$iterator\fP = \f(CW$aliasdb\fP\->get_seq_stream(@args)" .IX Subsection "$iterator = $aliasdb->get_seq_stream(@args)" This method is similar to the underlying database's \fIget_seq_stream()\fR method, except that it wraps each feature. Example: .PP .Vb 4 \& $iterator = $aliasdb\->get_seq_stream(\-type=>\*(Aqsome_type2\*(Aq); \& while (my $seq = $iterator\->next_seq) { \& # do something with the seq object. \& } .Ve .ie n .SS "@f = $aliasdb\->get_features_by_location(@args)" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->get_features_by_location(@args)" .IX Subsection "@f = $aliasdb->get_features_by_location(@args)" This method is similar to the underlying database's \fIget_features_by_location()\fR method. .PP .Vb 4 \& $iterator = $aliasdb\->get_seq_stream(\-type=>\*(Aqsome_type2\*(Aq); \& while (my $seq = $iterator\->next_seq) { \& # do something with the seq object. \& } .Ve .ie n .SS "@f = $aliasdb\->get_features_by_name(@args)" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->get_features_by_name(@args)" .IX Subsection "@f = $aliasdb->get_features_by_name(@args)" This method is similar to the underlying database's \fIget_features_by_location()\fR method. .ie n .SS "@f = $aliasdb\->get_features_by_name(@args)" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->get_features_by_name(@args)" .IX Subsection "@f = $aliasdb->get_features_by_name(@args)" This method is similar to the underlying database's \fIget_features_by_location()\fR method. .ie n .SS "@f = $aliasdb\->get_features_by_alias(@args);" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->get_features_by_alias(@args);" .IX Subsection "@f = $aliasdb->get_features_by_alias(@args);" This method is similar to the underlying database's \fIget_features_by_alias()\fR method. .ie n .SS "@f = $aliasdb\->get_features_by_attribute(@args);" .el .SS "\f(CW@f\fP = \f(CW$aliasdb\fP\->get_features_by_attribute(@args);" .IX Subsection "@f = $aliasdb->get_features_by_attribute(@args);" This method is similar to the underlying database's \fIget_features_by_attribute()\fR method. .SH "BUGS" .IX Header "BUGS" Please report them. .SH "SEE ALSO" .IX Header "SEE ALSO" Bio::SeqFeature::Store, Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, Bio::Graphics::Browser2 .SH "AUTHOR" .IX Header "AUTHOR" Copyright (c) 2012 Ontario Institute for Cancer Research .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \s-1DISCLAIMER\s0.txt for disclaimers of warranty.