| 1 | #!/usr/bin/env perl -w |
| 2 | |
| 3 | use TFBS::Word::Consensus; |
| 4 | use Test; |
| 5 | plan(tests => 2); |
| 6 | # print STDERR join("\n", @INC); |
| 7 | |
| 8 | my $word = "AGGTCMNNNNKGACCT"; |
| 9 | |
| 10 | my $word_obj = TFBS::Word::Consensus->new(-word=>$word, |
| 11 | -name=>"MyConsensus"); |
| 12 | print $word_obj->to_PWM->prettyprint; |
| 13 | |
| 14 | my $siteset = $word_obj->search_seq(-file=>'t/test.fa', |
| 15 | -threshold=>"70%", |
| 16 | -max_mismatches => 4); |
| 17 | |
| 18 | ok($siteset->size(), 6); |
| 19 | #print $siteset->GFF."\n\n"; |
| 20 | |
| 21 | my $sitepairset = |
| 22 | $word_obj->search_aln(-file=>'t/test.aln', |
| 23 | -window=>50, -cutoff=>50, |
| 24 | -max_mismatches=>6); |
| 25 | #print $sitepairset->GFF; |
| 26 | |
| 27 | my $It = $sitepairset->Iterator(); |
| 28 | my $startsum = 0; |
| 29 | |
| 30 | while (my $sitepair = $It->next) { |
| 31 | $startsum += $sitepair->feature1->start; |
| 32 | } |
| 33 | |
| 34 | ok($sitepairset->size, 24); |
| 35 | |
| 36 |