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
f39b7b5f
Commit
f39b7b5f
authored
22 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
fixed several bugs in refactored DBEntryAdaptor
parent
d7906d75
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/DBEntryAdaptor.pm
+27
-28
27 additions, 28 deletions
modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm
with
27 additions
and
28 deletions
modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm
+
27
−
28
View file @
f39b7b5f
...
...
@@ -340,22 +340,23 @@ sub exists {
sub
fetch_all_by_Gene
{
my
(
$self
,
$gene
)
=
@_
;
my
$sth
=
$self
->
prepare
("
SELECT t.transcript_id, t.translation_id
FROM transcript t
WHERE t.gene_id = ?
");
my
$sth
=
$self
->
prepare
(
"
SELECT t.transcript_id, t.translation_id
FROM transcript t
WHERE t.gene_id = ?
");
$sth
->
execute
(
$gene
->
dbID
);
while
(
my
(
$transcript_id
,
$translation_id
)
=
$sth
->
fetchrow
)
{
if
(
$translation_id
)
{
foreach
my
$translink
(
@
{
$self
->
_fetch_by_object_type
(
$translation_id
,
'
Translation
'
)}
)
{
foreach
my
$translink
(
@
{
$self
->
_fetch_by_object_type
(
$translation_id
,
'
Translation
')}
){
$gene
->
add_DBLink
(
$translink
);
}
}
foreach
my
$translink
(
@
{
$self
->
_fetch_by_object_type
(
$transcript_id
,
'
Transcript
'
)}
)
{
$gene
->
add_DBLink
(
$translink
);
foreach
my
$translink
(
@
{
$self
->
_fetch_by_object_type
(
$transcript_id
,
'
Transcript
'
)}
)
{
$gene
->
add_DBLink
(
$translink
);
}
}
if
(
$gene
->
stable_id
){
...
...
@@ -491,43 +492,41 @@ sub _fetch_by_object_type {
my
(
$refID
,
$dbprimaryId
,
$displayid
,
$version
,
$desc
,
$dbname
,
$release
,
$exDB_status
,
$objid
,
$synonym
,
$queryid
,
$targetid
)
=
@$arrRef
;
my
$exDB
;
my
%obj_hash
=
(
_adaptor
=>
$self
,
_dbID
=>
$refID
,
my
%obj_hash
=
(
_adaptor
=>
$self
,
_dbID
=>
$refID
,
_primary_id
=>
$dbprimaryId
,
_display_id
=>
$displayid
,
_version
=>
$version
,
_release
=>
$release
,
_dbname
=>
$dbname
);
_version
=>
$version
,
_release
=>
$release
,
_dbname
=>
$dbname
);
# using an outer join on the synonyms as well as on identity_xref, we
# now have to filter out the duplicates (see v.1.18 for
# original). Since there is at most one identity_xref row per xref,
# this is easy enough; all the 'extra' bits are synonyms
if
(
!
$seen
{
$refID
}
)
{
$seen
{
$refID
}
++
;
my
$exDB
;
if
((
defined
$queryid
))
{
# an xref with similarity scores
$exDB
=
Bio::EnsEMBL::
IdentityXref
->
new_fast
(
\
%obj_hash
);
$exDB
->
query_identity
(
$queryid
);
$exDB
->
query_identity
(
$queryid
);
$exDB
->
target_identity
(
$targetid
);
}
else
{
$exDB
=
Bio::EnsEMBL::
DBEntry
->
new_fast
(
\
%obj_hash
);
}
$exDB
->
description
(
$desc
)
if
(
$desc
eq
defined
);
$exDB
->
status
(
$exDB_status
)
if
(
$exDB_status
eq
defined
);
$exDB
->
description
(
$desc
)
if
(
defined
(
$desc
));
$exDB
->
status
(
$exDB_status
)
if
(
defined
(
$exDB_status
));
push
(
@out
,
$exDB
);
}
#if (!$seen{$refID})
$seen
{
$refID
}
=
$exDB
;
}
# $exDB still points to the same xref, so we can keep adding synonyms
$exDB
->
add_synonym
(
$synonym
)
if
(
$synonym
eq
defined
);
}
# while <a row from database>
# $exDB still points to the same xref, so we can keep adding synonyms
$seen
{
$refID
}
->
add_synonym
(
$synonym
)
if
(
defined
(
$synonym
));
}
return
\
@out
;
}
...
...
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