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
9a49aa06
Commit
9a49aa06
authored
22 years ago
by
Alistair Rust
Browse files
Options
Downloads
Patches
Plain Diff
Access to relevant_xref_id stuff.
parent
3e54e077
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/GeneAdaptor.pm
+46
-2
46 additions, 2 deletions
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
modules/Bio/EnsEMBL/Gene.pm
+30
-0
30 additions, 0 deletions
modules/Bio/EnsEMBL/Gene.pm
with
76 additions
and
2 deletions
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
+
46
−
2
View file @
9a49aa06
...
...
@@ -711,9 +711,17 @@ sub store {
$type
=
$gene
->
type
;
}
my
$xref_id
=
0
;
# if (defined ($gene->relevant_xref)) {
# $xref_id = $gene->relevant_xref;
# }
# else {
# $xref_id = 0;
# }
my
$sth2
=
$self
->
prepare
("
INSERT INTO gene(type, analysis_id,
transcript_count)
VALUES('
$type
',
$analysisId
,
$trans_count
)
"
);
transcript_count
, relevant_xref_id
)
VALUES('
$type
',
$analysisId
,
$trans_count
,
$xref_id
)
"
);
$sth2
->
execute
();
...
...
@@ -941,6 +949,7 @@ sub get_external_name {
return
$xref
;
}
=head2 get_external_dbname
Arg [1] : int $dbID
...
...
@@ -982,6 +991,41 @@ sub get_external_dbname {
}
=head2 get_relevant_xref_id
Arg [1] : int $dbID
the database identifier of the gene for which the name of
external db from which its external name is derived.
Example : $external_dbname = $gene_adaptor->get_relevant_xref_id(42);
Description: Retrieves the relevant_xref_id for a gene.
Returntype : int
Exceptions : thrown if $dbId arg is not defined
Caller : general
=cut
sub
get_relevant_xref_id
{
my
(
$self
,
$dbID
)
=
@_
;
if
(
!
defined
$dbID
)
{
$self
->
throw
("
Must call with a dbID
");
}
my
$sth
=
$self
->
prepare
("
SELECT relevant_xref_id
FROM gene
WHERE gene_id = ?
");
$sth
->
execute
(
$dbID
);
my
(
$xref_id
)
=
$sth
->
fetchrow_array
();
if
(
!
defined
$xref_id
)
{
return
undef
;
}
return
$xref_id
;
}
1
;
__END__
...
...
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Gene.pm
+
30
−
0
View file @
9a49aa06
...
...
@@ -914,4 +914,34 @@ sub species {
}
=head2 relevant_xref
Arg [1] : int $relevant_xref_id
Example : $gene->relevant_xref(42);
Description: get/set/lazy_loaded relevant_xref_id for this gene
Returntype : int
Exceptions : none
Caller : general
=cut
sub
relevant_xref
{
my
(
$self
,
$value
)
=
@_
;
if
(
defined
$value
)
{
$self
->
{'
relevant_xref
'}
=
$value
;
return
;
}
if
(
exists
$self
->
{'
relevant_xref
'}
)
{
return
$self
->
{'
relevant_xref
'};
}
$self
->
{'
relevant_xref
'}
=
$self
->
adaptor
->
get_relevant_xref_id
(
$self
->
dbID
);
return
$self
->
{'
relevant_xref
'};
}
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