Alignment executables

FeatureAlignment Module

class feature_alignment.AlignmentStatistics
count(astats, multipeptides, fdr_cutoff, skipDecoy=True)
class feature_alignment.Experiment

Bases: msproteomicstoolslib.algorithms.alignment.MRExperiment.MRExperiment

An Experiment is a container for multiple experimental runs - some of which may contain the same precursors.

estimate_real_fdr(multipeptides, fraction_needed_selected)
print_stats(multipeptides, fdr_cutoff, fraction_present, min_nrruns)
write_to_file(multipeptides, options, writeTrafoFiles=True)
feature_alignment.estimate_aligned_fdr_cutoff(options, this_exp, multipeptides, fdr_range)
feature_alignment.doMSTAlignment(exp, multipeptides, max_rt_diff, rt_diff_isotope, initial_alignment_cutoff, fdr_cutoff, aligned_fdr_cutoff, smoothing_method, method, use_RT_correction, stdev_max_rt_per_run, use_local_stdev)

Minimum Spanning Tree (MST) based local aligment

feature_alignment.doParameterEstimation(options, this_exp, multipeptides)

Perform (q-value) parameter estimation

feature_alignment.doReferenceAlignment(options, this_exp, multipeptides)
feature_alignment.main(options)

Noise imputation Module

Analysis functions

requantAlignedValues.runSingleFileImputation(options, peakgroups_file, mzML_file, method)

Impute values across chromatograms

Parameters:
  • peakgroups_file (filename) – CSV file containing all peakgroups
  • mzML_file (filename) – mzML file containing chromatograms
Returns:

A tuple of: new_exp(AlignmentExperiment): experiment containing the aligned peakgroups multipeptides(list(AlignmentHelper.Multipeptide)): list of multipeptides

This function will read the csv file with all peakgroups as well as the provided chromatogram file (.chrom.mzML). It will then try to impute missing values for those peakgroups where no values is currently present, reading the raw chromatograms.

requantAlignedValues.runImputeValues(options, peakgroups_file, trafo_fnames)

Impute values across chromatograms

Parameters:
  • peakgroups_file (filename) – CSV file containing all peakgroups
  • trafo_fnames (filename) – A list of .tr filenames (it is assumed that in the same directory also the chromatogram mzML reside)
Returns:

A tuple of: new_exp(AlignmentExperiment): experiment containing the aligned peakgroups multipeptides(list(AlignmentHelper.Multipeptide)): list of multipeptides

This function will read the csv file with all peakgroups as well as the transformation files (.tr) and the corresponding raw chromatograms which need to be in the same folder. It will then try to impute missing values for those peakgroups where no values is currently present, reading the raw chromatograms.

requantAlignedValues.analyze_multipeptides(new_exp, multipeptides, swath_chromatograms, transformation_collection_, border_option, onlyExtractFromRun=None, tree=None, mat=None, disable_isotopic_transfer=False)

Analyze the multipeptides and impute missing values

Parameters:
  • new_exp (AlignmentExperiment) – experiment containing the aligned peakgroups
  • multipeptides (list(AlignmentHelper.Multipeptide)) – list of multipeptides
  • swath_chromatograms (dict) – containing the objects pointing to the original chrom mzML (see runImputeValues)
  • transformation_collection (.TransformationCollection) – specifying how to transform between retention times of different runs
Returns:

The updated multipeptides

This function will update the input multipeptides and add peakgroups, imputing missing values

requantAlignedValues.analyze_multipeptide_cluster(current_mpep, cnt, new_exp, swath_chromatograms, transformation_collection_, border_option, selected_pg, cluster_id, onlyExtractFromRun=None, tree=None, mat=None)
requantAlignedValues.integrate_chromatogram(template_pg, current_run, swath_chromatograms, left_start, right_end, cnt)

Integrate a chromatogram from left_start to right_end and store the sum.

Parameters:
  • template_pg (GeneralPeakGroup) – A template peakgroup from which to construct the new peakgroup
  • current_run (SWATHScoringReader.Run) – current run where the missing value occured
  • swath_chromatograms (dict) – containing the objects pointing to the original chrom mzML
  • left_start (float) – retention time for integration (left border)
  • right_end (float) – retention time for integration (right border)
Returns:

A new GeneralPeakGroup which contains the new, integrated intensity for this run (or “NA” if no chromatograms could be found).

Create a new peakgroup from the old pg and then store the integrated intensity.

requantAlignedValues.write_out(new_exp, multipeptides, outfile, matrix_outfile, single_outfile)

Write the result to disk

requantAlignedValues.main(options)

Data Structures

class requantAlignedValues.ImputeValuesHelper

Bases: object

Static object with some helper methods.

static select_correct_swath(swath_chromatograms, mz)

Select the correct chromatogram

Parameters:
  • swath_chromatograms (dict) – containing the objects pointing to the original chrom mzML (see runImputeValues)
  • mz (float) – the mz value of the precursor
class requantAlignedValues.SwathChromatogramRun

Bases: object

A single SWATH LC-MS/MS run.

Each run may contain multiple files (split up by swath).

getChromatogram(chromid)
parse(runid, files)

Parse a set of files which all belong to the same experiment

class requantAlignedValues.SwathChromatogramCollection

Bases: object

A collection of multiple SWATH LC-MS/MS runs.

Each single run is represented as a SwathChromatogramRun and accessible through a run id.

>>> mzml_files = ["file1.mzML", "file2.mzML"]
>>> runMapping = {"file1.mzML": "run1", "file2.mzML" : "run2"}
>>> chromatograms = SwathChromatogramCollection()
>>> chromatograms.parseFromMzML(mzml_files, runMapping)
>>> chromatogram = chromatograms.getChromatogram("run1", "ChromatogramId")
>>> chromatogram = chromatograms.getChromatogram("run2", "ChromatogramId")
createRunCache(runid)
getChromatogram(runid, chromid)
getRunIDs()
parseFromMzML(mzML_files, runIdMapping)

Parse a set of different experiments.

Parameters:
  • mzML_files (list(filename)) – a list of filenames of the mzML files
  • runIdMapping (dict) – a dictionary mapping each filename to a run id
parseFromTrafoFiles(trafo_fnames)

Parse a set of different experiments from the .tr files

The mzML files belonging to the same run are assumed to be in the same folder as the .tr files.

Table Of Contents

Previous topic

OpenSWATH - GUI Views

This Page