2 # bioperl module for Bio::LiveSeq::DNA
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Joseph Insana <insana@ebi.ac.uk> <jinsana@gmx.net>
8 # Copyright Joseph Insana
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::LiveSeq::DNA - DNA object for LiveSeq
20 # documentation needed
24 This holds the DNA sequence (or the RNA in the case of cDNA entries)
25 and is accessed by exons, genes, transcripts... objects
27 =head1 AUTHOR - Joseph A.L. Insana
29 Email: Insana@ebi.ac.uk, jinsana@gmx.net
33 The rest of the documentation details each of the object
34 methods. Internal methods are usually preceded with a _
38 # Let the code begin...
40 package Bio
::LiveSeq
::DNA
;
43 use base
qw(Bio::LiveSeq::SeqI);
48 Usage : $dna = Bio::LiveSeq::DNA->new(-seq => "atcgaccaatggacctca",
51 Function: generates a new Bio::LiveSeq::DNA
52 Returns : reference to a new object of class DNA
55 AND an optional offset to create nucleotide labels (default is 1, i.e.
56 starting the count of labels from "1") -> do not bother using it ->
57 it could be used by alternative loaders !EMBL format
58 NOTE : strand of DNA is set to 1 by default
63 my ($thing, %args) = @_;
64 my $class = ref($thing) || $thing;
68 $obj = $thing->string2chain($args{-seq
},$args{-offset
}); # inherited from ChainI
69 $obj = bless $obj, $class;
72 $obj = bless $obj, $class;
73 $obj->throw("$class not initialized properly");
76 $obj->{'alphabet'}='dna'; # set alphabet default
77 $obj->{'strand'}=1; # set strand default = 1
78 $obj->{'seq'}=$obj; # set seq field to itself
84 # it has to be redefined here because default from SeqI accesses field "start"
87 return $self->{'begin'}; # the chain's start is called begin
90 # it is overridden to provide faster output
93 return $self->chain_length();
96 # it is overridden to provide MUCH faster output
99 return $self->label_exists(@_);