| 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 | # ^ Version check commented out because from BioPerl 1.5.2 |
| 22 | # version nrs are represented differently. // PE 2007-7-11 |
| 23 | } |
| 24 | |
| 25 | |
| 26 | =head2 pattern |
| 27 | |
| 28 | Title : pattern |
| 29 | Usage : my $pattern = $sitepair->pattern(); # gets the pattern |
| 30 | # sets the pattern to $pwm |
| 31 | Function: gets the pattern object associated with the site pair |
| 32 | Returns : pattern object, here TFBS::Matrix::PWM object |
| 33 | Args : none (get-only method) |
| 34 | |
| 35 | =cut |
| 36 | |
| 37 | |
| 38 | sub pattern { |
| 39 | $_[0]->feature1->pattern(); |
| 40 | } |
| 41 | |
| 42 | |
| 43 | =head2 GFF |
| 44 | |
| 45 | Title : GFF |
| 46 | Usage : print $site->GFF(); |
| 47 | : print $site->GFF($gff_formatter) |
| 48 | Function: returns a "standard" multiline GFF string |
| 49 | Returns : a string (multiline, newline terminated) |
| 50 | Args : a $gff_formatter function reference (optional) |
| 51 | |
| 52 | =cut |
| 53 | |
| 54 | |
| 55 | sub GFF { |
| 56 | return join "\n", $_[0]->site1->GFF, $_[0]->site2->GFF; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | =head2 site1 |
| 61 | =head2 site2 |
| 62 | |
| 63 | Title : site1 |
| 64 | site2 |
| 65 | Usage : my $site1 = $sitepair->site1(); |
| 66 | |
| 67 | Function: Returns individual TFBS::Site objects, from the site pair |
| 68 | Returns : a TFBS::Site |
| 69 | Args : none |
| 70 | |
| 71 | =cut |
| 72 | |
| 73 | |
| 74 | sub site1 { |
| 75 | $_[0]->feature1(); |
| 76 | } |
| 77 | |
| 78 | sub site2 { |
| 79 | $_[0]->feature2(); |
| 80 | } |
| 81 | |
| 82 | |
| 83 |