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
2b23b974
Commit
2b23b974
authored
22 years ago
by
Web Admin
Browse files
Options
Downloads
Patches
Plain Diff
Add get_all_by_exon_stable_id method
parent
b0a78762
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
+68
-32
68 additions, 32 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
with
68 additions
and
32 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+
68
−
32
View file @
2b23b974
...
...
@@ -146,10 +146,76 @@ sub fetch_by_translation_stable_id {
$sth
->
execute
(
$transl_stable_id
);
my
(
$id
)
=
$sth
->
fetchrow_array
;
return
$self
->
fetch_by_dbID
(
$id
);
if
(
$id
){
return
$self
->
fetch_by_dbID
(
$id
);
}
else
{
return
undef
;
}
}
=head2 fetch_all_by_DBEntry
Arg [1] : in $external_id
the external identifier for the transcript to be obtained
Example : @trans = @{$trans_adaptor->fetch_all_by_DBEntry($ext_id)}
Description: retrieves a list of transcripts with an external database
idenitifier $external_id
Returntype : listref of Bio::EnsEMBL::DBSQL::Transcript in contig coordinates
Exceptions : none
Caller : ?
=cut
sub
fetch_all_by_DBEntry
{
my
$self
=
shift
;
my
$external_id
=
shift
;
my
@trans
=
();
my
$entryAdaptor
=
$self
->
db
->
get_DBEntryAdaptor
();
my
@ids
=
$entryAdaptor
->
transcriptids_by_extids
(
$external_id
);
foreach
my
$trans_id
(
@ids
)
{
my
$trans
=
$self
->
fetch_by_dbID
(
$trans_id
);
if
(
$trans
)
{
push
(
@trans
,
$trans
);
}
}
return
\
@trans
;
}
=head2 fetch_all_by_exon_stable_id
Arg [1] : string $stable_id
The stable id of an exon in a transcript
Example : $trans = $trans_adptr->fetch_all_by_exon_stable_id('ENSE00000309301');
Description: Retrieves a list of transcripts via an exon stable id
Returntype : Bio::EnsEMBL::Transcript
Exceptions : none
Caller : general
=cut
sub
fetch_all_by_exon_stable_id
{
my
(
$self
,
$stable_id
)
=
@_
;
my
@trans
;
my
$sth
=
$self
->
prepare
(
qq( SELECT et.transcript_id
FROM exon_transcript as et,
exon_stable_id as esi
WHERE esi.exon_id = et.exon_id and
esi.stable_id = "$stable_id" )
);
$sth
->
execute
(
);
while
(
my
$id
=
$sth
->
fetchrow_array
)
{
my
$transcript
=
$self
->
fetch_by_dbID
(
$id
);
push
(
@trans
,
$transcript
)
if
$transcript
;
}
if
(
!
@trans
)
{
$self
->
warn
(
"
No Transcript with this exon stable id found in the database.
"
);
return
undef
;
}
return
\
@trans
;
}
=head2 store
...
...
@@ -481,36 +547,6 @@ sub update {
}
=head2 fetch_all_by_DBEntry
Arg [1] : in $external_id
the external identifier for the transcript to be obtained
Example : @trans = @{$trans_adaptor->fetch_all_by_DBEntry($ext_id)}
Description: retrieves a list of transcripts with an external database
idenitifier $external_id
Returntype : listref of Bio::EnsEMBL::DBSQL::Transcript in contig coordinates
Exceptions : none
Caller : ?
=cut
sub
fetch_all_by_DBEntry
{
my
$self
=
shift
;
my
$external_id
=
shift
;
my
@trans
=
();
my
$entryAdaptor
=
$self
->
db
->
get_DBEntryAdaptor
();
my
@ids
=
$entryAdaptor
->
transcriptids_by_extids
(
$external_id
);
foreach
my
$trans_id
(
@ids
)
{
my
$trans
=
$self
->
fetch_by_dbID
(
$trans_id
);
if
(
$trans
)
{
push
(
@trans
,
$trans
);
}
}
return
\
@trans
;
}
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