NAME
Bio::LiveSeq::SeqI - Abstract sequence interface class for LiveSeq
SYNOPSIS
# documentation needed
DESCRIPTION
This class implements BioPerl PrimarySeqI interface for Live Seq objects.
One of the main difference in LiveSequence compared to traditional "string" sequences is that coordinate systems are flexible. Typically gene nucleotide numbering starts from 1 at the first character of the initiator codon (A in ATG). This means that negative positions are possible and common!
Secondly, the sequence manipulation methods do not return a new sequence object but change the current object. The current status can be written out to BioPerl sequence objects.
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts 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 the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Joseph A.L. Insana
Email: [email protected], [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
Some note on the terminology/notation of method names:
label: a unique pointer to a single nucleotide
position: the position of a nucleotide according to a particular coordinate
system (e.g. counting downstream from a particular label taken as
number 1)
base: the one letter code for a nucleotide (i.e.: "a" "t" "c" "g")
a base is the "value" that an "element" of a "chain" can assume(see documentation on the Chain datastructure if interested)
seq
Title : seqUsage : $string = $obj->seq()Function: Returns the complete sequence of an object as a string of letters.Suggested cases are upper case for proteins and lower case forDNA sequence (IUPAC standard),Returns : a string
all_labels
Title : all_labelsUsage : @labels = $obj->all_labels()Function: all the labels of every nucleotide an object is composed ofReturns : an array of labelsArgs : none
labelsubseq
Title : labelsubseqUsage : $dna->labelsubseq();: $dna->labelsubseq($startlabel);: $dna->labelsubseq($startlabel,$length);: $dna->labelsubseq($startlabel,undef,$endlabel);e.g. : $dna->labelsubseq(4,undef,8);Function: prints the sequence as string. The difference between labelsubseqand normal subseq is that it uses /labels/ as arguments, insteadthan positions. This allows for faster and more efficient lookup,skipping the (usually) lengthy conversion of positions into labels.This is especially useful for manipulating with high powerLiveSeq objects, knowing the labels and exploiting theirusefulness.Returns : a stringErrorcode -1Args : without arguments it returns the entire sequencewith a startlabel it returns the sequence downstream that labelif a length is specified, it returns only that number of basesif an endlabel is specified, it overrides the length argumentand prints instead up to that label (included)Defaults: $startlabel defaults to the beginning of the entire sequence$endlabel defaults to the end of the entire sequence
subseq
Title : subseqUsage : $substring = $obj->subseq(10,40);: $substring = $obj->subseq(10,undef,4);Function: returns the subseq from start to end, where the first baseis 1 and the number is inclusive, ie 1-2 are the first twobases of the sequenceStart cannot be larger than end but can be equal.Allows for negative numbers $obj->subseq(-10,-1). Bydefinition, there is no 0!-5 -1 1 5gctagcgcccaac atggctcgctgThis allows one to retrieve sequences upstream from given position.The precedence is from left to right: if END is given LENGTH isignored.Examples: $obj->subseq(-10,undef,10) returns 10 elements before position 1$obj->subseq(4,8) returns elements from the 4th to the 8th, inclusiveReturns : a stringErrorcode: -1Args : start, integer, defaults to start of the sequenceend, integer, '' or undef, defaults to end of the sequencelength, integer, '' or undefan optional strand (1 or -1) 4th argumentif strand argument is not given, it will default to the objectargument. This argument is useful when a call is issued from a childof a parent object containing the subseq method
length
Title : lengthUsage : $seq->length();Function: returns the number of nucleotides (or the number of aminoacids)in the entire sequenceReturns : an integerErrorcode -1Args : none
display_id
Title : display_idUsage : $id_string = $obj->display_id();Function: returns the display id, alias the common name of the objectThe 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 IDfield 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.See also: accession_numberReturns : a stringArgs : none
accession_number
Title : accession_numberUsage : $unique_biological_key = $obj->accession_number;Function: Returns the unique biological id for a sequence, commonlycalled the accession_number.Notice that primary_id() provides the unique id for theimplementation, allowing multiple objects to have the same accessionnumber in a particular implementation.For objects with no accession_number this method returns "unknown".Returns : a stringArgs : none
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 their ownobject ids in a way the implementation can control. Clients canexpect one id to map to one object.For sequences with no primary_id, this method returnsa stringified memory location.Returns : A stringArgs : None
change
Title : changeUsage : $substring = $obj->change('AA', 10);Function: changes, modifies, mutates the LiveSequenceExamples:$obj->change('', 10); delete nucleotide #10$obj->change('', 10, 2); delete two nucleotides starting from #10$obj->change('G', 10); change nuc #10 to 'G'$obj->change('GA', 10, 4); replace #10 and 3 following with 'GA'$obj->change('GA', 10, 2)); is same as $obj->change('GA', 10);$obj->change('GA', 10, 0 ); insert 'GA' before nucleotide at #10$obj->change('GA', 10, 1); GA inserted before #10, #10 deleted$obj->change('GATC', 10, 2); GATC inserted before #10, #10 deleted$obj->change('GATC', 10, 6); GATC inserted before #10, #10-#15 deletedReturns : a string of deleted bases (if any) or 1 (everything OK)Errorcode: -1Args : seq, string, or '' ('' = undef = 0 = deletion)start, integerlength, integer (optional)
positionchange
Title : positionchangeFunction: Exactly like change. I.e. change() defaults to positionchange()
labelchange
Title : labelchangeFunction: Exactly like change but uses a /label/ instead than a positionas second argument. This allows for multiple changes in a LiveSeqwithout the burden of recomputing positions. I.e. for a multiplechange in two different points of the LiveSeq, the approach wouldbe the following: fetch the correct labels out of the two differentpositions (method: label($position)) and then use the labelchange()method to modify the sequence using those labels instead thanrelying on the positions (that would have modified after thefirst change).
valid
Title : validUsage : $boolean = $obj->valid($label)Function: tests if a label exists inside the objectReturns : booleanArgs : label
start
Title : startUsage : $startlabel=$obj->start()Function: returns the label of the first nucleotide of the object (exon, CDS)Returns : labelArgs : none
end
Title : endUsage : $endlabel=$obj->end()Function: returns the label of the last nucleotide of the object (exon, CDS)Returns : labelArgs : none
strand
Title : strandUsage : $strand=$obj->strand()$obj->strand($strand)Function: gets or sets strand information, being 1 or -1 (forward or reverse)Returns : -1 or 1Args : none OR -1 or 1
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.Returns : a string either 'dna','rna','protein'.Args : none
coordinate_start
Title : coordinate_startUsage : $coordstartlabel=$obj->coordinate_start(): $coordstartlabel=$obj->coordinate_start($label)Function: returns and optionally sets the first label of the coordinatesystem usedFor some objects only labels inside the object or in frame (forTranslation objects) will be allowed to get set as coordinate startReturns : label. It returns 0 if label not found.Errorcode -1Args : an optional reference $label that is position 1
label
Title : labelUsage : $seq->label($position): $seq->label($position,$firstlabel)Examples: $nextlabel=$seq->label(2,$label) -> retrieves the following label: $prevlabel=$seq->label(-1,$label) -> retrieves the preceding labelFunction: returns the label of the nucleotide at $position from currentcoordinate startReturns : a label. It returns 0 if label not found.Errorcode -1Args : a position,an optional reference $firstlabel that is to be used as position 1an optional strand (1 or -1) argumentif strand argument is not given, it will default to the objectargument. This argument is useful when a call is issued from a childof a parent object containing the subseq method
position
Title : positionUsage : $seq->position($label): $seq->position($label,$firstlabel)Function: returns the position of nucleotide at $labelReturns : the position of the label from current coordinate startErrorcode 0Args : a label pointing to a certain nucleotide (e.g. start of exon)an optional "firstlabel" as reference to count froman optional strand (1 or -1) argumentif strand argument is not given, it will default to the objectargument. This argument is useful when a call is issued from a childof a parent object containing the subseq method
follows
Title : followsUsage : $seq->follows($firstlabel,$secondlabel): $seq->follows($firstlabel,$secondlabel,$strand)Function: checks if SECONDlabel follows FIRSTlabel, undependent of the strandi.e. it checks downstream for forward strand andupstream for reverse strandReturns : 1 or 0Errorcode -1Args : two labelsan optional strand (1 or -1) argumentif strand argument is not given, it will default to the objectargument. This argument is useful when a call is issued from a childof a parent object containing the subseq method
gene
Title : geneUsage : my $gene=$obj->gene;Function: Gets or sets the reference to the LiveSeq::Gene object.Objects that are features of a LiveSeq Gene will have thisattribute set automatically.Returns : reference to an object of class GeneNote : if Gene object is not set, this method will return 0;Args : none or reference to object of class Bio::LiveSeq::Gene
obj_valid
Title : obj_validUsage : if ($obj->obj_valid) {do something;}Function: Checks if start and end labels are still valid for the ojbect,i.e. tests if the LiveSeq object is still validReturns : booleanArgs : none
name
Title : nameUsage : $name = $obj->name;: $name = $obj->name("ABCD");Function: Returns or sets the name of the object.If there is no name, it will return "unknown";Returns : A stringArgs : None
desc
Title : descUsage : $desc = $obj->desc;: $desc = $obj->desc("ABCD");Function: Returns or sets the description of the object.If there is no description, it will return "unknown";Returns : A stringArgs : None
source
Title : sourceUsage : $name = $obj->source;: $name = $obj->source("Homo sapiens");Function: Returns or sets the organism that is source of the object.If there is no source, it will return "unknown";Returns : A stringArgs : None