File: 07_MEME.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 (39 lines) | stat: -rw-r--r-- 867 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
35
36
37
38
39
#!/usr/bin/env perl -w

use TFBS::PatternGen::MEME;

use Test;
plan(tests => 5);
my $memepath;
eval {$memepath = `which meme 2> /dev/null`;};
if (!$memepath or ($memepath =~ / /)) { # if space, then error message :)
    print "ok # Skipped: (no meme executable found)\n"x5;
	exit(0);
}

my $fastafile = "t/test_meme.fa";

for (1..1) {
    my $patterngen=TFBS::PatternGen::MEME->new(-seq_file=>$fastafile,
                                               -additional_params=>' -revcomp -nmotifs 2 -w 10',
                                               );
   
    
    my @motifs=$patterngen->all_motifs;
    if (@motifs>0){
	ok(1);
	my @sites=$motifs[0]->get_sites;
#	my $seq=$sites[0]->seq->seq;
	ok(1,($sites[0]->seq->seq ne ''));
    }

    my @pfms = $patterngen->all_patterns();
    if (@pfms>0) {
	ok(1);
	ok(1,($pfms[0]->tag("score")>0));
	last;
    }
}

ok(1);