How to use the pyopenms.TraMLFile function in pyopenms

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 / MRMTransitionGroupPicker.py View on Github external
out = options.outfile
    chromat_in = options.infile
    traml_in = options.traml_in

    pp = pyopenms.MRMTransitionGroupPicker()

    pp_params = pp.getDefaults();
    pp_params.setValue("PeakPickerMRM:remove_overlapping_peaks", options.remove_overlapping_peaks, '')
    pp_params.setValue("PeakPickerMRM:method", options.method, '')
    pp.setParameters(pp_params);

    chromatograms = pyopenms.MSExperiment()
    fh = pyopenms.FileHandler()
    fh.loadExperiment(chromat_in, chromatograms)
    targeted = pyopenms.TargetedExperiment();
    tramlfile = pyopenms.TraMLFile();
    tramlfile.load(traml_in, targeted);

    output = algorithm(chromatograms, targeted, pp)

    pyopenms.FeatureXMLFile().store(out, output);
github msproteomicstools / msproteomicstools / msproteomicstoolslib / format / SWATHScoringMapper.py View on Github external
except ImportError as e:
        print("\nError!")
        print("Could not import pyOpenMS while trying to load a TraML file - please make sure pyOpenMS is installed.")
        print("pyOpenMS is available from https://pypi.python.org/pypi/pyopenms")
        print()
        raise e

    assert len(aligned_pg_files) == 1, "There should only be one file in simple mode"
    f = aligned_pg_files[0]

    # Produce simple mapping between runs and files (assume each file is one run)
    for i,raw in enumerate(rawdata_files):
        mapping[str(i)] = [ raw ]

    targexp = pyopenms.TargetedExperiment()
    pyopenms.TraMLFile().load(f, targexp)

    for peptide_precursor in targexp.getPeptides():

        # Fill the protein mapping
        protein_id = peptide_precursor.protein_refs
        if len(protein_id) > 0:
            protein_id = protein_id[0] # take the first one ... 

        tmp = protein_mapping.get(protein_id, [])
        if peptide_precursor.sequence not in tmp:
            tmp.append(peptide_precursor.sequence)
        protein_mapping[protein_id] = tmp

        # Fill the sequence mapping
        tmp = sequences_mapping.get(peptide_precursor.sequence, [])
        if peptide_precursor.id not in tmp:
github OpenMS / OpenMS / pyOpenMS / pyTOPP / MRMMapper.py View on Github external
out = options.outfile
    chromat_in = options.infile
    traml_in = options.traml_in

    # precursor_tolerance = 0.05
    # product_tolerance = 0.05
    # out = "/tmp/out.mzML"
    # chromat_in = "../source/TEST/TOPP/MRMMapping_input.chrom.mzML"
    # traml_in = "../source/TEST/TOPP/MRMMapping_input.TraML"

    ff = pyopenms.MRMFeatureFinderScoring()
    chromatogram_map = pyopenms.MSExperiment()
    fh = pyopenms.FileHandler()
    fh.loadExperiment(chromat_in, chromatogram_map)
    targeted = pyopenms.TargetedExperiment();
    tramlfile = pyopenms.TraMLFile();
    tramlfile.load(traml_in, targeted);
     
    output = algorithm(chromatogram_map, targeted, precursor_tolerance, product_tolerance)

    pyopenms.MzMLFile().store(out, output);
github OpenMS / OpenMS / src / pyOpenMS / pyTOPP / MRMMapper.py View on Github external
out = options.outfile
    chromat_in = options.infile
    traml_in = options.traml_in

    # precursor_tolerance = 0.05
    # product_tolerance = 0.05
    # out = "/tmp/out.mzML"
    # chromat_in = "../source/TEST/TOPP/MRMMapping_input.chrom.mzML"
    # traml_in = "../source/TEST/TOPP/MRMMapping_input.TraML"

    ff = pyopenms.MRMFeatureFinderScoring()
    chromatogram_map = pyopenms.MSExperiment()
    fh = pyopenms.FileHandler()
    fh.loadExperiment(chromat_in, chromatogram_map)
    targeted = pyopenms.TargetedExperiment();
    tramlfile = pyopenms.TraMLFile();
    tramlfile.load(traml_in, targeted);

    output = algorithm(chromatogram_map, targeted, precursor_tolerance, product_tolerance)

    pyopenms.MzMLFile().store(out, output);
github OpenMS / OpenMS / pyOpenMS / pyTOPP / OpenSwathChromatogramExtractor.py View on Github external
def main(options):

    # load TraML file
    targeted = pyopenms.TargetedExperiment();
    pyopenms.TraMLFile().load(options.traml_in, targeted);

    # Create empty files as input and finally as output
    empty_swath = pyopenms.MSExperiment()
    trafo = pyopenms.TransformationDescription()
    output = pyopenms.MSExperiment();

    # load input
    for infile in options.infiles:
        exp = pyopenms.MSExperiment()
        pyopenms.FileHandler().loadExperiment(infile, exp)

        transition_exp_used = pyopenms.TargetedExperiment();

        do_continue = True
        if options.is_swath:
            do_continue = pyopenms.OpenSwathHelper().checkSwathMapAndSelectTransitions(exp, targeted, transition_exp_used, options.min_upper_edge_dist)