@@ -298,6 +298,7 @@ def setUp(self):
298
298
'qiita_prep_id' : 1000 ,
299
299
'instrument_model' : 'Illumina MiSeq' ,
300
300
'library_construction_protocol' : 'AAAA' ,
301
+ 'insdc_nulls' : '3.6' ,
301
302
'experiment_design_description' : 'BBBB' },
302
303
'SKD8.640184' : {'center_name' : 'ANL' ,
303
304
'center_project_name' : 'Test Project' ,
@@ -311,6 +312,7 @@ def setUp(self):
311
312
'qiita_prep_id' : 1000 ,
312
313
'instrument_model' : 'Illumina MiSeq' ,
313
314
'library_construction_protocol' : 'AAAA' ,
315
+ 'insdc_nulls' : 'NoT applicable' ,
314
316
'experiment_design_description' : 'BBBB' },
315
317
'SKB7.640196' : {'center_name' : 'ANL' ,
316
318
'center_project_name' : 'Test Project' ,
@@ -324,6 +326,7 @@ def setUp(self):
324
326
'qiita_prep_id' : 1000 ,
325
327
'instrument_model' : 'Illumina MiSeq' ,
326
328
'library_construction_protocol' : 'AAAA' ,
329
+ 'insdc_nulls' : 'unspecified' ,
327
330
'experiment_design_description' : 'BBBB' }
328
331
}
329
332
self .metadata = pd .DataFrame .from_dict (self .metadata_dict ,
@@ -342,6 +345,7 @@ def setUp(self):
342
345
'qiita_prep_id' : 1000 ,
343
346
'instrument_model' : 'Illumina MiSeq' ,
344
347
'library_construction_protocol' : 'AAAA' ,
348
+ 'insdc_nulls' : '3.6' ,
345
349
'experiment_design_description' : 'BBBB' },
346
350
'1.SKD8.640184' : {'center_name' : 'ANL' ,
347
351
'center_project_name' : 'Test Project' ,
@@ -355,6 +359,7 @@ def setUp(self):
355
359
'qiita_prep_id' : 1000 ,
356
360
'instrument_model' : 'Illumina MiSeq' ,
357
361
'library_construction_protocol' : 'AAAA' ,
362
+ 'insdc_nulls' : 'not applicable' ,
358
363
'experiment_design_description' : 'BBBB' },
359
364
'1.SKB7.640196' : {'center_name' : 'ANL' ,
360
365
'center_project_name' : 'Test Project' ,
@@ -368,6 +373,7 @@ def setUp(self):
368
373
'qiita_prep_id' : 1000 ,
369
374
'instrument_model' : 'Illumina MiSeq' ,
370
375
'library_construction_protocol' : 'AAAA' ,
376
+ 'insdc_nulls' : 'not applicable' ,
371
377
'experiment_design_description' : 'BBBB' }
372
378
}
373
379
self .metadata_prefixed = pd .DataFrame .from_dict (metadata_prefixed_dict ,
@@ -730,6 +736,7 @@ def test_clean_validate_template(self):
730
736
'platform' : 'Illumina' ,
731
737
'instrument_model' : 'Illumina MiSeq' ,
732
738
'library_construction_protocol' : 'AAAA' ,
739
+ 'insdc_nulls' : '3.6' ,
733
740
'experiment_design_description' : 'BBBB' },
734
741
'2.SKD8.640184' : {'center_name' : 'ANL' ,
735
742
'center_project_name' : 'Test Project' ,
@@ -742,6 +749,7 @@ def test_clean_validate_template(self):
742
749
'platform' : 'Illumina' ,
743
750
'instrument_model' : 'Illumina MiSeq' ,
744
751
'library_construction_protocol' : 'AAAA' ,
752
+ 'insdc_nulls' : 'not applicable' ,
745
753
'experiment_design_description' : 'BBBB' },
746
754
'2.SKB7.640196' : {'center_name' : 'ANL' ,
747
755
'center_project_name' : 'Test Project' ,
@@ -754,13 +762,16 @@ def test_clean_validate_template(self):
754
762
'platform' : 'Illumina' ,
755
763
'instrument_model' : 'Illumina MiSeq' ,
756
764
'library_construction_protocol' : 'AAAA' ,
765
+ 'insdc_nulls' : 'not applicable' ,
757
766
'experiment_design_description' : 'BBBB' }
758
767
}
759
768
exp = pd .DataFrame .from_dict (metadata_dict , orient = 'index' , dtype = str )
769
+
760
770
obs .sort_index (axis = 0 , inplace = True )
761
771
obs .sort_index (axis = 1 , inplace = True )
762
772
exp .sort_index (axis = 0 , inplace = True )
763
773
exp .sort_index (axis = 1 , inplace = True )
774
+
764
775
assert_frame_equal (obs , exp , check_like = True )
765
776
766
777
def test_clean_validate_template_no_forbidden_words1 (self ):
@@ -909,7 +920,7 @@ def _common_creation_checks(self, pt, fp_count, name):
909
920
'run_prefix' , 'barcode' , 'primer' , 'platform' ,
910
921
'instrument_model' , 'experiment_design_description' ,
911
922
'library_construction_protocol' , 'center_name' ,
912
- 'center_project_name' , 'emp_status' }
923
+ 'center_project_name' , 'insdc_nulls' , ' emp_status' }
913
924
self .assertCountEqual (pt .categories , exp_categories )
914
925
exp_dict = {
915
926
'%s.SKB7.640196' % self .test_study .id : {
@@ -924,6 +935,7 @@ def _common_creation_checks(self, pt, fp_count, name):
924
935
'str_column' : 'Value for sample 3' ,
925
936
'center_name' : 'ANL' ,
926
937
'center_project_name' : 'Test Project' ,
938
+ 'insdc_nulls' : 'not applicable' ,
927
939
'emp_status' : 'EMP' },
928
940
'%s.SKB8.640193' % self .test_study .id : {
929
941
'barcode' : 'GTCCGCAAGTTA' ,
@@ -937,6 +949,7 @@ def _common_creation_checks(self, pt, fp_count, name):
937
949
'str_column' : 'Value for sample 1' ,
938
950
'center_name' : 'ANL' ,
939
951
'center_project_name' : 'Test Project' ,
952
+ 'insdc_nulls' : '3.6' ,
940
953
'emp_status' : 'EMP' },
941
954
'%s.SKD8.640184' % self .test_study .id : {
942
955
'barcode' : 'CGTAGAGCTCTC' ,
@@ -950,6 +963,7 @@ def _common_creation_checks(self, pt, fp_count, name):
950
963
'str_column' : 'Value for sample 2' ,
951
964
'center_name' : 'ANL' ,
952
965
'center_project_name' : 'Test Project' ,
966
+ 'insdc_nulls' : 'not applicable' ,
953
967
'emp_status' : 'EMP' }
954
968
}
955
969
for s_id in exp_sample_ids :
@@ -1068,7 +1082,7 @@ def test_create_warning(self):
1068
1082
self .assertEqual (pt ._get_sample_ids (), exp_sample_ids )
1069
1083
self .assertEqual (len (pt ), 3 )
1070
1084
exp_categories = {'str_column' , 'ebi_submission_accession' ,
1071
- 'run_prefix' , 'primer' , 'platform' ,
1085
+ 'run_prefix' , 'primer' , 'platform' , 'insdc_nulls' ,
1072
1086
'instrument_model' , 'experiment_design_description' ,
1073
1087
'library_construction_protocol' , 'center_name' ,
1074
1088
'center_project_name' , 'emp_status' }
@@ -1085,6 +1099,7 @@ def test_create_warning(self):
1085
1099
'str_column' : 'Value for sample 3' ,
1086
1100
'center_name' : 'ANL' ,
1087
1101
'center_project_name' : 'Test Project' ,
1102
+ 'insdc_nulls' : 'not applicable' ,
1088
1103
'emp_status' : 'EMP' },
1089
1104
'%s.SKB8.640193' % self .test_study .id : {
1090
1105
'ebi_submission_accession' : None ,
@@ -1097,6 +1112,7 @@ def test_create_warning(self):
1097
1112
'str_column' : 'Value for sample 1' ,
1098
1113
'center_name' : 'ANL' ,
1099
1114
'center_project_name' : 'Test Project' ,
1115
+ 'insdc_nulls' : '3.6' ,
1100
1116
'emp_status' : 'EMP' },
1101
1117
'%s.SKD8.640184' % self .test_study .id : {
1102
1118
'ebi_submission_accession' : None ,
@@ -1109,6 +1125,7 @@ def test_create_warning(self):
1109
1125
'str_column' : 'Value for sample 2' ,
1110
1126
'center_name' : 'ANL' ,
1111
1127
'center_project_name' : 'Test Project' ,
1128
+ 'insdc_nulls' : 'not applicable' ,
1112
1129
'emp_status' : 'EMP' }
1113
1130
}
1114
1131
for s_id in exp_sample_ids :
@@ -1217,6 +1234,7 @@ def test_to_file(self):
1217
1234
self ._clean_up_files .append (fp )
1218
1235
with open (fp , newline = None ) as f :
1219
1236
obs = f .read ()
1237
+
1220
1238
self .assertEqual (obs , EXP_PREP_TEMPLATE .format (pt .id ))
1221
1239
1222
1240
# cleaning
@@ -1803,17 +1821,17 @@ def test_name_setter(self):
1803
1821
EXP_PREP_TEMPLATE = (
1804
1822
'sample_name\t barcode\t center_name\t center_project_name\t '
1805
1823
'ebi_submission_accession\t emp_status\t experiment_design_description\t '
1806
- 'instrument_model \ t library_construction_protocol\t platform\t primer \t '
1807
- 'qiita_prep_id \t run_prefix\t str_column\n '
1824
+ 'insdc_nulls \t instrument_model \ t library_construction_protocol\t platform\t '
1825
+ 'primer \t qiita_prep_id \t run_prefix\t str_column\n '
1808
1826
'1.SKB7.640196\t CCTCTGAGAGCT\t ANL\t Test Project\t \t EMP\t BBBB\t '
1809
- 'Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t {0} \t '
1810
- 's_G1_L002_sequences \t Value for sample 3\n '
1827
+ 'not applicable \t Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t '
1828
+ '{0} \t s_G1_L002_sequences \t Value for sample 3\n '
1811
1829
'1.SKB8.640193\t GTCCGCAAGTTA\t ANL\t Test Project\t \t EMP\t BBBB\t '
1812
- 'Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t {0} \t '
1813
- 's_G1_L001_sequences \t Value for sample 1\n '
1830
+ '3.6 \t Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t '
1831
+ '{0} \t s_G1_L001_sequences \t Value for sample 1\n '
1814
1832
'1.SKD8.640184\t CGTAGAGCTCTC\t ANL\t Test Project\t \t EMP\t BBBB\t '
1815
- 'Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t {0} \t '
1816
- 's_G1_L001_sequences \t Value for sample 2\n ' )
1833
+ 'not applicable \t Illumina MiSeq\t AAAA\t Illumina\t GTGCCAGCMGCCGCGGTAA\t '
1834
+ '{0} \t s_G1_L001_sequences \t Value for sample 2\n ' )
1817
1835
1818
1836
1819
1837
if __name__ == '__main__' :
0 commit comments