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
06280195
Commit
06280195
authored
19 years ago
by
Glenn Proctor
Browse files
Options
Downloads
Patches
Plain Diff
Added regulated_genes() and genes_regulated_by_same_factor() - analagous to transcript equivalents.
parent
b6f8221f
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/RegulatoryFeature.pm
+82
-2
82 additions, 2 deletions
modules/Bio/EnsEMBL/RegulatoryFeature.pm
with
82 additions
and
2 deletions
modules/Bio/EnsEMBL/RegulatoryFeature.pm
+
82
−
2
View file @
06280195
...
...
@@ -148,8 +148,8 @@ sub name {
=head2 regulated_transcripts
Arg [1] : none
Example : my $transcipts = $rf->regulated_transcripts();
Description: Return a list of all transcripts that are regulated by
Example : my $transc
r
ipts = $rf->regulated_transcripts();
Description: Return a list of all transcripts that are regulated by
this RegulatoryFeature.
Returntype : listREF of Bio::EnsEMBL::RegulatoryFeatures
Exceptions : none
...
...
@@ -184,6 +184,43 @@ sub regulated_transcripts {
}
=head2 regulated_genes
Arg [1] : none
Example : my $genes = $rf->regulated_genes();
Description: Return a list of all genes that are regulated by
this RegulatoryFeature.
Returntype : listREF of Bio::EnsEMBL::RegulatoryFeatures
Exceptions : none
Caller : ?
Status : At Risk
: under development
=cut
sub
regulated_genes
{
my
$self
=
shift
;
my
(
$gene_id
);
my
$sth
=
$self
->
adaptor
()
->
db
()
->
dbc
()
->
prepare
("
SELECT ensembl_object_id
FROM regulatory_feature_object
WHERE ensembl_object_type='Gene'
AND regulatory_feature_id=?
");
$sth
->
execute
(
$self
->
dbID
());
$sth
->
bind_columns
(
\
$gene_id
);
my
$gene_adaptor
=
$self
->
adaptor
()
->
db
()
->
get_GeneAdaptor
();
my
@genes
;
while
(
$sth
->
fetch
)
{
push
@genes
,
$gene_adaptor
->
fetch_by_dbID
(
$gene_id
);
}
return
\
@genes
;
}
=head2 transcripts_regulated_by_same_factor
...
...
@@ -227,4 +264,47 @@ sub transcripts_regulated_by_same_factor {
}
=head2 genes_regulated_by_same_factor
Arg [1] : none
Example : my $transcipts = $rf->genes_regulated_by_same_factor();
Description: Return a list of all genes that are regulated by any
RegulatoryFeature with the same factor as this one. If a gene
is regulated by more than one feature, it will only appear
once in the returned list.
Returntype : listREF of Bio::EnsEMBL::RegulatoryFeatures
Exceptions : none
Caller : ?
Status : At Risk
: under development
=cut
sub
genes_regulated_by_same_factor
{
my
$self
=
shift
;
# fetch all regulatory features by factor
my
$features
=
$self
->
adaptor
()
->
fetch_all_by_factor
(
$self
->
factor
());
# build cumulative list of genes, removing duplicates
my
%genes
;
foreach
my
$feature
(
@$features
)
{
foreach
my
$feature_gene
(
@
{
$feature
->
regulated_genes
()})
{
bless
$feature_gene
,
"
Bio::EnsEMBL::Gene
";
if
(
!
exists
(
$genes
{
$feature_gene
->
dbID
()}))
{
$genes
{
$feature_gene
->
dbID
()}
=
$feature_gene
;
}
}
}
my
@tr
=
values
%genes
;
return
\
@tr
;
}
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