Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
40145c7d
Commit
40145c7d
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
Added seq_region_length attribute
parent
a5d38a9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Slice.pm
+46
-17
46 additions, 17 deletions
modules/Bio/EnsEMBL/Slice.pm
with
46 additions
and
17 deletions
modules/Bio/EnsEMBL/Slice.pm
+
46
−
17
View file @
40145c7d
...
...
@@ -90,6 +90,7 @@ use Bio::EnsEMBL::RepeatMaskedSlice;
-end => 10000,
-strand => 1,
-seq_region_name => 'X',
-seq_region_length => 12e6,
-adaptor => $slice_adaptor);
Description: Creates a new slice object. A slice represents a region
of sequence in a particular coordinate system. Slices can be
...
...
@@ -116,9 +117,9 @@ sub new {
#new can be called as a class or object method
my
$class
=
ref
(
$caller
)
||
$caller
;
my
(
$seq
,
$coord_system
,
$seq_region_name
,
my
(
$seq
,
$coord_system
,
$seq_region_name
,
$seq_region_length
,
$start
,
$end
,
$strand
,
$adaptor
,
$empty
)
=
rearrange
([
qw(SEQ COORD_SYSTEM SEQ_REGION_NAME
rearrange
([
qw(SEQ COORD_SYSTEM SEQ_REGION_NAME
SEQ_REGION_LENGTH
START END STRAND ADAPTOR EMPTY)
],
@
_
);
#empty is only for backwards compatibility
...
...
@@ -133,6 +134,14 @@ sub new {
defined
(
$end
)
||
throw
('
END argument is required
');
(
$start
<=
$end
)
||
throw
('
start must be less than or equal to end
');
if
(
!
defined
(
$seq_region_length
))
{
warning
("
SEQ_REGION_LENGTH argument not provided.
\n
Using end of Slice
"
.
"
which may not be correct.
");
$seq_region_length
=
$end
;
}
else
{
throw
('
SEQ_REGION_LENGTH must be > 0
')
if
(
$seq_region_length
<
1
);
}
if
(
$seq
&&
length
(
$seq
)
!=
(
$end
-
$start
+
1
)){
throw
('
SEQ must be the same length as the defined LENGTH not
'
.
length
(
$seq
)
.
'
compared to
'
.
(
$end
-
$start
+
1
));
...
...
@@ -155,13 +164,14 @@ sub new {
}
}
return
bless
{'
coord_system
'
=>
$coord_system
,
'
seq
'
=>
$seq
,
'
seq_region_name
'
=>
$seq_region_name
,
'
start
'
=>
$start
,
'
end
'
=>
$end
,
'
strand
'
=>
$strand
,
'
adaptor
'
=>
$adaptor
},
$class
;
return
bless
{'
coord_system
'
=>
$coord_system
,
'
seq
'
=>
$seq
,
'
seq_region_name
'
=>
$seq_region_name
,
'
seq_region_length
'
=>
$seq_region_length
,
'
start
'
=>
$start
,
'
end
'
=>
$end
,
'
strand
'
=>
$strand
,
'
adaptor
'
=>
$adaptor
},
$class
;
}
...
...
@@ -199,7 +209,7 @@ sub adaptor{
=head2 seq_region_name
Arg [1] : none
Example : $seq_region = $slice->seq_region_name;
Example : $seq_region = $slice->seq_region_name
()
;
Description: Returns the name of the seq_region that this slice is on. For
example if this slice is in chromosomal coordinates the
seq_region_name might be 'X' or '10'.
...
...
@@ -220,6 +230,25 @@ sub seq_region_name {
=head2 seq_region_length
Arg [1] : none
Example : $seq_region_length = $slice->seq_region_length();
Description: Returns the length of the entire seq_region that this slice is
on. For example if this slice is on a chromosome this will be
the length (in basepairs) of the entire chromosome.
Returntype : int
Exceptions : none
Caller : general
=cut
sub
seq_region_length
{
my
$self
=
shift
;
return
$self
->
{'
seq_region_length
'};
}
=head2 coord_system
Arg [1] : none
...
...
@@ -643,13 +672,12 @@ sub project {
#skip gaps
if
(
$coord
->
isa
('
Bio::EnsEMBL::Mapper::Coordinate
'))
{
#create slices for the mapped-to coord system
my
$slice
=
$self
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
START
=>
$coord_start
,
-
END
=>
$coord_end
,
-
STRAND
=>
$coord
->
strand
(),
-
SEQ_REGION_NAME
=>
$coord
->
id
(),
-
ADAPTOR
=>
$self
->
adaptor
());
my
$slice
=
$slice_adaptor
->
fetch_by_region
(
$cs
->
name
(),
$coord
->
id
(),
$coord_start
,
$coord_end
,
$coord
->
strand
(),
$cs
->
version
());
my
$current_end
=
$current_start
+
$length
-
1
;
...
...
@@ -1223,6 +1251,7 @@ sub get_repeatmasked_seq {
-
ADAPTOR
=>
$self
->
{'
adaptor
'},
-
SEQ
=>
$self
->
{'
seq
'},
-
SEQ_REGION_NAME
=>
$self
->
{'
seq_region_name
'},
-
SEQ_REGION_LENGTH
=>
$self
->
{'
seq_region_length
'},
-
COORD_SYSTEM
=>
$self
->
{'
coord_system
'},
-
REPEAT_MASK
=>
$logic_names
,
-
SOFT_MASK
=>
$soft_mask
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment