Supply TEMPLATE and SUFFIX for temporary query sequence files.
[bioperl-run.git] / t / RepeatMasker.t
blob90e96b5c4f70017696707bc2420dac5032317a7f
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 # $Id$
5 use strict;
6 BEGIN {
7     use Bio::Root::Test;
8     test_begin(-tests => 12);
9         use_ok('Bio::Tools::Run::RepeatMasker');
10         use_ok('Bio::SeqIO');
13 my $inputfilename= test_input_file('repeatmasker.fa');
14 my $createdfile = test_output_file();
16 my $verbose = test_debug();
17 my @params=("species" => "mammal", 'noint' => 1, 'qq' => 1, '-verbose' => $verbose);
18 my $fact = Bio::Tools::Run::RepeatMasker->new(@params);
19 $fact->quiet(1);
21 SKIP: {
22     test_skip(-requires_executable => $fact,
23               -tests => 10);
24         
25         is ($fact->species, 'mammal');
26         is ($fact->noint,1);
27         
28         my $in  = Bio::SeqIO->new(-file => $inputfilename , '-format' => 'fasta');
29         my $seq = $in->next_seq();
30         my @feats = $fact->mask($seq);
31         
32         my $version = $fact->version;
33         
34         is ($feats[0]->feature1->primary_tag, "Simple_repeat");
35         is ($feats[0]->feature1->source_tag, "RepeatMasker");
36         is ($feats[0]->feature2->seq_id, "(TTAGGG)n");
37         
38         if( $version =~ /open-(\S+)/) {
39                 my $num = $1;
40                 if( $num ge '3.1.0' ) {
41                 is ($feats[0]->feature1->start, 1337);
42                 is ($feats[0]->feature1->end, 1411);
43                 is ($feats[0]->feature1->strand, 1);
44                 is ($feats[1]->feature1->start, 1710);
45                 is ($feats[1]->feature1->end, 2052);
46                 } elsif( $num ge  '3.0.8' ) {
47                 is ($feats[0]->feature1->start, 1337);
48                 is ($feats[0]->feature1->end, 1407);
49                 is ($feats[0]->feature1->strand, 1);
50                 is ($feats[1]->feature1->start, 1712);
51                 is ($feats[1]->feature1->end, 2225);    
52                 } else {
53                 skip("unknown RepeatMasker Version, cannot test",1) for ( 1..3);
54                 }
55         } else {
56                 is ($feats[0]->feature1->start, 1337);
57                 is ($feats[0]->feature1->end, 1407);
58                 is ($feats[0]->feature1->strand, 1);
59         }