2 ## Bioperl Test Harness Script for Modules
6 eval { require Test; };
13 plan tests => $NTESTS;
16 use vars qw( $reason);
17 $reason = 'Unable to run Vista , java may not be installed';
20 foreach ( $Test::ntest..$NTESTS ) {
23 unlink "t/data/vista.pdf";
26 use Bio::Tools::Run::Vista;
29 #Java and java version check
32 print STDERR "You must have java to run vista\n";
33 $reason = "Skipping because no java present to run vista ";
36 my $output = `java -version 2>&1`;
37 open(PIPE,"java -version 2>&1 |");
40 if (/Java\sVersion\:\s(\d+\.\d+)/) {
44 elsif (/java version\s.(\d+\.\d+)/) {
48 elsif (/java version\s\"(\d\.\d)"/) {
54 print STDERR "You need at least version 1.2 of JDK to run vista\n";
55 $reason = "Skipping due to old java version";
58 open (PIPE ,'java Vista 2>&1 |');
60 if(/NoClassDefFoundError/){
61 print STDERR "Vista.jar is not your class path \n";
65 my $inputfilename= Bio::Root::IO->catfile("t","data","vista.cls");
66 my $gff_file = Bio::Root::IO->catfile("t","data","vista.gff");
67 my $aio = Bio::AlignIO->new(-file=>$inputfilename,-format=>'clustalw');
68 my $aln = $aio->next_aln;
70 my $out= Bio::Root::IO->catfile("t","data","vista.pdf");
71 my $vis = Bio::Tools::Run::Vista->new('outfile'=>$out,
72 'title' => "My Vista Plot",
73 'annotation'=>$gff_file,
74 'annotation_format'=>'GFF',
85 'color'=> {'EXON'=>'45 25 54','CNS'=>'0 0 100'},
87 ok $vis->isa('Bio::Tools::Run::Vista');
89 ok $vis->annotation, $gff_file;
94 $vis->run($aln,'mouse');