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

Added functionality to add and get unconventional transcripts associated with this gene.

parent cfff4504
No related branches found
No related tags found
No related merge requests found
......@@ -1076,6 +1076,89 @@ sub get_all_regulatory_features {
}
=head2 add_unconventional_transcript_association
Arg [1] : Bio::EnsEMBL::Transcript $trans
The transcript to associate with the gene, in an unconventional manner.
Arg [2] : String $type
The type of association between this gene and this transcript, e.g.
"antisense","sense_intronic","sense_overlaping_exonic","chimeric_sense_exonic"
Example : my $transcript = Bio::EnsEMBL::Transcript->new(...);
$gene->add_unconventional_transcript_association($transcript, "antisense");
Description: Associate a transcript with this gene in a way that is
non-conventional.
Returntype : none
Exceptions : none
Caller : general
Status : At Risk.
=cut
sub add_unconventional_transcript_association {
my ($self, $transcript, $type) = @_;
if( !ref $transcript || ! $transcript->isa("Bio::EnsEMBL::Transcript") ) {
throw("$transcript is not a Bio::EnsEMBL::Transcript!");
}
my $uta = Bio::EnsEMBL::UnconventionalTranscriptAssociation->new($transcript, $self, $type);
$self->{'_unconventional_transcript_array'} ||= [];
push(@{$self->{'_unconventional_transcript_array'}}, $uta);
}
=head2 get_all_unconventional_transcript_associations
Arg [1] : (optional) String - Only get transcripts where the association
between this gene and the transcripts is of a certain type.
Example : my @transcripts = @{ $gene->get_all_unconventional_transcript_associations, "antisense" };
Description: Returns the unconventional transcripts associated with this gene.
Returntype : Listref of Bio::EnsEMBL::UnconventionalTranscriptAssociation objects
Exceptions : none
Caller : general
Status : At risk.
=cut
sub get_all_unconventional_transcript_associations {
my ($self, $type) = @_;
if( ! exists $self->{'_unconventional_transcript_array'} ) {
$self->{'_unconventional_transcript_array'} = [];
if( defined $self->adaptor() ) {
my $utaa = $self->adaptor()->db()->get_UnconventionalTranscriptAssociationAdaptor();
my $utas = $utaa->fetch_all_by_gene( $self, $type );
$self->{'_unconventional_transcript_array'} = $utas;
}
}
return $self->{'_unconventional_transcript_array'};
}
=head2 remove_unconventional_transcript_associations
Args : None
Example : $gene->remove__unconventional_transcript_associations();
Description: Returns the unconventional transcripts associated with this gene.
Returntype : Listref of Bio::EnsEMBL::UnconventionalTranscriptAssociation objects
Exceptions : none
Caller : general
Status : At risk.
=cut
sub remove_unconventional_transcript_associations {
my $self = shift;
$self->{'_unconventional_transcript_array'} = [];
}
###########################
# DEPRECATED METHODS FOLLOW
###########################
......
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