VyLala commited on
Commit
743194b
·
verified ·
1 Parent(s): 20d117d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -8,9 +8,15 @@ from functools import lru_cache
8
  from mtdna_classifier import classify_sample_location
9
  import subprocess
10
 
11
- if not os.path.exists(f"{os.environ['HOME']}/edirect/esummary"):
12
- subprocess.run("yes | sh -c \"$(wget -q https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh -O -)\"", shell=True)
 
 
 
 
 
13
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"
 
14
 
15
 
16
  @lru_cache(maxsize=128)
 
8
  from mtdna_classifier import classify_sample_location
9
  import subprocess
10
 
11
+ import shutil
12
+
13
+ if not shutil.which("esummary"):
14
+ subprocess.run(
15
+ 'yes | sh -c "$(wget -q https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh -O -)"',
16
+ shell=True
17
+ )
18
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"
19
+ print("EDirect esummary found at:", shutil.which("esummary"))
20
 
21
 
22
  @lru_cache(maxsize=128)