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
66e8009b
Commit
66e8009b
authored
22 years ago
by
Alistair Rust
Browse files
Options
Downloads
Patches
Plain Diff
get_relevant_xref_id method.
parent
f245514f
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/TranscriptAdaptor.pm
+46
-4
46 additions, 4 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
with
46 additions
and
4 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+
46
−
4
View file @
66e8009b
...
...
@@ -196,16 +196,23 @@ sub store {
$self
->
db
->
get_TranslationAdaptor
()
->
store
(
$translation
);
}
$exon_count
=
scalar
(
@
{
$transcript
->
get_all_Exons
()});
# assuming that the store is used during the Genebuil process, set
# the relevant_xref_id to 0. This ought to get re-set during the protein
# pipeline run. This probably update to the gene table has yet to be
# implemented.
my
$xref_id
=
0
;
# ok - now load this line in
my
$tst
=
$self
->
prepare
("
insert into transcript ( gene_id, translation_id, exon_count )
values ( ?, ?, ?)
insert into transcript ( gene_id, translation_id, exon_count
, relevant_xref_id
)
values ( ?, ?,
?,
?)
");
if
(
defined
$translation
)
{
$tst
->
execute
(
$gene
->
dbID
(),
$translation
->
dbID
(),
$exon_count
);
$tst
->
execute
(
$gene
->
dbID
(),
$translation
->
dbID
(),
$exon_count
,
$xref_id
);
}
else
{
$tst
->
execute
(
$gene
->
dbID
(),
0
,
$exon_count
);
$tst
->
execute
(
$gene
->
dbID
(),
0
,
$exon_count
,
$xref_id
);
}
$transcript
->
dbID
(
$tst
->
{'
mysql_insertid
'});
...
...
@@ -404,5 +411,40 @@ sub get_external_dbname {
}
=head2 get_relevant_xref_id
Arg [1] : int $dbID
the database identifier of the transcript for which the name
of external db from which its external name is derived.
Example : $external_dbname = $transcript_adaptor->get_relevant_xref_id(42);
Description: Retrieves the relevant_xref_id for a transcript.
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 transcript
WHERE transcript_id = ?
");
$sth
->
execute
(
$dbID
);
my
(
$xref_id
)
=
$sth
->
fetchrow_array
();
if
(
!
defined
$xref_id
)
{
return
undef
;
}
return
$xref_id
;
}
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