Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michabirklbauer committed Jan 11, 2024
1 parent 720d069 commit 3beefac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def test5_msannika_fdr():
# csms file with fdr should validate
def test6_msannika_fdr():

import pandas as pd
from msannika_fdr import main
from msannika_fdr import MSAnnika_CSM_Validator as csm_val

Expand Down Expand Up @@ -106,13 +105,12 @@ def test6_msannika_fdr():
assert result[1].shape[0] == 3021

# check fdr of validated csms
results[1]["Class"] = pd.apply(lambda row: csm_val.get_class(row), axis = 1)
result[1]["Class"] = result[1].apply(lambda row: csm_val.get_class(row), axis = 1)
assert result[1][result[1]["Class"] == "Decoy"].shape[0] / result[1][result[1]["Class"] == "Target"].shape[0] < 0.01

# csms file with fdr should validate
def test7_msannika_fdr():

import pandas as pd
from msannika_fdr import main
from msannika_fdr import MSAnnika_CSM_Validator as csm_val

Expand Down Expand Up @@ -140,13 +138,12 @@ def test7_msannika_fdr():
assert result[1].shape[0] == 3021

# check fdr of validated csms
results[1]["Class"] = pd.apply(lambda row: csm_val.get_class(row), axis = 1)
result[1]["Class"] = result[1].apply(lambda row: csm_val.get_class(row), axis = 1)
assert result[1][result[1]["Class"] == "Decoy"].shape[0] / result[1][result[1]["Class"] == "Target"].shape[0] < 0.01

# csms file with fdr should validate
def test8_msannika_fdr():

import pandas as pd
from msannika_fdr import main
from msannika_fdr import MSAnnika_CSM_Validator as csm_val

Expand Down Expand Up @@ -174,5 +171,5 @@ def test8_msannika_fdr():
assert result[1].shape[0] == 3331

# check fdr of validated csms
results[1]["Class"] = pd.apply(lambda row: csm_val.get_class(row), axis = 1)
result[1]["Class"] = result[1].apply(lambda row: csm_val.get_class(row), axis = 1)
assert result[1][result[1]["Class"] == "Decoy"].shape[0] / result[1][result[1]["Class"] == "Target"].shape[0] < 0.01

0 comments on commit 3beefac

Please sign in to comment.