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
1d5ee781
Commit
1d5ee781
authored
15 years ago
by
Daniel Rios
Browse files
Options
Downloads
Patches
Plain Diff
modified to use new_fast method in the constructor for speed purposes
parent
8b3ee83b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+50
-48
50 additions, 48 deletions
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/Slice.pm
+18
-2
18 additions, 2 deletions
modules/Bio/EnsEMBL/Slice.pm
with
68 additions
and
50 deletions
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+
50
−
48
View file @
1d5ee781
...
...
@@ -389,13 +389,14 @@ sub fetch_by_region {
}
return
Bio::EnsEMBL::
Slice
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
SEQ_REGION_NAME
=>
$seq_region_name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
START
=>
$start
,
-
END
=>
$end
,
-
STRAND
=>
$strand
,
-
ADAPTOR
=>
$self
);
Bio::EnsEMBL::
Slice
->
new_fast
({
'
coord_system
'
=>
$cs
,
'
seq_region_name
'
=>
$seq_region_name
,
'
seq_region_length
'
=>
$length
,
'
start
'
=>
$start
,
'
end
'
=>
$end
,
'
strand
'
=>
$strand
,
'
adaptor
'
=>
$self
}
);
}
## end sub fetch_by_region
...
...
@@ -506,13 +507,14 @@ sub fetch_by_seq_region_id {
}
return
Bio::EnsEMBL::
Slice
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
SEQ_REGION_NAME
=>
$name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
START
=>
$start
||
1
,
-
END
=>
$end
||
$length
,
-
STRAND
=>
$strand
||
1
,
-
ADAPTOR
=>
$self
);
Bio::EnsEMBL::
Slice
->
new_fast
({
'
coord_system
'
=>
$cs
,
'
seq_region_name
'
=>
$name
,
'
seq_region_length
'
=>
$length
,
'
start
'
=>
$start
||
1
,
'
end
'
=>
$end
||
$length
,
'
strand
'
=>
$strand
||
1
,
'
adaptor
'
=>
$self
}
);
}
## end sub fetch_by_seq_region_id
...
...
@@ -732,14 +734,14 @@ sub fetch_all {
$cache_count
++
;
}
my
$slice
=
Bio::EnsEMBL::
Slice
->
new
(
-
START
=>
1
,
-
END
=>
$length
,
-
STRAND
=>
1
,
-
SEQ_REGION_NAME
=>
$name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
COORD_SYSTEM
=>
$cs
,
-
ADAPTOR
=>
$self
);
my
$slice
=
Bio::EnsEMBL::
Slice
->
new
_fast
({
'
start
'
=>
1
,
'
end
'
=>
$length
,
'
strand
'
=>
1
,
'
seq_region_name
'
=>
$name
,
'
seq_region_length
'
=>
$length
,
'
coord_system
'
=>
$cs
,
'
adaptor
'
=>
$self
}
);
if
(
!
defined
(
$include_duplicates
)
or
!
$include_duplicates
){
# test if this slice *could* have a duplicate (exception) region
...
...
@@ -1085,14 +1087,14 @@ sub fetch_by_Feature{
$size
=
int
(
(
$
1
-
100
)
/200 * ($fend-$fstart+1) ) if( $size =~/
([
\
d
+\.
]
+
)
%/
);
#return a new slice covering the region of the feature
my
$S
=
Bio::EnsEMBL::
Slice
->
new
(
-
seq_region_name
=>
$slice
->
seq_region_name
,
-
seq_region_length
=>
$slice
->
seq_region_length
,
-
coord_system
=>
$slice
->
coord_system
,
-
start
=>
$fstart
-
$size
,
-
end
=>
$fend
+
$size
,
-
strand
=>
1
,
-
adaptor
=>
$self
);
my
$S
=
Bio::EnsEMBL::
Slice
->
new
_fast
({
'
seq_region_name
'
=>
$slice
->
seq_region_name
,
'
seq_region_length
'
=>
$slice
->
seq_region_length
,
'
coord_system
'
=>
$slice
->
coord_system
,
'
start
'
=>
$fstart
-
$size
,
'
end
'
=>
$fend
+
$size
,
'
strand
'
=>
1
,
'
adaptor
'
=>
$self
}
);
$S
->
{'
_raw_feature_strand
'}
=
$feature
->
strand
*
$slice_strand
if
$feature
->
can
('
strand
');
return
$S
;
}
...
...
@@ -1258,28 +1260,28 @@ sub fetch_normalized_slice_projection {
my
@out
;
for
my
$coord
(
@linked
)
{
if
(
$coord
->
isa
(
"
Bio::EnsEMBL::Mapper::Gap
"
))
{
my
$exc_slice
=
Bio::EnsEMBL::
Slice
->
new
(
-
START
=>
$coord
->
start
(),
-
END
=>
$coord
->
end
(),
-
STRAND
=>
$slice
->
strand
(),
-
COORD_SYSTEM
=>
$slice
->
coord_system
(),
-
ADAPTOR
=>
$self
,
-
SEQ_REGION_NAME
=>
$slice
->
seq_region_name
(),
-
SEQ_REGION_LENGTH
=>
$slice
->
seq_region_length
());
my
$exc_slice
=
Bio::EnsEMBL::
Slice
->
new
_fast
({
'
start
'
=>
$coord
->
start
(),
'
end
'
=>
$coord
->
end
(),
'
strand
'
=>
$slice
->
strand
(),
'
coord_system
'
=>
$slice
->
coord_system
(),
'
adaptor
'
=>
$self
,
'
seq_region_name
'
=>
$slice
->
seq_region_name
(),
'
seq_region_length
'
=>
$slice
->
seq_region_length
()
}
);
push
(
@out
,
bless
(
[
$rel_start
,
$coord
->
length
()
+
$rel_start
-
1
,
$exc_slice
],
"
Bio::EnsEMBL::ProjectionSegment
")
);
}
else
{
my
$exc_slice
=
$self
->
fetch_by_seq_region_id
(
$coord
->
id
()
);
my
$exc2_slice
=
Bio::EnsEMBL::
Slice
->
new
(
-
START
=>
$coord
->
start
(),
-
END
=>
$coord
->
end
(),
-
STRAND
=>
$coord
->
strand
(),
-
SEQ_REGION_NAME
=>
$exc_slice
->
seq_region_name
(),
-
SEQ_REGION_LENGTH
=>
$exc_slice
->
seq_region_length
(),
-
COORD_SYSTEM
=>
$exc_slice
->
coord_system
(),
-
ADAPTOR
=>
$self
);
my
$exc2_slice
=
Bio::EnsEMBL::
Slice
->
new
_fast
({
'
start
'
=>
$coord
->
start
(),
'
end
'
=>
$coord
->
end
(),
'
strand
'
=>
$coord
->
strand
(),
'
seq_region_name
'
=>
$exc_slice
->
seq_region_name
(),
'
seq_region_length
'
=>
$exc_slice
->
seq_region_length
(),
'
coord_system
'
=>
$exc_slice
->
coord_system
(),
'
adaptor
'
=>
$self
}
);
push
(
@out
,
bless
(
[
$rel_start
,
$coord
->
length
()
+
$rel_start
-
1
,
$exc2_slice
],
"
Bio::EnsEMBL::ProjectionSegment
")
);
...
...
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Slice.pm
+
18
−
2
View file @
1d5ee781
...
...
@@ -194,6 +194,23 @@ sub new {
'
adaptor
'
=>
$adaptor
},
$class
;
}
=head2 new_fast
Arg [1] : hashref to be blessed
Description: Construct a new Bio::EnsEMBL::Slice using the hashref.
Exceptions : none
Returntype : Bio::EnsEMBL::Slice
Caller : general
Status : Stable
=cut
sub
new_fast
{
my
$class
=
shift
;
my
$hashref
=
shift
;
return
bless
$hashref
,
$class
;
}
=head2 adaptor
...
...
@@ -782,8 +799,7 @@ sub project {
# trim off regions which are not defined
return
$self
->
_constrain_to_region
();
}
#create slices for the mapped-to coord system
#create slices for the mapped-to coord system
my
$slice
=
$slice_adaptor
->
fetch_by_seq_region_id
(
$coord
->
id
(),
$coord_start
,
...
...
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