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
0dde70c8
Commit
0dde70c8
authored
19 years ago
by
Stephen Searle
Browse files
Options
Downloads
Patches
Plain Diff
New adaptor for transcript supporting features
parent
39a0fdff
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/TranscriptSupportingFeatureAdaptor.pm
+99
-0
99 additions, 0 deletions
...s/Bio/EnsEMBL/DBSQL/TranscriptSupportingFeatureAdaptor.pm
with
99 additions
and
0 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptSupportingFeatureAdaptor.pm
0 → 100644
+
99
−
0
View file @
0dde70c8
# EnsEMBL Adaptor for retrieving SupportingFeatures
#
# Author: Graham McVicker
#
# Date : 11-Oct-2002
#
=head1 NAME
Bio::EnsEMBL::DBSQL::TranscriptSupportingFeatureAdaptor - Retrieves supporting features
from the database.
=head1 SYNOPSIS
$supporting_feature_adaptor = $database_adaptor->get_TranscriptSupportingFeatureAdaptor;
@supporting_feats = @{$supporting_feat_adaptor->fetch_all_by_Transcript($transcript)};
=head1 CONTACT
Post questions to ensembl developer mailing list : <ensembl-dev@ebi.ac.uk>
=cut
use
strict
;
package
Bio::EnsEMBL::DBSQL::
TranscriptSupportingFeatureAdaptor
;
use
Bio::EnsEMBL::DBSQL::
BaseAdaptor
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw warning)
;
use
vars
qw(@ISA)
;
#inherits from BaseAdaptor
@ISA
=
qw(Bio::EnsEMBL::DBSQL::BaseAdaptor)
;
=head2 fetch_all_by_Transcript
Arg [1] : Bio::EnsEMBL::Transcript $transcript
The transcript to fetch supporting features for
Example : @sfs = @{$supporting_feat_adaptor->fetch_all_by_Transcript($transcript)};
Description: Retrieves supporting features (evidence) for a given transcript.
Returntype : list of Bio::EnsEMBL::BaseAlignFeatures in the same coordinate
system as the $transcript argument
Exceptions : warning if $transcript is not in the database (i.e. dbID not defined)
throw if a retrieved supporting feature is of unknown type
Caller : Bio::EnsEMBL::Transcript
=cut
sub
fetch_all_by_Transcript
{
my
(
$self
,
$transcript
)
=
@_
;
my
$out
=
[]
;
unless
(
$transcript
->
dbID
)
{
warning
("
Cannot retrieve evidence for transcript without dbID
");
return
[]
;
}
return
$out
;
my
$sth
=
$self
->
prepare
("
SELECT tsf.feature_type, tsf.feature_id
FROM transcript_supporting_feature tsf
WHERE transcript_id = ?
");
$sth
->
execute
(
$transcript
->
dbID
());
my
$prot_adp
=
$self
->
db
->
get_ProteinAlignFeatureAdaptor
;
my
$dna_adp
=
$self
->
db
->
get_DnaAlignFeatureAdaptor
;
my
$feature
;
while
(
my
(
$type
,
$feature_id
)
=
$sth
->
fetchrow
){
if
(
$type
eq
'
protein_align_feature
'){
$feature
=
$prot_adp
->
fetch_by_dbID
(
$feature_id
);
}
elsif
(
$type
eq
'
dna_align_feature
'){
$feature
=
$dna_adp
->
fetch_by_dbID
(
$feature_id
);
}
else
{
warning
("
Unknown feature type [
$type
]
\n
");
}
if
(
!
$feature
)
{
warning
("
Supporting feature
$type
$feature_id
does not exist in DB
");
}
my
$new_feature
=
$feature
->
transfer
(
$transcript
->
slice
());
push
@$out
,
$new_feature
if
(
$new_feature
);
}
$sth
->
finish
();
return
$out
;
}
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