2 # BioPerl module for Bio::SeqFeature::SiRNA::Pair
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Donald Jackson, donald.jackson@bms.com
8 # Copyright Donald Jackson
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::SeqFeature::SiRNA::Pair - Perl object for small inhibitory RNA
21 use Bio::SeqFeature::SiRNA::Pair;
22 my $pair = Bio::SeqFeature::SiRNA::Pair->
23 new( -sense => $bio_seqfeature_sirna_oligo, # strand=1
24 -antisense => $bio_seqfeature_sirna_oligo, # strand= -1
25 -primary => 'SiRNA::Pair',
26 -source_tag => 'Bio::Tools::SiRNA',
31 -tag => { note => 'a note' } );
33 $target_sequence->add_SeqFeature($pair);
37 Object methods for (complementary) pairs of L<Bio::SeqFeature::SiRNA::Oligo>
38 objects - inherits L<Bio::SeqFeature::Generic>. See that package for information
41 Does B<not> include methods for designing SiRNAs -- see L<Bio::Tools::SiRNA>
45 L<Bio::SeqFeature::Oligo>, L<Bio::Tools::SiRNA>.
51 User feedback is an integral part of the evolution of this and other
52 Bioperl modules. Send your comments and suggestions preferably to
53 the Bioperl mailing list. Your participation is much appreciated.
55 bioperl-l@bioperl.org - General discussion
56 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
60 Please direct usage questions or support issues to the mailing list:
62 I<bioperl-l@bioperl.org>
64 rather than to the module maintainer directly. Many experienced and
65 reponsive experts will be able look at the problem and quickly
66 address it. Please include a thorough description of the problem
67 with code and data examples if at all possible.
71 Report bugs to the Bioperl bug tracking system to help us keep track
72 of the bugs and their resolution. Bug reports can be submitted via
75 https://github.com/bioperl/bioperl-live/issues
79 Donald Jackson (donald.jackson@bms.com)
83 The rest of the documentation details each of the object methods.
84 Internal methods are usually preceded with a _
88 package Bio
::SeqFeature
::SiRNA
::Pair
;
93 use base
qw(Bio::SeqFeature::Generic);
95 # arguments to new(). Taken from Bio::SeqFeature Generic.
96 # Omit frame (not relevant), GFF_STRING and GFF1_STRING
97 # because I'm not sure how to handle them. Add RANK, FXGC, SENSE, ANTISENSE
98 our @ARGNAMES = qw(RANK FXGC SENSE ANTISENSE START END STRAND PRIMARY SOURCE_TAG
99 SCORE TAG SEQNAME ANNOTATION LOCATION);
106 Usage : my $sirna_pair = Bio::SeqFeature::SiRNA::Pair->new();
107 Purpose : Create a new SiRNA::Pair object
108 Returns : Bio::Tools::SiRNA object
111 -rank 1 # 'Rank' in Tuschl group's rules
112 -fxgc 0.5 # GC fraction for target sequence
113 -primary 'SiRNA::Pair', # default value
114 -source_tag 'Bio::Tools::SiRNA'
115 -tag { note => 'A note' }
116 -sense a Bio::SeqFeature::SiRNA::Oligo object
118 -antisense a Bio::SeqFeature::SiRNA::Oligo object
122 Note : SiRNA::Pair objects are typically created by a design
123 algorithm such as Bio::Tools::SiRNA
128 my ($proto, @args) = @_;
130 my $pkg = ref($proto) || $proto;
132 my $self = $pkg->SUPER::new
();
134 @args{@ARGNAMES} = $self->_rearrange(\
@ARGNAMES, @args);
135 # default primary tag
136 $args{'PRIMARY'} ||= 'SiRNA::Pair';
138 $args{'PRIMARY'} && $self->primary_tag($args{'PRIMARY'});
139 $args{'SOURCE_TAG'} && $self->source_tag($args{'SOURCE_TAG'});
140 $args{'SEQNAME'} && $self->seqname($args{'SEQNAME'});
141 $args{'ANNOTATION'} && $self->annotation($args{'ANNOTATION'});
142 $args{'LOCATION'} && $self->location($args{'LOCATION'});
143 $args{'SENSE'} && $self->sense($args{'SENSE'});
144 $args{'ANTISENSE'} && $self->antisense($args{'ANTISENSE'});
145 defined($args{'START'}) && $self->start($args{'START'});
146 defined($args{'END'}) && $self->end($args{'END'});
147 defined($args{'STRAND'}) && $self->strand($args{'STRAND'});
148 defined($args{'SCORE'}) && $self->score($args{'SCORE'});
149 defined($args{'RANK'}) && $self->rank($args{'RANK'});
150 defined($args{'FXGC'}) && $self->fxGC($args{'FXGC'});
153 foreach my $t (keys %{$args{'TAG'}}) {
154 $self->add_tag_value($t, $args{'TAG'}->{$t});
165 Usage : my $pair_rank = $sirna_pair->rank()
166 Purpose : Get/set the 'quality rank' for this pair.
167 See Bio::Tools::SiRNA for a description of ranks.
169 Args : scalar (optional) indicating pair rank
174 my ($self, $rank) = @_;
177 # first clear out old tags
178 $self->remove_tag('rank') if ( $self->has_tag('rank') );
179 $self->add_tag_value('rank', $rank);
182 if ($self->has_tag('rank')) {
183 my @ranks = $self->get_tag_values('rank');
187 $self->throw("Rank not defined for this Pair\n");
196 Usage : my $fxGC = $sirna_pair->fxGC();
197 Purpose : Get/set the fraction of GC for this pair - based on TARGET sequence, not oligos.
198 Returns : scalar between 0-1
199 Args : scalar between 0-1 (optional)
205 my ($self, $fxGC) = @_;
208 # is this an integer?
209 if ($fxGC =~ /[^.\d]/) {
210 $self->throw( -class => 'Bio::Root::BadParameter',
211 -text
=> "Fraction GC must be a number between 0, 1 - NOT <$fxGC>",
215 if ( $fxGC < 0 or $fxGC > 1 ) {
216 $self->throw( -class => 'Bio::Root::BadParameter',
217 -text
=> "Fraction GC must be a number between 0, 1 - NOT <$fxGC>",
223 $self->remove_tag('fxGC') if ( $self->has_tag('fxGC') );
224 $self->add_tag_value('fxGC', $fxGC)
225 or $self->throw("Unable to set fxGC");
228 if ($self->has_tag('fxGC')) {
229 my @fxGCs = $self->get_tag_values('fxGC');
233 $self->throw("FxGC not defined for this Pair");
241 Usage : my $sense_oligo = $sirna_pair->sense()
242 Purpose : Get/set the SiRNA::Oligo object corresponding to the sense strand
243 Returns : Bio::SeqFeature::SiRNA::Oligo object
244 Args : Bio::SeqFeature::SiRNA::Oligo object
250 my ($self, $soligo) = @_;
253 $self->_add_oligo($soligo, 1) or return;
256 return $self->_get_oligo(1);
263 Usage : my $antisense_oligo = $sirna_pair->antisense()
264 Purpose : Get/set the SiRNA::Oligo object corresponding to the antisense strand
265 Returns : Bio::SeqFeature::SiRNA::Oligo object
266 Args : Bio::SeqFeature::SiRNA::Oligo object
271 my ($self, $asoligo) = @_;
274 $self->_add_oligo($asoligo, -1) or return;
277 return $self->_get_oligo(-1);
282 my ($self, $oligo, $strand) = @_;
284 unless ($oligo->isa('Bio::SeqFeature::SiRNA::Oligo')) {
285 $self->throw( -class => 'Bio::Root::BadParameter',
286 -text
=> "Oligos must be passed as Bio::SeqFeature::SiRNA::Oligo objects\n");
289 $oligo->strand($strand);
290 return $self->add_sub_SeqFeature($oligo, 'EXPAND');
294 my ($self, $strand) = @_;
297 my @feats = $self->sub_SeqFeature;
299 foreach $feat (@feats) {
300 next unless ($feat->primary_tag eq 'SiRNA::Oligo');
301 next unless ($feat->strand == $strand);