Skip to content

Commit

Permalink
Merge pull request #12 from hgb-bin-proteomics/develop
Browse files Browse the repository at this point in the history
Bugfix: Handle empty spectra
  • Loading branch information
michabirklbauer authored Jun 16, 2024
2 parents e952168 + 29cfd89 commit e4e00dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions create_spectral_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# micha.birklbauer@gmail.com

# version tracking
__version = "1.1.3"
__date = "2024-01-08"
__version = "1.1.4"
__date = "2024-06-17"

# REQUIREMENTS
# pip install pandas
Expand Down Expand Up @@ -60,7 +60,7 @@ def read_spectra(filename: Union[str, BinaryIO]) -> Dict[int, Dict]:
spectrum_dict = dict()
spectrum_dict["precursor"] = spectrum["params"]["pepmass"]
spectrum_dict["charge"] = spectrum["params"]["charge"]
spectrum_dict["max_intensity"] = float(max(spectrum["intensity array"]))
spectrum_dict["max_intensity"] = float(max(spectrum["intensity array"])) if len(spectrum["intensity array"]) > 0 else 0.0
peaks = dict()
for i, mz in enumerate(spectrum["m/z array"]):
peaks[mz] = spectrum["intensity array"][i]
Expand Down

0 comments on commit e4e00dd

Please sign in to comment.