| 1 |
#!/usr/bin/env perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
use File::Temp; |
| 5 |
use Test::Files qw(compare_ok); |
| 6 |
|
| 7 |
BEGIN { unshift( @INC, './lib' ) } |
| 8 |
BEGIN { unshift( @INC, '../lib' ) } |
| 9 |
|
| 10 |
BEGIN { |
| 11 |
use Test::Most; |
| 12 |
use_ok('Bio::Tradis::TradisPlot'); |
| 13 |
} |
| 14 |
|
| 15 |
my $destination_directory_obj = File::Temp->newdir( CLEANUP => 1 ); |
| 16 |
my $destination_directory = $destination_directory_obj->dirname(); |
| 17 |
|
| 18 |
my ( $mappedfile, $obj, $outfile ); |
| 19 |
|
| 20 |
$mappedfile = "t/data/TradisPlot/test.mapped.bam"; |
| 21 |
$outfile = "test.plot"; |
| 22 |
|
| 23 |
ok( |
| 24 |
$obj = Bio::Tradis::TradisPlot->new( |
| 25 |
mappedfile => $mappedfile, |
| 26 |
outfile => $outfile, |
| 27 |
mapping_score => 30 |
| 28 |
), |
| 29 |
'creating object' |
| 30 |
); |
| 31 |
|
| 32 |
ok( $obj->plot, 'testing plotting' ); |
| 33 |
ok( -e 'test.plot.AE004091.insert_site_plot.gz', |
| 34 |
'checking plot file existence' ); |
| 35 |
|
| 36 |
system("gunzip -c test.plot.AE004091.insert_site_plot.gz > test.plot.unzipped"); |
| 37 |
system("gunzip -c t/data/TradisPlot/expected.plot.gz > expected.plot.unzipped"); |
| 38 |
compare_ok( |
| 39 |
'test.plot.unzipped', |
| 40 |
'expected.plot.unzipped', |
| 41 |
'checking file contents' |
| 42 |
); |
| 43 |
|
| 44 |
unlink('test.plot.AE004091.insert_site_plot.gz'); |
| 45 |
unlink('expected.plot.unzipped'); |
| 46 |
done_testing(); |