Skip to content
Snippets Groups Projects
Commit 01224e7f authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Added coding_gene() and coding_transcript() methods to pull data from...

Added coding_gene() and coding_transcript() methods to pull data from regulatory_factor_coding table.
parent eb33957c
No related branches found
No related tags found
No related merge requests found
......@@ -57,9 +57,10 @@ sub new_fast {
=head2 name
Arg [1] : string $name (optional)
Example : $name = $regulatory_factor->name()
Description: Getter/Setter for the name of this regulatory factor
Arg [1] : none
Example : $trans = $regulatory_factor->get_coding_transcript()
Description: Returns the transcript that codes for this regulatory factor,
if it is defined.
Returntype : string
Exceptions : none
Caller : general
......@@ -75,11 +76,84 @@ sub name {
}
=head2 coding_transcript
Arg [1] : none
Example : $transcript = $regulatory_factor->coding_transcript()
Description: Get the transcript which codes for this regulatory factor.
Returntype : Bio::EnsEMBL::Transcript, or undef
Exceptions : none
Caller : general
Status : At Risk
: under development
=cut
sub coding_transcript {
my $self = shift;
my ($transcript_id);
my $sth = $self->adaptor()->db()->dbc()->prepare("SELECT transcript_id
FROM regulatory_factor_coding
WHERE regulatory_factor_id=?");
$sth->execute($self->dbID());
$sth->bind_columns(\$transcript_id);
my $transcript_adaptor = $self->adaptor()->db()->get_TranscriptAdaptor();
my $transcript;
if ($sth->fetch) {
$transcript = $transcript_adaptor->fetch_by_dbID($transcript_id);
}
return $transcript;
}
=head2 coding_gene
Arg [1] : none
Example : $gene = $regulatory_factor->coding_gene()
Description: Get the gene which codes for this regulatory factor.
Returntype : Bio::EnsEMBL::Gene, or undef
Exceptions : none
Caller : general
Status : At Risk
: under development
=cut
sub coding_gene {
my $self = shift;
my ($gene_id);
my $sth = $self->adaptor()->db()->dbc()->prepare("SELECT gene_id
FROM regulatory_factor_coding
WHERE regulatory_factor_id=?");
$sth->execute($self->dbID());
$sth->bind_columns(\$gene_id);
my $gene_adaptor = $self->adaptor()->db()->get_GeneAdaptor();
my $gene;
if ($sth->fetch) {
$gene = $gene_adaptor->fetch_by_dbID($gene_id);
}
return $gene;
}
=head2 type
Arg [1] : string $type
Example : $type = $regulatory_factor->type()
Description: Getter/Setter for the length of this regulatory factor
Description: Getter/Setter for the type of this regulatory factor
Returntype : int
Exceptions : none
Caller : general
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment