|
16 | 16 |
|
17 | 17 |
|
18 | 18 | # version tracking
|
19 |
| -__version = "1.4.14" |
| 19 | +__version = "1.4.15" |
20 | 20 | __date = "2025-09-24"
|
21 | 21 |
|
22 | 22 | # REQUIREMENTS
|
|
48 | 48 | ######################
|
49 | 49 |
|
50 | 50 | # import packages
|
| 51 | +import gc |
51 | 52 | import re
|
52 | 53 | import pandas as pd
|
53 | 54 | from tqdm import tqdm
|
@@ -362,20 +363,20 @@ def read_multiple_spectra(filenames: List[str]) -> Dict[str, Dict[int, Dict]]:
|
362 | 363 | result_dict[current_spectra_file] = read_spectra(filename)
|
363 | 364 | print(f"INFO: Read all spectra from file {filename}.")
|
364 | 365 | except Exception as e:
|
365 |
| - print(f"Error while reading file: {filename}") |
| 366 | + print(f"ERROR: Error while reading file: {filename}") |
366 | 367 | print("Error details:")
|
367 | 368 | print(e)
|
368 | 369 | errors.append(filename)
|
369 | 370 | print(f"INFO: Read {i + 1}/{len(filenames)} files...")
|
370 | 371 |
|
371 | 372 | if len(errors) > 0:
|
372 |
| - print("Found errors in the following file(s):") |
| 373 | + print("ERROR: Found errors in the following file(s):") |
373 | 374 | for error in errors:
|
374 | 375 | print(error)
|
375 |
| - print("Exiting spectral library creation...") |
| 376 | + print("ERROR: Exiting spectral library creation...") |
376 | 377 | raise RuntimeError("Errors while reading spectra files!")
|
377 | 378 |
|
378 |
| - print("Read all spectra files successfully!") |
| 379 | + print("INFO: Read all spectra files successfully!") |
379 | 380 | return result_dict
|
380 | 381 |
|
381 | 382 | # read multiple spectra files - streamlit version
|
@@ -1349,6 +1350,8 @@ def main(spectra_file: Union[List[str], List[BinaryIO]] = SPECTRA_FILE,
|
1349 | 1350 | for i, row in tqdm(csms.iterrows(), total=csms.shape[0], desc="INFO: Processing CSMs..."):
|
1350 | 1351 | current_spectrum_file = ".".join(row["Spectrum File"].split(".")[:-1]).strip()
|
1351 | 1352 | if current_spectrum_file not in spectra:
|
| 1353 | + del spectra |
| 1354 | + gc.collect() |
1352 | 1355 | print("Found unseen spectrum file! Trying to read spectrum file...")
|
1353 | 1356 | local_spectrum_file_name = __get_local_spectrum_file_name(current_spectrum_file, spectra_file)
|
1354 | 1357 | spectra = read_multiple_spectra([local_spectrum_file_name])
|
|
0 commit comments