diff t/bih_managerTest.t @ 1:52798007c6b2 draft default tip

Master branch Updating - - Fxx
author fgiacomoni
date Thu, 24 Jan 2019 10:02:05 -0500
parents be582bcd6585
children
line wrap: on
line diff
--- a/t/bih_managerTest.t	Thu Oct 04 10:37:14 2018 -0400
+++ b/t/bih_managerTest.t	Thu Jan 24 10:02:05 2019 -0500
@@ -4,7 +4,7 @@
 no warnings qw/void/;
 use strict;
 no strict "refs" ;
-use Test::More tests => 36 ;
+use Test::More tests => 37 ;
 use FindBin ;
 use Data::Dumper ;
 
@@ -75,19 +75,22 @@
 #17
 is ( mz_delta_conversion_Testmin(100, 'Da', 0.005), 99.995, 'Works with \'100, Da, 0.005\' for minimum');
 #18
-is ( mz_delta_conversion_Testmax(100, 'Da', 0.005), 100.0050000001, 'Works with \'100, Da, 0.005\' for maximum');
+is ( mz_delta_conversion_Testmax(100, 'Da', 0.005), 100.0051, 'Works with \'100, Da, 0.005\' for maximum');
 #19
 is ( mz_delta_conversion_Testmin(500, 'Da', 0.005), 499.995, 'Works with \'500, Da, 0.005\' for minimum');
 #20
-is ( mz_delta_conversion_Testmax(500, 'Da', 0.005), 500.0050000001, 'Works with \'500, Da, 0.005\' for maximum');
+is ( mz_delta_conversion_Testmax(500, 'Da', 0.005), 500.0051, 'Works with \'500, Da, 0.005\' for maximum');
+#20.1
+is ( mz_delta_conversion_Testmax(500.159989, 'Da', 0.005), 500.1649891, 'Works with \'500, Da, 0.005\' for maximum');
+
 #21
 is ( mz_delta_conversion_Testmin(100, 'ppm', 5), 99.9995, 'Works with \'100, ppm, 5\' for minimum');
 #22
-is ( mz_delta_conversion_Testmax(100, 'ppm', 5), 100.0005000001, 'Works with \'100, ppm, 5\' for maximum');
+is ( mz_delta_conversion_Testmax(100, 'ppm', 5), 100.00051, 'Works with \'100, ppm, 5\' for maximum');
 #23
 is ( mz_delta_conversion_Testmin(500, 'ppm', 5), 499.9975, 'Works with \'500, ppm, 5\' for minimum');
 #24
-is ( mz_delta_conversion_Testmax(500, 'ppm', 5), 500.0025000001, 'Works with \'500, ppm, 5\' for maximum');
+is ( mz_delta_conversion_Testmax(500, 'ppm', 5), 500.00251, 'Works with \'500, ppm, 5\' for maximum');
 print "\n--\n" ;
 
 ## testing dichotomi_search
@@ -111,34 +114,34 @@
 print "\n--\n" ;
 
 ## test of input bank parsing
-print "\n-- Test bank parsing\n\n" ;
-is_deeply ( parse_bank_interest_Test(
-	'/Users/fgiacomoni/Inra/labs/perl/galaxy_tools/tool-bank_inhouse/test_data/in_test2.tabular', 1),
-	{ '422.0849114' => [ [ 'C19H18O11', '422.0849114' ] ], '98.952389' => [ [ 'Halothane', '98.952389' ] ], '209.987659' => [ [ 'Bismuth', '209.987659' ] ], '18.0105647' => [ [ 'H2O', '18.0105647' ] ], '199.951068' => [ [ 'Picolinic acid', '199.951068' ] ], '535.3181236' => [ [ 'C18H45N7O11', '535.3181236' ] ] }, 
-	"Parsing a bank method works an return a well organized hash\n" ) ; 
-
-print "\n--\n" ;
+#print "\n-- Test bank parsing\n\n" ;
+#is_deeply ( parse_bank_interest_Test(
+#	'/Users/fgiacomoni/Inra/labs/perl/galaxy_tools/tool-bank_inhouse/test_data/in_test2.tabular', 1),
+#	{ '422.0849114' => [ [ 'C19H18O11', '422.0849114' ] ], '98.952389' => [ [ 'Halothane', '98.952389' ] ], '209.987659' => [ [ 'Bismuth', '209.987659' ] ], '18.0105647' => [ [ 'H2O', '18.0105647' ] ], '199.951068' => [ [ 'Picolinic acid', '199.951068' ] ], '535.3181236' => [ [ 'C18H45N7O11', '535.3181236' ] ] }, 
+#	"Parsing a bank method works an return a well organized hash\n" ) ; 
+#
+#print "\n--\n" ;
 
 
 ## test of rest ws of PeakForest
