Anton Bushuiev
commited on
Commit
·
926bf18
1
Parent(s):
c53be73
Fix test example downloading
Browse files
app.py
CHANGED
|
@@ -18,15 +18,22 @@ from dreams.definitions import *
|
|
| 18 |
|
| 19 |
|
| 20 |
def setup():
|
| 21 |
-
# Download
|
| 22 |
-
|
|
|
|
| 23 |
url = 'https://huggingface.co/datasets/roman-bushuiev/GeMS/resolve/main/data/auxiliary/MassSpecGym_DreaMS.hdf5'
|
| 24 |
-
target_path = '
|
| 25 |
-
if not
|
| 26 |
urllib.request.urlretrieve(url, target_path)
|
| 27 |
|
| 28 |
# Run simple example as a test and to download weights
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
print("Setup complete")
|
| 31 |
|
| 32 |
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
def setup():
|
| 21 |
+
# Download spectral library
|
| 22 |
+
data_path = Path('./DreaMS/data')
|
| 23 |
+
data_path.mkdir(parents=True, exist_ok=True)
|
| 24 |
url = 'https://huggingface.co/datasets/roman-bushuiev/GeMS/resolve/main/data/auxiliary/MassSpecGym_DreaMS.hdf5'
|
| 25 |
+
target_path = data_path / 'MassSpecGym_DreaMS.hdf5'
|
| 26 |
+
if not target_path.exists():
|
| 27 |
urllib.request.urlretrieve(url, target_path)
|
| 28 |
|
| 29 |
# Run simple example as a test and to download weights
|
| 30 |
+
# Download example spectra file
|
| 31 |
+
example_url = 'https://raw.githubusercontent.com/pluskal-lab/DreaMS/cc806fa6fea281c1e57dd81fc512f71de9290017/data/examples/example_5_spectra.mgf'
|
| 32 |
+
example_path = Path('./data/example_5_spectra.mgf')
|
| 33 |
+
example_path.parent.mkdir(parents=True, exist_ok=True)
|
| 34 |
+
if not example_path.exists():
|
| 35 |
+
urllib.request.urlretrieve(example_url, example_path)
|
| 36 |
+
embs = dreams_embeddings(example_path)
|
| 37 |
print("Setup complete")
|
| 38 |
|
| 39 |
|