Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Jul 24, 2024
1 parent c3ae809 commit fe5811a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spras/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def process_config(self, raw_config):
self.analysis_include_ml = raw_config["analysis"]["ml"]["include"]
self.analysis_include_evalution = raw_config["analysis"]["evaluation"]["include"]

# COMMENT: the code will run correctly without this section below due to empty dict in try except above
# COMMENT: the code will run correctly without this section below due to empty dict in try except above
# TODO: decide if this part is needed
if self.gold_standards == {} and self.analysis_include_evalution == True:
print("Gold standard data not provided. Evaluation analysis cannot run.")
Expand Down
11 changes: 3 additions & 8 deletions spras/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ def load_files_from_dict(self, gold_standard_dict):
returns: none
"""
self.label = gold_standard_dict["label"] # COMMENT: cannot be empty, will break with a NoneType exception
self.label = gold_standard_dict["label"] # COMMENT: cannot be empty, will break with a NoneType exception
self.datasets = gold_standard_dict["datasets"] # COMMENT: can be empty, snakemake will not run evaluation due to dataset_gold_standard_pairs in snakemake file

try:
# COMMENT: cannot be empty, snakemake will run evaluation even if empty
node_data_files = gold_standard_dict["node_files"][0] # TODO: single file for now
except:
if not gold_standard_dict["node_files"]:
raise ValueError (f"Node_files for {self.label} is an empty list, cannot run evalution")
# COMMENT: cannot be empty, snakemake will run evaluation even if empty
node_data_files = gold_standard_dict["node_files"][0] # TODO: single file for now

data_loc = gold_standard_dict["data_dir"]

Expand All @@ -75,7 +71,6 @@ def load_files_from_dict(self, gold_standard_dict):

# TODO: later iteration - chose between node and edge file, or allow both

# TODO: move outside of Evaluation class?
def precision(file_paths: Iterable[Path], node_table: pd.DataFrame, output_file: str):
"""
Takes in file paths for a specific dataset and an associated gold standard node table.
Expand Down
1 change: 0 additions & 1 deletion spras/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from spras.allpairs import AllPairs as allpairs
from spras.dataset import Dataset
from spras.domino import DOMINO as domino
from spras.evaluation import Evaluation
from spras.meo import MEO as meo
from spras.mincostflow import MinCostFlow as mincostflow
from spras.omicsintegrator1 import OmicsIntegrator1 as omicsintegrator1
Expand Down

0 comments on commit fe5811a

Please sign in to comment.