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
cdacc4ef
Commit
cdacc4ef
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Modify previous patch to store() so that it actually might work.
parent
dfc58ff8
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/GeneAdaptor.pm
+40
-25
40 additions, 25 deletions
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
with
40 additions
and
25 deletions
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
+
40
−
25
View file @
cdacc4ef
...
...
@@ -1101,8 +1101,11 @@ sub store {
my
$original
=
$gene
;
my
$original_transcripts
=
$gene
->
get_all_Transcripts
();
my
$canonical_transcript
=
$gene
->
canonical_transcript
();
my
$old_canonical_transcript_id
=
$gene
->
canonical_transcript
()
->
dbID
();
my
$seq_region_id
;
(
$gene
,
$seq_region_id
)
=
$self
->
_pre_store
(
$gene
);
my
$store_gene_sql
=
qq(
...
...
@@ -1170,13 +1173,14 @@ sub store {
# store the dbentries associated with this gene
my
$dbEntryAdaptor
=
$db
->
get_DBEntryAdaptor
();
foreach
my
$dbe
(
@
{
$gene
->
get_all_DBEntries
}
)
{
$dbEntryAdaptor
->
store
(
$dbe
,
$gene_dbID
,
"
Gene
",
$ignore_release
);
foreach
my
$dbe
(
@
{
$gene
->
get_all_DBEntries
}
)
{
$dbEntryAdaptor
->
store
(
$dbe
,
$gene_dbID
,
"
Gene
",
$ignore_release
);
}
# we allow transcripts not to share equal exons and instead have copies
# For the database we still want sharing though, to have easier time with
# stable ids. So we need to have a step to merge exons together before store
# We allow transcripts not to share equal exons and instead have
# copies. For the database we still want sharing though, to have
# easier time with stable ids. So we need to have a step to merge
# exons together before store.
my
%exons
;
foreach
my
$trans
(
@
{
$gene
->
get_all_Transcripts
}
)
{
...
...
@@ -1194,35 +1198,46 @@ sub store {
my
$transcripts
=
$gene
->
get_all_Transcripts
();
for
(
my
$i
=
0
;
$i
<
@$transcripts
;
$i
++
)
{
my
$new_canonical_transcript_id
;
for
(
my
$i
=
0
;
$i
<
@$transcripts
;
$i
++
)
{
my
$new
=
$transcripts
->
[
$i
];
my
$old
=
$original_transcripts
->
[
$i
];
$transcript_adaptor
->
store
(
$new
,
$gene_dbID
,
$analysis_id
);
$transcript_adaptor
->
store
(
$new
,
$gene_dbID
,
$analysis_id
);
if
(
!
defined
(
$new_canonical_transcript_id
)
&&
defined
(
$old
->
dbID
()
)
&&
$old
->
dbID
()
==
$old_canonical_transcript_id
)
{
$new_canonical_transcript_id
=
$new
->
dbID
();
}
# update the original transcripts since we may have made copies of
# them by transforming the gene
$old
->
dbID
(
$new
->
dbID
());
$old
->
adaptor
(
$new
->
adaptor
());
if
(
$new
->
translation
)
{
$old
->
translation
->
dbID
(
$new
->
translation
()
->
dbID
);
$old
->
translation
->
adaptor
(
$new
->
translation
()
->
adaptor
);
$old
->
dbID
(
$new
->
dbID
()
);
$old
->
adaptor
(
$new
->
adaptor
()
);
if
(
$new
->
translation
)
{
$old
->
translation
->
dbID
(
$new
->
translation
()
->
dbID
);
$old
->
translation
->
adaptor
(
$new
->
translation
()
->
adaptor
);
}
}
# Now the canonical transcript has been stored, so update the
# canonical_transcript_id of this gene with the new dbID.
my
$sth
=
$self
->
prepare
(
q(
UPDATE gene
SET canonical_transcript_id = ?
WHERE gene_id = ?)
);
if
(
defined
(
$new_canonical_transcript_id
)
)
{
# Now the canonical transcript has been stored, so update the
# canonical_transcript_id of this gene with the new dbID.
my
$sth
=
$self
->
prepare
(
q(
UPDATE gene
SET canonical_transcript_id = ?
WHERE gene_id = ?)
);
$sth
->
bind_param
(
1
,
$canonical_transcript
->
dbID
()
,
SQL_INTEGER
);
$sth
->
bind_param
(
2
,
$gene_dbID
,
SQL_INTEGER
);
$sth
->
bind_param
(
1
,
$
new_
canonical_transcript
_id
,
SQL_INTEGER
);
$sth
->
bind_param
(
2
,
$gene_dbID
,
SQL_INTEGER
);
$sth
->
execute
();
$sth
->
execute
();
}
# update gene to point to display xref if it is set
if
(
my
$display_xref
=
$gene
->
display_xref
)
{
...
...
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