-print "\n-- Test PeakForest WS\n\n" ;
-is_deeply ( db_pforest_get_clean_range_Test(
-	'https://rest.peakforest.org', '/spectra/lcms/peaks/get-range-clean', '190.0', '200.0', 'negative'),
- 	[{ 'cpds' => [ 186 ], 'thMass' => '195.0877', 'sp' => 25, 'ri' => '100', 'deltaPPM' => '0.245', 'composition' => 'C8H11N4O2', 'attribution' => '[M+H]+', 'mz' => '195.0875' }, { 'composition' => 'C9H9O5', 'attribution' => '[M-H]-', 'ri' => '100', 'deltaPPM' => '0.271', 'cpds' => [ 360 ], 'thMass' => '197.0456', 'sp' => 37, 'mz' => '197.0452' }, { 'composition' => 'C9H12NO4', 'attribution' => '[M+H]+', 'deltaPPM' => '-0.426098891623529', 'ri' => '100', 'thMass' => '198.0760844', 'sp' => 77, 'cpds' => [ 1841 ], 'mz' => '198.076' }, { 'mz' => '196.0614', 'composition' => 'C9H10NO4', 'attribution' => '[M-H]-', 'cpds' => [ 1841 ], 'thMass' => '196.0615311', 'sp' => 78, 'ri' => '100', 'deltaPPM' => '-0.668667633415113' }, { 'cpds' => [ 1841 ], 'thMass' => '198.0760844', 'sp' => 79, 'ri' => '100', 'deltaPPM' => '-0.426098891623529', 'composition' => 'C9H12NO4', 'attribution' => '[M+H]+', 'mz' => '198.076' }],
-	"PForest WS call works an return a clean range og mz between 190 and 200\n" ) ; 
-	
-print "\n--\n" ;
+#print "\n-- Test PeakForest WS\n\n" ;
+#is_deeply ( db_pforest_get_clean_range_Test(
+#	'https://rest.peakforest.org', '/spectra/lcms/peaks/get-range-clean', '190.0', '200.0', 'negative'),
+# 	[{ 'cpds' => [ 186 ], 'thMass' => '195.0877', 'sp' => 25, 'ri' => '100', 'deltaPPM' => '0.245', 'composition' => 'C8H11N4O2', 'attribution' => '[M+H]+', 'mz' => '195.0875' }, { 'composition' => 'C9H9O5', 'attribution' => '[M-H]-', 'ri' => '100', 'deltaPPM' => '0.271', 'cpds' => [ 360 ], 'thMass' => '197.0456', 'sp' => 37, 'mz' => '197.0452' }, { 'composition' => 'C9H12NO4', 'attribution' => '[M+H]+', 'deltaPPM' => '-0.426098891623529', 'ri' => '100', 'thMass' => '198.0760844', 'sp' => 77, 'cpds' => [ 1841 ], 'mz' => '198.076' }, { 'mz' => '196.0614', 'composition' => 'C9H10NO4', 'attribution' => '[M-H]-', 'cpds' => [ 1841 ], 'thMass' => '196.0615311', 'sp' => 78, 'ri' => '100', 'deltaPPM' => '-0.668667633415113' }, { 'cpds' => [ 1841 ], 'thMass' => '198.0760844', 'sp' => 79, 'ri' => '100', 'deltaPPM' => '-0.426098891623529', 'composition' => 'C9H12NO4', 'attribution' => '[M+H]+', 'mz' => '198.076' }],
+#	"PForest WS call works an return a clean range og mz between 190 and 200\n" ) ; 
+#	
+#print "\n--\n" ;
 
 ## test of rest ws of PeakForest
-print "\n-- Test PeakForest JSON Bank parsing\n\n" ;
-
-my ($bank, $headers) = map_pfjson_bankobject_Test([ { 'cpds' => [ 186 ], 'mz' => '195.0875' }, {'mz' => '198.076', 'cpds' => [ 190 ]} ]) ;
-is_deeply ( 
-	$bank, 
-	{ '198.076' => [ [ 190, '198.076' ] ], '195.0875' => [ [ 186, '195.0875' ] ] },
-	"Parsing json bank from PeakForest works an return a well organized hash for data\n" ) ;
-	
-is_deeply ( 
-	$headers, 
-	['id', 'mz'],
-	"Parsing json bank from PeakForest works an return a well organized array for headers\n" ) ;
\ No newline at end of file
+#print "\n-- Test PeakForest JSON Bank parsing\n\n" ;
+#
+#my ($bank, $headers) = map_pfjson_bankobject_Test([ { 'cpds' => [ 186 ], 'mz' => '195.0875' }, {'mz' => '198.076', 'cpds' => [ 190 ]} ]) ;
+#is_deeply ( 
+#	$bank, 
+#	{ '198.076' => [ [ 190, '198.076' ] ], '195.0875' => [ [ 186, '195.0875' ] ] },
+#	"Parsing json bank from PeakForest works an return a well organized hash for data\n" ) ;
+#	
+#is_deeply ( 
+#	$headers, 
+#	['id', 'mz'],
+#	"Parsing json bank from PeakForest works an return a well organized array for headers\n" ) ;
\ No newline at end of file