3 # bioperl module for Bio::LiveSeq::DNA
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Joseph Insana <insana@ebi.ac.uk> <jinsana@gmx.net>
9 # Copyright Joseph Insana
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::LiveSeq::DNA - DNA object for LiveSeq
21 # documentation needed
25 This holds the DNA sequence (or the RNA in the case of cDNA entries)
26 and is accessed by exons, genes, transcripts... objects
28 =head1 AUTHOR - Joseph A.L. Insana
30 Email: Insana@ebi.ac.uk, jinsana@gmx.net
34 The rest of the documentation details each of the object
35 methods. Internal methods are usually preceded with a _
39 # Let the code begin...
41 package Bio
::LiveSeq
::DNA
;
44 use base
qw(Bio::LiveSeq::SeqI);
49 Usage : $dna = Bio::LiveSeq::DNA->new(-seq => "atcgaccaatggacctca",
52 Function: generates a new Bio::LiveSeq::DNA
53 Returns : reference to a new object of class DNA
56 AND an optional offset to create nucleotide labels (default is 1, i.e.
57 starting the count of labels from "1") -> do not bother using it ->
58 it could be used by alternative loaders !EMBL format
59 NOTE : strand of DNA is set to 1 by default
64 my ($thing, %args) = @_;
65 my $class = ref($thing) || $thing;
69 $obj = $thing->string2chain($args{-seq
},$args{-offset
}); # inherited from ChainI
70 $obj = bless $obj, $class;
73 $obj = bless $obj, $class;
74 $obj->throw("$class not initialized properly");
77 $obj->{'alphabet'}='dna'; # set alphabet default
78 $obj->{'strand'}=1; # set strand default = 1
79 $obj->{'seq'}=$obj; # set seq field to itself
85 # it has to be redefined here because default from SeqI accesses field "start"
88 return $self->{'begin'}; # the chain's start is called begin
91 # it is overridden to provide faster output
94 return $self->chain_length();
97 # it is overridden to provide MUCH faster output
100 return $self->label_exists(@_);