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
23e62527
Commit
23e62527
authored
20 years ago
by
Daniel Rios
Browse files
Options
Downloads
Patches
Plain Diff
Modified methods to get SNPs to allow backwards compatibility
parent
d7a23a20
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
+28
-41
28 additions, 41 deletions
modules/Bio/EnsEMBL/Slice.pm
with
28 additions
and
41 deletions
modules/Bio/EnsEMBL/Slice.pm
+
28
−
41
View file @
23e62527
...
...
@@ -71,6 +71,7 @@ use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
use
Bio::EnsEMBL::
ProjectionSegment
;
use
Bio::EnsEMBL::
Registry
;
my
$reg
=
"
Bio::EnsEMBL::Registry
";
# inheritance to Bio::EnsEMBL::Root will eventually be removed
...
...
@@ -1346,34 +1347,29 @@ sub get_all_genotyped_VariationFeatures{
}
}
=head2 get_all_SNPs
Args : none
Function : returns all SNPs on this slice. This function will only work
correctly if the SNP database or the lite database has been
attached to the core database. This can been done through
a call to DBAdaptor::add_db_adaptor.
Returntype: listref of Bio::EnsEMBL::External::Variation
Exceptions: none
Caller : contigview, snpview
Description: DEPRECATED. Use get_all_VariationFeatures insted
=cut
sub
get_all_SNPs
{
my
$self
=
shift
;
my
$snpa
;
if
(
!
$self
->
adaptor
())
{
warning
('
Cannot get SNPs without attached adaptor
');
return
[]
;
}
deprecate
('
Use get_all_VariationFeatures() instead.
');
my
$db
=
$self
->
adaptor
()
->
db
();
if
(
defined
(
$db
)){
$snpa
=
$reg
->
get_adaptor
(
$db
->
species
(),
$db
->
group
(),
"
SNP
"
);
}
if
(
$snpa
)
{
return
$snpa
->
fetch_all_by_Slice
(
$self
);
my
$snps
;
my
$vf
=
$self
->
get_all_genotyped_VariationFeatures
();
if
(
$vf
->
[
0
]
)
{
#necessary to convert the VariationFeatures into SNP objects
foreach
my
$variation_feature
(
@
{
$vf
}){
push
@
{
$snps
},
$variation_feature
->
convert_to_SNP
();
}
return
$snps
;
}
else
{
return
[]
;
}
...
...
@@ -1381,42 +1377,33 @@ sub get_all_SNPs {
=head2 get_all_genotyped_SNPs
Args : none
Function : returns all genotyped SNPs on this slice. This function will
only work correctly if the SNP database or the lite database has
been attached to the core database. This can been done through
a call to DBAdaptor::add_db_adaptor.
Returntype: listref of Bio::EnsEMBL::External::Variation
Exceptions: none
Caller : contigview, snpview, ldview
Description : DEPRECATED. Use get_all_genotyped_VariationFeatures insted
=cut
sub
get_all_genotyped_SNPs
{
my
$self
=
shift
;
my
$snpa
=
$self
->
adaptor
()
->
db
()
->
get_SNPAdaptor
();
if
(
$snpa
)
{
return
$snpa
->
fetch_genotyped_by_Slice
(
$self
);
deprecate
("
Use get_all_genotyped_VariationFeatures instead
");
my
$vf
=
$self
->
get_all_genotyped_VariationFeatures
;
my
$snps
;
if
(
$vf
->
[
0
]){
foreach
my
$variation_feature
(
@
{
$vf
}){
push
@
{
$snps
},
$variation_feature
->
convert_to_SNP
();
}
return
$snps
;
}
else
{
return
[]
;
return
[]
;
}
}
sub
get_all_SNPs_transcripts
{
my
$self
=
shift
;
if
(
!
$self
->
adaptor
())
{
warning
('
Cannot get SNPs without attached adaptor
');
return
[]
;
}
deprecate
("
DEPRECATED
");
return
[]
;
my
$snpa
=
$self
->
adaptor
()
->
db
()
->
get_SNPAdaptor
();
if
(
$snpa
)
{
return
$snpa
->
fetch_all_by_Slice_transcript_ids
(
$self
,
@
_
);
}
else
{
return
[]
;
}
}
...
...
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