Hide Show 85 lines of Pod
use
Carp
qw(carp croak cluck confess)
;
@ISA
=
qw(Bio::Root::Root Bio::SeqI Bio::Das::SegmentI Bio::DB::Das::Chado)
;
sub
new {
my
$self
= {};
my
$class_type
=
shift
;
my
(
$name
,
$factory
,
$base_start
,
$stop
,
$db_id
,
$target
,
$feature_id
,
$srcf_id
) =
@_
;
bless
$self
,
ref
$class_type
||
$class_type
;
$self
->{
'factory'
} =
$factory
;
$self
->{
'name'
} =
$name
;
$self
->feature_id(
$feature_id
)
if
$feature_id
;
$target
||=0;
my
$strand
;
warn
"na:$name, id:$db_id, $factory\n"
if
DEBUG;
warn
"base_start = $base_start, stop = $stop\n"
if
DEBUG;
if
(!
defined
(
$name
)) {
return
;
}
$base_start
=
$base_start
?
int
(
$base_start
) : 1;
my
$interbase_start
=
$base_start
- 1;
my
$quoted_name
=
$factory
->dbh->quote(
lc
$name
);
warn
"quoted name:$quoted_name\n"
if
DEBUG;
my
$refclass
=
$factory
->default_class()
?
$factory
->name2term(
$factory
->default_class())
:
undef
;
my
$ref_feature_id
=
$factory
->refclass_feature_id() ||
undef
;
my
$where_part
=
" and rank = $target "
if
(
defined
(
$target
));
if
(
defined
(
$ref_feature_id
)){
$where_part
.=
" and fl.srcfeature_id = $ref_feature_id "
;
}
else
{
$where_part
.=
" and srcf.type_id = $refclass "
if
(
defined
(
$refclass
));
}
$where_part
.=
" and srcf.is_obsolete = false "
unless
$self
->factory->allow_obsolete;
$where_part
.=
" and srcf.organism_id = "
.
$self
->factory->organism_id
if
$self
->factory->organism_id;
warn
$where_part
if
DEBUG;
my
$srcfeature_query
=
$factory
->dbh->prepare( "
select
srcfeature_id from featureloc fl
join
feature srcf on (fl.srcfeature_id = srcf.feature_id)
where fl.feature_id = ? " .
$where_part
);
my
$landmark_is_src_query
=
$factory
->dbh->prepare( "
select
f.name,f.feature_id,f.seqlen,f.type_id,f.is_obsolete
from feature f
where f.feature_id = ?
" );
my
$fetch_uniquename_query
=
$factory
->dbh->prepare( "
select
f.name,fl.fmin,fl.fmax,f.uniquename,f.is_obsolete,fl.srcfeature_id,fl.strand
from feature f, featureloc fl
where f.feature_id = ? and
f.feature_id = fl.feature_id
");
my
$ref
=
$self
->_search_by_name(
$factory
,
$quoted_name
,
$db_id
,
$feature_id
);
if
(
ref
$ref
eq
'ARRAY'
) {
my
@segments
;
foreach
my
$feature_id
(
@$ref
) {
$fetch_uniquename_query
->execute(
$feature_id
)
or Bio::Root::Root->throw(
"fetching uniquename from feature_id failed"
) ;
my
$hashref
=
$fetch_uniquename_query
->fetchrow_hashref;
next
if
(
$$hashref
{
'is_obsolete'
} and !
$self
->factory->allow_obsolete);
warn
"$base_start, $stop\n"
if
DEBUG;
warn
"Looping through feature_ids in constructor:\n"
.Dumper(
$hashref
)
if
DEBUG;
$base_start
=
$base_start
?
$base_start
:
$$hashref
{fmin} + 1;
$stop
=
$stop
?
$stop
:
$$hashref
{fmax};
$db_id
=
$$hashref
{uniquename};
$srcf_id
=
$$hashref
{srcfeature_id};
$name
=
$$hashref
{name};
next
if
(!
defined
(
$base_start
) or !
defined
(
$stop
) or !
defined
(
$db_id
));
warn
"calling factory->segment with name:$name, start:$base_start, stop:$stop, db_id:$db_id, srcfeature_id:$srcf_id\n"
if
DEBUG;
push
@segments
,
$factory
->segment(
-name
=>
$name
,
-start
=>
$base_start
,
-stop
=>
$stop
,
-db_id
=>
$db_id
,
-feature_id
=>
$feature_id
,
-srcfeature_id
=>
$srcf_id
);
warn
"segments array in constructor:@segments"
if
DEBUG;
$base_start
=
''
;
$stop
=
''
;
$db_id
=
''
;
$strand
=
''
;
$srcf_id
=
''
;
}
$landmark_is_src_query
->finish;
$fetch_uniquename_query
->finish;
$srcfeature_query
->finish;
if
(
@segments
< 2) {
return
$segments
[0];
}
elsif
(
wantarray
) {
return
@segments
;
}
else
{
warn
"The query for $name returned multiple segments\nPlease call in a list context to get them all"
;
Bio::Root::Root->throw(
"multiple segment exception"
) ;
}
}
elsif
(
ref
$ref
eq
'SCALAR'
) {
my
$landmark_feature_id
=
$$ref
;
warn
"landmark feature_id:$landmark_feature_id"
if
DEBUG;
$srcfeature_query
->execute(
$landmark_feature_id
)
or Bio::Root::Root->throw(
"finding srcfeature_id failed"
);
my
$hash_ref
=
$srcfeature_query
->fetchrow_hashref;
my
$srcfeature_id
=
$$hash_ref
{
'srcfeature_id'
}
?
$$hash_ref
{
'srcfeature_id'
}
:
$landmark_feature_id
;
warn
"srcfeature_id:$srcfeature_id"
if
DEBUG;
$factory
->refclass_feature_id(
$srcfeature_id
)
unless
defined
(
$target
);
if
(
$landmark_feature_id
==
$srcfeature_id
) {
$landmark_is_src_query
->execute(
$landmark_feature_id
)
or Bio::Root::Root->throw(
"something else failed"
);
$hash_ref
=
$landmark_is_src_query
->fetchrow_hashref;
warn
"skipping feature_id $$hash_ref{feature_id}"
if
(DEBUG and
$$hash_ref
{
'is_obsolete'
} and
!
$self
->factory->allow_obsolete);
next
if
(
$$hash_ref
{
'is_obsolete'
} and !
$self
->factory->allow_obsolete);
$name
=
$$hash_ref
{
'name'
};
my
$length
=
$$hash_ref
{
'seqlen'
};
my
$type
=
$factory
->term2name(
$$hash_ref
{
'type_id'
} );
if
(
$$hash_ref
{
'fmin'
} ) {
$interbase_start
=
$$hash_ref
{
'fmin'
};
$base_start
=
$interbase_start
+ 1;
$stop
=
$$hash_ref
{
'fmax'
};
$strand
=
$$hash_ref
{
'strand'
};
}
warn
"base_start:$base_start, stop:$stop, length:$length"
if
DEBUG;
if
(
defined
(
$interbase_start
) and
$interbase_start
< 0) {
$self
->
warn
(
"start value ($interbase_start) less than zero,"
.
" resetting to zero"
)
if
DEBUG;
$base_start
= 1;
$interbase_start
= 0;
}
if
(
defined
(
$stop
) and
defined
(
$length
) and
$stop
>
$length
){
$self
->
warn
(
"end value ($stop) greater than length ($length),"
.
" truncating to $length"
)
if
DEBUG;
$stop
=
$length
;
}
$stop
=
$stop
?
int
(
$stop
) :
$length
;
$length
=
$stop
-
$interbase_start
;
warn
"base_start:$base_start, stop:$stop, length:$length"
if
DEBUG;
$self
->start(
$base_start
);
$self
->end(
$stop
);
$self
->{
'length'
} =
$length
;
$self
->{
'srcfeature_id'
} =
$srcfeature_id
;
$self
->class(
$type
);
$self
->name(
$name
);
$self
->strand(
$strand
);
my
$source
=
$self
->source();
my
$type_obj
= Bio::DB::GFF::Typename->new(
$type
,
$source
);
$self
->type(
$type_obj
);
$fetch_uniquename_query
->finish;
$srcfeature_query
->finish;
$landmark_is_src_query
->finish;
return
$self
;
}
else
{
warn
$landmark_feature_id
if
DEBUG;
warn
$factory
,
$base_start
,
$stop
,
$strand
if
DEBUG;
$fetch_uniquename_query
->execute(
$landmark_feature_id
);
my
$resultref
=
$fetch_uniquename_query
->fetchrow_hashref;
warn
Dumper(
$resultref
)
if
DEBUG;
$base_start
=
$$resultref
{
'fmin'
} +1;
$stop
=
$$resultref
{
'fmax'
};
$strand
=
$$resultref
{
'strand'
};
warn
"after fetching coord info: $base_start, $stop, $strand"
if
DEBUG;
my
(
$feat
) =
$self
->features(
-feature_id
=>
$landmark_feature_id
,
-factory
=>
$factory
,
-start
=>
$base_start
,
-stop
=>
$stop
,
-strand
=>
$strand
, );
$fetch_uniquename_query
->finish;
$srcfeature_query
->finish;
$landmark_is_src_query
->finish;
return
$feat
;
}
}
else
{
$fetch_uniquename_query
->finish;
$landmark_is_src_query
->finish;
$srcfeature_query
->finish;
warn
"no segment found"
if
DEBUG;
return
;
}
}
Hide Show 11 lines of Pod
sub
name {
my
$self
=
shift
;
return
undef
unless
ref
$self
;
return
$self
->{
'name'
}
}
Hide Show 11 lines of Pod
sub
feature_id {
my
$self
=
shift
;
return
$self
->{
'feature_id'
} =
shift
if
@_
;
return
$self
->{
'feature_id'
};
}
*primary_id
= \
&feature_id
;
Hide Show 14 lines of Pod
sub
strand {
my
$self
=
shift
;
return
$self
->{
'strand'
} =
shift
if
@_
;
return
$self
->{
'strand'
} || 0;
}
*abs_strand
= \
&strand
;
Hide Show 13 lines of Pod
sub
attributes {
my
$self
=
shift
;
my
$factory
=
$self
->factory;
defined
(
my
$id
=
$self
->id) or
return
;
$factory
->attributes(
$id
,
@_
);
}
Hide Show 11 lines of Pod
sub
_search_by_name {
my
$self
=
shift
;
my
(
$factory
,
$quoted_name
,
$db_id
,
$feature_id
) =
@_
;
warn
"_search_by_name args:@_"
if
DEBUG;
my
$obsolete_part
=
""
;
$obsolete_part
=
" and is_obsolete = false "
unless
$self
->factory->allow_obsolete;
$obsolete_part
.=
" and organism_id = "
.
$self
->factory->organism_id
if
$self
->factory->organism_id;
my
$sth
;
if
(
$feature_id
) {
$sth
=
$factory
->dbh->prepare("
select
name,feature_id,seqlen from feature
where feature_id =
$feature_id
$obsolete_part
");
}
elsif
(
$db_id
) {
$sth
=
$factory
->dbh->prepare ("
select
name,feature_id,seqlen from feature
where uniquename = \'
$db_id
\'
$obsolete_part
");
}
else
{
$sth
=
$factory
->dbh->prepare ("
select
name,feature_id,seqlen from feature
where lower(name) =
$quoted_name
$obsolete_part
");
}
$sth
->execute or Bio::Root::Root->throw(
"unable to validate name/length"
);
my
$where_part
=
''
;
$where_part
=
" and f.organism_id = "
.
$self
->factory->organism_id
if
$self
->factory->organism_id;
$where_part
.=
" and f.is_obsolete = 'false' "
unless
$self
->factory->allow_obsolete;
my
$rows_returned
=
$sth
->rows;
if
(
$rows_returned
== 0) {
warn
"looking for a synonym to $quoted_name"
if
DEBUG;
my
$isth
;
if
(
$self
->factory->use_all_feature_names()) {
$isth
=
$factory
->dbh->prepare ("
select
afn.feature_id from all_feature_names afn, feature f
where afn.feature_id = f.feature_id and
f.is_obsolete =
'false'
and
lower(afn.name) =
$quoted_name
$where_part
");
}
else
{
$isth
=
$factory
->dbh->prepare ("
select
fs.feature_id from feature_synonym fs, synonym s, feature f
where fs.synonym_id = s.synonym_id and
f.feature_id = fs.feature_id and
f.is_obsolete =
'false'
and
lower(s.synonym_sgml) =
$quoted_name
$where_part
");
}
$isth
->execute or Bio::Root::Root->throw(
"query for name in synonym failed"
);
$rows_returned
=
$isth
->rows;
if
(
$rows_returned
== 0) {
warn
"looking in dbxref for $quoted_name"
if
DEBUG;
$isth
=
$factory
->dbh->prepare ("
select
fd.feature_id from feature_dbxref fd, dbxref d, feature f
where fd.dbxref_id = d.dbxref_id and
f.feature_id = fd.feature_id and
f.is_obsolete =
'false'
and
lower(d.accession) =
$quoted_name
$where_part
");
$isth
->execute or Bio::Root::Root->throw(
"query for accession failed"
);
$rows_returned
=
$isth
->rows;
$sth
->finish;
$isth
->finish;
return
if
$rows_returned
== 0;
if
(
$rows_returned
== 1) {
my
$hashref
=
$isth
->fetchrow_hashref;
my
$feature_id
=
$$hashref
{
'feature_id'
};
$sth
->finish;
$isth
->finish;
return
\
$feature_id
;
}
else
{
my
@feature_ids
;
while
(
my
$hashref
=
$isth
->fetchrow_hashref) {
push
@feature_ids
,
$$hashref
{
'feature_id'
};
}
$sth
->finish;
$isth
->finish;
return
\
@feature_ids
;
}
}
elsif
(
$rows_returned
== 1) {
my
$hashref
=
$isth
->fetchrow_hashref;
my
$feature_id
=
$$hashref
{
'feature_id'
};
warn
"found $feature_id in feature_synonym"
if
DEBUG;
$sth
->finish;
$isth
->finish;
return
\
$feature_id
;
}
else
{
my
@feature_ids
;
while
(
my
$hashref
=
$isth
->fetchrow_hashref) {
push
@feature_ids
,
$$hashref
{
'feature_id'
};
}
$sth
->finish;
$isth
->finish;
return
\
@feature_ids
;
}
}
elsif
(
$rows_returned
== 1) {
my
$hashref
=
$sth
->fetchrow_hashref;
my
$feature_id
=
$$hashref
{
'feature_id'
};
warn
"feature_id in _search_by_name:$feature_id"
if
DEBUG;
$sth
->finish;
return
\
$feature_id
;
}
else
{
my
@feature_ids
;
while
(
my
$hashref
=
$sth
->fetchrow_hashref) {
warn
"feature_ids in _search_by_name$$hashref{'feature_id'}"
if
DEBUG;
push
@feature_ids
,
$$hashref
{
'feature_id'
};
}
$sth
->finish;
return
\
@feature_ids
;
}
}
Hide Show 11 lines of Pod
sub
class {
my
$self
=
shift
;
return
$self
->{
'class'
} =
shift
if
@_
;
return
$self
->{
'class'
};
}
Hide Show 11 lines of Pod
sub
type {
my
$self
=
shift
;
return
$self
->{
'type'
} =
shift
if
@_
;
return
$self
->{
'type'
};
}
Hide Show 11 lines of Pod
*seq_id
= \
&name
;
Hide Show 11 lines of Pod
sub
start {
my
$self
=
shift
;
return
undef
unless
ref
$self
;
return
$self
->{
'start'
} =
shift
if
@_
;
return
$self
->{
'start'
}
if
$self
->{
'start'
};
return
undef
;
}
Hide Show 13 lines of Pod
*low
= \
&start
;
Hide Show 11 lines of Pod
sub
end {
my
$self
=
shift
;
return
undef
unless
ref
$self
;
return
$self
->{
'end'
} =
shift
if
@_
;
return
$self
->{
'end'
}
if
$self
->{
'end'
};
return
undef
;
}
Hide Show 13 lines of Pod
*high
= \
&end
;
Hide Show 13 lines of Pod
*stop
= \
&end
;
Hide Show 13 lines of Pod
sub
length
{
shift
->{
length
} }
Hide Show 65 lines of Pod
sub
features {
my
$self
=
shift
;
warn
"Segment->features() args:@_"
if
DEBUG;
my
@sub_args
=
@_
;
my
(
$factory
,
$feature_id
);
if
(
ref
(
$self
) &&
$self
->factory->do2Level) {
return
$self
->_features2level(
@sub_args
);
}
else
{
if
(
$sub_args
[0] and
$sub_args
[0] =~ /^-/) {
my
%args
=
@_
;
$factory
=
$args
{-factory}
if
(
$args
{-factory});
$feature_id
=
$args
{-feature_id}
if
(
$args
{-feature_id});
}
}
my
(
$types
,
$type_placeholder
,
$attributes
,
$rangetype
,
$iterator
,
$callback
,
$base_start
,
$stop
,
$seq_id
,
$end
);
if
(
ref
(
$self
) and
$sub_args
[0] and
$sub_args
[0] =~ /^-/) {
(
$types
,
$type_placeholder
,
$attributes
,
$rangetype
,
$iterator
,
$callback
,
$base_start
,
$stop
,
$seq_id
,
$end
) =
$self
->_rearrange([
qw(TYPES
TYPE
ATTRIBUTES
RANGETYPE
ITERATOR
CALLBACK
START
STOP
SEQ_ID
END )
],
@sub_args
);
warn
"type and types after calling _rearrange:$type_placeholder,$types"
if
DEBUG;
}
elsif
(
defined
$factory
and
$sub_args
[0] and
$sub_args
[0] =~ /^-/) {
(
$types
,
$type_placeholder
,
$attributes
,
$rangetype
,
$iterator
,
$callback
,
$base_start
,
$stop
,
$seq_id
,
$end
) =
$factory
->_rearrange([
qw(TYPES
TYPE
ATTRIBUTES
RANGETYPE
ITERATOR
CALLBACK
START
STOP
SEQ_ID
END )
],
@sub_args
);
warn
"type and types after calling factory->_rearrange:$type_placeholder,$types"
if
DEBUG;
}
else
{
warn
"didn't call rearrange"
if
DEBUG;
$types
= \
@sub_args
;
}
if
(
$type_placeholder
and !
$types
) {
if
(
ref
$type_placeholder
eq
'ARRAY'
) {
$types
=
$type_placeholder
;
}
else
{
$$types
[0] =
$type_placeholder
;
}
warn
"what sort of thing is type_placeholder?:"
.
ref
$type_placeholder
if
DEBUG;
}
warn
"@$types\n"
if
(
defined
$types
and DEBUG);
warn
$factory
if
DEBUG;
$factory
||=
$self
->factory();
my
$feat
= Bio::DB::Das::Chado::Segment::Feature->new();
my
@features
;
my
(
$interbase_start
,
$rend
,
$srcfeature_id
,
$sql_types
);
if
(!
$feature_id
) {
$rangetype
||=
'overlaps'
;
$base_start
=
defined
$base_start
?
$base_start
:
$self
->start;
$interbase_start
=
$base_start
-1;
$end
||=
$stop
;
$rend
=
defined
$end
?
$end
:
$self
->end;
$sql_types
=
''
;
my
$valid_type
=
undef
;
if
(
$types
&&
scalar
@$types
!= 0) {
warn
"first type:$$types[0]\n"
if
DEBUG;
if
(
ref
$$types
[0] eq
'ARRAY'
) {
@$types
= @{
$$types
[0]};
warn
"first type after deref:$$types[0]\n"
if
DEBUG;
}
my
$temp_type
=
$$types
[0];
my
$temp_source
=
''
;
if
(
$$types
[0] =~ /(.*):(.*)/) {
$temp_type
= $1;
$temp_source
= $2;
}
$valid_type
=
$factory
->name2term(
$temp_type
);
$self
->throw(
"feature type: '$temp_type' is not recognized"
)
unless
$valid_type
;
my
$temp_dbxref
=
$factory
->source2dbxref(
$temp_source
);
if
(
$temp_source
&&
$temp_dbxref
) {
$sql_types
.=
"((f.type_id = $valid_type and fd.dbxref_id = $temp_dbxref)"
;
}
else
{
$sql_types
.=
"((f.type_id = $valid_type)"
;
}
if
(
scalar
@$types
> 1) {
for
(
my
$i
=1;
$i
<(
scalar
@$types
);
$i
++) {
$temp_type
=
$$types
[
$i
];
$temp_source
=
''
;
if
(
$$types
[
$i
] =~ /(.*):(.*)/) {
$temp_type
= $1;
$temp_source
= $2;
}
warn
"more types:$$types[$i]\n"
if
DEBUG;
$valid_type
=
$factory
->name2term(
$temp_type
);
$self
->throw(
"feature type: '$temp_type' is not recognized"
)
unless
$valid_type
;
$temp_dbxref
=
$factory
->source2dbxref(
$temp_source
);
if
(
$temp_source
&&
$temp_dbxref
) {
$sql_types
.=
" OR \n (f.type_id = $valid_type and fd.dbxref_id = $temp_dbxref)"
;
}
else
{
$sql_types
.=
" OR \n (f.type_id = $valid_type)"
;
}
}
}
$sql_types
.=
") "
;
}
$srcfeature_id
=
$self
->{srcfeature_id}
if
ref
$self
;
if
(!
$srcfeature_id
&&
defined
(
$seq_id
)) {
my
$srcfeature_query
=
"SELECT feature_id FROM feature where lower(uniquename) = ? "
;
$srcfeature_query
.=
"and organism_id = "
.
$factory
->organism_id
if
$factory
->organism_id;
my
$srcf_query_handle
=
$factory
->dbh->prepare(
$srcfeature_query
);
$srcf_query_handle
->execute(
lc
(
$seq_id
));
(
$srcfeature_id
) =
$srcf_query_handle
->fetchrow_array;
warn
"found srcfeature_id:$srcfeature_id"
if
DEBUG;
}
}
my
$select_part
=
"select distinct f.name,fl.fmin,fl.fmax,fl.strand,fl.phase,"
.
"fl.locgroup,fl.srcfeature_id,f.type_id,f.uniquename,"
.
"f.feature_id, af.significance as score, "
.
"fd.dbxref_id,f.is_obsolete "
;
my
$order_by
=
"order by f.type_id,fl.fmin "
;
warn
$feature_id
if
DEBUG;
my
$where_part
;
my
$from_part
;
if
(
$feature_id
) {
$from_part
=
"from (feature f join featureloc fl ON (f.feature_id = fl.feature_id)) "
."left
join
feature_dbxref fd ON (f.feature_id = fd.feature_id
AND fd.dbxref_id in (
select
dbxref_id from dbxref where db_id=
".$factory->gff_source_db_id."
)) "
.
"left join analysisfeature af ON (f.feature_id = af.feature_id)"
;
$where_part
=
"where f.feature_id = $feature_id and fl.rank=0 "
;
my
$refclass
=
$factory
->name2term(
$factory
->default_class());
my
$refclass_feature_id
=
$factory
->refclass_feature_id() ||
undef
;
if
(
defined
(
$refclass_feature_id
) and
defined
(
$srcfeature_id
)){
$where_part
.=
" and fl.srcfeature_id = $refclass_feature_id "
;
}
elsif
(
$refclass
){
my
$srcquery
=
"select srcfeature_id "
;
$srcquery
.=
"from featureloc fl join feature f on (fl.srcfeature_id = f.feature_id) "
;
$srcquery
.=
"where fl.feature_id = ? and f.type_id = ?"
;
my
$sth
=
$factory
->dbh->prepare(
$srcquery
);
$sth
->execute(
$feature_id
,
$refclass
) or
$self
->throw(
"refclass_srcfeature query failed"
);
my
$hashref
=
$sth
->fetchrow_hashref();
my
$srcfeature_id
=
$hashref
->{srcfeature_id} ||
undef
;
$where_part
.=
" and fl.srcfeature_id = $srcfeature_id "
if
(
defined
(
$srcfeature_id
));
$sth
->finish;
}
}
else
{
my
$featureslice
;
if
(
$factory
->srcfeatureslice
&&
$srcfeature_id
&&
defined
$interbase_start
&&
defined
$rend
){
$featureslice
=
"featureloc_slice($srcfeature_id,$interbase_start, $rend)"
;
warn
"using featureloc_slice"
if
DEBUG;
}
elsif
(
defined
$interbase_start
&&
defined
$rend
){
$featureslice
=
"featureslice($interbase_start, $rend)"
;
}
else
{
$featureslice
=
"featureloc"
;
}
$from_part
=
"from (feature f left join $featureslice fl ON (f.feature_id = fl.feature_id)) "
."left
join
feature_dbxref fd ON (f.feature_id = fd.feature_id
AND fd.dbxref_id in (
select
dbxref_id from dbxref where db_id=
".$factory->gff_source_db_id."
)) "
.
"left join analysisfeature af ON (f.feature_id = af.feature_id)"
;
$where_part
=
"where fl.rank=0 "
;
$where_part
.=
" and $sql_types "
if
defined
(
$sql_types
);
$where_part
.=
" and fl.srcfeature_id = $srcfeature_id "
if
defined
(
$srcfeature_id
);
}
$where_part
.=
" and f.organism_id = "
.
$self
->factory->organism_id
if
(
ref
$self
&&
$self
->factory->organism_id);
my
$query
=
"$select_part\n$from_part\n$where_part\n$order_by\n"
;
if
(
$factory
->recursivMapping && !
$feature_id
){
my
$qFrom
=
$from_part
;
$qFrom
=~ s/featureslice/recurs_featureslice/g;
$query
=
"$select_part\n$from_part\n$where_part\nUNION\n$select_part\n$qFrom\n$where_part\norder by type_id, fmin"
;
}
$query
=~ s/\s+/ /gs
if
DEBUG;
warn
$query
if
DEBUG;
$factory
->dbh->
do
(
"set enable_seqscan=0"
);
warn
"Segement->features query:$query"
if
DEBUG;
my
$feature_query
=
$factory
->dbh->prepare(
$query
);
$feature_query
->execute or
$self
->throw(
"feature query failed"
);
$factory
->dbh->
do
(
"set enable_seqscan=1"
);
if
(
$feature_query
->rows < 1
and
$sql_types
and !
defined
(
$interbase_start
)
and !
defined
(
$rend
)) {
my
$srcfeature_query
=
"SELECT f.name,f.type_id,f.uniquename,f.feature_id, fd.dbxref_id,f.is_obsolete,f.seqlen FROM feature f left join feature_dbxref fd ON (f.feature_id = fd.feature_id AND fd.dbxref_id in (select dbxref_id from dbxref where db_id=2)) WHERE $sql_types order by f.type_id"
;
warn
"srcfeature_query:$srcfeature_query"
if
DEBUG;
$feature_query
=
$factory
->dbh->prepare(
$srcfeature_query
);
$feature_query
->execute or
$self
->throw(
"srcfeature query failed"
);
}
while
(
my
$hashref
=
$feature_query
->fetchrow_hashref) {
warn
"dbstart:$$hashref{fmim}, dbstop:$$hashref{fmax}"
if
DEBUG;
warn
"start:$base_start, stop:$stop\n"
if
DEBUG;
warn
"skipping feature_id $$hashref{feature_id} because it is obsolete"
if
(DEBUG and
$$hashref
{is_obsolete} and !
$self
->factory->allow_obsolete);
next
if
(
$$hashref
{is_obsolete} and !
$self
->factory->allow_obsolete);
if
(
$feature_id
&&
defined
(
$stop
) &&
$stop
!=
$$hashref
{fmax} ) {
$stop
=
$$hashref
{fmin} +
$stop
+ 1;
}
elsif
(
defined
(
$$hashref
{seqlen})) {
$stop
=
$$hashref
{seqlen};
}
else
{
$stop
=
$$hashref
{fmax};
}
if
(
$feature_id
&&
defined
(
$base_start
) &&
defined
(
$$hashref
{fmin}) &&
$base_start
!= (
$$hashref
{fmin}+1) ) {
my
$interbase_start
=
$$hashref
{fmin} +
$base_start
- 1;
$base_start
=
$interbase_start
+ 1;
}
elsif
(
defined
(
$$hashref
{seqlen})) {
$base_start
= 1;
}
else
{
my
$interbase_start
=
$$hashref
{fmin};
$base_start
=
$interbase_start
+1;
}
warn
"base_start:$base_start, end:$stop"
if
DEBUG;
my
$source
=
$factory
->dbxref2source(
$$hashref
{dbxref_id}) ||
""
;
my
$type
= Bio::DB::GFF::Typename->new(
$factory
->term2name(
$$hashref
{type_id}),
$source
);
if
(
defined
$$hashref
{seqlen}) {
$feat
= Bio::DB::Das::Chado::Segment::Feature->new(
$factory
,
undef
,
undef
,
$base_start
,
$stop
,
$type
,
undef
,
undef
,
undef
,
$$hashref
{name},
$$hashref
{uniquename},
$$hashref
{feature_id}
);
}
else
{
$feat
= Bio::DB::Das::Chado::Segment::Feature->new(
$factory
,
$feature_id
?
undef
:
$self
,
$feature_id
?
$factory
->srcfeature2name(
$$hashref
{
'srcfeature_id'
})
:
$self
->seq_id,
$base_start
,
$stop
,
$type
,
$$hashref
{score},
$$hashref
{strand},
$$hashref
{phase},
$$hashref
{name},
$$hashref
{uniquename},
$$hashref
{feature_id});
}
push
@features
,
$feat
;
my
$fstart
=
$feat
->start()
if
DEBUG;
my
$fend
=
$feat
->end()
if
DEBUG;
}
warn
"returning @features\n"
if
DEBUG;
$feature_query
->finish;
if
(
$iterator
) {
warn
"using Bio::DB::Das::ChadoIterator\n"
if
DEBUG;
return
Bio::DB::Das::ChadoIterator->new(\
@features
)
if
@features
;
}
elsif
(
wantarray
) {
return
@features
;
}
elsif
(
@features
>0) {
return
\
@features
;
}
else
{
return
;
}
}
Hide Show 16 lines of Pod
sub
_features2level(){
my
$self
=
shift
;
warn
"Segment->_features2level() args:@_\n"
if
DEBUG;
my
(
$types
,
$type_placeholder
,
$attributes
,
$rangetype
,
$iterator
,
$callback
,
$base_start
,
$stop
,
$feature_id
,
$factory
);
if
(
$_
[0] and
$_
[0] =~ /^-/) {
(
$types
,
$type_placeholder
,
$attributes
,
$rangetype
,
$iterator
,
$callback
,
$base_start
,
$stop
,
$feature_id
,
$factory
) =
$self
->_rearrange([
qw(TYPES
TYPE
ATTRIBUTES
RANGETYPE
ITERATOR
CALLBACK
START
STOP
FEATURE_ID
FACTORY)
],
@_
);
warn
"$types\n"
if
DEBUG;
}
else
{
$types
= \
@_
;
}
if
(
$type_placeholder
and !
$types
) {
$types
=
$type_placeholder
;
}
warn
"@$types\n"
if
(
defined
$types
and DEBUG);
$factory
||=
$self
->factory();
my
$feat
= Bio::DB::Das::Chado::Segment::Feature->new();
my
@features
;
my
(
$interbase_start
,
$rend
,
$srcfeature_id
,
$sql_types
);
unless
(
$feature_id
) {
$rangetype
||=
'overlaps'
;
$base_start
=
$self
->start;
$interbase_start
=
$base_start
-1;
$rend
=
$self
->end;
$sql_types
=
''
;
my
$valid_type
=
undef
;
if
(
scalar
@$types
!= 0) {
warn
"first type:$$types[0]\n"
if
DEBUG;
my
$temp_type
=
$$types
[0];
my
$temp_source
=
''
;
if
(
$$types
[0] =~ /(.*):(.*)/) {
$temp_type
= $1;
$temp_source
= $2;
}
$valid_type
=
$factory
->name2term(
$temp_type
);
$self
->throw(
"feature type: '$temp_type' is not recognized"
)
unless
$valid_type
;
my
$temp_dbxref
=
$factory
->source2dbxref(
$temp_source
);
if
(
$temp_source
&&
$temp_dbxref
) {
$sql_types
.=
"((f.type_id = $valid_type and fd.dbxref_id = $temp_dbxref)"
;
}
else
{
$sql_types
.=
"((f.type_id = $valid_type)"
;
}
if
(
scalar
@$types
> 1) {
for
(
my
$i
=1;
$i
<(
scalar
@$types
);
$i
++) {
$temp_type
=
$$types
[
$i
];
$temp_source
=
''
;
if
(
$$types
[
$i
] =~ /(.*):(.*)/) {
$temp_type
= $1;
$temp_source
= $2;
}
warn
"more types:$$types[$i]\n"
if
DEBUG;
$valid_type
=
$factory
->name2term(
$temp_type
);
$self
->throw(
"feature type: '$temp_type' is not recognized"
)
unless
$valid_type
;
$temp_dbxref
=
$factory
->source2dbxref(
$temp_source
);
if
(
$temp_source
&&
$temp_dbxref
) {
$sql_types
.=
" OR \n (f.type_id = $valid_type and fd.dbxref_id = $temp_dbxref)"
;
}
else
{
$sql_types
.=
" OR \n (f.type_id = $valid_type)"
;
}
}
}
$sql_types
.=
") "
;
}
$srcfeature_id
=
$self
->{srcfeature_id};
}
my
$select_part
=
"select distinct f.name,fl.fmin,fl.fmax,fl.strand,fl.phase,"
.
"fl.locgroup,fl.srcfeature_id,f.type_id,f.uniquename,"
.
"f.feature_id, af.significance as score, "
.
"fd.dbxref_id,f.is_obsolete "
;
my
$order_by
=
"order by f.type_id,fl.fmin "
;
my
$where_part
;
my
$from_part
;
if
(
$feature_id
) {
$from_part
=
"from (feature f join featureloc fl ON (f.feature_id = fl.feature_id)) "
."left
join
feature_dbxref fd ON
(f.feature_id = fd.feature_id
AND fd.dbxref_id in (
select
dbxref_id from dbxref where db_id=
".$factory->gff_source_db_id."
)) "
.
"left join analysisfeature af ON (af.feature_id = f.feature_id) "
;
$where_part
=
" where f.feature_id = $feature_id and fl.rank=0 "
;
$where_part
.=
" and f.organism_id = "
.
$self
->factory->organism_id
if
$self
->factory->organism_id;
my
$refclass
=
$factory
->name2term(
$factory
->default_class());
my
$refclass_feature_id
=
$factory
->refclass_feature_id() ||
undef
;
if
(
defined
(
$refclass_feature_id
)){
$where_part
.=
" and fl.srcfeature_id = $refclass_feature_id "
;
}
elsif
(
$refclass
){
my
$srcquery
=
"select srcfeature_id "
;
$srcquery
.=
"from featureloc fl join feature f on (fl.srcfeature_id = f.feature_id) "
;
$srcquery
.=
"where fl.feature_id = ? and f.type_id = ?"
;
my
$sth
=
$factory
->dbh->prepare(
$srcquery
,
$refclass
);
$sth
->execute(
$feature_id
) or
$self
->throw(
"refclass_srcfeature query failed"
);
my
$hashref
=
$sth
->fetchrow_hashref();
my
$srcfeature_id
=
$hashref
->{srcfeature_id} ||
undef
;
$where_part
.=
" and fl.srcfeature_id = $srcfeature_id "
if
(
defined
(
$srcfeature_id
));
$sth
->finish;
}
}
else
{
my
$featureslice
;
if
(
$factory
->srcfeatureslice){
$featureslice
=
"featureloc_slice($srcfeature_id,$interbase_start, $rend)"
;
}
else
{
$featureslice
=
"featureslice($interbase_start, $rend)"
;
}
$from_part
=
"from ((feature f join $featureslice fl ON (f.feature_id = fl.feature_id)) "
."left
join
feature_dbxref fd ON
(f.feature_id = fd.feature_id
AND fd.dbxref_id in (
select
dbxref_id from dbxref where db_id=
".$factory->gff_source_db_id."
)) "
.
"left join analysisfeature af ON (af.feature_id = f.feature_id)) "
.
'left join feature_relationship fr on (f.feature_id = fr.object_id) left join feature sub_f on (sub_f.feature_id = fr.subject_id) left join featureloc sub_fl on (sub_f.feature_id=sub_fl.feature_id) '
;
$where_part
=
"where $sql_types "
.
" and fl.srcfeature_id = $srcfeature_id and fl.rank=0 "
.
' AND (fl.locgroup=sub_fl.locgroup OR sub_fl.locgroup is null) '
;
}
$select_part
.=
', sub_f.name as sname,sub_fl.fmin as sfmin,sub_fl.fmax as sfmax,sub_fl.strand as sstrand,sub_fl.phase as sphase,sub_fl.locgroup as slocgroup,sub_f.type_id as stype_id,sub_f.uniquename as suniquename,sub_f.feature_id as sfeature_id'
;
my
$query
=
"$select_part\n $from_part\n$where_part\n$order_by\n"
;
$query
=~ s/\s+/ /gs
if
DEBUG;
warn
$query
if
DEBUG;
warn
"Segement->features query:$query"
if
DEBUG;
my
$sth
=
$factory
->dbh->prepare(
$query
);
$sth
->execute or
$self
->throw(
"feature query failed"
);
while
(
my
$hashref
=
$sth
->fetchrow_hashref) {
warn
"dbstart:$$hashref{fmim}, dbstop:$$hashref{fmax}"
if
DEBUG;
warn
"start:$base_start, stop:$stop\n"
if
DEBUG;
next
if
(
$$hashref
{is_obsolete} and !
$self
->factory->allow_obsolete);
if
( !
defined
(
$feat
->feature_id) ||
$feat
->feature_id !=
$$hashref
{feature_id}) {
if
(
defined
(
$feat
->feature_id) &&
$feat
->feature_id !=
$$hashref
{feature_id}) {
push
@features
,
$feat
;
}
if
(
$feature_id
&&
defined
(
$stop
) &&
$stop
!=
$$hashref
{fmax} ) {
$stop
=
$$hashref
{fmin} +
$stop
+ 1;
}
else
{
$stop
=
$$hashref
{fmax};
}
if
(
$feature_id
&&
defined
(
$base_start
) &&
$base_start
!= (
$$hashref
{fmin}+1) ) {
my
$interbase_start
=
$$hashref
{fmin} +
$base_start
- 1;
$base_start
=
$interbase_start
+ 1;
}
else
{
my
$interbase_start
=
$$hashref
{fmin};
$base_start
=
$interbase_start
+1;
}
warn
"base_start:$base_start, end:$stop"
if
DEBUG;
my
$source
=
$factory
->dbxref2source(
$$hashref
{dbxref_id}) ||
""
;
my
$type
= Bio::DB::GFF::Typename->new(
$factory
->term2name(
$$hashref
{type_id}),
$source
);
$feat
= Bio::DB::Das::Chado::Segment::Feature->new(
$factory
,
$feature_id
?
undef
:
$self
,
$feature_id
?
$factory
->srcfeature2name(
$$hashref
{
'srcfeature_id'
})
:
$self
->seq_id,
$base_start
,
$stop
,
$type
,
$$hashref
{score},
$$hashref
{strand},
$$hashref
{phase},
$$hashref
{name},
$$hashref
{uniquename},
$$hashref
{feature_id});
print
STDERR
"Created Feature obj $$hashref{name}][[$$hashref{feature_id}][$$hashref{'srcfeature_id'}]\n"
if
DEBUG;
}
if
(
$$hashref
{sfeature_id}) {
if
(
$feature_id
&&
defined
(
$stop
) &&
$stop
!=
$$hashref
{sfmax} ) {
$stop
=
$$hashref
{sfmin} +
$stop
+ 1;
}
else
{
$stop
=
$$hashref
{fmax};
}
if
(
$feature_id
&&
defined
(
$base_start
) &&
$base_start
!= (
$$hashref
{sfmin}+1) ) {
my
$interbase_start
=
$$hashref
{sfmin} +
$base_start
- 1;
$base_start
=
$interbase_start
+ 1;
}
else
{
my
$interbase_start
=
$$hashref
{sfmin};
$base_start
=
$interbase_start
+1;
}
warn
"base_start:$base_start, end:$stop"
if
DEBUG;
my
$source
=
$factory
->dbxref2source(
$$hashref
{dbxref_id}) ||
""
;
my
$type
= Bio::DB::GFF::Typename->new(
$factory
->term2name(
$$hashref
{stype_id}),
$source
);
my
$subFeat
= Bio::DB::Das::Chado::Segment::Feature->new(
$factory
,
$feat
,
$feature_id
?
$factory
->srcfeature2name(
$$hashref
{
'srcfeature_id'
}):
$self
->seq_id,
$$hashref
{sfmin} + 1,
$$hashref
{sfmax},
$type
,
$$hashref
{score},
$$hashref
{sstrand},
$$hashref
{sphase},
$$hashref
{sname},
$$hashref
{suniquename},
$$hashref
{sfeature_id});
$feat
->add_subfeature(
$subFeat
);
}
my
$fstart
=
$feat
->start()
if
DEBUG;
my
$fend
=
$feat
->end()
if
DEBUG;
}
if
(
@features
> 0 &&
$features
[-1]->feature_id() ne
$feat
->feature_id()){
push
@features
,
$feat
;
}
$sth
->finish;
if
(
$iterator
) {
warn
"using Bio::DB::Das::ChadoIterator\n"
if
DEBUG;
return
Bio::DB::Das::ChadoIterator->new(\
@features
)
if
@features
;
}
elsif
(
wantarray
) {
return
@features
;
}
else
{
return
\
@features
;
}
}
Hide Show 13 lines of Pod
*get_all_SeqFeature
=
*top_SeqFeatures
=
*all_SeqFeatures
= \
&features
;
sub
get_SeqFeatures {
return
}
Hide Show 13 lines of Pod
sub
dna {
my
$self
=
shift
;
my
%arg
=
@_
;
my
(
$ref
,
$class
,
$base_start
,
$stop
,
$strand
)
= @{
$self
}{
qw(sourceseq class start end strand)
};
warn
"ref:$ref, class:$class, $base_start..$stop, ($strand)\n"
if
DEBUG;
if
(
$arg
{self}){
my
$r_id
=
$self
->feature_id;
$self
->
warn
(
"FIXME: incomplete implementation of alternate sequence selection"
)
if
$self
->verbose;
my
$sth
=
$self
->factory->dbh->prepare("
select
residues from feature
where feature_id = ?");
$sth
->execute(
$r_id
) or
$self
->throw(
"seq query failed"
);
my
$array_ref
=
$sth
->fetchrow_arrayref;
my
$seq
=
$$array_ref
[0];
$sth
->finish;
return
$seq
;
}
my
$feat_id
=
$self
->{srcfeature_id};
my
$has_start
=
defined
$base_start
;
my
$has_stop
=
defined
$stop
;
my
$reversed
;
if
(
$has_start
&&
$has_stop
&&
$base_start
>
$stop
) {
$reversed
++;
(
$base_start
,
$stop
) = (
$stop
,
$base_start
);
}
elsif
(
$strand
&&
$strand
< 0 ) {
$reversed
++;
}
my
$sth
;
if
(!
$has_start
and !
$has_stop
) {
$sth
=
$self
->factory->dbh->prepare("
select
residues from feature
where feature_id =
$feat_id
");
}
elsif
(!
$has_start
) {
$sth
=
$self
->factory->dbh->prepare("
select
substring(residues
for
$stop
) from feature
where feature_id =
$feat_id
");
}
elsif
(!
$has_stop
) {
$sth
=
$self
->factory->dbh->prepare("
select
substring(residues from
$base_start
) from feature
where feature_id =
$feat_id
");
}
else
{
my
$sslen
=
$stop
-
$base_start
+1;
$sth
=
$self
->factory->dbh->prepare("
select
substring(residues from
$base_start
for
$sslen
) from feature
where feature_id =
$feat_id
");
}
$sth
->execute or
$self
->throw(
"seq query failed"
);
my
$array_ref
=
$sth
->fetchrow_arrayref;
my
$seq
=
$$array_ref
[0];
$sth
->finish;
if
(
$reversed
) {
$seq
=
reverse
$seq
;
$seq
=~
tr
/gatcGATC/ctagCTAG/;
}
return
$seq
;
}
sub
subseq {
my
$self
=
shift
;
my
(
$start
,
$stop
) =
@_
;
$start
--;
my
$dna
=
$self
->dna;
my
$length
=
$stop
-
$start
+ 1;
my
$substr
=
substr
(
$dna
,
$start
,
$length
);
my
$subseqobj
= Bio::Seq->new(
-display_id
=>
$self
->seq_id,
-seq
=>
$substr
);
return
$subseqobj
;
}
Hide Show 13 lines of Pod
sub
seq {
my
$self
=
shift
;
my
$seqobj
= Bio::Seq->new(
-display_id
=>
$self
->seq_id
.
":"
.
$self
->start
.
".."
.
$self
->end,
-seq
=>
$self
->dna,
);
return
$seqobj
;
}
*protein
= \
&dna
;
Hide Show 15 lines of Pod
sub
factory {
my
$self
=
shift
;
confess
"self is not an object"
unless
ref
$self
;
return
$self
->{factory} }
Hide Show 11 lines of Pod
sub
srcfeature_id {
my
$self
=
shift
;
return
$self
->{
'srcfeature_id'
} =
shift
if
@_
;
confess
"how did I get into srcfeature_id method"
if
(DEBUG and !
ref
$self
);
return
$self
->{
'srcfeature_id'
};
}
Hide Show 10 lines of Pod
sub
source {
my
$self
=
shift
;
my
$source
;
return
$self
->{
'source'
} =
shift
if
@_
;
return
$self
->{
'source'
}
if
defined
(
$self
->{
'source'
});
my
$query
= "SELECT dbx.accession FROM feature_dbxref fd
JOIN dbxref dbx USING (dbxref_id)
WHERE fd.feature_id = ?
AND dbx.db_id = ?";
my
$sth
=
$self
->factory->dbh->prepare(
$query
);
$sth
->execute(
$self
->feature_id,
$self
->factory->gff_source_db_id)
or
$self
->throw(
"failed to get source via query"
);
(
$source
) =
$sth
->fetchrow_array;
$sth
->finish;
return
$source
;
}
Hide Show 7 lines of Pod
*source_tag
= \
&source
;
Hide Show 11 lines of Pod
sub
alphabet {
return
'dna'
;
}
Hide Show 13 lines of Pod
*display_id
=
*display_name
=
*accession_number
= \
&name
;
sub
desc {
my
$self
=
shift
;
return
$self
->{
'desc'
}
if
defined
$self
->{
'desc'
};
my
$sth
=
$self
->factory->dbh->prepare( "
select
value from featureprop
where feature_id = ? and type_id in (
select
cvterm_id from cvterm where name =
'Note'
) ");
$sth
->execute(
$self
->feature_id );
my
$hashref
=
$sth
->fetchrow_hashref();
$sth
->finish;
return
$self
->{
'desc'
}=
$hashref
->{value};
}
sub
species {
my
$self
=
shift
;
return
$self
->{
'species'
}
if
defined
$self
->{
'species'
};
my
$sth
=
$self
->factory->dbh->prepare( "
select
genus,species from organism
where organism_id = (
select
organism_id from feature where feature_id = ?) ");
cluck
"i'm in species"
;
$sth
->execute(
$self
->srcfeature_id );
my
$hashref
=
$sth
->fetchrow_hashref();
$sth
->finish;
my
$spp
=
$hashref
->{genus}.
' '
.
$hashref
->{species};
return
$self
->{
'species'
}=
$spp
;
}
Hide Show 13 lines of Pod
sub
get_feature_stream {
my
$self
=
shift
;
my
@args
=
@_
;
warn
"get_feature_stream args: @_\n"
if
DEBUG;
my
$features
=
$self
->features(
@args
);
warn
"using get_feature_stream\n"
if
DEBUG;
warn
"feature array: $features\n"
if
DEBUG;
warn
"first feature: $$features[0]\n"
if
DEBUG;
return
Bio::DB::Das::ChadoIterator->new(
$features
)
if
$features
;
return
Bio::DB::Das::ChadoIterator->new([]);
}
*get_seq_stream
= \
&get_feature_stream
;
Hide Show 11 lines of Pod
sub
clone {
my
$self
=
shift
;
my
%h
=
%$self
;
return
bless
\
%h
,
ref
(
$self
);
}
Hide Show 11 lines of Pod
sub
sourceseq {
my
$self
=
shift
;
return
$self
->{
'sourceseq'
}
if
$self
->{
'sourceseq'
};
my
$dbh
=
$self
->factory->dbh;
my
$sourceseq_query
=
$dbh
->prepare("
select
name from feature where feature_id = ?");
$sourceseq_query
->execute(
$self
->srcfeature_id)
or
$self
->throw(
"getting sourceseq name query failed"
);
return
if
$sourceseq_query
->rows < 1;
my
$hashref
=
$sourceseq_query
->fetchrow_hashref;
$sourceseq_query
->finish;
$self
->{
'sourceseq'
} =
$$hashref
{
'name'
};
return
$self
->{
'sourceseq'
};
}
Hide Show 15 lines of Pod
*refseq
= \
&sourceseq
;
Hide Show 12 lines of Pod
*abs_ref
= \
&sourceseq
;
Hide Show 10 lines of Pod
*abs_start
= \
&start
;
Hide Show 10 lines of Pod
*abs_end
= \
&end
;
Hide Show 16 lines of Pod
sub
asString {
my
$self
=
shift
;
unless
(
ref
$self
) {
warn
"in asString with no self"
;
return
unless
ref
$self
;
}
my
$label
=
$self
->refseq;
my
$start
=
$self
->start;
my
$stop
=
$self
->stop;
return
"$label:$start,$stop"
;
}
sub
rel2abs {
shift
;
return
@_
;
}
1;