diff --git a/ms2rescore/feature_generators/ms2.py b/ms2rescore/feature_generators/ms2.py index 490f4f4..a3bd6d7 100644 --- a/ms2rescore/feature_generators/ms2.py +++ b/ms2rescore/feature_generators/ms2.py @@ -23,7 +23,6 @@ FRAGMENTATION_MODELS = { "cidhcd": FragmentationModel.CidHcd, - "etcid": FragmentationModel.Etcid, "etd": FragmentationModel.Etd, "ethcd": FragmentationModel.Ethcd, "all": FragmentationModel.All, @@ -148,28 +147,6 @@ def _calculate_features(self, psm_list: PSMList, spectrum_file: str) -> List: else: psm.rescoring_features.update({"hyperscore": np.nan}) - # with multiprocessing.Pool(self.processes) as pool: - # counts_failed = 0 - # for psm, features in zip( - # psm_list, - # track( - # pool.imap( - # self._calculate_spectrum_features_wrapper, - # zip(psm_list, annotated_spectra), - # chunksize=1000, - # ), - # total=len(psm_list), - # description="Calculating MS2 features...", - # transient=True, - # ), - # ): - # if features: - # psm.rescoring_features.update(features) - - # else: - # counts_failed += 1 - # if counts_failed > 0: - # logger.warning(f"Failed to calculate features for {counts_failed} PSMs") @staticmethod def _read_spectrum_file(spectrum_filepath: str) -> Union[mzml.PreIndexedMzML, mgf.IndexedMGF]: @@ -246,10 +223,6 @@ def _calculate_spectrum_features(self, psm, annotated_spectrum): / (len(b_ions_matched) + len(y_ions_matched)), } - def _calculate_spectrum_features_wrapper(self, psm_spectrum_tuple): - psm, spectrum = psm_spectrum_tuple - return self._calculate_spectrum_features(psm, spectrum) - def _annotate_spectrum(self, psm, pyteomics_spectrum): spectrum = RawSpectrum( @@ -272,17 +245,6 @@ def _annotate_spectrum(self, psm, pyteomics_spectrum): return annotated_spectrum.spectrum - def _calculate_hyperscore(self, psm, spectrum): - pass - - def _calculate_fragmentation_features(self, psm, annotated_spectrum): - pass - - -# TODO: keep this here? -def modification_evidence(): - return - def _annotated_spectrum_to_mzint(annotated_spectrum, ion_types=["b", "y"]): diff --git a/ms2rescore/parse_psms.py b/ms2rescore/parse_psms.py index cc61926..2f0ec3b 100644 --- a/ms2rescore/parse_psms.py +++ b/ms2rescore/parse_psms.py @@ -104,13 +104,9 @@ def parse_psms(config: Dict, psm_list: Union[PSMList, None]) -> PSMList: psm.rescoring_features = {} psm_handler = PSMHandler( - **mumble_config, # TODO how do we store config for mumble? + **mumble_config, ) - psm_list = psm_handler.add_modified_psms( - psm_list, generate_modified_decoys=True, keep_original=True - ) - if mumble_config["output_file"]: - psm_handler.write_modified_psm_list(psm_list, mumble_config["output_file"]) + psm_list = psm_handler.add_modified_psms(psm_list) return psm_list diff --git a/pyproject.toml b/pyproject.toml index 4285f1f..985cc27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,6 @@ dependencies = [ "pyteomics>=4.7.2", "rich>=12", "tomli>=2; python_version < '3.11'", - "mumble" ] [project.optional-dependencies]