Microarray
view release on metacpan or search on metacpan
t/Microarray-File-Data-Quantarray.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::Quantarray');
}
my ($oFile,$oImage_File,$oImage_File2);
my $data_file = $FindBin::Bin.'/../test_files/quantarray.csv';
begin_skipping_tests "The test-file 'quantarray.csv' could not be found" unless (-e $data_file);
test "Data file object creation" => sub {
ok($oFile = quantarray_file->new($data_file),'object creation');
isa_ok($oFile,'quantarray_file','quantarray_file object');
};
test "Header information" => sub {
is($oFile->analysis_software,'ScanArray Express v3','analysis_software');
cmp_ok($oFile->pixel_size,'==',5,'pixel_size');
is($oFile->channel1_name,'Cyanine 3','channel1_name');
is($oFile->channel2_name,'Cyanine 5','channel2_name');
cmp_ok($oFile->num_channels,'==',2,'num_channels');
is($oFile->slide_barcode,'7011','slide_barcode');
is($oFile->channel1_image_file,'C:\Documents and Settings\Ken Choi\Desktop\Dimitra\Chr18 MMCT Validation\Cyanine3_240407 slide7011.tif','channel1_image_file');
is($oFile->channel2_image_file,'C:\Documents and Settings\Ken Choi\Desktop\Dimitra\Chr18 MMCT Validation\Cyanine5_240407 slide7011.tif','channel2_image_file');
is($oFile->gal_file,undef,'gal_file');
is($oFile->scanner,'Model: ScanArray Express Serial No.: 432748','scanner');
is($oFile->user_comment,undef,'user_comment');
cmp_ok($oFile->channel1_pmt,'==',88,'channel1_pmt');
cmp_ok($oFile->channel2_pmt,'==',81,'channel2_pmt');
cmp_ok($oFile->channel1_laser,'==',88,'channel1_laser');
cmp_ok($oFile->channel2_laser,'==',81,'channel2_laser');
};
test "Data" => sub {
test "Spot 1" => sub {
cmp_ok($oFile->block_row(0),'==',1,'block_row');
cmp_ok($oFile->block_col(0),'==',1,'block_col');
cmp_ok($oFile->spot_row(0),'==',1,'spot_row');
cmp_ok($oFile->spot_col(0),'==',1,'spot_col');
cmp_ok($oFile->spot_index(0),'==',1,'spot_index');
is($oFile->feature_id(0),'RP11-504F6','feature_id');
is($oFile->synonym_id(0),'none','synonym_id');
cmp_ok($oFile->y_pos(0),'==',6742,'y_pos');
cmp_ok($oFile->x_pos(0),'==',2027,'x_pos');
cmp_ok($oFile->spot_diameter(0),'==',100,'spot_diameter');
cmp_ok($oFile->spot_pixels(0),'==',286,'spot_pixels');
cmp_ok($oFile->bg_pixels(0),'==',468,'b_pixels');
cmp_ok($oFile->footprint(0),'==',9,'footprint');
cmp_ok($oFile->flag_id(0),'==',3,'flag_id');
cmp_ok($oFile->ch1_median_f(0),'==',1962,'ch1_median_f');
cmp_ok($oFile->ch1_mean_f(0),'==',2709,'ch1_mean_f');
cmp_ok($oFile->ch1_sd_f(0),'==',2360.03,'ch1_sd_f');
cmp_ok($oFile->ch1_median_b(0),'==',956,'ch1_median_b');
cmp_ok($oFile->ch1_mean_b(0),'==',1157,'ch1_mean_b');
cmp_ok($oFile->ch1_sd_b(0),'==',838.7,'ch1_sd_b');
cmp_ok($oFile->ch1_b1sd(0),'==',55.2,'ch1_b1sd');
cmp_ok($oFile->channel1_quality(0),'==',36.7,'channel1_quality');
cmp_ok($oFile->channel1_sat(0),'==',0,'channel1_sat');
is((sprintf "%3.2f",$oFile->channel1_snr(0)),'2.34','channel1_snr');
( run in 0.668 second using v1.01-cache-2.11-cpan-524268b4103 )