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
7ed68160
Commit
7ed68160
authored
16 years ago
by
Daniel Rios
Browse files
Options
Downloads
Patches
Plain Diff
code to get LRG from database and store in a MappedSliceContainer
parent
b365a33e
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/DBSQL/AssemblySliceAdaptor.pm
+71
-1
71 additions, 1 deletion
modules/Bio/EnsEMBL/DBSQL/AssemblySliceAdaptor.pm
with
71 additions
and
1 deletion
modules/Bio/EnsEMBL/DBSQL/AssemblySliceAdaptor.pm
+
71
−
1
View file @
7ed68160
...
...
@@ -131,7 +131,7 @@ sub fetch_by_version {
my
$mapped_slice
=
Bio::EnsEMBL::
MappedSlice
->
new
(
-
ADAPTOR
=>
$self
,
-
CONTAINER
=>
$container
,
-
NAME
=>
$slice
->
name
.
"
:
mapped_
$version
",
-
NAME
=>
$slice
->
name
.
"
\
#
mapped_
$version
",
);
my
$cs_name
=
$slice
->
coord_system_name
;
...
...
@@ -162,5 +162,75 @@ sub fetch_by_version {
}
=head2 fetch_by_name
Arg[1] : Bio::EnsEMBL::MappedSliceContainer $container - the container
to attach MappedSlices to
Arg[2] : String $name - the assembly name to fetch
Arg[3] : (optional) String $version -- the version for the new assembly
Example : my ($mapped_slice) = @{ $msc->fetch_by_name('LRG1','1') };
Description : Creates a MappedSlice representing an alternative assembly
version of the container's reference slice.
Return type : listref of Bio::EnsEMBL::MappedSlice
Exceptions : thrown on wrong or missing arguments
Caller : general, Bio::EnsEMBL::MappedSliceContainer
Status : At Risk
: under development
=cut
sub
fetch_by_name
{
my
$self
=
shift
;
my
$container
=
shift
;
my
$name
=
shift
;
my
$version
=
shift
;
# arguement check
unless
(
$container
and
ref
(
$container
)
and
$container
->
isa
('
Bio::EnsEMBL::MappedSliceContainer
'))
{
throw
("
Need a MappedSliceContainer.
");
}
unless
(
$name
)
{
throw
("
Need an assembly name.
");
}
$version
||=
'';
my
$slice
=
$container
->
ref_slice
;
# project slice onto other assembly and construct MappedSlice for result
my
$mapped_slice
=
Bio::EnsEMBL::
MappedSlice
->
new
(
-
ADAPTOR
=>
$self
,
-
CONTAINER
=>
$container
,
-
NAME
=>
$slice
->
name
.
"
\
#mapped_
$name
:
$version
",
);
foreach
my
$seg
(
@
{
$slice
->
project
(
$name
,
$version
)
})
{
my
$proj_slice
=
$seg
->
to_Slice
;
# create a Mapper to map to/from the mapped_slice artificial coord system
my
$mapper
=
Bio::EnsEMBL::
Mapper
->
new
('
mapped_slice
',
'
native_slice
');
# tell the mapper how to map this segment
$mapper
->
add_map_coordinates
(
'
mapped_slice
',
$seg
->
from_start
,
$seg
->
from_end
,
(
$slice
->
strand
*
$proj_slice
->
strand
),
$proj_slice
->
seq_region_name
,
$proj_slice
->
start
,
$proj_slice
->
end
);
# add the Slice/Mapper pair to the MappedSlice
$mapped_slice
->
add_Slice_Mapper_pair
(
$proj_slice
,
$mapper
);
}
return
[
$mapped_slice
];
}
1
;
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