diff --git a/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_good_input.csv b/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_good_input.csv new file mode 100644 index 00000000..93411fc4 --- /dev/null +++ b/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_good_input.csv @@ -0,0 +1,8 @@ +uniqid,genename,uniprotid,ensg,tissue,log2_fc,ci_upr,ci_lwr,pval,cor_pval +RPL35|P42766,RPL35,P42766,ENSG00000136942,DLPFC,-0.0763864716519552,-0.0099209909244187,-0.1428519523794917,0.0194330864811924,0.0532108844452419 +SLC6A12|P48065,SLC6A12,P48065,ENSG00000111181,DLPFC,0.0424329158355659,0.1099491140769349,-0.0250832824058029,0.303320959613638,0.5210898536952243 +PTPN11|Q06124,PTPN11,Q06124,ENSG00000179295,DLPFC,0.0064652259159073,0.0458145863390218,-0.0328841345072071,0.9213060368774064,0.9998368407824682 +PLXNB1|O43157,PLXNB1,O43157,ENSG00000164050,DLPFC,0.1315038527175516,0.2011640123915693,0.061843693043534,3.094711736695288e-05,0.0001727880719654 +STX5|Q13190,STX5,Q13190,ENSG00000162236,DLPFC,0.0042787903893951,0.1178799748681132,-0.1093223940893228,0.9957000250037246,0.999696551493841 +MTOR|P42345,MTOR,P42345,ENSG00000198793,DLPFC,-0.016913729214123,0.014911434052702,-0.0487388924809481,0.4255337386213362,0.6381170540950976 +STX1B|P61266,STX1B,P61266,ENSG00000099365,DLPFC,-0.0627896276157541,-0.018089777426611,-0.1074894778048971,0.0029030746757215,0.0092621906320641 \ No newline at end of file diff --git a/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_missing_input.csv b/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_missing_input.csv new file mode 100644 index 00000000..2768a992 --- /dev/null +++ b/tests/test_assets/proteomics_distribution_data/input/test_proteomics_distribution_srm_missing_input.csv @@ -0,0 +1,8 @@ +uniqid,genename,uniprotid,ensg,tissue,log2_fc,ci_upr,ci_lwr,pval,cor_pval +RPL35|P42766,RPL35,P42766,ENSG00000136942,,-0.0763864716519552,-0.0099209909244187,-0.1428519523794917,0.0194330864811924,0.0532108844452419 +SLC6A12|P48065,SLC6A12,P48065,ENSG00000111181,,0.0424329158355659,0.1099491140769349,-0.0250832824058029,0.303320959613638,0.5210898536952243 +PTPN11|Q06124,PTPN11,Q06124,ENSG00000179295,DLPFC,0.0064652259159073,0.0458145863390218,-0.0328841345072071,0.9213060368774064,0.9998368407824682 +PLXNB1|O43157,PLXNB1,O43157,ENSG00000164050,,0.1315038527175516,0.2011640123915693,0.061843693043534,3.094711736695288e-05,0.0001727880719654 +STX5|Q13190,STX5,Q13190,ENSG00000162236,DLPFC,0.0042787903893951,0.1178799748681132,-0.1093223940893228,0.9957000250037246,0.999696551493841 +MTOR|P42345,MTOR,P42345,ENSG00000198793,DLPFC,-0.016913729214123,0.014911434052702,-0.0487388924809481,0.4255337386213362,0.6381170540950976 +STX1B|P61266,STX1B,P61266,ENSG00000099365,DLPFC,-0.0627896276157541,-0.018089777426611,-0.1074894778048971,0.0029030746757215,0.0092621906320641 \ No newline at end of file diff --git a/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output.json b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output.json index 3fd37174..30f8a96a 100644 --- a/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output.json +++ b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output.json @@ -43,5 +43,14 @@ "median": 0.1132, "third_quartile": 0.2011, "type": "TMT" + }, + { + "tissue": "DLPFC", + "min": -0.1363, + "max": 0.1209, + "first_quartile": -0.0399, + "median": 0.0043, + "third_quartile": 0.0244, + "type": "SRM" } ] \ No newline at end of file diff --git a/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output_two_types.json b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output_two_types.json new file mode 100644 index 00000000..3fd37174 --- /dev/null +++ b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_good_output_two_types.json @@ -0,0 +1,47 @@ +[ + { + "tissue": "AntPFC", + "min": -0.1806, + "max": 0.1514, + "first_quartile": -0.0561, + "median": -0.011, + "third_quartile": 0.0269, + "type": "LFQ" + }, + { + "tissue": "DLPFC", + "min": -0.1472, + "max": 0.146, + "first_quartile": -0.0373, + "median": 0.018, + "third_quartile": 0.036, + "type": "LFQ" + }, + { + "tissue": "MFG", + "min": -0.0979, + "max": 0.0192, + "first_quartile": -0.054, + "median": -0.0339, + "third_quartile": -0.0247, + "type": "LFQ" + }, + { + "tissue": "TCX", + "min": -0.3847, + "max": 0.3455, + "first_quartile": -0.1109, + "median": -0.0953, + "third_quartile": 0.0717, + "type": "LFQ" + }, + { + "tissue": "DLPFC", + "min": -0.4097, + "max": 0.5676, + "first_quartile": -0.0432, + "median": 0.1132, + "third_quartile": 0.2011, + "type": "TMT" + } +] \ No newline at end of file diff --git a/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_missing_output.json b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_missing_output.json index 3ff9ea32..4e4686fd 100644 --- a/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_missing_output.json +++ b/tests/test_assets/proteomics_distribution_data/output/proteomics_distribution_missing_output.json @@ -43,5 +43,14 @@ "median": 0.1104, "third_quartile": 0.2545, "type": "TMT" + }, + { + "tissue": "DLPFC", + "min": -0.0782, + "max": 0.0546, + "first_quartile": -0.0284, + "median": -0.0063, + "third_quartile": 0.0048, + "type": "SRM" } ] \ No newline at end of file diff --git a/tests/transform/test_proteomics_distribution_data.py b/tests/transform/test_proteomics_distribution_data.py index 2f769a06..c8bd1630 100644 --- a/tests/transform/test_proteomics_distribution_data.py +++ b/tests/transform/test_proteomics_distribution_data.py @@ -18,6 +18,7 @@ class TestTransformProteomicsDistributionData: { "proteomics": "test_proteomics_distribution_lfq_good_input.csv", "proteomics_tmt": "test_proteomics_distribution_tmt_good_input.csv", + "proteomics_srm": "test_proteomics_distribution_srm_good_input.csv" }, "proteomics_distribution_good_output.json", ), @@ -25,19 +26,29 @@ class TestTransformProteomicsDistributionData: { "proteomics": "test_proteomics_distribution_lfq_missing_input.csv", "proteomics_tmt": "test_proteomics_distribution_tmt_missing_input.csv", + "proteomics_srm": "test_proteomics_distribution_srm_missing_input.csv" }, "proteomics_distribution_missing_output.json", ), + ( # pass with only two of the three proteomics types + { + "proteomics": "test_proteomics_distribution_lfq_good_input.csv", + "proteomics_tmt": "test_proteomics_distribution_tmt_good_input.csv", + }, + "proteomics_distribution_good_output_two_types.json", + ) ] pass_test_ids = [ - "Pass with good data (LFQ and TMT)", + "Pass with good data", "Pass with missing data", + "Pass with only two out of three proteomics types (LFQ, TMT)" ] fail_test_data = [ ( # fail with bad data type { "proteomics": "test_proteomics_distribution_lfq_wrong_data_type.csv", "proteomics_tmt": "test_proteomics_distribution_tmt_good_input.csv", + "proteomics_srm": "test_proteomics_distribution_srm_good_input.csv", }, KeyError, ), @@ -45,6 +56,7 @@ class TestTransformProteomicsDistributionData: { "proteomics": "test_proteomics_distribution_lfq_good_input.csv", "proteomics_tmt": "test_proteomics_distribution_tmt_bad_input.csv", + "proteomics_srm": "test_proteomics_distribution_srm_good_input.csv", }, KeyError, ), @@ -52,6 +64,7 @@ class TestTransformProteomicsDistributionData: { "bad_name": "test_proteomics_distribution_lfq_good_input.csv", "proteomics_tmt": "test_proteomics_distribution_tmt_good_input.csv", + "proteomics_srm": "test_proteomics_distribution_srm_good_input.csv", }, ValueError, ),