| 1 | # | ||||||||||
| 2 | # BioPerl module for Bio::SeqFeature::Similarity | ||||||||||
| 3 | # | ||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||
| 5 | # | ||||||||||
| 6 | # Cared for by Hilmar Lapp <hlapp@gmx.net> | ||||||||||
| 7 | # | ||||||||||
| 8 | # Copyright Hilmar Lapp | ||||||||||
| 9 | # | ||||||||||
| 10 | # You may distribute this module under the same terms as perl itself | ||||||||||
| 11 | |||||||||||
| 12 | # POD documentation - main docs before the code | ||||||||||
| 13 | |||||||||||
| 14 | =head1 NAME | ||||||||||
| 15 | |||||||||||
| 16 | Bio::SeqFeature::Similarity - A sequence feature based on similarity | ||||||||||
| 17 | |||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||
| 19 | |||||||||||
| 20 | # obtain a similarity feature somehow | ||||||||||
| 21 | print "significance: ", $sim_fea->significance(), "\n"; | ||||||||||
| 22 | print "bit score: ", $sim_fea->bits(), "\n"; | ||||||||||
| 23 | print "score: ", $sim_fea->score(), "\n"; | ||||||||||
| 24 | print "fraction of identical residues: ", $sim_fea->frac_identical(), "\n"; | ||||||||||
| 25 | |||||||||||
| 26 | =head1 DESCRIPTION | ||||||||||
| 27 | |||||||||||
| 28 | This module is basically a sequence features based on similarity, and therefore | ||||||||||
| 29 | has support for measures assessing the similarity. | ||||||||||
| 30 | |||||||||||
| 31 | Everything else is inherited from L<Bio::SeqFeature::Generic>. | ||||||||||
| 32 | |||||||||||
| 33 | =head1 FEEDBACK | ||||||||||
| 34 | |||||||||||
| 35 | =head2 Mailing Lists | ||||||||||
| 36 | |||||||||||
| 37 | User feedback is an integral part of the evolution of this | ||||||||||
| 38 | and other Bioperl modules. Send your comments and suggestions preferably | ||||||||||
| 39 | to one of the Bioperl mailing lists. | ||||||||||
| 40 | Your participation is much appreciated. | ||||||||||
| 41 | |||||||||||
| 42 | bioperl-l@bioperl.org - General discussion | ||||||||||
| 43 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||
| 44 | |||||||||||
| 45 | =head2 Support | ||||||||||
| 46 | |||||||||||
| 47 | Please direct usage questions or support issues to the mailing list: | ||||||||||
| 48 | |||||||||||
| 49 | I<bioperl-l@bioperl.org> | ||||||||||
| 50 | |||||||||||
| 51 | rather than to the module maintainer directly. Many experienced and | ||||||||||
| 52 | reponsive experts will be able look at the problem and quickly | ||||||||||
| 53 | address it. Please include a thorough description of the problem | ||||||||||
| 54 | with code and data examples if at all possible. | ||||||||||
| 55 | |||||||||||
| 56 | =head2 Reporting Bugs | ||||||||||
| 57 | |||||||||||
| 58 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||
| 59 | the bugs and their resolution. Bug reports can be submitted via the | ||||||||||
| 60 | web: | ||||||||||
| 61 | |||||||||||
| 62 | https://github.com/bioperl/bioperl-live/issues | ||||||||||
| 63 | |||||||||||
| 64 | =head1 AUTHOR - Hilmar Lapp | ||||||||||
| 65 | |||||||||||
| 66 | Email hlapp@gmx.net or hilmar.lapp@pharma.novartis.com | ||||||||||
| 67 | |||||||||||
| 68 | =head1 APPENDIX | ||||||||||
| 69 | |||||||||||
| 70 | The rest of the documentation details each of the object | ||||||||||
| 71 | methods. Internal methods are usually preceded with a _ | ||||||||||
| 72 | |||||||||||
| 73 | =cut | ||||||||||
| 74 | |||||||||||
| 75 | |||||||||||
| 76 | # Let the code begin... | ||||||||||
| 77 | |||||||||||
| 78 | |||||||||||
| 79 | package Bio::SeqFeature::Similarity; | ||||||||||
| 80 | 52 | $Bio::SeqFeature::Similarity::VERSION = '1.7.8'; | |||||||||
| 81 | 52 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 82 | |||||||||||
| 83 | |||||||||||
| 84 | 52 | ▶ | use base qw(Bio::SeqFeature::Generic); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 85 | |||||||||||
| 86 | 1773 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=9 SCAR=22.1
Pod
documented
| |||||||||||
| 87 | 1773 | my ( $caller, @args) = @_; | |||||||||
| 88 | 1773 | my ($self) = $caller->SUPER::new(@args); | |||||||||
| 89 | |||||||||||
| 90 | 1773 | my ($primary,$evalue, $bits, $frac,$seqlen,$seqdesc) = | |||||||||
| 91 | $self->_rearrange([qw(PRIMARY | ||||||||||
| 92 | EXPECT | ||||||||||
| 93 | BITS | ||||||||||
| 94 | FRAC | ||||||||||
| 95 | SEQLENGTH | ||||||||||
| 96 | SEQDESC | ||||||||||
| 97 | )],@args); | ||||||||||
| 98 | |||||||||||
| 99 | 1773 | ▶ | defined $evalue && $self->significance($evalue); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 100 | 1773 | ▶ | defined $bits && $self->bits($bits); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 101 | 1773 | ▶ | defined $frac && $self->frac_identical($frac); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 102 | 1773 | ▶ | defined $seqlen && $self->seqlength($seqlen); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 103 | 1773 | ▶ | defined $seqdesc && $self->seqdesc($seqdesc); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 104 | 1773 | ▶ | $primary = 'similarity' unless defined $primary; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 105 | 1773 | ▶ | $self->primary_tag($primary) unless( defined $self->primary_tag() ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 106 | 1773 | ▶ | $self->strand(0) unless( defined $self->strand() ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 107 | |||||||||||
| 108 | 1773 | return $self; | |||||||||
| 109 | } | ||||||||||
| 110 | |||||||||||
| 111 | =head2 significance | ||||||||||
| 112 | |||||||||||
| 113 | Title : significance | ||||||||||
| 114 | Usage : $evalue = $obj->significance(); | ||||||||||
| 115 | $obj->significance($evalue); | ||||||||||
| 116 | Function: | ||||||||||
| 117 | Returns : | ||||||||||
| 118 | Args : | ||||||||||
| 119 | |||||||||||
| 120 | |||||||||||
| 121 | =cut | ||||||||||
| 122 | |||||||||||
| 123 | 1489 | ▶ | sub significance { | ||||||||
|
Subroutine
significance: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 124 | 1489 | return shift->_tag_value('signif', @_); | |||||||||
| 125 | } | ||||||||||
| 126 | |||||||||||
| 127 | =head2 bits | ||||||||||
| 128 | |||||||||||
| 129 | Title : bits | ||||||||||
| 130 | Usage : $bits = $obj->bits(); | ||||||||||
| 131 | $obj->bits($value); | ||||||||||
| 132 | Function: | ||||||||||
| 133 | Returns : | ||||||||||
| 134 | Args : | ||||||||||
| 135 | |||||||||||
| 136 | |||||||||||
| 137 | =cut | ||||||||||
| 138 | |||||||||||
| 139 | 1620 | ▶ | sub bits { | ||||||||
|
Subroutine
bits: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 140 | 1620 | return shift->_tag_value('Bits', @_); | |||||||||
| 141 | } | ||||||||||
| 142 | |||||||||||
| 143 | =head2 frac_identical | ||||||||||
| 144 | |||||||||||
| 145 | Title : frac_identical | ||||||||||
| 146 | Usage : $fracid = $obj->frac_identical(); | ||||||||||
| 147 | $obj->frac_identical($value); | ||||||||||
| 148 | Function: | ||||||||||
| 149 | Returns : | ||||||||||
| 150 | Args : | ||||||||||
| 151 | |||||||||||
| 152 | |||||||||||
| 153 | =cut | ||||||||||
| 154 | |||||||||||
| 155 | 250 | ▶ | sub frac_identical { | ||||||||
|
Subroutine
frac_identical: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 156 | 250 | return shift->_tag_value('FracId', @_); | |||||||||
| 157 | } | ||||||||||
| 158 | |||||||||||
| 159 | =head2 seqlength | ||||||||||
| 160 | |||||||||||
| 161 | Title : seqlength | ||||||||||
| 162 | Usage : $len = $obj->seqlength(); | ||||||||||
| 163 | $obj->seqlength($len); | ||||||||||
| 164 | Function: | ||||||||||
| 165 | Returns : | ||||||||||
| 166 | Args : | ||||||||||
| 167 | |||||||||||
| 168 | |||||||||||
| 169 | =cut | ||||||||||
| 170 | |||||||||||
| 171 | 1534 | ▶ | sub seqlength { | ||||||||
|
Subroutine
seqlength: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 172 | 1534 | return shift->_tag_value('SeqLength', @_); | |||||||||
| 173 | } | ||||||||||
| 174 | |||||||||||
| 175 | =head2 seqdesc | ||||||||||
| 176 | |||||||||||
| 177 | Title : seqdesc | ||||||||||
| 178 | Usage : $desc = $obj->seqdesc(); | ||||||||||
| 179 | $obj->seqdesc($desc); | ||||||||||
| 180 | Function: At present this method is a shorthand for | ||||||||||
| 181 | $obj->annotation()->description(). | ||||||||||
| 182 | |||||||||||
| 183 | Note that this is not stored in the tag system and hence will | ||||||||||
| 184 | not be included in the return value of gff_string(). | ||||||||||
| 185 | Returns : | ||||||||||
| 186 | Args : | ||||||||||
| 187 | |||||||||||
| 188 | |||||||||||
| 189 | =cut | ||||||||||
| 190 | |||||||||||
| 191 | 1483 | ▶ | sub seqdesc { | ||||||||
|
Subroutine
seqdesc: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 192 | 1483 | my ( $self, $value ) = @_; | |||||||||
| 193 | |||||||||||
| 194 | 1483 | ▶ | if ( defined $value ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 195 | 806 | my $v = Bio::Annotation::SimpleValue->new(); | |||||||||
| 196 | 806 | $v->value($value); | |||||||||
| 197 | 806 | $self->annotation->add_Annotation( 'description', $v ); | |||||||||
| 198 | } | ||||||||||
| 199 | 1483 | my ($v) = $self->annotation()->get_Annotations('description'); | |||||||||
| 200 | 1483 | ▶ | return defined $v ? $v->value : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 201 | } | ||||||||||
| 202 | |||||||||||
| 203 | # | ||||||||||
| 204 | # Everything else is just inherited from SeqFeature::Generic. | ||||||||||
| 205 | # | ||||||||||
| 206 | |||||||||||
| 207 | 52 | 1; | |||||||||