| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
# documentation needed
| new | Description | Code |
| new | code | next | Top |
Title : new
Usage : $range1 = Bio::LiveSeq::Range->new(-seq => $obj_ref,
-start => $beginlabel,
-end => $endlabel, -strand => 1);
Function: generates a new Bio::LiveSeq::Range
Returns : reference to a new object of class Range
Errorcode -1
Args : two labels, an obj_ref and an integer
strand 1=forward strand, strand -1=reverse strand
if strand not specified, it defaults to 1
the -seq argument must point to the underlying DNA LiveSeq object |
| new | description | prev | next | Top |
my ($thing, %args) = @_; my $class = ref($thing) || $thing; my ($obj,%range); my ($seq,$start,$end,$strand)=($args{-seq},$args{-start},$args{-end},$args{-strand}); $obj =\% range; $obj = bless $obj, $class; unless ($seq->valid($start)) { $obj->warn("$class not initialised because start label not valid"); return (-1); } unless ($seq->valid($end)) { $obj->warn("$class not initialised because end label not valid"); return (-1); } unless (defined $strand) { $strand = 1; } if (($strand != 1)&&($strand != -1)) { $obj->warn("$class not initialised because strand identifier not valid. Use 1 (forward strand) or -1 (reverse strand)."); return (-1); } if ($start eq $end) { $obj->warn("$class reports: start and end label are the same...."); } else { unless ($seq->follows($start,$end,$strand)==1) { $obj->warn("Fatal: end label $end doesn't follow start label $start for strand $strand!"); return (-1); } } #if ($strand == 1) {}
# unless ($seq->is_downstream($start,$end)==1) {
# croak "Fatal: end label not downstream of start label for forward strand!";
# }
#} else {
# unless ($seq->is_upstream($start,$end)==1) {
# croak "Fatal: end label not upstream of start label for reverse strand!";
# }
#}
$obj->{'seq'}=$seq; $obj->{'start'}=$start; $obj->{'end'}=$end; $obj->{'strand'}=$strand; return $obj;
| AUTHOR - Joseph A.L. Insana | Top |
EMBL Outstation, European Bioinformatics Institute
Wellcome Trust Genome Campus, Hinxton
Cambs. CB10 1SD, United Kingdom| APPENDIX | Top |
| valid | Top |
Title : valid Usage : $boolean = $obj->valid($label) Function: tests if a label exists AND is part of the object Returns : boolean Args : label