| 1 | # | ||||||||||||||||||||||||||||
| 2 | # BioPerl module for Bio::SeqFeature::Gene::UTR | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # Cared for by David Block <dblock@gene.pbi.nrc.ca> | ||||||||||||||||||||||||||||
| 7 | # | ||||||||||||||||||||||||||||
| 8 | # Copyright David Block | ||||||||||||||||||||||||||||
| 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::Gene::UTR - A feature representing an untranslated region | ||||||||||||||||||||||||||||
| 17 | that is part of a transcriptional unit | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | See documentation of methods | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | A UTR is a Bio::SeqFeature::Gene::ExonI compliant object that is | ||||||||||||||||||||||||||||
| 26 | non-coding, and can be either 5' or 3' in a transcript. | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =head1 FEEDBACK | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =head2 Mailing Lists | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | User feedback is an integral part of the evolution of this and other | ||||||||||||||||||||||||||||
| 33 | Bioperl modules. Send your comments and suggestions preferably to | ||||||||||||||||||||||||||||
| 34 | the Bioperl mailing list. Your participation is much appreciated. | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||
| 37 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =head2 Support | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | rather than to the module maintainer directly. Many experienced and | ||||||||||||||||||||||||||||
| 46 | reponsive experts will be able look at the problem and quickly | ||||||||||||||||||||||||||||
| 47 | address it. Please include a thorough description of the problem | ||||||||||||||||||||||||||||
| 48 | with code and data examples if at all possible. | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||||||||||||||||||||
| 53 | of the bugs and their resolution. Bug reports can be submitted via the | ||||||||||||||||||||||||||||
| 54 | web: | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head1 AUTHOR - David Block | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | Email dblock@gene.pbi.nrc.ca | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | =head1 CONTRIBUTORS | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | This is based on the Gene Structure scaffolding erected by Hilmar Lapp | ||||||||||||||||||||||||||||
| 65 | (hlapp@gmx.net). | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =head1 APPENDIX | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | The rest of the documentation details each of the object methods. | ||||||||||||||||||||||||||||
| 70 | Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | =cut | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | # Let the code begin... | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | package Bio::SeqFeature::Gene::UTR; | ||||||||||||||||||||||||||||
| 79 | 9 | $Bio::SeqFeature::Gene::UTR::VERSION = '1.7.8'; | |||||||||||||||||||||||||||
| 80 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | # Object preamble - inherits from Bio::Root::Root | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 9 | ▶ | use base qw(Bio::SeqFeature::Gene::Exon); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | =head2 new | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | Title : new | ||||||||||||||||||||||||||||
| 90 | Usage : | ||||||||||||||||||||||||||||
| 91 | Function: We override the constructor here to set is_coding to false | ||||||||||||||||||||||||||||
| 92 | unless explicitly overridden. | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | Example : | ||||||||||||||||||||||||||||
| 95 | Returns : | ||||||||||||||||||||||||||||
| 96 | Args : | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | =cut | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 2 | ▶ | sub new{ | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||
| 102 | 2 | my ($caller, @args) = @_; | |||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 2 | ▶ | if(! grep { lc($_) eq '-is_coding'; } @args) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 105 | 2 | push(@args, '-is_coding', 0); | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | 2 | my $self = $caller->SUPER::new(@args); | |||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 2 | my ($primary, $prim) = | |||||||||||||||||||||||||||
| 110 | $self->_rearrange([qw(PRIMARY PRIMARY_TAG)],@args); | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 2 | ▶ | $self->primary_tag('utr') unless $primary || $prim; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$primary or $prim
MC/DC0%0/2
$primary or $prim
$primary
$prim
Truth table33%1/3
A or B
A= $primaryB= $prim
| |||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | 2 | return $self; | |||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | =head2 primary_tag | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | Title : primary_tag | ||||||||||||||||||||||||||||
| 120 | Usage : $tag = $feat->primary_tag() | ||||||||||||||||||||||||||||
| 121 | Function: Returns the primary tag for a feature, | ||||||||||||||||||||||||||||
| 122 | eg 'utr5prime'. This method insures that 5prime/3prime information | ||||||||||||||||||||||||||||
| 123 | is uniformly stored | ||||||||||||||||||||||||||||
| 124 | Returns : a string | ||||||||||||||||||||||||||||
| 125 | Args : none | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | =cut | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | 10 | ▶ | sub primary_tag{ | ||||||||||||||||||||||||||
|
Subroutine
primary_tag: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||
| 130 | 10 | my $self = shift; | |||||||||||||||||||||||||||
| 131 | 10 | ▶ | if(@_ && defined($_[0])) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 132 | 4 | my $val = shift; | |||||||||||||||||||||||||||
| 133 | 4 | ▶ | if ($val =~ /(3|5)/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | 4 | $val = "utr$1prime"; | |||||||||||||||||||||||||||
| 135 | } else { | ||||||||||||||||||||||||||||
| 136 | 0 | $self->warn("Primary tag should indicate if this is 3 or 5'. ". | |||||||||||||||||||||||||||
| 137 | "Preferred text is 'utr3prime' or 'utr5prime'."); | ||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||
| 139 | 4 | unshift(@_,$val); | |||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | 10 | return $self->SUPER::primary_tag(@_); | |||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 9 | 1; | |||||||||||||||||||||||||||