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
06394b55
Commit
06394b55
authored
11 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Changed check on method translate arguments, bits of documentation and
exception message.
parent
cd2b0782
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/Utils/SequenceOntologyMapper.pm
+7
-9
7 additions, 9 deletions
modules/Bio/EnsEMBL/Utils/SequenceOntologyMapper.pm
with
7 additions
and
9 deletions
modules/Bio/EnsEMBL/Utils/SequenceOntologyMapper.pm
+
7
−
9
View file @
06394b55
...
...
@@ -52,7 +52,7 @@ use Bio::EnsEMBL::Utils::Exception;
Constructor
Arg [1] : OntologyTermAdaptor from the EnsEMBL registry
Returntype : Bio::EnsEMBL::SequenceOntologyMapper
Exceptions : If no ontology term adaptor is
giv
en
Exceptions : If no ontology term adaptor is
passed as argum
en
t
=cut
...
...
@@ -92,7 +92,8 @@ sub new {
=head2 translate
Arg [0] : Instance of Bio::EnsEMBL::Feature subclass
Arg [0] : Instance of Bio::EnsEMBL::Feature, subclass or
related Storable
Description: Translates a Feature type into an SO term.
Returntype : String; the SO term
Exceptions : if argument is not an instance of Bio::EnsEMBL::Feature
...
...
@@ -107,18 +108,15 @@ sub translate {
my
$so_accession
;
my
$so_name
;
my
$ref
=
ref
(
$feature
);
$feature
->
isa
('
Bio::EnsEMBL::Feature
')
or
throw
"
Need an instance of Bio::EnsEMBL::Feature
";
my
$mapping
=
$self
->
{
feat_to_acc
};
if
(
exists
$mapping
->
{
$ref
})
{
$so_accession
=
$mapping
->
{
$ref
};
}
elsif
(
$feature
->
can
('
SO_term
'))
{
$so_accession
=
$feature
->
SO_term
();
}
else
{
$so_accession
=
$mapping
->
{'
Bio::EnsEMBL::Feature
'};
}
}
#
else {
#
$so_accession = $mapping->{'Bio::EnsEMBL::Feature'};
#
}
if
(
$so_accession
)
{
$so_name
=
$self
->
_fetch_SO_name_by_accession
(
$so_accession
);
...
...
@@ -133,7 +131,7 @@ sub translate {
if
$feature
->
isa
('
Bio::EnsEMBL::Variation::BaseVariationFeature
');
}
throw
sprintf
"
%s: sequence ontology
mapping
not found
",
$ref
throw
sprintf
"
%s:
mapping to
sequence ontology
term
not found
",
$ref
unless
$so_name
;
return
$so_name
;
...
...
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