Skip to content

Commit

Permalink
Added SpectrumProcessor for the primary harmonization of the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
omokshyna committed Nov 1, 2023
1 parent 9efba0c commit 19900e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library_spectra_validation/library_handler.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
from matchms.importing import load_spectra
from matchms.filtering.SpectrumProcessor import SpectrumProcessor

class LibraryHandler:
"""Stores the 3 different types of spectra. Correct, repaired, wrong.
Has internal organization using spectrum ids"""

def __init__(self, f, pipeline):
self.spectra = load_spectra(f)
#todo modify default pipeline
metadata_field_harmonization = SpectrumProcessor(predefined_pipeline="default")
self.spectra = metadata_field_harmonization.process_spectrums(load_spectra(f))
self.pipeline = pipeline
self.spectra_dictionary = {
'valid': None, #[id1, id2,...]
'repaired': None, #[id1:[modifications],..]
'invalid': None #also a dictionary
}
self.modifications = []
self.modifications = {} #todo change to Modifications class

def clean_and_validate_spectrum(self, spectrum_id):
spectrum = self.spectra[spectrum_id]
Expand Down

0 comments on commit 19900e8

Please sign in to comment.