| 1 | # | ||||||||||||||||||||||||||||
| 2 | # BioPerl module for Bio::Tools::Sim4::Exon | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # Cared for by Ewan Birney <birney-at-sanger.ac.uk> | ||||||||||||||||||||||||||||
| 7 | # and Hilmar Lapp <hlapp-at-gmx.net> | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # Copyright Ewan Birney, Hilmar Lapp | ||||||||||||||||||||||||||||
| 10 | # | ||||||||||||||||||||||||||||
| 11 | # You may distribute this module under the same terms as perl itself | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # POD documentation - main docs before the code | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | =head1 NAME | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | Bio::Tools::Sim4::Exon - A single exon determined by an alignment | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # See Bio::Tools::Sim4::Results for a description of the context. | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | # an instance of this class is-a Bio::SeqFeature::SimilarityPair | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | # coordinates of the exon (recommended way): | ||||||||||||||||||||||||||||
| 26 | print "exon from ", $exon->start(), | ||||||||||||||||||||||||||||
| 27 | " to ", $exon->end(), "\n"; | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | # the same (feature1() inherited from Bio::SeqFeature::FeaturePair) | ||||||||||||||||||||||||||||
| 30 | print "exon from ", $exon->feature1()->start(), | ||||||||||||||||||||||||||||
| 31 | " to ", $exon->feature1()->end(), "\n"; | ||||||||||||||||||||||||||||
| 32 | # also the same (query() inherited from Bio::SeqFeature::SimilarityPair): | ||||||||||||||||||||||||||||
| 33 | print "exon from ", $exon->query()->start(), | ||||||||||||||||||||||||||||
| 34 | " to ", $exon->query()->end(), "\n"; | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # coordinates on the matching EST (recommended way): | ||||||||||||||||||||||||||||
| 37 | print "matches on EST from ", $exon->est_hit()->start(), | ||||||||||||||||||||||||||||
| 38 | " to ", $exon->est_hit()->end(), "\n"; | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | # the same (feature2() inherited from Bio::SeqFeature::FeaturePair) | ||||||||||||||||||||||||||||
| 41 | print "matches on EST from ", $exon->feature2()->start(), | ||||||||||||||||||||||||||||
| 42 | " to ", $exon->feature2()->end(), "\n"; | ||||||||||||||||||||||||||||
| 43 | # also the same (subject() inherited from Bio::SeqFeature::SimilarityPair): | ||||||||||||||||||||||||||||
| 44 | print "exon from ", $exon->subject()->start(), | ||||||||||||||||||||||||||||
| 45 | " to ", $exon->subject()->end(), "\n"; | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | This class inherits from Bio::SeqFeature::SimilarityPair and represents an | ||||||||||||||||||||||||||||
| 50 | exon on a genomic sequence determined by similarity, that is, by aligning an | ||||||||||||||||||||||||||||
| 51 | EST sequence (using Sim4 in this case). Consequently, the notion of query and | ||||||||||||||||||||||||||||
| 52 | subject is always from the perspective of the genomic sequence: query refers | ||||||||||||||||||||||||||||
| 53 | to the genomic seq, subject to the aligned EST hit. Because of this, | ||||||||||||||||||||||||||||
| 54 | $exon-E<gt>start(), $exon-E<gt>end() etc will always return what you expect. | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | To get the coordinates on the matching EST, refer to the properties of the | ||||||||||||||||||||||||||||
| 57 | feature returned by L<est_hit>(). | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =head1 FEEDBACK | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | =head2 Mailing Lists | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | User feedback is an integral part of the evolution of this | ||||||||||||||||||||||||||||
| 64 | and other Bioperl modules. Send your comments and suggestions preferably | ||||||||||||||||||||||||||||
| 65 | to one of the Bioperl mailing lists. | ||||||||||||||||||||||||||||
| 66 | Your participation is much appreciated. | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||
| 69 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | =head2 Support | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | rather than to the module maintainer directly. Many experienced and | ||||||||||||||||||||||||||||
| 78 | reponsive experts will be able look at the problem and quickly | ||||||||||||||||||||||||||||
| 79 | address it. Please include a thorough description of the problem | ||||||||||||||||||||||||||||
| 80 | with code and data examples if at all possible. | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||||||||||||||||||||
| 85 | the bugs and their resolution. Bug reports can be submitted via the | ||||||||||||||||||||||||||||
| 86 | web: | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | =head1 AUTHOR - Ewan Birney, Hilmar Lapp | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | Ewan Birney E<lt>birney-at-sanger.ac.ukE<gt> | ||||||||||||||||||||||||||||
| 93 | Hilmar Lapp E<lt>hlapp-at-gmx.netE<gt> or E<lt>hilmar.lapp-at-pharma.novartis.comE<gt>. | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | =head1 APPENDIX | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | =cut | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | # Let the code begin... | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | package Bio::Tools::Sim4::Exon; | ||||||||||||||||||||||||||||
| 106 | 3 | $Bio::Tools::Sim4::Exon::VERSION = '1.7.8'; | |||||||||||||||||||||||||||
| 107 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | 3 | ▶ | use base qw(Bio::SeqFeature::SimilarityPair); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 18 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=19.9
Pod
documented
| |||||||||||||||||||||||||||||
| 113 | 18 | my ($class,@args) = @_; | |||||||||||||||||||||||||||
| 114 | 18 | my %param = @args; | |||||||||||||||||||||||||||
| 115 | 18 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | 18 | my ($prim, $prim_tag, $source, $source_tag) = | |||||||||||||||||||||||||||
| 118 | $self->_rearrange([qw(PRIMARY | ||||||||||||||||||||||||||||
| 119 | PRIMARY_TAG | ||||||||||||||||||||||||||||
| 120 | SOURCE | ||||||||||||||||||||||||||||
| 121 | SOURCE_TAG)], | ||||||||||||||||||||||||||||
| 122 | @args); | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | 18 | ▶ | $self->primary_tag('exon') unless $prim || $prim_tag; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$prim or $prim_tag
MC/DC0%0/2
$prim or $prim_tag
$prim
$prim_tag
Truth table33%1/3
A or B
A= $primB= $prim_tag
| |||||||||||||||||||||||||||||
| 125 | 18 | ▶ | $self->source_tag('Sim4') unless $source || $source_tag; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$source or $source_tag
MC/DC0%0/2
$source or $source_tag
$source
$source_tag
Truth table33%1/3
A or B
A= $sourceB= $source_tag
| |||||||||||||||||||||||||||||
| 126 | 18 | ▶ | $self->strand(0) unless defined($self->strand()); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 127 | 18 | $self->query(); | |||||||||||||||||||||||||||
| 128 | 18 | return $self; | |||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | =head2 percentage_id | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | Title : percentage_id | ||||||||||||||||||||||||||||
| 134 | Usage : $obj->percentage_id($newval) | ||||||||||||||||||||||||||||
| 135 | Function: This is a synonym for 100 * $obj->est_hit()->frac_identical(). | ||||||||||||||||||||||||||||
| 136 | Returns : value of percentage_id | ||||||||||||||||||||||||||||
| 137 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | =cut | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | 36 | ▶ | sub percentage_id { | ||||||||||||||||||||||||||
|
Subroutine
percentage_id: called CC=9 SCAR=23.5
Pod
documented
| |||||||||||||||||||||||||||||
| 143 | 36 | my ($self, @args) = @_; | |||||||||||||||||||||||||||
| 144 | 36 | my $frac; | |||||||||||||||||||||||||||
| 145 | my $val; | ||||||||||||||||||||||||||||
| 146 | 36 | my $delegated = 0; | |||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | 36 | ▶ | if(@args) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 149 | 18 | $frac = $args[0]; | |||||||||||||||||||||||||||
| 150 | 18 | ▶ | $frac /= 100.0 if defined($frac); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | 36 | ▶ | if($self->query()->can('frac_identical')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 153 | 36 | ▶ | if(defined($frac)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 154 | 18 | $self->query()->frac_identical($frac); | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | 36 | $val = 100.0 * $self->query()->frac_identical(); | |||||||||||||||||||||||||||
| 157 | 36 | $delegated = 1; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | 36 | ▶ | if($self->est_hit()->can('frac_identical')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 160 | 36 | ▶ | if(defined($frac)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 161 | 18 | $self->est_hit()->frac_identical($frac); | |||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | # this intentiously overwrites previous $val | ||||||||||||||||||||||||||||
| 164 | 36 | $val = 100.0 * $self->est_hit()->frac_identical(); | |||||||||||||||||||||||||||
| 165 | 36 | $delegated = 1; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | 36 | ▶ | if(! $delegated) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if(@args) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 169 | 0 | $val = shift(@args); | |||||||||||||||||||||||||||
| 170 | 0 | $self->{'percentage_id'} = $val; | |||||||||||||||||||||||||||
| 171 | } else { | ||||||||||||||||||||||||||||
| 172 | 0 | $val = $self->{'percentage_id'}; | |||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||
| 175 | 36 | return $val; | |||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | =head2 est_hit | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | Title : est_hit | ||||||||||||||||||||||||||||
| 181 | Usage : $est_feature = $obj->est_hit(); | ||||||||||||||||||||||||||||
| 182 | Function: Returns the EST hit pointing to (i.e., aligned to by Sim4) this | ||||||||||||||||||||||||||||
| 183 | exon (i.e., genomic region). At present, merely a synonym for | ||||||||||||||||||||||||||||
| 184 | $obj->feature2(). | ||||||||||||||||||||||||||||
| 185 | Returns : An Bio::SeqFeatureI implementing object. | ||||||||||||||||||||||||||||
| 186 | Args : | ||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | =cut | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 116 | ▶ | sub est_hit { | ||||||||||||||||||||||||||
|
Subroutine
est_hit: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 192 | 116 | my $self = shift; | |||||||||||||||||||||||||||
| 193 | 116 | return $self->feature2(@_); | |||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | 3 | 1; | |||||||||||||||||||||||||||