Commit 665868be authored by Kieron Taylor's avatar Kieron Taylor 😠
Browse files

Added summary methods for use in Region Report

Minor POD corrections
parent 62ba590a
......@@ -1429,7 +1429,24 @@ sub get_nearest_Gene {
}
=head2 summary_as_hash
Example : $feature_summary = $feature->summary_as_hash();
Description : Retrieves a textual summary of this Feature.
Should be overidden by subclasses for specific tweaking
Returns : hashref of arrays of descriptive strings
Status : Intended for internal use
=cut
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'ID'} = $self->display_id;
$summary{'start'} = $self->start;
$summary{'end'} = $self->end;
$summary{'strand'} = $self->strand;
return \%summary;
}
......
......@@ -1473,6 +1473,25 @@ sub is_reference{
return $self->{'is_ref'};
}
=head2 summary_as_hash
Example : $gene_summary = $gene->summary_as_hash();
Description : Extends Feature::summary_as_hash
Retrieves a summary of this Gene object.
Returns : hashref of arrays of descriptive strings
Status : Intended for internal use
=cut
sub summary_as_hash {
my $self = shift;
my $summary_ref = $self->SUPER::summary_as_hash;
$summary_ref->{'description'} = $self->description;
$summary_ref->{'biotype'} = $self->biotype;
return $summary_ref;
}
###########################
# DEPRECATED METHODS FOLLOW
###########################
......
......@@ -3447,6 +3447,25 @@ sub add_synonym{
return;
}
=head2 summary_as_hash
Example : $slice_summary = $slice->summary_as_hash();
Description : Retrieves a textual summary of this slice.
Returns : hashref of descriptive strings
=cut
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'display_id'} = $self->display_id;
$summary{'start'} = $self->start;
$summary{'end'} = $self->end;
$summary{'strand'} = $self->strand;
$summary{'Is_circular'} = $self->is_circular ? "true" : "false";
$summary{'region_name'} = $self->seq_region_name();
return \%summary;
}
#
# Bioperl Bio::PrimarySeqI methods:
#
......
......@@ -2650,6 +2650,25 @@ sub load {
} ## end sub load
=head2 summary_as_hash
Example : $transcript_summary = $transcript->summary_as_hash();
Description : Extends Feature::summary_as_hash
Retrieves a summary of this Transcript.
Returns : hashref of descriptive strings
Status : Intended for internal use
=cut
sub summary_as_hash {
my $self = shift;
my $summary_ref = $self->SUPER::summary_as_hash;
$summary_ref->{'description'} = $self->description;
$summary_ref->{'biotype'} = $self->biotype;
my $parent_gene = $self->get_nearest_Gene;
$summary_ref->{'Parent'} = $parent_gene->display_id;
return $summary_ref;
}
###########################
# DEPRECATED METHODS FOLLOW
###########################
......
......@@ -150,7 +150,7 @@ sub new_fast {
with this translation object.
Exceptions : Throws if there is no adaptor or no dbID defined for
the translation object.
Returntype : Bio::EnsEMBL::Transcript
=cut
sub transcript {
......@@ -170,7 +170,7 @@ sub transcript {
my $adaptor = $self->adaptor;
if ( !defined($adaptor) ) {
throw( "Adaptor is not set for translation, "
. "can not fecth its transcript." );
. "can not fetch its transcript." );
}
my $dbID = $self->{'dbID'};
......@@ -1204,5 +1204,24 @@ sub get_all_DAS_Features{
return $self->SUPER::get_all_DAS_Features($slice);
}
=head2 summary_as_hash
Example : $translation_summary = $translation->summary_as_hash();
Description : Retrieves a textual summary of this Translation.
Not inherited from Feature.
Returns : hashref of arrays of descriptive strings
Status : Intended for internal use
=cut
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'display_id'} = $self->display_id;
$summary{'genomic_start'} = $self->genomic_start;
$summary{'genomic_end'} = $self->genomic_end;
my $transcript = $self->transcript;
$summary{'Parent'} = $transcript->display_id;
return \%summary;
}
1;
......@@ -135,7 +135,7 @@ sub new {
Example : $obj = $iterator->next
Description: returns the next object from this iterator, or undef if the iterator is exhausted
Returntype : the return type will depend on what this iterator is iterating over
Returntype : Object type will depend on what this iterator is iterating over
Exceptions : none
Caller : general
Status : Experimental
......@@ -153,7 +153,7 @@ sub next {
=head2 has_next
Example : if ($iterator->has_next) { my $obj = $iterator->next }
Description: returns true if this iterator has more elements to fetch, false when
Description: Boolean - true if this iterator has more elements to fetch, false when
it is exhausted
Returntype : boolean
Exceptions : none
......@@ -176,7 +176,7 @@ sub has_next {
Description: returns the next object from this iterator, or undef if the iterator is exhausted,
much like next but does not advance the iterator (so the same object will be
returned on the following call to next or peek)
Returntype : the return type will depend on what this iterator is iterating over
Returntype : Object type will depend on what this iterator is iterating over
Exceptions : none
Caller : general
Status : Experimental
......@@ -403,7 +403,7 @@ sub skip {
first element in the set
Argument[2]: (optional) an initial value to use for the accumulator instead
of the first value of the set
Returntype : the same as the return type of the coderef
Returntype : returntype of the coderef
Exceptions : thrown if the argument is not a coderef
Caller : general
Status : Experimental
......
Markdown is supported
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