Microarray
view release on metacpan or search on metacpan
t/Microarray-File-Data.t view on Meta::CPAN
#! /usr/bin/perl -w
use strict;
use FindBin;
use Test::Harness;
use Test::More tests=>7;
use Test::Group;
use Test::Differences;
use Test::Deep;
BEGIN {
use_ok('Microarray::File::Data');
}
my ($oFile1,$oFile2,$oSpot1,$oSpot2,$oSpot3);
my $data_file1 = $FindBin::Bin.'/../test_files/bluefuse_output.xls';
begin_skipping_tests "The test-file 'bluefuse_output.xls' could not be found" unless (-e $data_file1);
test "BlueFuse object creation" => sub {
ok($oFile1 = data_file->new($data_file1),'object creation');
isa_ok($oFile1,'bluefuse_file','bluefuse_file object');
is($oFile1->guess_barcode,'bluefuse','guess_barcode');
};
test "Spot object tests 1" => sub {
test "Individual spot retrieval" => sub {
ok($oSpot1 = $oFile1->spot_object(1),'get spot 1');
cmp_ok($oSpot1->block_row,'==',1,'block_row');
cmp_ok($oSpot1->block_col,'==',1,'block_col');
cmp_ok($oSpot1->spot_row,'==',1,'spot_row');
cmp_ok($oSpot1->spot_col,'==',1,'spot_col');
cmp_ok($oSpot1->spot_index,'==',1,'spot_index');
is($oSpot1->feature_id,'RP11-1137J16','feature_id');
is($oSpot1->synonym_id,'RP11-1137J16','synonym_id');
cmp_ok($oSpot1->channel1_signal,'==',436.126,'channel1_signal');
cmp_ok($oSpot1->channel2_signal,'==',114.35,'channel2_signal');
cmp_ok($oSpot1->ch1_mean_f,'==',436.126,'ch1_mean_f');
cmp_ok($oSpot1->ch2_mean_f,'==',114.35,'ch2_mean_f');
cmp_ok($oSpot1->ch1_median_b,'==',1,'ch1_median_b');
cmp_ok($oSpot1->ch2_median_b,'==',1,'ch2_median_b');
cmp_ok($oSpot1->channel1_quality,'==',0.15,'channel1_quality');
cmp_ok($oSpot1->channel2_quality,'==',0.13,'channel2_quality');
cmp_ok($oSpot1->x_pos,'==',128,'x_pos');
cmp_ok($oSpot1->y_pos,'==',138,'y_pos');
cmp_ok($oSpot1->spot_diameter,'==',6.38,'spot_diameter');
is($oSpot1->flag_id,'E','flag_id');
is($oFile1->number_spots,undef,'number_spots');
cmp_ok($oFile1->spot_count,'==',33696,'spot_count');
};
test "Set spot objects and spot retrieval" => sub {
ok($oFile1->set_spot_objects,'set_spot_objects');
ok($oSpot2 = $oFile1->spot_object(18273),'get spot 18273');
cmp_ok($oSpot2->block_row,'==',7,'block_row');
cmp_ok($oSpot2->block_col,'==',3,'block_col');
cmp_ok($oSpot2->spot_row,'==',1,'spot_row');
cmp_ok($oSpot2->spot_col,'==',21,'spot_col');
cmp_ok($oSpot2->spot_index,'==',18273,'spot_index');
is($oSpot2->feature_id,'RP11-573G9','feature_id');
is($oSpot2->synonym_id,'RP11-573G9','synonym_id');
cmp_ok($oSpot2->channel1_signal,'==',806.789,'channel1_signal');
cmp_ok($oSpot2->channel2_signal,'==',733.357,'channel2_signal');
cmp_ok($oSpot2->ch1_mean_f,'==',806.789,'ch1_mean_f');
cmp_ok($oSpot2->ch2_mean_f,'==',733.357,'ch2_mean_f');
cmp_ok($oSpot2->ch1_median_b,'==',1,'ch1_median_b');
cmp_ok($oSpot2->ch2_median_b,'==',1,'ch2_median_b');
cmp_ok($oSpot2->channel1_quality,'==',1,'channel1_quality');
cmp_ok($oSpot2->channel2_quality,'==',1,'channel2_quality');
( run in 0.651 second using v1.01-cache-2.11-cpan-524268b4103 )