Bio::D...Segment(3pm)
πΈ NAME πΈ
Bio::D...Segment(3pm) β Bio::DB::GFF::Segment β a simple DNA segment object, and honestly? she's the blueprint bestie of the whole GFF situation π
(also hi, this is the User Contributed Perl Documentation page for Bio::D...Segment(3pm), we're doing this β¨)
β¨ SYNOPSIS β¨
See Bio::DB::GFF. That's it, that's the synopsis, she's lowkey mysterious like that π
π DESCRIPTION π
Bio::DB::GFF::Segment gives you the basic representation of a range of DNA that lives inside a GFF database. It's the base class, bestie β the mother of Bio::DB::GFF::RelSegment and Bio::DB::GFF::Feature, both of which are derived from her. Main character energy fr fr π
ngl, you're generally NOT gonna make or mess with Bio::DB::GFF::Segment objects directly. Instead you use the ones that the Bio::DB::GFF module hands you. Let the module do the work, you just vibe π¦
π API π
Okay so the rest of this doc is the whole API for Bio::DB::GFF::Segment. Buckle up, it's a lot of little accessors and every single one of them is iconic in her own way π«Ά
β¨ new β¨
Title : new
Usage : $s = Bio::DB::GFF::Segment->new(@args)
Function: create a new segment
Returns : a new Bio::DB::GFF::Segment object
Args : see below
Status : Public
This makes you a brand-new Bio::DB::GFF::Segment object π Usually you're not even the one calling it β the Bio::DB::GFF module and its derivatives handle that automatically. It's giving "you didn't build her, she was assigned to you" π
There are five positional arguments, in this exact order:
$factoryβ aBio::DB::GFF::Adaptorto use for database access$sourceseqβ ID of the source sequence$sourceclassβ class of the source sequence$startβ start of the desired segment relative to source sequence$stopβ stop of the desired segment relative to source sequence
π factory π
Title : factory
Usage : $s->factory
Function: get the factory object
Returns : a Bio::DB::GFF::Adaptor
Args : none
Status : Public
Read-only accessor for the Bio::DB::GFF::Adaptor object that was used to create the segment. She built you, you can look at her, you cannot change her. Boundaries π«Ά
π start π
Title : start
Usage : $s->start
Function: start of segment
Returns : integer
Args : none
Status : Public
Read-only accessor for the start of the segment. No touchie, just lookie π
π 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. Also no touchie β¨
π stop π
Title : stop
Usage : $s->stop
Function: stop of segment
Returns : integer
Args : none
Status : Public
This one is literally just an alias for end() β it exists purely for AcePerl compatibility. Same girl, different name, we love a rebrand π
π length π
Title : length
Usage : $s->length
Function: length of segment
Returns : integer
Args : none
Status : Public
Returns the length of the segment. And bestie, it is always a positive number. No negativity permitted in this household π«π
π strand π
Title : strand
Usage : $s->strand
Function: strand of segment
Returns : +1,0,-1
Args : none
Status : Public
Returns the strand the segment lives on, and it's one of exactly three moods: +1, 0, or -1. Pick your fighter π
π low π
Title : low
Usage : $s->low
Function: return lower coordinate
Returns : lower coordinate
Args : none
Status : Public
Gives you the lower coordinate β whichever of start or end is smaller. She keeps it lowkey, as requested π
π high π
Title : high
Usage : $s->high
Function: return higher coordinate
Returns : higher coordinate
Args : none
Status : Public
Gives you the higher coordinate β whichever of start or end is bigger. Highkey, even π₯
π sourceseq π
Title : sourceseq
Usage : $s->sourceseq
Function: get the segment source
Returns : a string
Args : none
Status : Public
Returns the name of the source sequence for this segment, as a plain string. That's the origin story π
π class π
Title : class
Usage : $s->class([$newclass])
Function: get the source sequence class
Returns : a string
Args : new class (optional)
Status : Public
Gets or sets the class for the source sequence of this segment. Pass in a new class and she switches it up; pass nothing and she just tells you what she is. Versatile queen π
π subseq π
Title : subseq
Usage : $s->subseq($start,$stop)
Function: generate a subsequence
Returns : a Bio::DB::GFF::Segment object
Args : start and end of subsequence
Status : Public
This generates a whole new segment out of the start and end positions you feed it. And here's the plot twist bestie β if stop < start, then the strand gets reversed. She flips the script, literally π
π seq π
Title : seq
Usage : $s->seq
Function: get the sequence string for this segment
Returns : a Bio::PrimarySeq
Args : none
Status : Public
Hands you the sequence for this segment as a Bio::PrimarySeq. Heads up: (β) strand segments are automatically reverse complemented, no extra steps from you π§
Also note the method is called dna() to return the data as a simple sequence string. Two vibes, one method β¨
π dna π
Title : dna
Usage : $s->dna
Function: get the DNA string for this segment
Returns : a string
Args : none
Status : Public
Returns the sequence for this segment as a simple string. And yeah β (β) strand segments are automatically reverse complemented here too, same deal π
Oh and this method is also called protein(). She answers to both, we don't judge π«Ά
π primary_seq π
Title : primary_seq
Usage : $s->primary_seq
Function: returns a Bio::PrimarySeqI compatible object
Returns : a Bio::PrimarySeqI object
Args : none
Status : Public
This exists for compatibility with BioPerl's whole separation-of-SeqI-from-PrimarySeqI situation. And what does it do? It just returns itself. No notes. She's her own primary seq, self-love era π
β¨
π type π
Title : type
Usage : $s->type
Function: return the string "feature"
Returns : the string "feature"
Args : none
Status : Public
Returns the string "feature", every single time. This is for future sequence ontology compatibility, and it represents the default type of a feature on the genome. She's not a phase, she's the default πΈ
π equals π
Title : equals
Usage : $s->equals($d)
Function: segment equality
Returns : true, if two segments are equal
Args : another segment
Status : Public
Returns true if two segments share the same source sequence, start and stop. That's the whole checklist. If all three match, twin flames fr fr π―ββοΈ
π asString π
Title : asString
Usage : $s->asString
Function: human-readable string for segment
Returns : a string
Args : none
Status : Public
Returns a human-readable string representing this sequence. The format is:
sourceseq/start,stop
Simple, clean, readable. Slay π
π clone π
Title : clone
Usage : $copy = $s->clone
Function: make a copy of this segment
Returns : a Bio::DB::GFF::Segment object
Args : none
Status : Public
Creates a copy of the segment and returns it to you. She's making a little mini-me π₯Ή
π error π
Title : error
Usage : $error = $s->error([$new_error])
Function: get or set the last error
Returns : a string
Args : an error message (optional)
Status : Public
In case of a fault, this is how you grab the last error message. And internally? She calls it to set the error message too. Get or set, she does both, because of course she does π
β¨ Relative Addressing Methods β¨
Okay bestie, so these next methods are all about playing nice with Bio::DB::GFF::RelSegment, which is the whole relative-addressing vibe. The following methods are provided for compatibility with Bio::DB::GFF::RelSegment, which provides relative addressing functions.
abs_start
- Title:
abs_start - Usage:
$s->abs_start - Function: the absolute start of the segment
- Returns: an integer
- Args: none
- Status: Public
This is an alias to start(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_end
- Title:
abs_end - Usage:
$s->abs_end - Function: the absolute stop of the segment
- Returns: an integer
- Args: none
- Status: Public
This is an alias to stop(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_strand
- Title:
abs_strand - Usage:
$s->abs_strand - Function: the absolute strand of the segment
- Returns:
+1,0,-1 - Args: none
- Status: Public
This is an alias to strand(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_ref
- Title:
abs_ref - Usage:
$s->abs_ref - Function: the reference sequence for this segment
- Returns: a string
- Args: none
- Status: Public
This is an alias to sourceseq(), and is here to provide API compatibility with Bio::DB::GFF::RelSegment.
refseq
- Title:
refseq - Usage:
$s->refseq - Function: get or set the reference sequence
- Returns: a string
- Args: none
- Status: Public
Examine or change the reference sequence. This is an alias to sourceseq(), provided here for API compatibility with Bio::DB::GFF::RelSegment.
ref
- Title:
ref - Usage:
$s->refseq - Function: get or set the reference sequence
- Returns: a string
- Args: none
- Status: Public
An alias for refseq()
seq_id
- Title:
seq_id - Usage:
$ref = $s->seq_id - Function: get the reference sequence in a LocationI-compatible way
- Returns: a string
- Args: none
- Status: Public
An alias for refseq() but only allows reading.
truncated
- Title:
truncated - Usage:
$truncated = $s->truncated - Function: Flag indicating that the segment was truncated during creation
- Returns: A boolean flag
- Args: none
- Status: Public
This indicates that the sequence was truncated during creation. The returned flag is undef if no truncation occurred. If truncation did occur, the flag is actually an array ref in which the first element is true if truncation occurred on the left, and the second element occurred if truncation occurred on the right.
π Bio::RangeI Methods π
The following Bio::RangeI methods are supported:
overlaps(), contains(), equals(),intersection(),union(),overlap_extent()
𧬠Bio::SeqI implementation π§¬
primary_id
- Title:
primary_id - Usage:
$unique_implementation_key = $obj->primary_id; - Function: Returns the unique id for this object in this implementation. This allows implementations to manage their own object ids in a way the implementation can control clients can expect one id to map to one object. For sequences with no accession number, this method should return a stringified memory location.
- Returns: A string
- Args: None
- Status: Virtual
display_name
- Title:
display_name - Usage:
$id = $obj->display_name or $obj->display_name($newid); - Function: Gets or sets the display id, also known as the common name of the Seq object. The semantics of this is that it is the most likely string to be used as an identifier of the sequence, and likely to have "human" readability. The id is equivalent to the LOCUS field of the GenBank/EMBL databanks and the ID field of the Swissprot/sptrembl database. In fasta format, the
>(\S+)is presumed to be the id, though some people overload the id to embed other information. Bioperl does not use any embedded information in the ID field, and people are encouraged to use other mechanisms (accession field for example, or extending the sequence object) to solve this. Notice that$seq->id()maps to this function, mainly for legacy/convenience issues. - Returns: A string
- Args: None or a new id
Note, this used to be called display_id(), and this name is preserved for backward compatibility. The default is to return the seq_id().
accession_number
- Title:
accession_number - Usage:
$unique_biological_key = $obj->accession_number; - Function: Returns the unique biological id for a sequence, commonly called the accession_number. For sequences from established databases, the implementors should try to use the correct accession number. Notice that
primary_id()provides the unique id for the implementation, allowing multiple objects to have the same accession number in a particular implementation. For sequences with no accession number, this method should return"unknown". - Returns: A string
- Args: None
alphabet
- Title:
alphabet - Usage:
if( $obj->alphabet eq 'dna' ) { /Do Something/ } - Function: Returns the type of sequence being one of
'dna','rna'or'protein'. This is case sensitive. This is not called<type>because this would cause upgrade problems from the 0.5 and earlier Seq objects. - Returns: a string either
'dna','rna','protein'. NB - the object must make a call of the type - if there is no type specified it has to guess. - Args: none
- Status: Virtual
desc
- Title:
desc - Usage:
$seqobj->desc($string) or $seqobj->desc() - Function: Sets or gets the description of the sequence
- Example:
- Returns: The description
- Args: The description or none
species
- Title:
species - Usage:
$species = $seq->species() or $seq->species($species) - Function: Gets or sets the species
- Example:
- Returns: Bio::Species object
- Args: None or Bio::Species object
See Bio::Species for more information
annotation
- Title:
annotation - Usage:
$ann = $seq->annotation or $seq->annotation($annotation) - Function: Gets or sets the annotation
- Example:
- Returns: Bio::Annotation object
- Args: None or Bio::Annotation object
See Bio::Annotation for more information
is_circular
- Title:
is_circular - Usage:
if( $obj->is_circular) { /Do Something/ } - Function: Returns true if the molecule is circular
- Returns: Boolean value
- Args: none
π BUGS π
Report them please. π
π SEE ALSO π
bioperl
π AUTHOR π
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2001 Cold Spring Harbor Laboratory.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π«Ά CONTRIBUTORS π«Ά
Jason Stajich <jason@bioperl.org>.
This page is from the perl v5.30.0 release, dated 2020-01-13, and it's the Bio::D...Segment(3pm) manpage β periodt. π
π¦ where this page comes from
- debian bookworm: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms