NAME
Bio::DB::GFF::Segment -- Simple DNA segment object
SYNOPSIS
See Bio::DB::GFF.
DESCRIPTION
Bio::DB::GFF::Segment provides the basic representation of a range of DNA contained in a GFF database. It is the base class from which the Bio::DB::GFF::RelSegment and Bio::DB::GFF::Feature classes are derived.
Generally, you will not create or manipulate Bio::DB::GFF::Segment objects directly, but use those that are returned by the Bio::DB::GFF module.
API
The remainder of this document describes the API for Bio::DB::GFF::Segment.
new
Title : newUsage : $s = Bio::DB::GFF::Segment->new(@args)Function: create a new segmentReturns : a new Bio::DB::GFF::Segment objectArgs : see belowStatus : Public
This method creates a new Bio::DB::GFF::Segment object. Generally this is called automatically by the Bio::DB::GFF module and derivatives.
There are five positional arguments:
$factory a Bio::DB::GFF::Adaptor to 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 : factoryUsage : $s->factoryFunction: get the factory objectReturns : a Bio::DB::GFF::AdaptorArgs : noneStatus : Public
This is a read-only accessor for the Bio::DB::GFF::Adaptor object used to create the segment.
start
Title : startUsage : $s->startFunction: start of segmentReturns : integerArgs : noneStatus : Public
This is a read-only accessor for the start of the segment.
end
Title : endUsage : $s->endFunction: end of segmentReturns : integerArgs : noneStatus : Public
This is a read-only accessor for the end of the segment.
stop
Title : stopUsage : $s->stopFunction: stop of segmentReturns : integerArgs : noneStatus : Public
This is an alias for end(), provided for AcePerl compatibility.
length
Title : lengthUsage : $s->lengthFunction: length of segmentReturns : integerArgs : noneStatus : Public
Returns the length of the segment. Always a positive number.
strand
Title : strandUsage : $s->strandFunction: strand of segmentReturns : +1,0,-1Args : noneStatus : Public
Returns the strand on which the segment resides, either +1, 0 or -1.
low
Title : lowUsage : $s->lowFunction: return lower coordinateReturns : lower coordinateArgs : noneStatus : Public
Returns the lower coordinate, either start or end.
high
Title : highUsage : $s->highFunction: return higher coordinateReturns : higher coordinateArgs : noneStatus : Public
Returns the higher coordinate, either start or end.
sourceseq
Title : sourceseqUsage : $s->sourceseqFunction: get the segment sourceReturns : a stringArgs : noneStatus : Public
Returns the name of the source sequence for this segment.
class
Title : classUsage : $s->class([$newclass])Function: get the source sequence classReturns : a stringArgs : new class (optional)Status : Public
Gets or sets the class for the source sequence for this segment.
subseq
Title : subseqUsage : $s->subseq($start,$stop)Function: generate a subsequenceReturns : a Bio::DB::GFF::Segment objectArgs : start and end of subsequenceStatus : Public
This method generates a new segment from the start and end positions given in the arguments. If stop < start, then the strand is reversed.
seq
Title : seqUsage : $s->seqFunction: get the sequence string for this segmentReturns : a Bio::PrimarySeqArgs : noneStatus : Public
Returns the sequence for this segment as a Bio::PrimarySeq. (-) strand segments are automatically reverse complemented
The method is called dna() return the data as a simple sequence string.
dna
Title : dnaUsage : $s->dnaFunction: get the DNA string for this segmentReturns : a stringArgs : noneStatus : Public
Returns the sequence for this segment as a simple string. (-) strand segments are automatically reverse complemented
The method is also called protein().
primary_seq
Title : primary_seqUsage : $s->primary_seqFunction: returns a Bio::PrimarySeqI compatible objectReturns : a Bio::PrimarySeqI objectArgs : noneStatus : Public
This is for compatibility with BioPerl's separation of SeqI from PrimarySeqI. It just returns itself.
type
Title : typeUsage : $s->typeFunction: return the string "feature"Returns : the string "feature"Args : noneStatus : Public
This is for future sequence ontology-compatibility and represents the default type of a feature on the genome
equals
Title : equalsUsage : $s->equals($d)Function: segment equalityReturns : true, if two segments are equalArgs : another segmentStatus : Public
Returns true if the two segments have the same source sequence, start and stop.
asString
Title : asStringUsage : $s->asStringFunction: human-readable string for segmentReturns : a stringArgs : noneStatus : Public
Returns a human-readable string representing this sequence. Format is:
sourceseq/start,stop
clone
Title : cloneUsage : $copy = $s->cloneFunction: make a copy of this segmentReturns : a Bio::DB::GFF::Segment objectArgs : noneStatus : Public
This method creates a copy of the segment and returns it.
error
Title : errorUsage : $error = $s->error([$new_error])Function: get or set the last errorReturns : a stringArgs : an error message (optional)Status : Public
In case of a fault, this method can be used to obtain the last error message. Internally it is called to set the error message.
Relative Addressing Methods
The following methods are provided for compatibility with Bio::DB::GFF::RelSegment, which provides relative addressing functions.
abs_start
Title : abs_startUsage : $s->abs_startFunction: the absolute start of the segmentReturns : an integerArgs : noneStatus : Public
This is an alias to start(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_end
Title : abs_endUsage : $s->abs_endFunction: the absolute stop of the segmentReturns : an integerArgs : noneStatus : Public
This is an alias to stop(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_strand
Title : abs_strandUsage : $s->abs_strandFunction: the absolute strand of the segmentReturns : +1,0,-1Args : noneStatus : Public
This is an alias to strand(), and provided for API compatibility with Bio::DB::GFF::RelSegment.
abs_ref
Title : abs_refUsage : $s->abs_refFunction: the reference sequence for this segmentReturns : a stringArgs : noneStatus : Public
This is an alias to sourceseq(), and is here to provide API compatibility with Bio::DB::GFF::RelSegment.
refseq
Title : refseqUsage : $s->refseqFunction: get or set the reference sequenceReturns : a stringArgs : noneStatus : 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 : refUsage : $s->refseqFunction: get or set the reference sequenceReturns : a stringArgs : noneStatus : Public
An alias for refseq()
seq_id
Title : seq_idUsage : $ref = $s->seq_idFunction: get the reference sequence in a LocationI-compatible wayReturns : a stringArgs : noneStatus : Public
An alias for refseq() but only allows reading.
truncated
Title : truncatedUsage : $truncated = $s->truncatedFunction: Flag indicating that the segment was truncated during creationReturns : A boolean flagArgs : noneStatus : 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_idUsage : $unique_implementation_key = $obj->primary_id;Function: Returns the unique id for this object in thisimplementation. This allows implementations to manage theirown object ids in a way the implementation can controlclients can expect one id to map to one object.For sequences with no accession number, this method shouldreturn a stringified memory location.Returns : A stringArgs : NoneStatus : Virtual
display_name
Title : display_nameUsage : $id = $obj->display_name or $obj->display_name($newid);Function: Gets or sets the display id, also known as the common name ofthe Seq object.The semantics of this is that it is the most likely stringto be used as an identifier of the sequence, and likely tohave "human" readability. The id is equivalent to the LOCUSfield of the GenBank/EMBL databanks and the ID field of theSwissprot/sptrembl database. In fasta format, the >(\S+) ispresumed to be the id, though some people overload the idto embed other information. Bioperl does not use anyembedded information in the ID field, and people areencouraged to use other mechanisms (accession field forexample, or extending the sequence object) to solve this.Notice that $seq->id() maps to this function, mainly forlegacy/convenience issues.Returns : A stringArgs : 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_numberUsage : $unique_biological_key = $obj->accession_number;Function: Returns the unique biological id for a sequence, commonlycalled the accession_number. For sequences from establisheddatabases, the implementors should try to use the correctaccession number. Notice that primary_id() provides theunique id for the implementation, allowing multiple objectsto have the same accession number in a particular implementation.For sequences with no accession number, this method should return"unknown".Returns : A stringArgs : None
alphabet
Title : alphabetUsage : 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 causeupgrade problems from the 0.5 and earlier Seq objects.Returns : a string either 'dna','rna','protein'. NB - the object mustmake a call of the type - if there is no type specified ithas to guess.Args : noneStatus : Virtual
desc
Title : descUsage : $seqobj->desc($string) or $seqobj->desc()Function: Sets or gets the description of the sequenceExample :Returns : The descriptionArgs : The description or none
species
Title : speciesUsage : $species = $seq->species() or $seq->species($species)Function: Gets or sets the speciesExample :Returns : Bio::Species objectArgs : None or Bio::Species object
See Bio::Species for more information
annotation
Title : annotationUsage : $ann = $seq->annotation or $seq->annotation($annotation)Function: Gets or sets the annotationExample :Returns : Bio::Annotation objectArgs : None or Bio::Annotation object
See Bio::Annotation for more information
is_circular
Title : is_circularUsage : if( $obj->is_circular) { /Do Something/ }Function: Returns true if the molecule is circularReturns : Boolean valueArgs : none
BUGS
Report them please.
SEE ALSO
bioperl
AUTHOR
Lincoln Stein <[email protected]>.
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 <[email protected]>.