From 0a95b61e0f5aba084a1355c9cf2f5c85c35a240a Mon Sep 17 00:00:00 2001 From: Micha Birklbauer Date: Thu, 11 Jan 2024 13:25:22 +0100 Subject: [PATCH] add more tests --- tests/tests.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/tests.py b/tests/tests.py index 94ebc93..099655f 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -29,3 +29,48 @@ def test2_msannika_fdr(): # check fdr assert result[0][result[0]["Decoy"] == True].shape[0] / result[0][result[0]["Decoy"] == False].shape[0] < 0.01 + +# crosslink file with fdr should validate +def test3_msannika_fdr(): + + from msannika_fdr import main + + result = main(["DSSO_Crosslinks.xlsx", "-fdr", "1"]) + + # check nr of results + assert len(result) == 1 + + # check nr of crosslinks + assert result[0].shape[0] == 714 + + # check fdr + assert result[0][result[0]["Decoy"] == True].shape[0] / result[0][result[0]["Decoy"] == False].shape[0] < 0.01 + +# crosslink file with fdr should validate +def test4_msannika_fdr(): + + from msannika_fdr import main + + result = main(["DSSO_Crosslinks.xlsx", "-fdr", "0.05"]) + + # check nr of results + assert len(result) == 1 + + # check nr of crosslinks + assert result[0].shape[0] == 807 + + # check fdr + assert result[0][result[0]["Decoy"] == True].shape[0] / result[0][result[0]["Decoy"] == False].shape[0] < 0.05 + +# csms file without fdr should group +def test5_msannika_fdr(): + + from msannika_fdr import main + + result = main(["DSSO_CSMs.xlsx"]) + + # check nr of results + assert len(result) == 1 + + # check nr of grouped crosslinks + assert result[0].shape[0] == 3192