File: 02_Search.t

package info (click to toggle)
libtfbs-perl 0.7.1%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,992 kB
  • sloc: perl: 10,728; ansic: 1,228; makefile: 560; sh: 9
file content (34 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env perl -w

use TFBS::Matrix::PFM;
use strict;

use Test;
plan(tests => 2);

my $matrixstring =
    "0   0  0  0  0  0  0  0\n".
    "0  12 12  0 12  0 12 12\n".
    "0   0  0 12  0 12  0  0\n".
    "12  0  0  0  0  0  0  0";

my $pfm = TFBS::Matrix::PFM->new(-matrix=>$matrixstring,
				 -name=>"MyMatrix");

my $siteset = $pfm->to_PWM->search_seq(-file=>'t/test.fa',-threshold=>"70%");

ok($siteset->size(), 20);
print $siteset->GFF();

my $sitepairset = 
    $pfm->to_PWM->search_aln(-file=>'t/test.aln', 
			     -window=>50, -cutoff=>50, 
			     -threshold=>"70%");

my $It = $sitepairset->Iterator();
my $startsum = 0;
while (my $sitepair = $It->next)  {
    $startsum += $sitepair->feature1->start;
}

ok($startsum, 3013);