File: pwmsearch.t

package info (click to toggle)
libtfbs-perl 0.5.svn.20100421-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 920 kB
  • sloc: perl: 6,073; ansic: 604; makefile: 30
file content (33 lines) | stat: -rw-r--r-- 809 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
use Test;
use TFBS::Ext::pwmsearch;
use TFBS::Matrix::PFM;
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 $pwm = $pfm->to_PWM;
my $seq = Bio::SeqIO->new(-file=>"t/test.fa", -format=>"fasta")->next_seq();

my $siteset1 = TFBS::Ext::pwmsearch::pwmsearch($pwm, $seq, "60%");
my $siteset2 = TFBS::Ext::pwmsearch::pwmsearch($pwm, $seq, "60%");
ok($siteset1->size(), 194);

#print STDERR "SIZE::".$siteset1->size()."\n";


my $it = $siteset2->Iterator();
my $startsum = 0;
while (my $site = $it->next())  {
    	$startsum += $site->start;
}
#print STDERR "STARTSUM::".$startsum."\n";

ok($startsum, 457608);