jannisborn commited on
Commit
ed32193
·
unverified ·
1 Parent(s): 30c86cf
Files changed (3) hide show
  1. app.py +5 -5
  2. requirements.txt +4 -3
  3. submission.py +1 -1
app.py CHANGED
@@ -26,10 +26,9 @@ site_mapper = {
26
  def run_inference(
27
  smiles: Optional[str],
28
  smiles_path: Optional[str],
29
- omic_path: Optional[str],
30
  confidence: bool,
31
  ):
32
-
33
  # Read SMILES
34
  if smiles is None and smiles_path is None:
35
  raise TypeError("Pass either single SMILES or a file")
@@ -43,8 +42,10 @@ def run_inference(
43
  raise ValueError(f"Found invalid SMILES {smi}")
44
 
45
  # Read omics and otherwise load baseline
46
- if not isinstance(omic_path, (str, type(None))):
47
- raise TypeError(f"Omics file pass has to be None or str, not {type(omic_path)}")
 
 
48
 
49
  # ToDo: Add progress bar for multiple smiles
50
  results = {}
@@ -106,7 +107,6 @@ def run_inference(
106
 
107
 
108
  if __name__ == "__main__":
109
-
110
  # Load metadata
111
  metadata_root = pathlib.Path(__file__).parent.joinpath("model_cards")
112
 
 
26
  def run_inference(
27
  smiles: Optional[str],
28
  smiles_path: Optional[str],
29
+ omic: Optional[str],
30
  confidence: bool,
31
  ):
 
32
  # Read SMILES
33
  if smiles is None and smiles_path is None:
34
  raise TypeError("Pass either single SMILES or a file")
 
42
  raise ValueError(f"Found invalid SMILES {smi}")
43
 
44
  # Read omics and otherwise load baseline
45
+ if omic is not None:
46
+ omic_path = omic.name
47
+ else:
48
+ omic_path = None
49
 
50
  # ToDo: Add progress bar for multiple smiles
51
  results = {}
 
107
 
108
 
109
  if __name__ == "__main__":
 
110
  # Load metadata
111
  metadata_root = pathlib.Path(__file__).parent.joinpath("model_cards")
112
 
requirements.txt CHANGED
@@ -10,11 +10,12 @@ numpy>=1.14.3
10
  scikit-learn==0.21.3
11
  pandas==0.24.1
12
  torch>=1.3.0
13
- matplotlib>=2.2.2
14
- seaborn>=0.9.0
15
  boto3==1.11.16
16
  boto3_type_annotations==0.3.1
17
  gunicorn==20.0.4
18
  regex==2020.1.8
19
  bokeh==1.4.0
20
- importlib_resources
 
 
10
  scikit-learn==0.21.3
11
  pandas==0.24.1
12
  torch>=1.3.0
13
+ matplotlib==3.3.4
14
+ seaborn==0.11.2
15
  boto3==1.11.16
16
  boto3_type_annotations==0.3.1
17
  gunicorn==20.0.4
18
  regex==2020.1.8
19
  bokeh==1.4.0
20
+ importlib_resources
21
+ urllib3==1.25.11
submission.py CHANGED
@@ -37,7 +37,7 @@ def submission(
37
  task_id (str): task identifier.
38
  estimate_confidence (bool, optional): estimate confidence of the
39
  prediction. Defaults to False.
40
- omics_file (Optional[str], optional): binary string containing
41
  expression data. Defaults to None.
42
  """
43
  prefix = os.path.join(RESULTS_PREFIX, workspace_id, task_id)
 
37
  task_id (str): task identifier.
38
  estimate_confidence (bool, optional): estimate confidence of the
39
  prediction. Defaults to False.
40
+ omics_file (Optional[str], optional): path to file containing
41
  expression data. Defaults to None.
42
  """
43
  prefix = os.path.join(RESULTS_PREFIX, workspace_id, task_id)