Bio::D...gmentI(3pm)
π Bio::Das::SegmentI β DAS-style access to a feature database π
hey bestie π«Ά so you found yourself in the Bio::Das::SegmentI manual (that's the User Contributed Perl Documentation section, in case you were wondering which little corner of the man pages you wandered into). Buckle up, because this one is a whole vibe β it's the interface that gives you DAS-style access to a feature database, and we're gonna go through it together, no skips, no skimming. β¨
πΈ NAME πΈ
Bio::Das::SegmentI β DAS-style access to a feature database. that's it, that's the name π
β¨ SYNOPSIS β¨
okay so picture this: you already have a Bio::DasI database object, and you want a segment out of it. boom:
# Get a Bio::Das::SegmentI object from a Bio::DasI database...
$segment = $das->segment(-name=>'Landmark',
-start=>$start,
-end => $end);
@features = $segment->overlapping_features(-type=>['type1','type2']);
# each feature is a Bio::SeqFeatureI-compliant object
@features = $segment->contained_features(-type=>['type1','type2']);
@features = $segment->contained_in(-type=>['type1','type2']);
$stream = $segment->get_feature_stream(-type=>['type1','type2','type3'];
while (my $feature = $stream->next_seq) {
# do something with feature
}
$count = $segment->features_callback(-type=>['type1','type2','type3'],
-callback => sub { ... { }
);
yes, that synopsis is doing a lot of heavy lifting and also being a little chaotic π but it's giving "here's every way you can pull features out of a segment" and honestly? iconic. π
π DESCRIPTION π
Bio::Das::SegmentI is a simplified alternative interface to sequence annotation databases, the kind used by the distributed annotation system. In this scheme, the genome is represented as a series of landmarks. πΊοΈ
Every single Bio::Das::SegmentI object β we call it a "segment" for short, iykyk β corresponds to a genomic region defined by a landmark plus a start and end position relative to that landmark. And how do you get one of these little guys? You make it with the Bio::DasI segment() method. periodt. π
π« Filtering your features π«
Features can be filtered by the following attributes, and yes you have options bestie:
- their location relative to the segment β whether they're overlapping, contained within, or completely containing it π
- their type π·οΈ
- other attributes, using tag/value semantics π§
π¦ The three APIs (a vibe check) π¦
Access to the feature list uses three distinct APIs:
- fetching the entire list of features at a time π
- fetching an iterator across features π
- a callback π
three whole ways to get your features, pick your fighter π
π FEEDBACK π
π¬ Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated, fr fr. π«Ά
bioperl-l@bio.perl.org
π Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. real talk: there are so many experienced and reponsive experts who will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. π
π Reporting Bugs
Report bugs to the Bioperl bug tracking system, to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
do it, the maintainers will literally love you for it π
π AUTHOR - Lincoln Stein π
Email lstein@cshl.org
shoutout to Lincoln, absolute legend, main character energy β
okay that's part 1 bestie, there's more coming so don't go anywhere π
β¨ APPENDIX β¨
okay so the rest of this doc is literally every single object method, one by one π
internal methods usually get a lil underscore _ in front, that's the vibe check.
πΈ seq_id
- Title β
seq_id - Usage β
$ref = $s->seq_id - Function β return the ID of the landmark
- Returns β a string
- Args β none
- Status β Public
πΈ display_name
- Title β
seq_name - Usage β
$ref = $s->seq_name - Function β return the human-readable name for the landmark
- Returns β a string
- Args β none
- Status β Public
ngl, this one defaults to being the same as seq_id.
πΈ start
- Title β
start - Usage β
$s->start - Function β start of segment
- Returns β integer
- Args β none
- Status β Public
this is a read-only accessor for the start of the segment π«Ά and it's an alias to low() for Gadfly compatibility, periodt.
πΈ end
- Title β
end - Usage β
$s->end - Function β end of segment
- Returns β integer
- Args β none
- Status β Public
read-only accessor for the end of the segment π alias to high() for Gadfly compatibility, no cap.
πΈ length
- Title β
length - Usage β
$s->length - Function β length of segment
- Returns β integer
- Args β none
- Status β Public
returns the length of the segment. always a positive number β¨ the way it refuses to be negative? iconic.
πΈ seq
- Title β
seq - Usage β
$s->seq - Function β get the sequence string for this segment
- Returns β a string
- Args β none
- Status β Public
gives you the sequence for this segment as a simple string π
πΈ ref
- Title β
ref - Usage β
$ref = $s->ref([$newlandmark]) - Function β get/set the reference landmark for addressing
- Returns β a string
- Args β none
- Status β Public
so this method lets you examine/change the reference landmark that establishes the coordinate system π by default the landmark cannot be changed, so this ends up doing the same thing as seq_id(). the new landmark might be an ID, or it might be another Das::SegmentI object. your call bestie.
πΈ absolute
- Title β
absolute - Usage β
$s->absolute([$new_value]) - Function β get/set absolute addressing mode
- Returns β flag
- Args β new flag (optional)
- Status β Public
turns absolute-addressing mode on and off π
in absolute addressing mode, coordinates are relative to some underlying "top level" coordinate system (like a chromosome). ref() returns the identity of the top level landmark, and start() and end() return locations relative to that landmark. in relative addressing mode, coordinates are relative to the landmark sequence specified when the segment was created β or later modified by the ref() method.
default behaviour: returns false, and does nothing when you try to set absolute addressing mode. it's giving "no thoughts, head empty" and honestly that's by design π
πΈ features
- Title β
features - Usage β
@features = $s->features(@args) - Function β get features that overlap this segment
- Returns β a list of Bio::SeqFeatureI objects
- Args β see below
- Status β Public
this method finds all the features that intersect the segment in a whole buncha ways and returns a list of Bio::SeqFeatureI objects π the feature locations will use coordinates relative to the reference sequence in effect at the time that features() was called.
the returned list can be limited to certain types, attributes or range intersection modes. types of range intersection are one of:
"overlaps" the default
"contains" return features completely contained within the segment
"contained_in" return features that completely contain the segment
two types of argument lists are accepted β¨ in the positional argument form, the arguments are treated as a list of feature types. in the named parameter form, the arguments are a series of -name=>value pairs.
Argument Description
-------- ------------
-types An array reference to type names in the format
"method:source"
-attributes A hashref containing a set of attributes to match
-rangetype One of "overlaps", "contains", or "contained_in".
-iterator Return an iterator across the features.
-callback A callback to invoke on each feature
the -attributes argument is a hashref containing one or more attributes to match against π¦ like this:
-attributes => { Gene => 'abc-1',
Note => 'confirmed' }
attribute matching is simple string matching, and multiple attributes are ANDed together π want something fancier? use the -callback option (see below).
if -iterator is true, then the method returns an object reference that implements the next_seq() method. each call to next_seq() returns a new Bio::SeqFeatureI object π
if -callback is passed a code reference, that code reference will be invoked on each feature returned. the code gets passed two arguments β the current feature and the segment object itself β and it must return a true value. if the code returns a false value, feature retrieval will be aborted. brutal but fair π
-callbackand-iteratorare mutually exclusive, bestie. if-iteratoris defined, then-callbackis ignored. pick a lane πΈ
NOTE: the following methods all build on top of features(), and do not need to be explicitly implemented.
overlapping_features()
contained_features()
contained_in()
get_feature_stream()
πΈ overlapping_features
- Title β
overlapping_features - Usage β
@features = $s->overlapping_features(@args) - Function β get features that overlap this segment
- Returns β a list of Bio::SeqFeatureI objects
- Args β see below
- Status β Public
identical to features() except it defaults to finding overlapping features. lowkey the same girl, different outfit π
πΈ contained_features
- Title β
contained_features - Usage β
@features = $s->contained_features(@args) - Function β get features that are contained in this segment
- Returns β a list of Bio::SeqFeatureI objects
- Args β see below
- Status β Public
identical to features() except it defaults to a range type of 'contained' β¨
πΈ contained_in
- Title β
contained_in - Usage β
@features = $s->contained_in(@args) - Function β get features that contain this segment
- Returns β a list of Bio::SeqFeatureI objects
- Args β see below
- Status β Public
identical to features() except it defaults to a range type of 'contained_in' π
πΈ get_feature_stream
- Title β
get_feature_stream - Usage β
$iterator = $s->get_feature_stream(@args) - Function β get an iterator across the segment
- Returns β an object that implements
next_seq() - Args β see below
- Status β Public
identical to features() except it always generates an iterator π₯
NOTE: this is defined in the interface in terms of features(). you do not have to implement it. consider this one a freebie, bestie π«Ά
πΈ factory
- Title β
factory - Usage β
$factory = $s->factory - Function β return the segment factory
- Returns β a
Bio::DasIobject - Args β see below
- Status β Public
this method returns a Bio::DasI object you can use to fetch more segments π it's typically the very same Bio::DasI object the segment was originally generated from. main character energy, literally where it came from.
πΈ primary_tag
- Title β
primary_tag - Usage β
$tag = $s->primary_tag - Function β identifies the segment as type "DasSegment"
- Returns β a string named "DasSegment"
- Args β none
- Status β Public, but see below
this method gives Bio::Das::Segment objects a primary_tag() field that identifies them as being of type "DasSegment" π this lets the Bio::Graphics engine render segments just like a feature in order nis way useful.
this does not need to be implemented. it is defined by the interface. so likeβ¦ you're off the hook πΈ
πΈ strand
- Title β
strand - Usage β
$strand = $s->strand - Function β identifies the segment strand as 0
- Returns β the number 0
- Args β none
- Status β Public, but see below
this method gives Bio::Das::Segment objects a strand() field that identifies it as being strandless π¦ this lets the Bio::Graphics engine render segments just like a feature in order nis way useful.
this does not need to be implemented either. it is defined by the interface. slay, less work for you π
and that's a wrap on the whole appendix, bestie π every method, every arg, every status β accounted for, no cap.
this page came from perl v5.32.1, dated 2021-08-15, and it's the Bio::D...gmentI(3pm) page from the User Contributed Perl Documentation π ty for reading to the end, you ate β¨π
π«Ά
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms