| 1 | package TFBS::SitePair; |
| 2 | |
| 3 | use vars qw(@ISA); |
| 4 | use strict; |
| 5 | |
| 6 | use Bio::SeqFeature::FeaturePair; |
| 7 | @ISA = qw(Bio::SeqFeature::FeaturePair); |
| 8 | |
| 9 | # 'new' used to be inherited, but we need it now |
| 10 | |
| 11 | sub new { |
| 12 | my ($caller, $site1, $site2) = @_; |
| 13 | if ($Bio::Root::Root::VERSION < 1.4) { |
| 14 | return $caller->SUPER::new($site1, $site2); |
| 15 | } |
| 16 | else { |
| 17 | return $caller->SUPER::new(-feature1 => $site1, |
| 18 | -feature2 => $site2); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | |
| 23 | =head2 pattern |
| 24 | |
| 25 | Title : pattern |
| 26 | Usage : my $pattern = $sitepair->pattern(); # gets the pattern |
| 27 | # sets the pattern to $pwm |
| 28 | Function: gets the pattern object associated with the site pair |
| 29 | Returns : pattern object, here TFBS::Matrix::PWM object |
| 30 | Args : none (get-only method) |
| 31 | |
| 32 | =cut |
| 33 | |
| 34 | |
| 35 | sub pattern { |
| 36 | $_[0]->feature1->pattern(); |
| 37 | } |
| 38 | |
| 39 | |
| 40 | =head2 GFF |
| 41 | |
| 42 | Title : GFF |
| 43 | Usage : print $site->GFF(); |
| 44 | : print $site->GFF($gff_formatter) |
| 45 | Function: returns a "standard" multiline GFF string |
| 46 | Returns : a string (multiline, newline terminated) |
| 47 | Args : a $gff_formatter function reference (optional) |
| 48 | |
| 49 | =cut |
| 50 | |
| 51 | |
| 52 | sub GFF { |
| 53 | return join "\n", $_[0]->site1->GFF, $_[0]->site2->GFF; |
| 54 | } |
| 55 | |
| 56 | |
| 57 | =head2 site1 |
| 58 | =head2 site2 |
| 59 | |
| 60 | Title : site1 |
| 61 | site2 |
| 62 | Usage : my $site1 = $sitepair->site1(); |
| 63 | |
| 64 | Function: Returns individual TFBS::Site objects, from the site pair |
| 65 | Returns : a TFBS::Site |
| 66 | Args : none |
| 67 | |
| 68 | =cut |
| 69 | |
| 70 | |
| 71 | sub site1 { |
| 72 | $_[0]->feature1(); |
| 73 | } |
| 74 | |
| 75 | sub site2 { |
| 76 | $_[0]->feature2(); |
| 77 | } |
| 78 | |
| 79 | |
| 80 |