How to use pyopenms - 10 common examples

To help you get started, we’ve selected a few pyopenms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
# set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github OpenMS / OpenMS / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
# set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
# set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github OpenMS / OpenMS / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
# set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
def algorithm(chromatograms, targeted):
    # Create empty files as input and finally as output
    empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.FeatureMap();

    # set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
github OpenMS / OpenMS / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
def algorithm(chromatograms, targeted):
    # Create empty files as input and finally as output
    empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.FeatureMap();

    # set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
def algorithm(chromatograms, targeted):
    # Create empty files as input and finally as output
    empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.FeatureMap();

    # set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
github OpenMS / OpenMS / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.FeatureMap();

    # set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / OpenSwathRTNormalizer.py View on Github external
empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.FeatureMap();

    # set up featurefinder and run
    featurefinder = pyopenms.MRMFeatureFinderScoring()
    # set the correct rt use values
    scoring_params = pyopenms.MRMFeatureFinderScoring().getDefaults();
    scoring_params.setValue("Scores:use_rt_score",'false', '')
    featurefinder.setParameters(scoring_params);
    featurefinder.pickExperiment(chromatograms, output, targeted, trafo, empty_swath)

    # get the pairs
    pairs=[]
    simple_find_best_feature(output, pairs, targeted)
    pairs_corrected = pyopenms.MRMRTNormalizer().rm_outliers( pairs, 0.95, 0.6) 
    pairs_corrected = [ list(p) for p in pairs_corrected] 

    # // store transformation, using a linear model as default
    trafo_out = pyopenms.TransformationDescription()
    trafo_out.setDataPoints(pairs_corrected);
    model_params = pyopenms.Param()
    model_params.setValue("symmetric_regression", 'false', '');
    model_type = "linear";
    trafo_out.fitModel(model_type, model_params);
    return trafo_out
github msproteomicstools / msproteomicstools / analysis / data_conversion / MSE2mzML.py View on Github external
rt = float(rt_[2])*60
    # Convert to mz/int pairs, then into separate arrays filtering out zero-intensity peaks
    pairs = [it.split() for it in stack[3:] if len(it.strip()) > 0 and float(it.split()[1]) > 0.0]
    try:
        mz = [float(it[0]) for it in pairs]
        intensity = [float(it[1]) for it in pairs]
    except ValueError:
        print("Could not convert", len(stack), "with pairs" , len(pairs))
        return
    assert len(mz) == len(intensity)
    #
    print("Handle scan at rt", rt)
    peaks = np.ndarray(shape=(len(mz), 2), dtype=np.float32)
    peaks[:,0] = mz
    peaks[:,1] = intensity
    s = pyopenms.MSSpectrum()
    s.set_peaks(peaks)
    s.setRT(rt)
    # set MSLevel to 1 for all
    s.setMSLevel(1)
    outexp.addSpectrum(s)