Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
31db1fdd
Commit
31db1fdd
authored
Jun 15, 2010
by
Ian Longden
Browse files
is_reference method added
parent
26f56610
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+35
-0
modules/Bio/EnsEMBL/Slice.pm
modules/Bio/EnsEMBL/Slice.pm
+20
-0
No files found.
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
View file @
31db1fdd
...
...
@@ -932,6 +932,41 @@ sub is_toplevel {
return
0
;
}
=head2 is_reference
Arg : int seq_region_id
Example : my $reference = $slice_adptor->is_reference($seq_region_id)
Description: Returns 1 if slice is a reference slice else 0
Returntype : int
Caller : Slice method is_reference
Status : At Risk
=cut
sub
is_reference
{
my
$self
=
shift
;
my
$id
=
shift
;
my
$sth
=
$self
->
prepare
(
"
SELECT at.code from seq_region_attrib sra, attrib_type at
"
.
"
WHERE sra.seq_region_id = ?
"
.
"
AND at.attrib_type_id = sra.attrib_type_id
"
.
"
AND at.code = 'non_ref'
"
);
$sth
->
bind_param
(
1
,
$id
,
SQL_INTEGER
);
$sth
->
execute
();
my
$code
;
$sth
->
bind_columns
(
\
$code
);
while
(
$sth
->
fetch
)
{
$sth
->
finish
;
return
0
;
}
$sth
->
finish
;
return
1
;
}
=head2 fetch_by_band
Title : fetch_by_band
...
...
modules/Bio/EnsEMBL/Slice.pm
View file @
31db1fdd
...
...
@@ -467,6 +467,26 @@ sub length {
return
$self
->
{'
end
'}
-
$self
->
{'
start
'}
+
1
;
}
=head2 is_reference
Arg : none
Example : my $reference = $slice->is_reference
Description: Returns 1 if slice is a reference slice else 0
Returntype : int
Caller : general
Status : At Risk
=cut
sub
is_reference
{
my
(
$self
)
=
@_
;
if
(
!
defined
(
$self
->
{'
is_reference
'})){
$self
->
{'
is_reference
'}
=
$self
->
adaptor
->
is_reference
(
$self
->
get_seq_region_id
);
}
return
$self
->
{'
is_reference
'};
}
=head2 is_toplevel
Arg : none
Example : my $top = $slice->is_toplevel
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment