Bio::D...::Alias(3pm)
π NAME π
Bio::DB::SeqFeature::Store::Alias β bestie, this is the module that overrides your feature type, method, source and attribute fields. It's giving glow-up, but for your features. No cap. π
β¨ SYNOPSIS β¨
So like, you wanna override feature type, method, source and attribute fields with the contents of a simple text index file? Say less, queen:
# 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=>'DBI::mysql',
-dsn =>'testdb');
my $meta = Bio::DB::SeqFeature::Store::Alias->new(-store => $db,
-index => '/usr/local/testdb/meta.index',
-default_type => 'example_feature',
);
my @features = $meta->get_seq_stream(-seq_id => 'I',
-attributes => {foo => 'bar'});
and meta.index has the following structure π
[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
π¦ DESCRIPTION π¦
This module can be used as a wrapper around any BioPerl database that supports the get_feature_by_name() method. It lets you dynamically override the type, source, method and display name of each feature, plus assign brand-new metadata attributes to each one. Obsessed, honestly.
It is used by GBrowse to create subtracks for tracks that have a small number of named features, primarily wiggle tracks. π
π 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:
[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
Each [stanza] begins with the name of a feature as it is represented in the underlying database. A call to the database's get_feature_by_name() method with the [stanza] heading contents (e.g. "feature_name_2") and a genomic position should return one and only one feature. One. Not two. Not zero. The vibes have to be exact. β¨
Below each [stanza] heading are a series of tag=value pairs. The following tag names have special meaning:
:dbidβ the 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 it's not present, it defaults to the feature's native display name (i.e. the one in the[stanza]).typeβ what is returned by calling the feature'stype()method.methodβ what is returned by calling the feature'smethod()method.sourceβ what is returned by calling the feature'ssource()method.scoreβ what is returned by calling the feature'sscore()method.
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. π
π₯ METHODS π₯
$aliasdb = Bio::DB::SeqFeature::Store::Alias->new(-metadata=>$path,-store=>$db,-type=>$type)
new() creates the Alias database. The arguments are:
-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.
$type = $aliasdb->default_type([$type])
Gets or sets the default type. That's it, that's the method. π
$store = $aliasdb->store
Gets the underlying feature database specified during new() (immutable). Not editable, bestie β it is what it is.
$index = $aliasdb->index
Returns the path to the metadata description file.
$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.
$f = $aliasdb->get_feature($name)
Calls the underlying database's get_feature_by_name() method and returns a list of response.
@f = $aliasdb->features(@args)
Same as calling the underlying database's features() 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. Yes, it's a whole makeover. π
$segment = $aliasdb->segment(@args)
Creates a segment object (see Bio::DB::SeqFeature::Store->segment()), which records a genomic range for use in further query refinement:
$chr1 = $aliasdb->segment(-seqid=>'chr1');
@f = $chr1->features;
$iterator = $aliasdb->get_seq_stream(@args)
This method is similar to the underlying database's get_seq_stream() method, except that it wraps each feature. Example:
$iterator = $aliasdb->get_seq_stream(-type=>'some_type2');
while (my $seq = $iterator->next_seq) {
# do something with the seq object.
}
@f = $aliasdb->get_features_by_location(@args)
This method is similar to the underlying database's get_features_by_location() method.
$iterator = $aliasdb->get_seq_stream(-type=>'some_type2');
while (my $seq = $iterator->next_seq) {
# do something with the seq object.
}
@f = $aliasdb->get_features_by_name(@args)
This method is similar to the underlying database's get_features_by_location() method.
@f = $aliasdb->get_features_by_name(@args)
This method is similar to the underlying database's get_features_by_location() method. (Yep, it's listed twice in the original β we keep it twice. We don't erase history here. π«Ά)
@f = $aliasdb->get_features_by_alias(@args);
This method is similar to the underlying database's get_features_by_alias() method.
@f = $aliasdb->get_features_by_attribute(@args);
This method is similar to the underlying database's get_features_by_attribute() method.
π BUGS π
Please report them. Fr fr, don't just suffer in silence.
π SEE ALSO π
Bio::SeqFeature::StoreBio::DB::GFFBio::SeqIBio::SeqFeatureIBio::DasBio::Graphics::Browser2
π AUTHOR π
Copyright (c) 2012 Ontario Institute for Cancer Research
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.
Okay that's the whole thing bestie, you ate it. π This was theBio::D...::Alias(3pm)manual page, brought to you byperl v5.40.0, dated2024-10-20. Slay. πβ¨
π¦ where this page comes from
- ubuntu questing: gbrowse 2.56+dfsg-12build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms