def main(options): out = options.outfile chromat_in = options.infile traml_in = options.traml_in trafo_in = options.trafo_in pp = pyopenms.MRMTransitionGroupPicker() metabolomics = False # this is an important weight for RT-deviation -- the larger the value, the less importance will be given to exact RT matches # for proteomics data it tends to be a good idea to set it to the length of # the RT space (e.g. for 100 second RT space, set it to 100) rt_normalization_factor = 100.0 pp_params = pp.getDefaults(); pp_params.setValue("PeakPickerMRM:remove_overlapping_peaks", options.remove_overlapping_peaks, '') pp_params.setValue("PeakPickerMRM:method", options.method, '') if (metabolomics): # Need to change those for metabolomics and very short peaks! pp_params.setValue("PeakPickerMRM:signal_to_noise", 0.01, '') pp_params.setValue("PeakPickerMRM:peak_width", 0.1, '') pp_params.setValue("PeakPickerMRM:gauss_width", 0.1, '') pp_params.setValue("resample_boundary", 0.05, '') pp_params.setValue("compute_peak_quality", "true", '') pp.setParameters(pp_params) scorer = pyopenms.MRMFeatureFinderScoring() scoring_params = scorer.getDefaults(); # Only report the top 5 features scoring_params.setValue("stop_report_after_feature", 5, '') scoring_params.setValue("rt_normalization_factor", rt_normalization_factor, '') scorer.setParameters(scoring_params); chromatograms = pyopenms.MSExperiment() fh = pyopenms.FileHandler() fh.loadExperiment(chromat_in, chromatograms) targeted = pyopenms.TargetedExperiment(); tramlfile = pyopenms.TraMLFile(); tramlfile.load(traml_in, targeted); trafoxml = pyopenms.TransformationXMLFile() trafo = pyopenms.TransformationDescription() if trafo_in is not None: model_params = pyopenms.Param() model_params.setValue("symmetric_regression", "false", "", []) model_type = "linear" trafoxml.load(trafo_in, trafo, True) trafo.fitModel(model_type, model_params); light_targeted = pyopenms.LightTargetedExperiment(); pyopenms.OpenSwathDataAccessHelper().convertTargetedExp(targeted, light_targeted) output = algorithm(chromatograms, light_targeted, pp, scorer, trafo) pyopenms.FeatureXMLFile().store(out, output);
def setUp(self): lt = pyopenms.LightTransition() lt.charge = 2 lt.transition_name = b"X" lt.peptide_ref = b"Y" lt.library_intensity = 12.0 lt.product_mz = 22.0 self.lt = lt lm = pyopenms.LightModification() lm.location = 13 lm.unimod_id = b"ID" self.lm = lm lpep = pyopenms.LightPeptide() lpep.rt = 12.0 lpep.charge = 2 lpep.sequence = b"SEQ" lpep.protein_ref = b"REF" lpep.modifications = [lm] self.lpep = lpep lprot = pyopenms.LightProtein() lprot.id = b"1234" lprot.sequence = b"ABC" self.lprot = lprot lte = pyopenms.LightTargetedExperiment() lte.peptides = [self.lpep] lte.proteins = [self.lprot] lte.transitions = [self.lt] self.lte = lte