2 # Bioperl Test Script for RNA Motif Modules
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
11 # to handle systems with no installed Test module
12 # we include the t dir (where a copy of Test.pm is located)
14 eval { require Test::More; };
27 use Bio::Tools::RNAMotif;
28 use Bio::Tools::ERPIN;
30 my $verbose = $ENV{'BIOPERLDEBUG'} || 0;
32 ### RNAMotif.pm tests ###
34 my $parser = new Bio::Tools::RNAMotif(
36 -file => Bio::Root::IO->catfile('t','data','trna.strict.rnamotif'),
37 -motiftag => 'tRNA_gene',
42 while( my $gene = $parser->next_prediction ) {
46 is($genes[1]->display_name, 'tRNA','RNAMotif::display_name()');
47 is($genes[12]->seq_id, 'M33910','RNAMotif::seq_id()');
48 is($genes[6]->primary_tag, 'tRNA_gene','RNAMotif::primary_tag()');
49 is($genes[22]->start, 464,'RNAMotif::start()');
50 is($genes[8]->end, 585,'RNAMotif::end()');
51 is($genes[9]->strand, 1,'RNAMotif::strand()');
52 is($genes[90]->get_Annotations('sequence'),
53 'cggatt ta ttg ggcg taa a gggct cgtaggc ggctc'.
54 ' gtcgcgtccggtgtgaaagtc catc gcttaac ggtg gatctg cgcc',
55 "RNAMotif::get_Annotations('sequence')");
56 is($genes[84]->get_Annotations('descfile'), 'trna.strict.descr',
57 "RNAMotif::get_Annotations('descfile')");
58 is($genes[4]->get_Annotations('descline'),
59 'gi|173683|gb|M10671|ACSTRW Avian oncornavirus Trp-tRNA',
60 "RNAMotif::get_Annotations('descline')");
61 is($genes[26]->get_Annotations('secstructure'),
62 'h5 ss h5 ss h3 ss h5 ss h3 ss h5 ss h3 h3 ss',
63 "RNAMotif::get_Annotations('secstructure')");
64 is($genes[4]->score, '0.000','RNAMotif::score()');
65 is($genes[4]->source_tag, 'RNAMotif','RNAMotif::source_tag()');
69 $parser = Bio::Tools::RNAMotif->new(
71 -file => Bio::Root::IO->catfile('t','data','sprintf.rnamotif'),
73 -desctag => 'stem_loop');
75 while( my $gene = $parser->next_prediction ) {
80 is($genes[1]->display_name, 'stem_loop','RNAMotif::display_name()');
81 is($genes[12]->seq_id, 'M82700','RNAMotif::seq_id()');
82 is($genes[6]->primary_tag, 'term','RNAMotif::primary_tag()');
83 is($genes[22]->start, 141,'RNAMotif::start()');
84 is($genes[8]->end, 154,'RNAMotif::end()');
85 is($genes[9]->strand, -1,'RNAMotif::strand()');
86 is($genes[90]->get_Annotations('sequence'), 'ggggaag cttg cttcccc',
87 "RNAMotif::get_Annotations('sequence')");
88 is($genes[84]->get_Annotations('descfile'), 'sprintf.descr',
89 "RNAMotif::get_Annotations('descfile')");
90 is($genes[4]->get_Annotations('descline'),
91 'gi|173741|gb|M83548|AQF16SRRN Aquifex pyrophilus 16S ribosomal RNA (16S rRNA)',
92 "RNAMotif::get_Annotations('descline')");
93 is($genes[26]->get_Annotations('secstructure'), 'h5 ss h3',
94 "RNAMotif::get_Annotations('secstructure')");
95 is($genes[4]->score, '-12.100,5,gaaa','RNAMotif::score()');
96 is($genes[4]->source_tag, 'RNAMotif','RNAMotif::source_tag()');
98 ### ERPIN.pm tests ###
103 ['30260185','5181155','5181183',1,'CTTT.aacc--.CAACC.CCGTGA.GGTTG.a.GAAG',0,
104 'gi|30260185|gb|AE016879.1| Bacillus anthracis str. Ames, complete genome',
106 ['30260185','3709092','3709121',-1,'CTTT.taatt-.CAGTC.CTGTGA.GACCG.g.AAAG',0,
107 'gi|30260185|gb|AE016879.1| Bacillus anthracis str. Ames, complete genome',
109 ['30260185','3710524','3710553',-1,'TTTT.aaatg-.TAGTC.CTGTGA.GGCTG.c.CAAA',0,
110 'gi|30260185|gb|AE016879.1| Bacillus anthracis str. Ames, complete genome',
112 ['30260185','3711223','3711251',-1,'CTTT.aaca--.CAGCC.CCGTGA.GGTTG.a.GAAG',0,
113 'gi|30260185|gb|AE016879.1| Bacillus anthracis str. Ames, complete genome',
117 $parser = Bio::Tools::ERPIN->new(
118 -verbose => $verbose,
119 -file => Bio::Root::IO->catfile('t','data','testfile.erpin'),
120 -motiftag => 'protein_bind',
121 -desctag => 'pyrR_BL');
123 while( my $gene = $parser->next_prediction ) {
124 my @stats = @{ shift @erpinstats };
125 is($gene->display_name, 'pyrR_BL','ERPIN::display_name()');
126 is($gene->seq_id, shift @stats,'ERPIN::seq_id()');
127 is($gene->primary_tag, 'protein_bind','ERPIN::primary_tag()');
128 is($gene->start, shift @stats,'ERPIN::start()');
129 is($gene->end, shift @stats,'ERPIN::end()');
130 is($gene->strand, shift @stats,'ERPIN::strand()');
131 is($gene->get_Annotations('sequence'), shift @stats,
132 "ERPIN::get_Annotations('sequence')");
133 is($gene->get_Annotations('descfile'), shift @stats,
134 "ERPIN::get_Annotations('descfile')");
135 is($gene->get_Annotations('descline'), shift @stats,
136 "ERPIN::get_Annotations('descline')");
137 is($gene->get_Annotations('secstructure'), shift @stats,
138 "ERPIN::get_Annotations('secstructure')");
139 is($gene->score, shift @stats,'ERPIN::score()');
140 is($gene->source_tag, 'ERPIN','ERPIN::source_tag()');
143 ### Infernal.pm tests ###
144 ### FASTR.pm tests ###