minwoosun commited on
Commit
d92a1e1
·
verified ·
1 Parent(s): e6813cf

fix path variable

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -78,13 +78,15 @@ def toggle_file_input(default_dataset):
78
 
79
 
80
  def main(input_file_path, species, default_dataset):
 
 
81
 
82
  # clone and cd into UCE repo
83
  os.system('git clone https://github.com/minwoosun/UCE.git')
84
- os.chdir(base_path)
85
 
86
  # Add the directory to the Python path
87
- sys.path.append(base_path)
88
 
89
  # Set default dataset path
90
  default_dataset_1_path = hf_hub_download(repo_id="minwoosun/uce-misc", filename="100_pbmcs_proc_subset.h5ad")
@@ -102,17 +104,16 @@ def main(input_file_path, species, default_dataset):
102
  from evaluate import AnndataProcessor
103
  from accelerate import Accelerator
104
 
105
- base_path = '/home/user/app/UCE/'
106
  model_loc = 'minwoosun/uce-100m'
107
 
108
  print(input_file_path)
109
- print(base_path)
110
  print(model_loc)
111
 
112
  # Construct the command
113
  command = [
114
  'python',
115
- base_path + 'eval_single_anndata.py',
116
  '--adata_path', input_file_path,
117
  '--dir', dir_path,
118
  '--model_loc', model_loc
@@ -134,12 +135,12 @@ def main(input_file_path, species, default_dataset):
134
  # Set output file path
135
  file_name_with_ext = os.path.basename(input_file_path)
136
  file_name = os.path.splitext(file_name_with_ext)[0]
137
- pred_file = base_path + f"{file_name}_predictions.csv"
138
  model_path = hf_hub_download(repo_id="minwoosun/uce-misc", filename="tabula_sapiens_v1_logistic_regression_model_weights.json")
139
 
140
  file_name_with_ext = os.path.basename(input_file_path)
141
  file_name = os.path.splitext(file_name_with_ext)[0]
142
- output_file = base_path + f"{file_name}_uce_adata.h5ad"
143
  adata = sc.read_h5ad(output_file)
144
  x = adata.obsm['X_uce']
145
 
 
78
 
79
 
80
  def main(input_file_path, species, default_dataset):
81
+
82
+ BASE_PATH = '/home/user/app/UCE/'
83
 
84
  # clone and cd into UCE repo
85
  os.system('git clone https://github.com/minwoosun/UCE.git')
86
+ os.chdir(BASE_PATH)
87
 
88
  # Add the directory to the Python path
89
+ sys.path.append(BASE_PATH)
90
 
91
  # Set default dataset path
92
  default_dataset_1_path = hf_hub_download(repo_id="minwoosun/uce-misc", filename="100_pbmcs_proc_subset.h5ad")
 
104
  from evaluate import AnndataProcessor
105
  from accelerate import Accelerator
106
 
 
107
  model_loc = 'minwoosun/uce-100m'
108
 
109
  print(input_file_path)
110
+ print(BASE_PATH)
111
  print(model_loc)
112
 
113
  # Construct the command
114
  command = [
115
  'python',
116
+ BASE_PATH + 'eval_single_anndata.py',
117
  '--adata_path', input_file_path,
118
  '--dir', dir_path,
119
  '--model_loc', model_loc
 
135
  # Set output file path
136
  file_name_with_ext = os.path.basename(input_file_path)
137
  file_name = os.path.splitext(file_name_with_ext)[0]
138
+ pred_file = BASE_PATH + f"{file_name}_predictions.csv"
139
  model_path = hf_hub_download(repo_id="minwoosun/uce-misc", filename="tabula_sapiens_v1_logistic_regression_model_weights.json")
140
 
141
  file_name_with_ext = os.path.basename(input_file_path)
142
  file_name = os.path.splitext(file_name_with_ext)[0]
143
+ output_file = BASE_PATH + f"{file_name}_uce_adata.h5ad"
144
  adata = sc.read_h5ad(output_file)
145
  x = adata.obsm['X_uce']
146