diff --git a/share/OpenMS/SCHEMAS/FeatureXML_1_8.xsd b/share/OpenMS/SCHEMAS/FeatureXML_1_8.xsd index 061f0241977..1b05b0c9a71 100644 --- a/share/OpenMS/SCHEMAS/FeatureXML_1_8.xsd +++ b/share/OpenMS/SCHEMAS/FeatureXML_1_8.xsd @@ -464,7 +464,7 @@ significance threshold as calculated by the search engine - + Integer reference number of the identified spectrum (or feature) diff --git a/share/OpenMS/SCHEMAS/FeatureXML_1_9.xsd b/share/OpenMS/SCHEMAS/FeatureXML_1_9.xsd index 79a63b2743a..8e91f328526 100644 --- a/share/OpenMS/SCHEMAS/FeatureXML_1_9.xsd +++ b/share/OpenMS/SCHEMAS/FeatureXML_1_9.xsd @@ -469,7 +469,7 @@ significance threshold as calculated by the search engine - + Integer reference number of the identified spectrum (or feature) diff --git a/src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h b/src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h index d2aef17c926..1e32b2cc268 100644 --- a/src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h +++ b/src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h @@ -99,12 +99,12 @@ namespace OpenMS The formula is obtained from "The importance of accurately correcting for the natural abundance of stable isotopes", Midani et al, doi:10.1016/j.ab.2016.12.011 - @param[in] normalized_feature Feature with normalized values for each component and unlabeled chemical formula for each component group. - @param[in] correction_matrix Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of + @param normalized_feature Feature with normalized values for each component and unlabeled chemical formula for each component group. + @param correction_matrix Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of naturally abundant 13C contribute to spectral peaks that overlap (or convolve) the spectral peaks of the corrected MDV of the derivatization agent. - @param[in] correction_matrix_agent name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, + @param correction_matrix_agent name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, only "TBDMS" is supported for now. - @param[out] corrected_feature Feature with corrected values for each component. + @return corrected_feature Feature with corrected values for each component. */ void isotopicCorrection( const Feature& normalized_feature, Feature& corrected_feature, @@ -117,12 +117,12 @@ namespace OpenMS The formula is obtained from "The importance of accurately correcting for the natural abundance of stable isotopes", Midani et al, doi:10.1016/j.ab.2016.12.011 - @param[in] normalized_featuremap FeatureMap with normalized values for each component and unlabeled chemical formula for each component group. - @param[in] correction_matrix Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of + @param normalized_featuremap FeatureMap with normalized values for each component and unlabeled chemical formula for each component group. + @param correction_matrix Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of naturally abundant 13C contribute to spectral peaks that overlap (or convolve) the spectral peaks of the corrected MDV of the derivatization agent. - @param[in] correction_matrix_agent name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, + @param correction_matrix_agent name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, only "TBDMS" is supported for now. - @param[out] corrected_featuremap FeatureMap with corrected values for each component. + @return corrected_featuremap FeatureMap with corrected values for each component. */ void isotopicCorrections( const FeatureMap& normalized_featureMap, FeatureMap& corrected_featureMap, diff --git a/src/openms/include/OpenMS/FILTERING/CALIBRATION/InternalCalibration.h b/src/openms/include/OpenMS/FILTERING/CALIBRATION/InternalCalibration.h index c17f4623f9f..2ea272d9ff0 100644 --- a/src/openms/include/OpenMS/FILTERING/CALIBRATION/InternalCalibration.h +++ b/src/openms/include/OpenMS/FILTERING/CALIBRATION/InternalCalibration.h @@ -200,7 +200,7 @@ namespace OpenMS const String& file_residuals_plot = "", const String& rscript_executable = "Rscript"); - /* + /** @brief Transform a precursor's m/z Calibrate m/z of precursors. @@ -210,7 +210,7 @@ namespace OpenMS */ static void applyTransformation(std::vector& pcs, const MZTrafoModel& trafo); - /* + /** @brief Transform a spectrum (data+precursor) See applyTransformation(MSExperiment, ...) for details. @@ -221,7 +221,7 @@ namespace OpenMS */ static void applyTransformation(PeakMap::SpectrumType& spec, const IntList& target_mslvl, const MZTrafoModel& trafo); - /* + /** @brief Transform spectra from a whole map (data+precursor) All data peaks and precursor information (if present) are calibrated in m/z. @@ -290,7 +290,7 @@ namespace OpenMS /// determine if sequence is within tol_ppm and update stats; fills mz_ref with the theoretical m/z of the sequence bool isDecalibrated_(const PeptideIdentification& pep_id, const double mz_obs, const double tol_ppm, CalibrantStats_& stats, double& mz_ref); - /* + /** @brief Calibrate m/z of a spectrum, ignoring precursors! This method is not exposed as public, because its easy to be misused on spectra while forgetting about the precursors of high-level spectra. diff --git a/src/openms/include/OpenMS/FORMAT/InspectOutfile.h b/src/openms/include/OpenMS/FORMAT/InspectOutfile.h index bfcf965c14e..212b9e71e36 100644 --- a/src/openms/include/OpenMS/FORMAT/InspectOutfile.h +++ b/src/openms/include/OpenMS/FORMAT/InspectOutfile.h @@ -154,13 +154,13 @@ namespace OpenMS } /** - get the search engine and its version from the output of the InsPecT executable without parameters + @brief get the search engine and its version from the output of the InsPecT executable without parameters returns true on success, false otherwise */ bool getSearchEngineAndVersion(const String & cmd_output, ProteinIdentification & protein_identification); - /** read the header of an inspect output file and retrieve various information + /** @brief read the header of an inspect output file and retrieve various information @throw Exception::ParseError */ void readOutHeader(const String & filename, const String & header_line, Int & spectrum_file_column, Int & scan_column, Int & peptide_column, Int & protein_column, Int & charge_column, Int & MQ_score_column, Int & p_value_column, Int & record_number_column, Int & DB_file_pos_column, Int & spec_file_pos_column, Size & number_of_columns); diff --git a/src/openms/include/OpenMS/KERNEL/ChromatogramTools.h b/src/openms/include/OpenMS/KERNEL/ChromatogramTools.h index 1cf216f05d8..e5e8fa43e3c 100644 --- a/src/openms/include/OpenMS/KERNEL/ChromatogramTools.h +++ b/src/openms/include/OpenMS/KERNEL/ChromatogramTools.h @@ -73,7 +73,7 @@ namespace OpenMS /// @name Accessors //@{ /** - @brief converts the chromatogram to a list of spectra with instrument settings SRM + @brief converts the chromatogram to a list of spectra with instrument settings This conversion may be necessary as most of the spectra formats do not support chromatograms, except of mzML. However, most formats support e.g. SRM chromatogram diff --git a/src/openms/include/OpenMS/MATH/MISC/BSpline2d.h b/src/openms/include/OpenMS/MATH/MISC/BSpline2d.h index 5e12867eb6f..001a5528873 100644 --- a/src/openms/include/OpenMS/MATH/MISC/BSpline2d.h +++ b/src/openms/include/OpenMS/MATH/MISC/BSpline2d.h @@ -122,12 +122,6 @@ namespace OpenMS */ double derivative(const double x) const; - /** - * Return the first derivative of the spline curve at the given @p x. - * Returns zero if the current state is not ok(). - */ - double derivatives(double x, unsigned order = 1) const; - /** * Return whether the spline fit was successful. */ diff --git a/src/openms/include/OpenMS/MATH/MISC/CubicSpline2d.h b/src/openms/include/OpenMS/MATH/MISC/CubicSpline2d.h index 942e53fa7dc..f12cf676cc5 100644 --- a/src/openms/include/OpenMS/MATH/MISC/CubicSpline2d.h +++ b/src/openms/include/OpenMS/MATH/MISC/CubicSpline2d.h @@ -87,6 +87,13 @@ namespace OpenMS */ double eval(double x) const; + /** + * @brief evaluates first derivative of spline at position x + * + * @param x x-position + */ + double derivative(double x) const; + /** * @brief evaluates derivative of spline at position x * diff --git a/src/openms/include/OpenMS/MATH/MISC/LinearInterpolation.h b/src/openms/include/OpenMS/MATH/MISC/LinearInterpolation.h index 6dff9f25e69..bb4314d61ee 100644 --- a/src/openms/include/OpenMS/MATH/MISC/LinearInterpolation.h +++ b/src/openms/include/OpenMS/MATH/MISC/LinearInterpolation.h @@ -184,7 +184,7 @@ namespace OpenMS } } - /**@brief Performs linear resampling. The arg_value is split up and + /** @brief Performs linear resampling. The arg_value is split up and added to the data points around arg_pos. */ void addValue(KeyType arg_pos, ValueType arg_value) @@ -237,7 +237,7 @@ namespace OpenMS } } - /**@brief Returns the interpolated derivative. + /** @brief Returns the interpolated derivative. Please drop me (= the maintainer) a message if you are using this. */ @@ -321,7 +321,7 @@ namespace OpenMS return data_; } - /**@brief Assigns data to the internal random access container from + /** @brief Assigns data to the internal random access container from which interpolated values are being sampled. SourceContainer must be assignable to ContainerType. @@ -374,7 +374,7 @@ namespace OpenMS return scale_; } - /**@brief Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". + /** @brief Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". Note: Using this invalidates the inside and outside reference points. @@ -401,8 +401,8 @@ namespace OpenMS offset_ = offset; } - /**@brief Specifies the mapping from "outside" to "inside" coordinates by the following data: - - scale: the difference in outside coordinates between consecutive values in the data vector. + /** @brief Specifies the mapping from "outside" to "inside" coordinates by the following data: + - scale: the difference in outside coordinates between consecutive values in the data vector. - inside and outside: these x-axis positions are mapped onto each other. For example, when you have a complicated probability distribution @@ -422,7 +422,7 @@ namespace OpenMS offset_ = outside - scale * inside; } - /**@brief Specifies the mapping from "outside" to "inside" coordinates by the following data: + /** @brief Specifies the mapping from "outside" to "inside" coordinates by the following data: - inside_low and outside_low: these axis positions are mapped onto each other. - inside_high and outside_high: these axis positions are mapped onto each other. diff --git a/src/openms/include/OpenMS/MATH/MISC/SplineBisection.h b/src/openms/include/OpenMS/MATH/MISC/SplineBisection.h index 84a6c44f2e2..7e3efeb73d4 100644 --- a/src/openms/include/OpenMS/MATH/MISC/SplineBisection.h +++ b/src/openms/include/OpenMS/MATH/MISC/SplineBisection.h @@ -70,7 +70,7 @@ namespace OpenMS do { double mid = (lefthand + righthand) / 2.0; - double midpoint_deriv_val = peak_spline.derivatives(mid, 1); + double midpoint_deriv_val = peak_spline.derivative(mid); // if deriv nearly zero then maximum already found if (!(std::fabs(midpoint_deriv_val) > eps)) diff --git a/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWavelet.h b/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWavelet.h index 2311e8e0d38..a271a5f1a68 100644 --- a/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWavelet.h +++ b/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWavelet.h @@ -65,41 +65,44 @@ namespace OpenMS /** @brief Returns the value of the isotope wavelet at position @p t. Usually, you do not need to call this function. - * Please use @see sampleTheWavelet instead. - * - * Note that this functions returns the pure function value of psi and not the normalized (average=0) - * value given by Psi. - * @param t The position at which the wavelet has to be drawn (within the coordinate system of the wavelet). - * @param m The m/z position within the signal (i.e. the mass not de-charged) within the signal. - * @param z The charge @p z we want to detect. - * @param mode Indicates whether positive mode (+1) or negative mode (-1) has been used for ionization. */ + Please use @see sampleTheWavelet instead. + + Note that this functions returns the pure function value of psi and not the normalized (average=0) + value given by Psi. + @param t The position at which the wavelet has to be drawn (within the coordinate system of the wavelet). + @param m The m/z position within the signal (i.e. the mass not de-charged) within the signal. + @param z The charge @p z we want to detect. + @param mode Indicates whether positive mode (+1) or negative mode (-1) has been used for ionization. + */ static double getValueByMass(const double t, const double m, const UInt z, const Int mode = +1) { return getValueByLambda(getLambdaL(m * z - z * mode * Constants::IW_PROTON_MASS), t * z + 1); } /** @brief Returns the value of the isotope wavelet at position @p t via a fast table lookup. - * Usually, you do not need to call this function. - * Please use @see sampleTheWavelet instead. - * - * Note that this functions returns the pure function value of psi and not the normalized (average=0) - * value given by Psi. - * @param lambda The mass-parameter lambda. - * @param tz1 t (the position) times the charge (z) plus 1. */ + Usually, you do not need to call this function. + Please use @see sampleTheWavelet instead. + + Note that this functions returns the pure function value of psi and not the normalized (average=0) + value given by Psi. + @param lambda The mass-parameter lambda. + @param tz1 t (the position) times the charge (z) plus 1. + */ static double getValueByLambda(const double lambda, const double tz1); /** @brief Returns the value of the isotope wavelet at position @p t. - * This function is usually significantly slower than the table lookup performed in @see getValueByLambda. - * Nevertheless, it might be necessary to call this function due to extrapolating reasons caused by the - * alignment of the wavelet. - * - * Usually, you do not need to call this function. - * Please use @see sampleTheWavelet instead. - * - * Note that this functions returns the pure function value of psi and not the normalized (average=0) - * value given by Psi. - * @param lambda The mass-parameter lambda. - * @param tz1 t (the position) times the charge (z) plus 1. */ + This function is usually significantly slower than the table lookup performed in @see getValueByLambda. + Nevertheless, it might be necessary to call this function due to extrapolating reasons caused by the + alignment of the wavelet. + + Usually, you do not need to call this function. + Please use @see sampleTheWavelet instead. + + Note that this functions returns the pure function value of psi and not the normalized (average=0) + value given by Psi. + @param lambda The mass-parameter lambda. + @param tz1 t (the position) times the charge (z) plus 1. + */ static double getValueByLambdaExtrapol(const double lambda, const double tz1); static double getValueByLambdaExact(const double lambda, const double tz1); @@ -118,18 +121,20 @@ namespace OpenMS } /** @brief Returns the table_steps_ parameter. - * - * This is an internally used parameter controlling the precision of several pre-sampling steps. - * Normally, this parameter can be left unchanged. */ + + This is an internally used parameter controlling the precision of several pre-sampling steps. + Normally, this parameter can be left unchanged. + */ static double getTableSteps() { return table_steps_; } /** @brief Returns the inv_table_steps_ parameter. - * - * This is an internally used parameter controlling the precision of several pre-sampling steps. - * Normally, this parameter can be left unchanged. */ + + This is an internally used parameter controlling the precision of several pre-sampling steps. + Normally, this parameter can be left unchanged. + */ static double getInvTableSteps() { return inv_table_steps_; @@ -147,9 +152,10 @@ namespace OpenMS /** @brief Computes the averagine isotopic distribution we would expect at the de-convoluted mass. - * @param m The de-convoluted mass m. - * @param size Returns the number of significant peaks within a pattern occurring at mass @p m. - * @return The isotopic distribution. */ + @param m The de-convoluted mass m. + @param size Returns the number of significant peaks within a pattern occurring at mass @p m. + @return The isotopic distribution. + */ static const IsotopeDistribution::ContainerType & getAveragine(const double m, UInt * size = nullptr); @@ -195,13 +201,14 @@ namespace OpenMS /** @brief Should be called once before values are drawn from the isotope wavelet function. - * The function is automatically called by the public constructor. - * - * The function pre-computes the expensive gamma function. Parameters related to this function are: - * @see max_charge_ and @see peak_cutoff_. If both of these are set correctly @see getValue will never compute - * the gamma function online. - * - * @param max_m The maximal de-convoluted mass that occurs in the current data set. */ + The function is automatically called by the public constructor. + + The function pre-computes the expensive gamma function. Parameters related to this function are: + @see max_charge_ and @see peak_cutoff_. If both of these are set correctly @see getValue will never compute + the gamma function online. + + @param max_m The maximal de-convoluted mass that occurs in the current data set. + */ static void preComputeExpensiveFunctions_(const double max_m); diff --git a/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWaveletTransform.h b/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWaveletTransform.h index e355d1311d9..ff238d43e51 100644 --- a/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWaveletTransform.h +++ b/src/openms/include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWaveletTransform.h @@ -288,7 +288,7 @@ namespace OpenMS /** @brief Computes a linear (intensity) interpolation. * @param mz_a The m/z value of the point left to the query. - * @param mz_a The intensity value of the point left to the query. + * @param intens_a The intensity value of the point left to the query. * @param mz_pos The query point. * @param mz_b The m/z value of the point right to the query. * @param intens_b The intensity value of the point left to the query. */ diff --git a/src/openms/source/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSAlphabet.cpp b/src/openms/source/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSAlphabet.cpp index 5ebaeb8fe2a..392140c504b 100644 --- a/src/openms/source/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSAlphabet.cpp +++ b/src/openms/source/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSAlphabet.cpp @@ -41,12 +41,9 @@ #include #include -namespace OpenMS +namespace OpenMS::ims { - namespace ims - { - const IMSAlphabet::name_type & IMSAlphabet::getName(size_type index) const { return getElement(index).getName(); @@ -174,5 +171,4 @@ namespace OpenMS return os; } - } // namespace ims -} // namespace OpenMS +} // namespace OpenMS // namespace ims diff --git a/src/openms/source/COMPARISON/SPECTRA/BinnedSpectrum.cpp b/src/openms/source/COMPARISON/SPECTRA/BinnedSpectrum.cpp index c94d1127a65..9b086e5de33 100644 --- a/src/openms/source/COMPARISON/SPECTRA/BinnedSpectrum.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/BinnedSpectrum.cpp @@ -81,7 +81,10 @@ namespace OpenMS { OPENMS_PRECONDITION(ps.isSorted(), "Spectrum needs to be sorted by m/z."); - if (ps.empty()) { return; } + if (ps.empty()) + { + return; + } bins_ = EmptySparseVector; @@ -120,15 +123,20 @@ namespace OpenMS } // efficient look-up of number of non-zero entries, so we use this as-well - if (bins_.nonZeros() != rhs.bins_.nonZeros()) { return false; } + if (bins_.nonZeros() != rhs.bins_.nonZeros()) + { + return false; + } // test non-sparse (non-zero) elements for equality SparseVectorIteratorType it(bins_); SparseVectorIteratorType rhs_it(rhs.bins_); while (it) { - if (it.index() != rhs_it.index() - || it.value() != rhs_it.value()) { return false; } + if (it.index() != rhs_it.index() || it.value() != rhs_it.value()) + { + return false; + } ++it; ++rhs_it; } diff --git a/src/openms/source/COMPARISON/SPECTRA/PeakAlignment.cpp b/src/openms/source/COMPARISON/SPECTRA/PeakAlignment.cpp index 6caddb4a2fe..ec995e1c8aa 100644 --- a/src/openms/source/COMPARISON/SPECTRA/PeakAlignment.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/PeakAlignment.cpp @@ -85,10 +85,14 @@ namespace OpenMS // shortcut similarity calculation by comparing PrecursorPeaks (PrecursorPeaks more than delta away from each other are supposed to be from another peptide) double pre_mz1 = 0.0; if (!spec1.getPrecursors().empty()) + { pre_mz1 = spec1.getPrecursors()[0].getMZ(); + } double pre_mz2 = 0.0; if (!spec2.getPrecursors().empty()) + { pre_mz2 = spec2.getPrecursors()[0].getMZ(); + } if (fabs(pre_mz1 - pre_mz2) > (double)param_.getValue("precursor_mass_tolerance")) { return 0; diff --git a/src/openms/source/COMPARISON/SPECTRA/SpectrumAlignmentScore.cpp b/src/openms/source/COMPARISON/SPECTRA/SpectrumAlignmentScore.cpp index 87bfd8dad25..07255de7fcf 100644 --- a/src/openms/source/COMPARISON/SPECTRA/SpectrumAlignmentScore.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/SpectrumAlignmentScore.cpp @@ -97,11 +97,16 @@ namespace OpenMS // calculate sum of squared intensities double sum1(0); - for (auto const & p : s1) { sum1 += pow(p.getIntensity(), 2); } + for (auto const & p : s1) + { + sum1 += pow(p.getIntensity(), 2); + } double sum2(0); - for (auto const & p : s2) { sum2 += pow(p.getIntensity(), 2); } - + for (auto const & p : s2) + { + sum2 += pow(p.getIntensity(), 2); + } for (auto const & ap : alignment) { const double mz_tolerance = is_relative_tolerance ? tolerance * s1[ap.first].getMZ() * 1e-6 : tolerance; diff --git a/src/openms/source/COMPARISON/SPECTRA/SpectrumCheapDPCorr.cpp b/src/openms/source/COMPARISON/SPECTRA/SpectrumCheapDPCorr.cpp index e1b9635c7d0..d5b397d4ff0 100644 --- a/src/openms/source/COMPARISON/SPECTRA/SpectrumCheapDPCorr.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/SpectrumCheapDPCorr.cpp @@ -111,9 +111,13 @@ namespace OpenMS lastconsensus_ = PeakSpectrum(); Precursor p1, p2; if (!x.getPrecursors().empty()) + { p1 = x.getPrecursors()[0]; + } if (!y.getPrecursors().empty()) + { p2 = y.getPrecursors()[0]; + } lastconsensus_.getPrecursors().resize(1); lastconsensus_.getPrecursors()[0].setMZ((p1.getMZ() + p2.getMZ()) / 2); lastconsensus_.getPrecursors()[0].setCharge(p1.getCharge()); @@ -174,9 +178,13 @@ namespace OpenMS yrun++; } if (xit + xrun == x.end()) + { break; + } if (yit + yrun == y.end()) + { break; + } } //dynamic programming necessary to calculate optimal pairing @@ -292,7 +300,9 @@ namespace OpenMS consensuspeak.setMZ(x[xstart + i - 1].getMZ()); consensuspeak.setIntensity((x[xstart + i - 1].getIntensity()) * (1 - factor_)); if (keeppeaks_) + { lastconsensus_.push_back(consensuspeak); + } i--; } else if (trace[i][j] == -1) @@ -301,11 +311,15 @@ namespace OpenMS consensuspeak.setMZ(y[ystart + j - 1].getMZ()); consensuspeak.setIntensity((y[ystart + j - 1].getIntensity()) * factor_); if (keeppeaks_) + { lastconsensus_.push_back(consensuspeak); + } j--; } if (!i || !j) + { break; + } } return dparray[xend - xstart + 1][yend - ystart + 1]; diff --git a/src/openms/source/COMPARISON/SPECTRA/SpectrumPrecursorComparator.cpp b/src/openms/source/COMPARISON/SPECTRA/SpectrumPrecursorComparator.cpp index 2e8e89954d7..0a082743dfa 100644 --- a/src/openms/source/COMPARISON/SPECTRA/SpectrumPrecursorComparator.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/SpectrumPrecursorComparator.cpp @@ -78,10 +78,14 @@ namespace OpenMS double mz1 = 0.0; if (!x.getPrecursors().empty()) + { mz1 = x.getPrecursors()[0].getMZ(); + } double mz2 = 0.0; if (!y.getPrecursors().empty()) + { mz2 = y.getPrecursors()[0].getMZ(); + } if (fabs(mz1 - mz2) > window) { diff --git a/src/openms/source/COMPARISON/SPECTRA/SteinScottImproveScore.cpp b/src/openms/source/COMPARISON/SPECTRA/SteinScottImproveScore.cpp index e8bfc9fe321..9d995d999f9 100644 --- a/src/openms/source/COMPARISON/SPECTRA/SteinScottImproveScore.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/SteinScottImproveScore.cpp @@ -103,16 +103,16 @@ namespace OpenMS std::cout << std::endl; std::cout << s2 << std::endl;*/ - for (PeakSpectrum::ConstIterator it1 = s1.begin(); it1 != s1.end(); ++it1) + for (const Peak1D& it1 : s1) { - double temp = it1->getIntensity(); + double temp = it1.getIntensity(); sum1 += temp * temp; sum3 += temp; } - for (PeakSpectrum::ConstIterator it1 = s2.begin(); it1 != s2.end(); ++it1) + for (const Peak1D& it1 : s2) { - double temp = it1->getIntensity(); + double temp = it1.getIntensity(); sum2 += temp * temp; sum4 += temp; } diff --git a/src/openms/source/COMPARISON/SPECTRA/ZhangSimilarityScore.cpp b/src/openms/source/COMPARISON/SPECTRA/ZhangSimilarityScore.cpp index 1734b3d8053..38e4f6c5676 100644 --- a/src/openms/source/COMPARISON/SPECTRA/ZhangSimilarityScore.cpp +++ b/src/openms/source/COMPARISON/SPECTRA/ZhangSimilarityScore.cpp @@ -93,9 +93,9 @@ namespace OpenMS throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); } - for (PeakSpectrum::ConstIterator it1 = s1.begin(); it1 != s1.end(); ++it1) + for (const Peak1D& it1 : s1) { - sum1 += it1->getIntensity(); + sum1 += it1.getIntensity(); /* for (PeakSpectrum::ConstIterator it2 = s1.begin(); it2 != s1.end(); ++it2) { @@ -158,9 +158,9 @@ for (PeakSpectrum::ConstIterator it2 = s1.begin(); it2 != s1.end(); ++it2) } }*/ - for (PeakSpectrum::ConstIterator it1 = s2.begin(); it1 != s2.end(); ++it1) + for (const Peak1D& it1 : s2) { - sum2 += it1->getIntensity(); + sum2 += it1.getIntensity(); /* for (PeakSpectrum::ConstIterator it2 = s2.begin(); it2 != s2.end(); ++it2) { diff --git a/src/openms/source/CONCEPT/ClassTest.cpp b/src/openms/source/CONCEPT/ClassTest.cpp index 07481f7d80d..2f309c951d5 100644 --- a/src/openms/source/CONCEPT/ClassTest.cpp +++ b/src/openms/source/CONCEPT/ClassTest.cpp @@ -55,12 +55,9 @@ #include -namespace OpenMS +namespace OpenMS::Internal::ClassTest { - namespace Internal - { - namespace ClassTest - { + bool all_tests = true; bool equal_files; bool newline = false; @@ -91,10 +88,6 @@ namespace OpenMS std::vector tmp_file_list; std::vector failed_lines_list; StringList whitelist; - } - - namespace ClassTest - { void mainInit(const char* version, const char* class_name, int argc, const char* argv0) { @@ -443,8 +436,7 @@ namespace OpenMS } } - bool - isRealSimilar(long double number_1, long double number_2) + bool isRealSimilar(long double number_1, long double number_2) { // Note: The original version of the stuff below was copied from // FuzzyStringComparator and then heavily modified for ClassTest. @@ -571,8 +563,7 @@ namespace OpenMS } } - void - testStringEqual(const char* /*file*/, int line, + void testStringEqual(const char* /*file*/, int line, const std::string& string_1, const char* string_1_stringified, const std::string& string_2, @@ -684,7 +675,4 @@ namespace OpenMS return result; } - - } - } } diff --git a/src/openms/source/CONCEPT/FuzzyStringComparator.cpp b/src/openms/source/CONCEPT/FuzzyStringComparator.cpp index 2b7df499e8f..b827271a6ed 100644 --- a/src/openms/source/CONCEPT/FuzzyStringComparator.cpp +++ b/src/openms/source/CONCEPT/FuzzyStringComparator.cpp @@ -300,8 +300,10 @@ namespace OpenMS bool FuzzyStringComparator::compareLines_(std::string const& line_str_1, std::string const& line_str_2) { // in most cases, results will be identical. If not, do the expensive fuzzy compare - if (line_str_1 == line_str_2) return true; - + if (line_str_1 == line_str_2) + { + return true; + } for (StringList::const_iterator slit = whitelist_.begin(); slit != whitelist_.end(); ++slit) { @@ -350,8 +352,10 @@ namespace OpenMS #ifdef DEBUG_FUZZY std::cout << "cmp number: " << String(element_1_.number) << " : " << String(element_2_.number) << std::endl; #endif - if (element_1_.number == element_2_.number) continue; - + if (element_1_.number == element_2_.number) + { + continue; + } // check if absolute difference is small double absdiff = element_1_.number - element_2_.number; if (absdiff < 0) @@ -666,7 +670,9 @@ namespace OpenMS wlcit != whitelist_cases_.end(); ++wlcit) { if (wlcit->first.size() > length) + { length = wlcit->first.size(); + } } for (std::map::const_iterator wlcit = whitelist_cases_.begin(); wlcit != whitelist_cases_.end(); ++wlcit) diff --git a/src/openms/source/CONCEPT/GlobalExceptionHandler.cpp b/src/openms/source/CONCEPT/GlobalExceptionHandler.cpp index edeb7d9b728..d6a1e0cc27d 100644 --- a/src/openms/source/CONCEPT/GlobalExceptionHandler.cpp +++ b/src/openms/source/CONCEPT/GlobalExceptionHandler.cpp @@ -53,12 +53,9 @@ #define OPENMS_CORE_DUMP_ENVNAME "OPENMS_DUMP_CORE" -namespace OpenMS +namespace OpenMS::Exception { - namespace Exception - { - GlobalExceptionHandler::GlobalExceptionHandler() throw() { std::set_terminate(terminate); @@ -143,6 +140,5 @@ namespace OpenMS GlobalExceptionHandler::line_() = line; } - } // namespace Exception -} // namespace OpenMS +} // namespace OpenMS // namespace Exception diff --git a/src/openms/source/CONCEPT/Init.cpp b/src/openms/source/CONCEPT/Init.cpp index 888851fa582..6c7e9c0bb88 100644 --- a/src/openms/source/CONCEPT/Init.cpp +++ b/src/openms/source/CONCEPT/Init.cpp @@ -36,28 +36,25 @@ #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { - // Initialize xerces - // see ticket #352 for more details - struct xerces_init + // Initialize xerces + // see ticket #352 for more details + struct xerces_init + { + xerces_init() { - xerces_init() - { - xercesc::XMLPlatformUtils::Initialize(); - } + xercesc::XMLPlatformUtils::Initialize(); + } - ~xerces_init() - { - xercesc::XMLPlatformUtils::Terminate(); - } + ~xerces_init() + { + xercesc::XMLPlatformUtils::Terminate(); + } - }; - const xerces_init xinit; + }; + const xerces_init xinit; - } -} +} //OpenMS //Internal diff --git a/src/openms/source/CONCEPT/LogStream.cpp b/src/openms/source/CONCEPT/LogStream.cpp index 88cb537fd42..78b1c47d335 100644 --- a/src/openms/source/CONCEPT/LogStream.cpp +++ b/src/openms/source/CONCEPT/LogStream.cpp @@ -82,7 +82,9 @@ namespace OpenMS { clearCache(); if (incomplete_line_.size() > 0) + { distribute_(incomplete_line_); + } delete[] pbuf_; pbuf_ = nullptr; } @@ -293,8 +295,9 @@ namespace OpenMS // send outline (and extra_message) to attached streams if (!extra_message.empty()) + { distribute_(extra_message); - + } distribute_(outstring); } @@ -413,8 +416,9 @@ namespace OpenMS { if (registered_at_ == nullptr) + { return; - + } registered_at_->remove(stream_); registered_at_ = nullptr; } @@ -479,8 +483,9 @@ namespace OpenMS void LogStream::insertNotification(std::ostream & s, LogStreamNotifier & target) { if (!bound_()) + { return; - + } insert(s); StreamIterator it = findStream_(s); @@ -504,16 +509,18 @@ namespace OpenMS bool LogStream::hasStream_(std::ostream & stream) { if (!bound_()) + { return false; - + } return findStream_(stream) != rdbuf()->stream_list_.end(); } void LogStream::setPrefix(const std::ostream & s, const string & prefix) { if (!bound_()) + { return; - + } StreamIterator it = findStream_(s); if (it != rdbuf()->stream_list_.end()) { @@ -524,8 +531,9 @@ namespace OpenMS void LogStream::setPrefix(const string & prefix) { if (!bound_()) + { return; - + } for (StreamIterator it = rdbuf()->stream_list_.begin(); it != rdbuf()->stream_list_.end(); ++it) { (*it).prefix = prefix; diff --git a/src/openms/source/CONCEPT/ProgressLogger.cpp b/src/openms/source/CONCEPT/ProgressLogger.cpp index d23636f8903..357019b2e9b 100644 --- a/src/openms/source/CONCEPT/ProgressLogger.cpp +++ b/src/openms/source/CONCEPT/ProgressLogger.cpp @@ -174,11 +174,17 @@ namespace OpenMS switch (type) { case NONE: + { return "NONE"; + } case CMD: + { return "CMD"; + } case GUI: + { return "GUI"; + } } // should never happen but gcc emits a warning/error @@ -205,7 +211,10 @@ namespace OpenMS ProgressLogger& ProgressLogger::operator=(const ProgressLogger& other) { - if (&other == this) return *this; + if (&other == this) + { + return *this; + } this->last_invoke_ = other.last_invoke_; this->type_ = other.type_; @@ -249,8 +258,10 @@ namespace OpenMS void ProgressLogger::setProgress(SignedSize value) const { // update only if at least 1 second has passed - if (last_invoke_ == time(nullptr)) return; - + if (last_invoke_ == time(nullptr)) + { + return; + } last_invoke_ = time(nullptr); current_logger_->setProgress(value, recursion_depth_); } @@ -258,7 +269,10 @@ namespace OpenMS { auto p = current_logger_->nextProgress(); // update only if at least 1 second has passed - if (last_invoke_ == time(nullptr)) return; + if (last_invoke_ == time(nullptr)) + { + return; + } last_invoke_ = time(nullptr); current_logger_->setProgress(p, recursion_depth_); diff --git a/src/openms/source/CONCEPT/Types.cpp b/src/openms/source/CONCEPT/Types.cpp index a6b879157ca..b3d82fd8e00 100644 --- a/src/openms/source/CONCEPT/Types.cpp +++ b/src/openms/source/CONCEPT/Types.cpp @@ -35,10 +35,7 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { - const char * OpenMS_locale = setlocale(LC_ALL, "C"); - } -} + const char * OpenMS_locale = setlocale(LC_ALL, "C"); +} // OpenMS // Internal diff --git a/src/openms/source/CONCEPT/UniqueIdInterface.cpp b/src/openms/source/CONCEPT/UniqueIdInterface.cpp index e77cbe91302..f78030df9f0 100644 --- a/src/openms/source/CONCEPT/UniqueIdInterface.cpp +++ b/src/openms/source/CONCEPT/UniqueIdInterface.cpp @@ -37,8 +37,7 @@ namespace OpenMS { - void - UniqueIdInterface::setUniqueId(const String & rhs) + void UniqueIdInterface::setUniqueId(const String & rhs) { clearUniqueId(); diff --git a/src/openms/source/DATASTRUCTURES/Compomer.cpp b/src/openms/source/DATASTRUCTURES/Compomer.cpp index 127e49e449a..d805f13084e 100644 --- a/src/openms/source/DATASTRUCTURES/Compomer.cpp +++ b/src/openms/source/DATASTRUCTURES/Compomer.cpp @@ -237,16 +237,18 @@ namespace OpenMS String Compomer::getAdductsAsString(UInt side) const { if (side >= BOTH) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Compomer::getAdductsAsString() does not support this value for 'side'!", String(side)); - + } String r; for (const auto& [formula, adduct] : cmp_[side]) { Int f = adduct.getAmount(); if (formula.has('+')) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "An Adduct contains implicit charge. This is not allowed!", formula); - + } EmpiricalFormula ef(formula); ef = ef * f; r += ef.toString(); @@ -258,8 +260,9 @@ namespace OpenMS bool Compomer::isSingleAdduct(Adduct& a, const UInt side) const { if (side >= BOTH) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Compomer::isSimpleAdduct() does not support this value for 'side'!", String(side)); - + } if (cmp_[side].size() != 1) { return false; @@ -281,8 +284,9 @@ namespace OpenMS Compomer Compomer::removeAdduct(const Adduct& a, const UInt side) const { if (side >= BOTH) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Compomer::removeAdduct() does not support this value for 'side'!", String(side)); - + } Compomer tmp(*this); if (tmp.cmp_[side].count(a.getFormula()) > 0) { @@ -307,8 +311,9 @@ namespace OpenMS StringList Compomer::getLabels(const UInt side) const { if (side >= BOTH) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Compomer::getLabels() does not support this value for 'side'!", String(side)); - + } StringList tmp; for (CompomerSide::const_iterator it = this->cmp_[side].begin(); it != this->cmp_[side].end(); ++it) diff --git a/src/openms/source/DATASTRUCTURES/ConvexHull2D.cpp b/src/openms/source/DATASTRUCTURES/ConvexHull2D.cpp index db63e356026..c20e9a89265 100644 --- a/src/openms/source/DATASTRUCTURES/ConvexHull2D.cpp +++ b/src/openms/source/DATASTRUCTURES/ConvexHull2D.cpp @@ -244,8 +244,9 @@ namespace OpenMS } compressed_map[middle_it->first] = middle_it->second; // copy last scan if (succ_it != map_points_.end()) + { throw Exception::BufferOverflow(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); - + } //std::cout << "compressed CH from " << map_points_.size() << " to " << compressed_map.size() << "\n"; Size saved_points = map_points_.size() - compressed_map.size(); //copy diff --git a/src/openms/source/FILTERING/CALIBRATION/InternalCalibration.cpp b/src/openms/source/FILTERING/CALIBRATION/InternalCalibration.cpp index 1a5b007cf36..af2606f0c89 100644 --- a/src/openms/source/FILTERING/CALIBRATION/InternalCalibration.cpp +++ b/src/openms/source/FILTERING/CALIBRATION/InternalCalibration.cpp @@ -145,7 +145,10 @@ namespace OpenMS Size s_left = it->findNearest(mz_iso_left); if (Math::getPPMAbs(mz_iso_left, (*it)[s_left].getMZ()) < 0.5) // intra-scan ppm should be very good! { // peak nearby lock mass was not the monoisotopic - if (verbose) OPENMS_LOG_INFO << "peak at [RT, m/z] " << it->getRT() << ", " << (*it)[s].getMZ() << " is NOT monoisotopic. Skipping it!\n"; + if (verbose) + { + OPENMS_LOG_INFO << "peak at [RT, m/z] " << it->getRT() << ", " << (*it)[s].getMZ() << " is NOT monoisotopic. Skipping it!\n"; + } failed_lock_masses.insertCalibrationPoint(it->getRT(), itl->mz, 1.0, itl->mz, 0.0, std::distance(ref_masses.begin(), itl)); continue; } @@ -157,7 +160,10 @@ namespace OpenMS Size s_right = it->findNearest(mz_iso_right); if (!(Math::getPPMAbs(mz_iso_right, (*it)[s_right].getMZ()) < 0.5)) // intra-scan ppm should be very good! { // peak has no +1iso.. weird - if (verbose) OPENMS_LOG_INFO << "peak at [RT, m/z] " << it->getRT() << ", " << (*it)[s].getMZ() << " has no +1 isotope (ppm to closest: " << Math::getPPM(mz_iso_right, (*it)[s_right].getMZ()) << ")... Skipping it!\n"; + if (verbose) + { + OPENMS_LOG_INFO << "peak at [RT, m/z] " << it->getRT() << ", " << (*it)[s].getMZ() << " has no +1 isotope (ppm to closest: " << Math::getPPM(mz_iso_right, (*it)[s_right].getMZ()) << ")... Skipping it!\n"; + } failed_lock_masses.insertCalibrationPoint(it->getRT(), itl->mz, 2.0, itl->mz, 0.0, std::distance(ref_masses.begin(), itl)); continue; } @@ -261,8 +267,14 @@ namespace OpenMS double delta = Math::getPPMAbs(mz_obs, mz_ref); if (tol_ppm < delta) { - if (stats.cnt_decal < 10) OPENMS_LOG_INFO << "Peptide " << pid.getHits()[0].getSequence().toString() << " is " << delta << " (>" << tol_ppm << ") ppm away from theoretical mass and is omitted as calibration point.\n"; - else if (stats.cnt_decal == 10) OPENMS_LOG_INFO << "More than 10 peptides are at least " << tol_ppm << " ppm away from theoretical mass and are omitted as calibration point."; + if (stats.cnt_decal < 10) + { + OPENMS_LOG_INFO << "Peptide " << pid.getHits()[0].getSequence().toString() << " is " << delta << " (>" << tol_ppm << ") ppm away from theoretical mass and is omitted as calibration point.\n"; + } + else if (stats.cnt_decal == 10) + { + OPENMS_LOG_INFO << "More than 10 peptides are at least " << tol_ppm << " ppm away from theoretical mass and are omitted as calibration point."; + } ++stats.cnt_decal; return true; } @@ -439,9 +451,18 @@ namespace OpenMS for (Size i = 0; i < tms.size(); ++i) { sv << tms[i].getRT() << tms[i].toString(); - if (!MZTrafoModel::isValidModel(tms[i])) sv << "invalid"; // this only happens if ALL models are invalid (since otherwise they would use 'neighbour') - else if (invalid_models.count(i) > 0) sv << "neighbor"; - else sv << "local"; + if (!MZTrafoModel::isValidModel(tms[i])) + { + sv << "invalid"; // this only happens if ALL models are invalid (since otherwise they would use 'neighbour') + } + else if (invalid_models.count(i) > 0) + { + sv << "neighbor"; + } + else + { + sv << "local"; + } sv << nl; } } @@ -473,8 +494,11 @@ namespace OpenMS std::vector vec_ppm_before, vec_ppm_after; vec_ppm_before.reserve(cal_data_.size()); vec_ppm_after.reserve(cal_data_.size()); - if (sv != nullptr) *sv << "# residual error after calibration" << nl + if (sv != nullptr) + { + *sv << "# residual error after calibration" << nl << "RT" << "intensity" << "mz ref" << "mz before" << "mz after" << "ppm before" << "ppm after" << nl; + } Size ii(0); for (CalibrationData::const_iterator itc = cal_data_.begin(); itc != cal_data_.end(); ++itc, ++ii) { @@ -483,7 +507,10 @@ namespace OpenMS Size idx = (global_model ? 0 : MZTrafoModel::findNearest(tms, rt)); double mz_corrected = std::numeric_limits::quiet_NaN(); - if (MZTrafoModel::isValidModel(tms[idx])) mz_corrected = tms[idx].predict(itc->getMZ()); + if (MZTrafoModel::isValidModel(tms[idx])) + { + mz_corrected = tms[idx].predict(itc->getMZ()); + } double mz_ref = cal_data_.getRefMZ(ii); double ppm_before = Math::getPPM(itc->getMZ(), mz_ref); double ppm_after = Math::getPPM(mz_corrected, mz_ref); @@ -517,8 +544,10 @@ namespace OpenMS if (!hasValidModels) { // QC tables are done; quit OPENMS_LOG_ERROR << "Error: Could not build a single local calibration model! Check your calibrants and/or extend the search window!" << std::endl; - if (use_RANSAC) OPENMS_LOG_ERROR << " Since you are using RANSAC, check the parameters as well and test different setups." << std::endl; - + if (use_RANSAC) + { + OPENMS_LOG_ERROR << " Since you are using RANSAC, check the parameters as well and test different setups." << std::endl; + } return false; } diff --git a/src/openms/source/FILTERING/CALIBRATION/MZTrafoModel.cpp b/src/openms/source/FILTERING/CALIBRATION/MZTrafoModel.cpp index 70c6f2fef6c..dcc10f933f0 100644 --- a/src/openms/source/FILTERING/CALIBRATION/MZTrafoModel.cpp +++ b/src/openms/source/FILTERING/CALIBRATION/MZTrafoModel.cpp @@ -102,10 +102,18 @@ namespace OpenMS if (trafo.coeff_.empty()) return false; // go through coefficients and see if they are too extreme - if (limit_offset_ < fabs(trafo.coeff_[0])) return false; - if (limit_scale_ < fabs(trafo.coeff_[1])) return false; - if (limit_power_ < fabs(trafo.coeff_[2])) return false; - + if (limit_offset_ < fabs(trafo.coeff_[0])) + { + return false; + } + if (limit_scale_ < fabs(trafo.coeff_[1])) + { + return false; + } + if (limit_power_ < fabs(trafo.coeff_[2])) + { + return false; + } return (true); } @@ -197,8 +205,10 @@ namespace OpenMS { if (md == LINEAR) { - if (obs_mz.size() < 2) return false; - + if (obs_mz.size() < 2) + { + return false; + } if (use_RANSAC && (obs_mz.size() > ransac_params_->n)) // with fewer points, RANSAC will fail { @@ -230,8 +240,10 @@ namespace OpenMS } else if (md == LINEAR_WEIGHTED) { - if (obs_mz.size() < 2) return false; - + if (obs_mz.size() < 2) + { + return false; + } double confidence_interval_P(0.0); Math::LinearRegression lr; lr.computeRegressionWeighted(confidence_interval_P, theo_mz.begin(), theo_mz.end(), obs_mz.begin(), weights.begin(), false); @@ -241,8 +253,10 @@ namespace OpenMS } else if (md == QUADRATIC) { - if (obs_mz.size() < 3) return false; - + if (obs_mz.size() < 3) + { + return false; + } if (use_RANSAC && (obs_mz.size() > ransac_params_->n)) // with fewer points, RANSAC will fail { @@ -270,8 +284,10 @@ namespace OpenMS } else if (md == QUADRATIC_WEIGHTED) { - if (obs_mz.size() < 3) return false; - + if (obs_mz.size() < 3) + { + return false; + } // Quadratic fit (weighted) Math::QuadraticRegression qr; qr.computeRegressionWeighted(theo_mz.begin(), theo_mz.end(), obs_mz.begin(), weights.begin()); @@ -292,12 +308,19 @@ namespace OpenMS std::vector st_ppm_before, st_ppm_after; for (Size i = 0; i < obs_mz.size(); i++) { - if (use_ppm_) st_ppm_before.push_back(obs_mz[i]); - else st_ppm_before.push_back(Math::getPPM(theo_mz[i], obs_mz[i])); - + if (use_ppm_) + { + st_ppm_before.push_back(obs_mz[i]); + } + else + { + st_ppm_before.push_back(Math::getPPM(theo_mz[i], obs_mz[i])); + } double obs_mz_v = obs_mz[i]; - if (use_ppm_) obs_mz_v = Math::ppmToMass(obs_mz_v, theo_mz[i]) + theo_mz[i]; // - + if (use_ppm_) + { + obs_mz_v = Math::ppmToMass(obs_mz_v, theo_mz[i]) + theo_mz[i]; + } st_ppm_after.push_back(Math::getPPM(theo_mz[i], predict(obs_mz_v))); // predict() is ppm-aware itself printf("%4.5f %4.5f %2.1f | %2.1f\n", theo_mz[i], obs_mz_v, st_ppm_before.back(), st_ppm_after.back()); @@ -379,8 +402,10 @@ namespace OpenMS void MZTrafoModel::getCoefficients( double& intercept, double& slope, double& power ) { - if (!isTrained()) throw Exception::Precondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Model is not trained yet."); - + if (!isTrained()) + { + throw Exception::Precondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Model is not trained yet."); + } intercept = coeff_[0]; slope = coeff_[1]; power = coeff_[2]; diff --git a/src/openms/source/FILTERING/CALIBRATION/PrecursorCorrection.cpp b/src/openms/source/FILTERING/CALIBRATION/PrecursorCorrection.cpp index 33330092d07..474ae349bb8 100644 --- a/src/openms/source/FILTERING/CALIBRATION/PrecursorCorrection.cpp +++ b/src/openms/source/FILTERING/CALIBRATION/PrecursorCorrection.cpp @@ -269,8 +269,10 @@ namespace OpenMS for (Size f = 0; f != features.size(); ++f) { // feature is incompatible if believe_charge is set and charges don't match - if (believe_charge && features[f].getCharge() != pc_charge) continue; - + if (believe_charge && features[f].getCharge() != pc_charge) + { + continue; + } // check if precursor/MS2 position overlap with feature if (overlaps_(features[f], rt, pc_mz, rt_tolerance_s)) { diff --git a/src/openms/source/FILTERING/CALIBRATION/TOFCalibration.cpp b/src/openms/source/FILTERING/CALIBRATION/TOFCalibration.cpp index 6018dc43c15..1ca1edc429a 100644 --- a/src/openms/source/FILTERING/CALIBRATION/TOFCalibration.cpp +++ b/src/openms/source/FILTERING/CALIBRATION/TOFCalibration.cpp @@ -213,20 +213,20 @@ namespace OpenMS // iterate through all spectra - for (spec_iter = calib_peaks.begin(); spec_iter != calib_peaks.end(); ++spec_iter) + for (MSSpectrum& spec_iter : calib_peaks) { - peak_iter = spec_iter->begin(); + peak_iter = spec_iter.begin(); help_iter = peak_iter; std::vector vec; // go through current scan - while (peak_iter < spec_iter->end()) + while (peak_iter < spec_iter.end()) { - while (peak_iter + 1 < spec_iter->end() && ((peak_iter + 1)->getMZ() - peak_iter->getMZ() < 1.2)) + while (peak_iter + 1 < spec_iter.end() && ((peak_iter + 1)->getMZ() - peak_iter->getMZ() < 1.2)) { ++peak_iter; } - vec.push_back(distance(spec_iter->begin(), help_iter)); + vec.push_back(distance(spec_iter.begin(), help_iter)); help_iter = peak_iter + 1; ++peak_iter; @@ -263,9 +263,9 @@ namespace OpenMS //two point conversion if (ml3s_.empty()) { - for (PeakMap::iterator spec_iter = calib_spectra.begin(); spec_iter != calib_spectra.end(); ++spec_iter) + for (MSSpectrum& spec_iter : calib_spectra) { - peak_iter = spec_iter->begin(); + peak_iter = spec_iter.begin(); double ml1, ml2; if (ml1s_.size() == 1) { @@ -279,7 +279,7 @@ namespace OpenMS } // go through current scan - for (; peak_iter != spec_iter->end(); ++peak_iter) + for (; peak_iter != spec_iter.end(); ++peak_iter) { double time = peak_iter->getMZ(); peak_iter->setPos(ml1 / 1E12 * (time * 1000 - ml2)); @@ -290,9 +290,9 @@ namespace OpenMS else { // three point conversion - for (PeakMap::iterator spec_iter = calib_spectra.begin(); spec_iter != calib_spectra.end(); ++spec_iter) + for (MSSpectrum& spec_iter : calib_spectra) { - peak_iter = spec_iter->begin(); + peak_iter = spec_iter.begin(); double ml1, ml2, ml3; if (ml1s_.size() == 1) { @@ -308,7 +308,7 @@ namespace OpenMS } // go through current scan - for (; peak_iter != spec_iter->end(); ++peak_iter) + for (; peak_iter != spec_iter.end(); ++peak_iter) { double time = peak_iter->getMZ(); peak_iter->setPos((-ml2 - (0.1E7 * (-5E5 + sqrt(0.25E12 - ml1 * ml2 * ml3 + ml1 * ml3 * time))) / (ml1 * ml3) + time) / ml3); @@ -352,9 +352,13 @@ namespace OpenMS { double xi = mQ_(calib_peaks_ft_[spec][monoiso[p]].getMZ(), spec); if (xi > calib_masses[error_medians_.size() - 1]) + { continue; + } if (xi < calib_masses[0]) + { continue; + } std::cout << exp_masses[p] << "\t" << Math::getPPM(xi - spline(xi), exp_masses[p]) << std::endl; diff --git a/src/openms/source/FILTERING/DATAREDUCTION/DataFilters.cpp b/src/openms/source/FILTERING/DATAREDUCTION/DataFilters.cpp index 611b4bc07ac..7e0ff32811f 100644 --- a/src/openms/source/FILTERING/DATAREDUCTION/DataFilters.cpp +++ b/src/openms/source/FILTERING/DATAREDUCTION/DataFilters.cpp @@ -136,7 +136,9 @@ namespace OpenMS tmp.split(' ', parts); SignedSize size = parts.size(); if (size < 2) + { throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "invalid filter format", tmp); + } //field tmp = parts[0]; tmp.toLower(); diff --git a/src/openms/source/FILTERING/DATAREDUCTION/FeatureFindingMetabo.cpp b/src/openms/source/FILTERING/DATAREDUCTION/FeatureFindingMetabo.cpp index 96c2b0d582a..26606a69270 100644 --- a/src/openms/source/FILTERING/DATAREDUCTION/FeatureFindingMetabo.cpp +++ b/src/openms/source/FILTERING/DATAREDUCTION/FeatureFindingMetabo.cpp @@ -925,8 +925,10 @@ namespace OpenMS { // traces are sorted by m/z, so we can break when we leave the allowed window double diff_mz = std::fabs(input_mtraces[ext_idx].getCentroidMZ() - ref_trace_mz); - if (diff_mz > local_mz_range_) break; - + if (diff_mz > local_mz_range_) + { + break; + } double diff_rt = std::fabs(input_mtraces[ext_idx].getCentroidRT() - ref_trace_rt); if (diff_rt <= local_rt_range_) { diff --git a/src/openms/source/FILTERING/DATAREDUCTION/IsotopeDistributionCache.cpp b/src/openms/source/FILTERING/DATAREDUCTION/IsotopeDistributionCache.cpp index 9a64498f372..48fe1a11b67 100644 --- a/src/openms/source/FILTERING/DATAREDUCTION/IsotopeDistributionCache.cpp +++ b/src/openms/source/FILTERING/DATAREDUCTION/IsotopeDistributionCache.cpp @@ -61,10 +61,10 @@ namespace OpenMS isotope_distributions_[index].trimmed_left = size_before - d.size(); d.trimRight(intensity_percentage_optional); - for (IsotopeDistribution::Iterator it = d.begin(); it != d.end(); ++it) + for (Peak1D& it : d) { - isotope_distributions_[index].intensity.push_back(it->getIntensity()); - //log_ << " - " << it->second << std::endl; + isotope_distributions_[index].intensity.push_back(it.getIntensity()); + //log_ << " - " << it.second << std::endl; } //determine the number of optional peaks at the beginning/end @@ -77,11 +77,17 @@ namespace OpenMS if (isotope_distributions_[index].intensity[i] < intensity_percentage) { if (!is_end && !is_begin) + { is_end = true; + } if (is_begin) + { ++begin; + } else if (is_end) + { ++end; + } } else if (is_begin) { diff --git a/src/openms/source/FILTERING/DATAREDUCTION/MassTraceDetection.cpp b/src/openms/source/FILTERING/DATAREDUCTION/MassTraceDetection.cpp index e2e8c471e2d..1c98d84447b 100644 --- a/src/openms/source/FILTERING/DATAREDUCTION/MassTraceDetection.cpp +++ b/src/openms/source/FILTERING/DATAREDUCTION/MassTraceDetection.cpp @@ -211,15 +211,17 @@ namespace OpenMS // *********************************************************** // // Step 1: Detecting potential chromatographic apices // *********************************************************** // - for (PeakMap::ConstIterator it = input_exp.begin(); it != input_exp.end(); ++it) + for (const MSSpectrum& it : input_exp) { // check if this is a MS1 survey scan - if (it->getMSLevel() != 1) continue; - + if (it.getMSLevel() != 1) + { + continue; + } std::vector indices_passing; - for (Size peak_idx = 0; peak_idx < it->size(); ++peak_idx) + for (Size peak_idx = 0; peak_idx < it.size(); ++peak_idx) { - double tmp_peak_int((*it)[peak_idx].getIntensity()); + double tmp_peak_int((it)[peak_idx].getIntensity()); if (tmp_peak_int > noise_threshold_int_) { // Assume that noise_threshold_int_ contains the noise level of the @@ -233,7 +235,7 @@ namespace OpenMS ++total_peak_count; } } - PeakMap::SpectrumType tmp_spec(*it); + PeakMap::SpectrumType tmp_spec(it); tmp_spec.select(indices_passing); work_exp.addSpectrum(tmp_spec); spec_offsets.push_back(spec_offsets.back() + tmp_spec.size()); @@ -541,7 +543,10 @@ namespace OpenMS MassTrace new_trace(current_trace); new_trace.updateWeightedMeanRT(); new_trace.updateWeightedMeanMZ(); - if (!fwhms_mz.empty()) new_trace.fwhm_mz_avg = Math::median(fwhms_mz.begin(), fwhms_mz.end()); + if (!fwhms_mz.empty()) + { + new_trace.fwhm_mz_avg = Math::median(fwhms_mz.begin(), fwhms_mz.end()); + } new_trace.setQuantMethod(quant_method_); //new_trace.setCentroidSD(ftl_sd); new_trace.updateWeightedMZsd(); @@ -554,7 +559,10 @@ namespace OpenMS this->setProgress(peaks_detected); // check if we already reached the (optional) maximum number of traces - if (max_traces > 0 && found_masstraces.size() == max_traces) break; + if (max_traces > 0 && found_masstraces.size() == max_traces) + { + break; + } } } diff --git a/src/openms/source/FORMAT/ConsensusXMLFile.cpp b/src/openms/source/FORMAT/ConsensusXMLFile.cpp index 584b8ec04c6..375221ff5b1 100644 --- a/src/openms/source/FORMAT/ConsensusXMLFile.cpp +++ b/src/openms/source/FORMAT/ConsensusXMLFile.cpp @@ -258,7 +258,9 @@ namespace OpenMS String file_version = ""; optionalAttributeAsString_(file_version, attributes, "version"); if (file_version == "") + { file_version = "1.0"; //default version is 1.0 + } if (file_version.toDouble() > version_.toDouble()) { warning(LOAD, "The XML file (" + file_version + ") is newer than the parser (" + version_ + "). This might lead to undefined program behavior."); diff --git a/src/openms/source/FORMAT/ControlledVocabulary.cpp b/src/openms/source/FORMAT/ControlledVocabulary.cpp index 7b2fefebc84..6e0b52cd856 100644 --- a/src/openms/source/FORMAT/ControlledVocabulary.cpp +++ b/src/openms/source/FORMAT/ControlledVocabulary.cpp @@ -209,8 +209,9 @@ namespace OpenMS //do nothing for empty lines if (line == "") + { continue; - + } //******************************************************************************** //stanza line if (line_wo_spaces[0] == '[') @@ -292,7 +293,9 @@ namespace OpenMS //check if the parent term name is correct String parent_name = line.suffix('!').trim(); if (!checkName_(parent_id, parent_name)) + { cerr << "Warning: while loading term '" << term.id << "' of CV '" << name_ << "': part_of relationship term name '" << parent_name << "' and id '" << parent_id << "' differ." << "\n"; + } } else { @@ -309,7 +312,9 @@ namespace OpenMS //check if the parent term name is correct String unit_name = line.suffix('!').trim(); if (!checkName_(unit_id, unit_name)) + { cerr << "Warning: while loading term '" << term.id << "' of CV '" << name_ << "': has_units relationship term name '" << unit_name << "' and id '" << unit_id << "' differ." << "\n"; + } } else { @@ -572,8 +577,9 @@ namespace OpenMS bool ControlledVocabulary::checkName_(const String& id, const String& name, bool ignore_case) { if (!exists(id)) + { return true; //what?! - + } String parent_name = name; String real_parent_name = getTerm(id).name; diff --git a/src/openms/source/FORMAT/DATAACCESS/MSDataSqlConsumer.cpp b/src/openms/source/FORMAT/DATAACCESS/MSDataSqlConsumer.cpp index 0b2048a4ec1..4e0c254d8eb 100644 --- a/src/openms/source/FORMAT/DATAACCESS/MSDataSqlConsumer.cpp +++ b/src/openms/source/FORMAT/DATAACCESS/MSDataSqlConsumer.cpp @@ -84,18 +84,28 @@ namespace OpenMS { spectra_.push_back(s); s.clear(false); - if (full_meta_) peak_meta_.addSpectrum(s); - - if (spectra_.size() >= flush_after_) {flush();} + if (full_meta_) + { + peak_meta_.addSpectrum(s); + } + if (spectra_.size() >= flush_after_) + { + flush(); + } } void MSDataSqlConsumer::consumeChromatogram(ChromatogramType & c) { chromatograms_.push_back(c); c.clear(false); - if (full_meta_) peak_meta_.addChromatogram(c); - - if (chromatograms_.size() >= flush_after_) {flush();} + if (full_meta_) + { + peak_meta_.addChromatogram(c); + } + if (chromatograms_.size() >= flush_after_) + { + flush(); + } } void MSDataSqlConsumer::setExpectedSize(Size /* expectedSpectra */, Size /* expectedChromatograms */) {;} diff --git a/src/openms/source/FORMAT/DATAACCESS/MSDataTransformingConsumer.cpp b/src/openms/source/FORMAT/DATAACCESS/MSDataTransformingConsumer.cpp index 8fffcd78a44..44485b45154 100644 --- a/src/openms/source/FORMAT/DATAACCESS/MSDataTransformingConsumer.cpp +++ b/src/openms/source/FORMAT/DATAACCESS/MSDataTransformingConsumer.cpp @@ -85,6 +85,9 @@ namespace OpenMS void MSDataTransformingConsumer::setExperimentalSettings(const OpenMS::ExperimentalSettings& es) { // apply the given function to it (unless nullptr) - if (lambda_exp_settings_) lambda_exp_settings_(es); + if (lambda_exp_settings_) + { + lambda_exp_settings_(es); + } } } // namespace OpenMS diff --git a/src/openms/source/FORMAT/DATAACCESS/MSDataWritingConsumer.cpp b/src/openms/source/FORMAT/DATAACCESS/MSDataWritingConsumer.cpp index 4bc6b3115ab..81f902579c2 100644 --- a/src/openms/source/FORMAT/DATAACCESS/MSDataWritingConsumer.cpp +++ b/src/openms/source/FORMAT/DATAACCESS/MSDataWritingConsumer.cpp @@ -187,8 +187,9 @@ namespace OpenMS // Only write the footer if we actually did start writing ... if (started_writing_) + { Internal::MzMLHandlerHelper::writeFooter_(ofs_, options_, spectra_offsets_, chromatograms_offsets_); - + } delete validator_; ofs_.close(); } diff --git a/src/openms/source/FORMAT/DATAACCESS/SiriusFragmentAnnotation.cpp b/src/openms/source/FORMAT/DATAACCESS/SiriusFragmentAnnotation.cpp index 6cc0da2f7a8..f0644110560 100644 --- a/src/openms/source/FORMAT/DATAACCESS/SiriusFragmentAnnotation.cpp +++ b/src/openms/source/FORMAT/DATAACCESS/SiriusFragmentAnnotation.cpp @@ -133,13 +133,13 @@ namespace OpenMS { if (line.hasPrefix(n_id_prefix)) { - String n_id = line.erase(line.find(n_id_prefix), n_id_prefix.size()); - ext_n_ids.emplace_back(n_id); + String n_id = line.erase(line.find(n_id_prefix), n_id_prefix.size()); + ext_n_ids.emplace_back(n_id); } else if (spectrum_ms_file.eof()) { - OPENMS_LOG_WARN << "No native id was found - please check your input mzML. " << std::endl; - break; + OPENMS_LOG_WARN << "No native id was found - please check your input mzML. " << std::endl; + break; } } spectrum_ms_file.close(); diff --git a/src/openms/source/FORMAT/FeatureXMLFile.cpp b/src/openms/source/FORMAT/FeatureXMLFile.cpp index 1bd6fc31667..8e83a56b97f 100644 --- a/src/openms/source/FORMAT/FeatureXMLFile.cpp +++ b/src/openms/source/FORMAT/FeatureXMLFile.cpp @@ -400,7 +400,9 @@ namespace OpenMS else if (tag == "featureList") { if (options_.getMetadataOnly()) + { throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); + } Size count = attributeAsInt_(attributes, "count"); if (size_only_) // true if loadSize() was used instead of load() { @@ -812,8 +814,9 @@ namespace OpenMS } if (disable_parsing_) + { return; - + } // do the actual parsing: open_tags_.pop_back(); @@ -823,8 +826,9 @@ namespace OpenMS in_description_ = false; } if (in_description_) + { return; - + } if (tag == "feature") { if ((!options_.hasRTRange() || options_.getRTRange().encloses(current_feature_->getRT())) @@ -933,18 +937,21 @@ namespace OpenMS { // handle skipping of whole sections if (disable_parsing_) + { return; - + } // do the actual parsing: //for downward compatibility, all tags in the old description must be ignored if (in_description_) + { return; - + } // we are before first tag or beyond last tag if (open_tags_.size() == 0) + { return; - + } String& current_tag = open_tags_.back(); if (current_tag == "intensity") { diff --git a/src/openms/source/FORMAT/FileHandler.cpp b/src/openms/source/FORMAT/FileHandler.cpp index 1079c32402b..c5d3d4f76a4 100644 --- a/src/openms/source/FORMAT/FileHandler.cpp +++ b/src/openms/source/FORMAT/FileHandler.cpp @@ -456,7 +456,9 @@ namespace OpenMS conversion_error = true; } if (!conversion_error) + { return FileTypes::DTA; + } } //DTA2D @@ -475,7 +477,9 @@ namespace OpenMS conversion_error = true; } if (!conversion_error) + { return FileTypes::DTA2D; + } } // MGF (Mascot Generic Format) diff --git a/src/openms/source/FORMAT/FileTypes.cpp b/src/openms/source/FORMAT/FileTypes.cpp index a7fcb0cc86a..2a87e7adace 100644 --- a/src/openms/source/FORMAT/FileTypes.cpp +++ b/src/openms/source/FORMAT/FileTypes.cpp @@ -131,7 +131,10 @@ namespace OpenMS { for (const auto& t : type_list_) { - if (t == type) return true; + if (t == type) + { + return true; + } } return false; } @@ -161,8 +164,10 @@ namespace OpenMS } out += ListUtils::concatenate(items, ""); } - if (add_all_filter) out += "all files (*);;"; - + if (add_all_filter) + { + out += "all files (*);;"; + } // remove the last ";;", since this will be interpreted as ' (*)' by Qt out = out.chop(2); @@ -174,7 +179,10 @@ namespace OpenMS { for (const auto& t_info : type_with_annotation__) { - if (t_info.type == type) return t_info.name; + if (t_info.type == type) + { + return t_info.name; + } } throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Type has no name!", String(type)); } @@ -195,7 +203,10 @@ namespace OpenMS for (const auto& t_info : type_with_annotation__) { - if (String(t_info.name).toUpper() == name_upper) return t_info.type; + if (String(t_info.name).toUpper() == name_upper) + { + return t_info.type; + } } return FileTypes::UNKNOWN; diff --git a/src/openms/source/FORMAT/HANDLERS/AcqusHandler.cpp b/src/openms/source/FORMAT/HANDLERS/AcqusHandler.cpp index 63ec837b304..81ba474c8fc 100644 --- a/src/openms/source/FORMAT/HANDLERS/AcqusHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/AcqusHandler.cpp @@ -39,94 +39,94 @@ using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal + + AcqusHandler::AcqusHandler(const String & filename) { + params_.clear(); - AcqusHandler::AcqusHandler(const String & filename) + std::ifstream is(filename.c_str()); + if (!is) { - params_.clear(); + throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename); + } - std::ifstream is(filename.c_str()); - if (!is) + //temporary variables + String line; + std::vector strings(2); + + //read lines + while (getline(is, line, '\n')) + { + if (line.size() < 5) { - throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename); + continue; // minimal string = "##x=x" } - - //temporary variables - String line; - std::vector strings(2); - - //read lines - while (getline(is, line, '\n')) + if (line.prefix(2) != String("##")) { - if (line.size() < 5) - continue; // minimal string = "##x=x" - if (line.prefix(2) != String("##")) - continue; - - if (line.split('=', strings)) + continue; + } + if (line.split('=', strings)) + { + if (strings.size() == 2) { - if (strings.size() == 2) - { - params_[strings[0].substr(2)] = strings[1].trim(); - } + params_[strings[0].substr(2)] = strings[1].trim(); } } + } - // TOF calibration params - dw_ = params_[String("$DW")].toDouble(); - delay_ = (Size)params_[String("$DELAY")].toInt(); - ml1_ = params_[String("$ML1")].toDouble(); - ml2_ = params_[String("$ML2")].toDouble(); - ml3_ = params_[String("$ML3")].toDouble(); - td_ = (Size) params_[String("$TD")].toInt(); + // TOF calibration params + dw_ = params_[String("$DW")].toDouble(); + delay_ = (Size)params_[String("$DELAY")].toInt(); + ml1_ = params_[String("$ML1")].toDouble(); + ml2_ = params_[String("$ML2")].toDouble(); + ml3_ = params_[String("$ML3")].toDouble(); + td_ = (Size) params_[String("$TD")].toInt(); - is.close(); - } + is.close(); + } + + AcqusHandler::~AcqusHandler() + { + params_.clear(); + } + + Size AcqusHandler::getSize() + { + return td_; + } - AcqusHandler::~AcqusHandler() + double AcqusHandler::getPosition(const Size index) + { + double sqrt_mz_; + double tof_ = dw_ * index + delay_; + double a_ = ml3_; + double b_ = sqrt(1000000000000.0 / ml1_); + double c_ = ml2_ - tof_; + + if (ml3_ == 0.0) { - params_.clear(); + sqrt_mz_ = c_ / b_; } - - Size AcqusHandler::getSize() + else { - return td_; + sqrt_mz_ = (sqrt(b_ * b_ - 4 * a_ * c_) - b_) / (2 * a_); } + return sqrt_mz_ * sqrt_mz_; + } - double AcqusHandler::getPosition(const Size index) + String AcqusHandler::getParam(const String & param) + { + if (param == String("mzMax")) { - double sqrt_mz_; - double tof_ = dw_ * index + delay_; - double a_ = ml3_; - double b_ = sqrt(1000000000000.0 / ml1_); - double c_ = ml2_ - tof_; - - if (ml3_ == 0.0) - { - sqrt_mz_ = c_ / b_; - } - else - { - sqrt_mz_ = (sqrt(b_ * b_ - 4 * a_ * c_) - b_) / (2 * a_); - } - return sqrt_mz_ * sqrt_mz_; + return String(getPosition(td_ - 1)); } - - String AcqusHandler::getParam(const String & param) + else if (param == String("mzMin")) { - if (param == String("mzMax")) - { - return String(getPosition(td_ - 1)); - } - else if (param == String("mzMin")) - { - return String(getPosition(0)); - } - return params_[param]; + return String(getPosition(0)); } + return params_[param]; + } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp index 8ebae222400..10ea6040eda 100644 --- a/src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp @@ -37,11 +37,8 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { -namespace Internal -{ - CachedMzMLHandler::CachedMzMLHandler() { } @@ -53,8 +50,9 @@ namespace Internal CachedMzMLHandler& CachedMzMLHandler::operator=(const CachedMzMLHandler& rhs) { if (&rhs == this) + { return *this; - + } spectra_index_ = rhs.spectra_index_; chrom_index_ = rhs.chrom_index_; @@ -352,8 +350,10 @@ namespace Internal ifs.read((char*) &(data[0]->data)[0], data_size * sizeof(DatumSingleton)); ifs.read((char*) &(data[1]->data)[0], data_size * sizeof(DatumSingleton)); } - if (nr_float_arrays == 0) return; - + if (nr_float_arrays == 0) + { + return; + } char* buffer = new(std::nothrow) char[1024]; for (Size k = 0; k < nr_float_arrays; k++) { @@ -364,7 +364,10 @@ namespace Internal // We will not read data longer than 1024 bytes as this will not fit into // our buffer (and is user-generated input data) - if (len_name > 1023) ifs.seekg(len_name * sizeof(char), ifs.cur); + if (len_name > 1023) + { + ifs.seekg(len_name * sizeof(char), ifs.cur); + } else { ifs.read(buffer, len_name); @@ -547,7 +550,10 @@ namespace Internal // now go to the actual data tmp.clear(); tmp.reserve(fda.size()); - for (const auto& val : fda) {tmp.push_back(val);} + for (const auto& val : fda) + { + tmp.push_back(val); + } ofs.write((char*)&tmp.front(), tmp.size() * sizeof(tmp.front())); } for (const auto& ida : chromatogram.getIntegerDataArrays() ) @@ -560,11 +566,13 @@ namespace Internal // now go to the actual data tmp.clear(); tmp.reserve(ida.size()); - for (const auto& val : ida) {tmp.push_back(val);} + for (const auto& val : ida) + { + tmp.push_back(val); + } ofs.write((char*)&tmp.front(), tmp.size() * sizeof(tmp.front())); } } -} -} +}//namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/FidHandler.cpp b/src/openms/source/FORMAT/HANDLERS/FidHandler.cpp index e2d415e9230..398150a16fe 100644 --- a/src/openms/source/FORMAT/HANDLERS/FidHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/FidHandler.cpp @@ -54,37 +54,33 @@ T ByteReverse(const T in) #endif -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal + FidHandler::FidHandler(const String & filename) : + ifstream(filename.c_str(), ios_base::binary | ios_base::in) { - FidHandler::FidHandler(const String & filename) : - ifstream(filename.c_str(), ios_base::binary | ios_base::in) - { - index_ = 0; - seekg(0, ios::beg); - } + index_ = 0; + seekg(0, ios::beg); + } - FidHandler::~FidHandler() - { - } + FidHandler::~FidHandler() + { + } - Size FidHandler::getIndex() - { - return index_; - } + Size FidHandler::getIndex() + { + return index_; + } - Size FidHandler::getIntensity() - { - // intensity is coded in 32 bits little-endian integer format - Int32 result = 0; - read((char *) &result, 4); + Size FidHandler::getIntensity() + { + // intensity is coded in 32 bits little-endian integer format + Int32 result = 0; + read((char *) &result, 4); #ifdef OPENMS_BIG_ENDIAN - result = ByteReverse(result); + result = ByteReverse(result); #endif - index_++; - return (result > 0) ? result : 0; - } - - } // namespace Internal -} // namespace OpenMS + index_++; + return (result > 0) ? result : 0; + } +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/IndexedMzMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/IndexedMzMLHandler.cpp index 8cfa9a9e2d1..ade9f2ea499 100644 --- a/src/openms/source/FORMAT/HANDLERS/IndexedMzMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/IndexedMzMLHandler.cpp @@ -40,9 +40,7 @@ // #define DEBUG_READER -namespace OpenMS -{ -namespace Internal +namespace OpenMS::Internal { void IndexedMzMLHandler::parseFooter_() @@ -76,8 +74,14 @@ namespace Internal spectra_before_chroms_ = true; if (!spectra_offsets_.empty() && !chromatograms_offsets_.empty()) { - if (spectra_offsets_[0] < chromatograms_offsets_[0]) spectra_before_chroms_ = true; - else spectra_before_chroms_ = false; + if (spectra_offsets_[0] < chromatograms_offsets_[0]) + { + spectra_before_chroms_ = true; + } + else + { + spectra_before_chroms_ = false; + } } parsing_success_ = (res == 0); @@ -322,5 +326,4 @@ namespace Internal MzMLSpectrumDecoder(skip_xml_checks_).domParseChromatogram(text, c); } -} -} +} //namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MascotXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MascotXMLHandler.cpp index 4ca10ffa79d..5977efa2506 100644 --- a/src/openms/source/FORMAT/HANDLERS/MascotXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MascotXMLHandler.cpp @@ -38,10 +38,9 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + MascotXMLHandler::MascotXMLHandler(ProteinIdentification& protein_identification, vector& id_data, const String& filename, map >& modified_peptides, const SpectrumMetaDataLookup& lookup): XMLHandler(filename, ""), protein_identification_(protein_identification), id_data_(id_data), peptide_identification_index_(0), actual_title_(""), @@ -148,7 +147,10 @@ namespace OpenMS if (!no_rt_error_) // report the error only the first time { String msg = "Could not extract RT value "; - if (!lookup_.empty()) msg += "or a matching spectrum reference "; + if (!lookup_.empty()) + { + msg += "or a matching spectrum reference "; + } msg += "from element with format '" + title + "'. Try adjusting the 'scan_regex' parameter."; error(LOAD, msg); } @@ -630,8 +632,10 @@ namespace OpenMS // OpenMS_search // // will trigger a characters() between and , which should be ignored - if (tag_.empty()) return; - + if (tag_.empty()) + { + return; + } character_buffer_ += String(sm_.convert(chars)); } @@ -673,6 +677,4 @@ namespace OpenMS } return mods; } - - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzDataHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzDataHandler.cpp index a76e9a7da46..1f21c3e2148 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzDataHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzDataHandler.cpp @@ -36,11 +36,9 @@ #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { MzDataHandler::MzDataHandler(MapType & exp, const String & filename, const String & version, ProgressLogger & logger) : XMLHandler(filename, version), @@ -113,8 +111,9 @@ namespace OpenMS { // skip current spectrum if (skip_spectrum_) + { return; - + } String transcoded_chars = sm_.convert(chars); //current tag @@ -233,12 +232,14 @@ namespace OpenMS //determine the parent tag String parent_tag; if (open_tags_.size() > 1) + { parent_tag = *(open_tags_.end() - 2); - + } //do nothing until a new spectrum is reached if (tag != "spectrum" && skip_spectrum_) + { return; - + } // Do something depending on the tag if (tag == "sourceFile") @@ -1087,8 +1088,9 @@ namespace OpenMS //determine the parent tag String parent_tag; if (open_tags_.size() > 1) + { parent_tag = *(open_tags_.end() - 2); - + } if (parent_tag == "spectrumInstrument") { if (accession == "PSI:1000036") //Scan Mode @@ -1506,6 +1508,5 @@ namespace OpenMS << str << "\n\t\t\t\n"; } - } -} // namespace OpenMS +} // namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzIdentMLDOMHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzIdentMLDOMHandler.cpp index 2504dc4f6f1..24cc49742c5 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzIdentMLDOMHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzIdentMLDOMHandler.cpp @@ -50,10 +50,9 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + //TODO remodel CVTermList //TODO extend CVTermlist with CVCollection functionality for complete replacement?? //TODO general id openms struct for overall parameter for one id run @@ -167,16 +166,24 @@ namespace OpenMS if (stat(mzid_file.c_str(), &fileStatus) == -1) // ==0 ok; ==-1 error { if (errno == ENOENT) // errno declared by include file errno.h + { throw (runtime_error("Path file_name does not exist, or path is an empty string.")); + } else if (errno == ENOTDIR) + { throw (runtime_error("A component of the path is not a directory.")); + } // On MSVC 2008, the ELOOP constant is not declared and thus introduces a compile error //else if (errno == ELOOP) // throw (runtime_error("Too many symbolic links encountered while traversing the path.")); else if (errno == EACCES) + { throw (runtime_error("Permission denied.")); + } else if (errno == ENAMETOOLONG) + { throw (runtime_error("File can not be read.")); + } } // Configure DOM parser. @@ -237,7 +244,10 @@ namespace OpenMS // 1. DataCollection {1,1} DOMNodeList* spectraDataElements = xmlDoc->getElementsByTagName(CONST_XMLCH("SpectraData")); - if (spectraDataElements->getLength() == 0) throw(runtime_error("No SpectraData nodes")); + if (spectraDataElements->getLength() == 0) + { + throw(runtime_error("No SpectraData nodes")); + } parseInputElements_(spectraDataElements); // 1.2. SearchDatabase {0,unbounded} @@ -250,12 +260,18 @@ namespace OpenMS // 2. SpectrumIdentification {1,unbounded} ! creates identification runs (or ProteinIdentifications) DOMNodeList* spectrumIdentificationElements = xmlDoc->getElementsByTagName(CONST_XMLCH("SpectrumIdentification")); - if (spectrumIdentificationElements->getLength() == 0) throw(runtime_error("No SpectrumIdentification nodes")); + if (spectrumIdentificationElements->getLength() == 0) + { + throw(runtime_error("No SpectrumIdentification nodes")); + } parseSpectrumIdentificationElements_(spectrumIdentificationElements); // 3. AnalysisProtocolCollection {1,1} SpectrumIdentificationProtocol {1,unbounded} ! identification run parameters DOMNodeList* spectrumIdentificationProtocolElements = xmlDoc->getElementsByTagName(CONST_XMLCH("SpectrumIdentificationProtocol")); - if (spectrumIdentificationProtocolElements->getLength() == 0) throw(runtime_error("No SpectrumIdentificationProtocol nodes")); + if (spectrumIdentificationProtocolElements->getLength() == 0) + { + throw(runtime_error("No SpectrumIdentificationProtocol nodes")); + } parseSpectrumIdentificationProtocolElements_(spectrumIdentificationProtocolElements); // 4. SequenceCollection nodes {0,1} DBSequenceElement {1,unbounded} Peptide {0,unbounded} PeptideEvidence {0,unbounded} @@ -275,7 +291,10 @@ namespace OpenMS // 6.1 SpectrumIdentificationList {0,1} DOMNodeList* spectrumIdentificationListElements = xmlDoc->getElementsByTagName(CONST_XMLCH("SpectrumIdentificationList")); - if (spectrumIdentificationListElements->getLength() == 0) throw(runtime_error("No SpectrumIdentificationList nodes")); + if (spectrumIdentificationListElements->getLength() == 0) + { + throw(runtime_error("No SpectrumIdentificationList nodes")); + } parseSpectrumIdentificationListElements_(spectrumIdentificationListElements); // 6.2 ProteinDetection {0,1} @@ -423,10 +442,13 @@ namespace OpenMS DOMLSSerializer* serializer = ((DOMImplementationLS*)impl)->createLSSerializer(); // serializer gets prettyprint and stuff if (serializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true)) + { serializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true); + } if (serializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) + { serializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); - + } // // optionally implement DOMErrorHandler (e.g. MyDOMErrorHandler) and set it to the serializer // DOMErrorHandler* errHandler = new myDOMErrorHandler(); // serializer->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, myErrorHandler); @@ -3045,6 +3067,5 @@ namespace OpenMS } return sp; } - - } //namespace Internal -} // namespace OpenMS + +} // namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzIdentMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzIdentMLHandler.cpp index aaea28df195..8a2bdfdf19b 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzIdentMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzIdentMLHandler.cpp @@ -1084,8 +1084,7 @@ namespace OpenMS void MzIdentMLHandler::writeFragmentAnnotations_(String& s, const std::vector& annotations, UInt indent, bool is_ppxl) const { std::map > > annotation_map; - for (std::vector::const_iterator kt = annotations.begin(); - kt != annotations.end(); ++kt) + for (const PeptideHit::PeakAnnotation& pep : annotations) {// string coding example: [alpha|ci$y3-H2O-NH3]5+ // static const boost::regex frag_regex("\\[(?:([\\|\\w]+)\\$)*([abcxyz])(\\d+)((?:[\\+\\-\\w])*)\\](\\d+)\\+"); // this will fetch the complete loss/gain part as one static const boost::regex frag_regex_tweak(R"(\[(?:([\|\w]+)\$)*([abcxyz])(\d+)(?:-(H2O|NH3))*\][(\d+)\+]*)"); // this will only fetch the last loss - and is preferred for now, as only these extra cv params are present @@ -1095,7 +1094,7 @@ namespace OpenMS String loss; StringList extra; boost::smatch str_matches; - if (boost::regex_match(kt->annotation, str_matches, frag_regex_tweak)) + if (boost::regex_match(pep.annotation, str_matches, frag_regex_tweak)) { String(str_matches[1]).split("|",extra); iontype = std::string(str_matches[2]); @@ -1109,34 +1108,36 @@ namespace OpenMS // TODO find ways to represent additional fragment types or filter out known incompatible types // OPENMS_LOG_WARN << "Well, fudge you very much, there is no matching annotation. "; - // OPENMS_LOG_WARN << kt->annotation << std::endl; + // OPENMS_LOG_WARN << pep.annotation << std::endl; continue; } String lt = "frag: " + iontype + " ion"; if (!loss.empty()) - lt += " - "+loss; - if (annotation_map.find(kt->charge) == annotation_map.end()) { - annotation_map[kt->charge] = std::map >(); + lt += " - "+loss; } - if (annotation_map[kt->charge].find(lt) == annotation_map[kt->charge].end()) + if (annotation_map.find(pep.charge) == annotation_map.end()) { - annotation_map[kt->charge][lt] = std::vector (3); + annotation_map[pep.charge] = std::map >(); + } + if (annotation_map[pep.charge].find(lt) == annotation_map[pep.charge].end()) + { + annotation_map[pep.charge][lt] = std::vector (3); if (is_ppxl) { - annotation_map[kt->charge][lt].push_back(StringList()); // alpha|beta - annotation_map[kt->charge][lt].push_back(StringList()); // ci|xi + annotation_map[pep.charge][lt].push_back(StringList()); // alpha|beta + annotation_map[pep.charge][lt].push_back(StringList()); // ci|xi } } - annotation_map[kt->charge][lt][0].push_back(ionseries_index); - annotation_map[kt->charge][lt][1].push_back(String(kt->mz)); - annotation_map[kt->charge][lt][2].push_back(String(kt->intensity)); + annotation_map[pep.charge][lt][0].push_back(ionseries_index); + annotation_map[pep.charge][lt][1].push_back(String(pep.mz)); + annotation_map[pep.charge][lt][2].push_back(String(pep.intensity)); if (is_ppxl) { String ab = ListUtils::contains(extra ,String("alpha")) ? String("alpha"):String("beta"); String cx = ListUtils::contains(extra ,String("ci")) ? String("ci"):String("xi"); - annotation_map[kt->charge][lt][3].push_back(ab); - annotation_map[kt->charge][lt][4].push_back(cx); + annotation_map[pep.charge][lt][3].push_back(ab); + annotation_map[pep.charge][lt][4].push_back(cx); } } @@ -1757,8 +1758,14 @@ namespace OpenMS } } // mod should never be null, but gcc complains (-Werror=maybe-uninitialized) - if (mod != nullptr) acc = mod->getPSIMODAccession(); - if (mod != nullptr) name = mod->getId(); + if (mod != nullptr) + { + acc = mod->getPSIMODAccession(); + } + if (mod != nullptr) + { + name = mod->getId(); + } } if (!acc.empty()) { diff --git a/src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp index e95f87c649c..92b87ff92cb 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp @@ -44,10 +44,8 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { /// Constructor for a read-only handler MzMLHandler::MzMLHandler(MapType& exp, const String& filename, const String& version, const ProgressLogger& logger) @@ -812,8 +810,9 @@ namespace OpenMS //Abort if we need meta data only if (options_.getMetadataOnly()) + { throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); - + } scan_count_total_ = attributeAsInt_(attributes, s_count); logger_.startProgress(0, scan_count_total_, "loading spectra list"); in_spectrum_list_ = true; @@ -836,8 +835,9 @@ namespace OpenMS //Abort if we need meta data only if (options_.getMetadataOnly()) + { throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); - + } chrom_count_total_ = attributeAsInt_(attributes, s_count); logger_.startProgress(0, chrom_count_total_, "loading chromatogram list"); in_spectrum_list_ = false; @@ -845,7 +845,10 @@ namespace OpenMS // we only want total scan count and chrom count if (load_detail_ == XMLHandler::LD_RAWCOUNTS) { // in case spectra came before chroms, we have all information --> end parsing - if (scan_count_total_ != -1) throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); + if (scan_count_total_ != -1) + { + throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); + } // or skip the remaining chroms until skip_chromatogram_ = true; } @@ -913,13 +916,25 @@ namespace OpenMS { path_to_file = File::path(name_of_file); name_of_file = File::basename(name_of_file); - if (path_to_file == ".") path_to_file = "file://./"; + if (path_to_file == ".") + { + path_to_file = "file://./"; + } } // format URI prefix as in mzML spec. - if (path_to_file.hasPrefix("File://")) path_to_file.substitute("File://", "file://"); - if (path_to_file.hasPrefix("FILE://")) path_to_file.substitute("FILE://", "file://"); - if (path_to_file.hasPrefix("file:///.")) path_to_file.substitute("file:///.", "file://./"); + if (path_to_file.hasPrefix("File://")) + { + path_to_file.substitute("File://", "file://"); + } + if (path_to_file.hasPrefix("FILE://")) + { + path_to_file.substitute("FILE://", "file://"); + } + if (path_to_file.hasPrefix("file:///.")) + { + path_to_file.substitute("file:///.", "file://./"); + } bool is_relative_path = path_to_file.hasPrefix("file://./") || path_to_file.hasPrefix("file://../"); @@ -1699,8 +1714,9 @@ namespace OpenMS { //parse only the first selected ion if (selected_ion_count_ > 1) + { return; - + } if (accession == "MS:1000744") //selected ion m/z { double this_mz = value.toDouble(); @@ -5704,5 +5720,4 @@ namespace OpenMS os << "\t\t\t" << "\n"; } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzMLHandlerHelper.cpp b/src/openms/source/FORMAT/HANDLERS/MzMLHandlerHelper.cpp index 104e9271b15..f6dafe26476 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzMLHandlerHelper.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzMLHandlerHelper.cpp @@ -38,10 +38,9 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + void MzMLHandlerHelper::warning(int mode, const String & msg, UInt line, UInt column) { String error_message_; @@ -236,11 +235,17 @@ namespace OpenMS double unit_multiplier = bindata.unit_multiplier; if (unit_multiplier != 1.0 && bindata.precision == BinaryData::PRE_64) { - for (auto& it : bindata.floats_64) it = it * unit_multiplier; + for (auto& it : bindata.floats_64) + { + it = it * unit_multiplier; + } } else if (unit_multiplier != 1.0 && bindata.precision == BinaryData::PRE_32) { - for (auto& it : bindata.floats_32) it = it * unit_multiplier; + for (auto& it : bindata.floats_32) + { + it = it * unit_multiplier; + } } } else if (bindata.data_type == BinaryData::DT_INT) @@ -404,5 +409,4 @@ namespace OpenMS } - } -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzMLSqliteHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzMLSqliteHandler.cpp index b5031ce0382..cd2d9c96cd8 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzMLSqliteHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzMLSqliteHandler.cpp @@ -54,12 +54,9 @@ #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { - namespace Sql = Internal::SqliteHelper; /* @@ -183,7 +180,10 @@ namespace OpenMS if (data_type == 1) { // intensity - if (containers[curr_id].empty()) containers[curr_id].resize(data.size()); + if (containers[curr_id].empty()) + { + containers[curr_id].resize(data.size()); + } std::vector< double >::iterator data_it = data.begin(); for (auto it = containers[curr_id].begin(); it != containers[curr_id].end(); ++it, ++data_it) { @@ -200,7 +200,10 @@ namespace OpenMS "Found m/z data type for chromatogram (instead of retention time)"); } - if (containers[curr_id].empty()) containers[curr_id].resize(data.size()); + if (containers[curr_id].empty()) + { + containers[curr_id].resize(data.size()); + } std::vector< double >::iterator data_it = data.begin(); for (auto it = containers[curr_id].begin(); it != containers[curr_id].end(); ++it, ++data_it) { @@ -629,24 +632,53 @@ namespace OpenMS OpenMS::Precursor& precursor = chrom.getPrecursor(); OpenMS::Product& product = chrom.getProduct(); - if (Sql::extractValue(&tmp, stmt, 1)) chrom.setNativeID(tmp); - if (sqlite3_column_type(stmt, 2) != SQLITE_NULL) precursor.setCharge(sqlite3_column_int(stmt, 2)); - if (sqlite3_column_type(stmt, 3) != SQLITE_NULL) precursor.setDriftTime(sqlite3_column_double(stmt, 3)); - if (sqlite3_column_type(stmt, 4) != SQLITE_NULL) precursor.setMZ(sqlite3_column_double(stmt, 4)); - if (sqlite3_column_type(stmt, 5) != SQLITE_NULL) precursor.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 5)); - if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) precursor.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 6)); + if (Sql::extractValue(&tmp, stmt, 1)) + { + chrom.setNativeID(tmp); + } + if (sqlite3_column_type(stmt, 2) != SQLITE_NULL) + { + precursor.setCharge(sqlite3_column_int(stmt, 2)); + } + if (sqlite3_column_type(stmt, 3) != SQLITE_NULL) + { + precursor.setDriftTime(sqlite3_column_double(stmt, 3)); + } + if (sqlite3_column_type(stmt, 4) != SQLITE_NULL) + { + precursor.setMZ(sqlite3_column_double(stmt, 4)); + } + if (sqlite3_column_type(stmt, 5) != SQLITE_NULL) + { + precursor.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 5)); + } + if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) + { + precursor.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 6)); + } if (Sql::extractValue(&tmp, stmt, 7)) precursor.setMetaValue("peptide_sequence", tmp); // if (sqlite3_column_type(stmt, 8) != SQLITE_NULL) product.setCharge(sqlite3_column_int(stmt, 8)); - if (sqlite3_column_type(stmt, 9) != SQLITE_NULL) product.setMZ(sqlite3_column_double(stmt, 9)); - if (sqlite3_column_type(stmt, 10) != SQLITE_NULL) product.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 10)); - if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) product.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 11)); + if (sqlite3_column_type(stmt, 9) != SQLITE_NULL) + { + product.setMZ(sqlite3_column_double(stmt, 9)); + } + if (sqlite3_column_type(stmt, 10) != SQLITE_NULL) + { + product.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 10)); + } + if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) + { + product.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 11)); + } if (sqlite3_column_type(stmt, 12) != SQLITE_NULL && sqlite3_column_int(stmt, 12) != -1 && sqlite3_column_int(stmt, 12) < static_cast(OpenMS::Precursor::SIZE_OF_ACTIVATIONMETHOD)) { precursor.getActivationMethods().insert(static_cast(sqlite3_column_int(stmt, 12))); } - if (sqlite3_column_type(stmt, 13) != SQLITE_NULL) precursor.setActivationEnergy(sqlite3_column_double(stmt, 13)); - + if (sqlite3_column_type(stmt, 13) != SQLITE_NULL) + { + precursor.setActivationEnergy(sqlite3_column_double(stmt, 13)); + } sqlite3_step( stmt ); } @@ -704,35 +736,84 @@ namespace OpenMS MSSpectrum& spec = spectra.back(); OpenMS::Precursor precursor; OpenMS::Product product; - if (Sql::extractValue(&tmp, stmt, 1)) spec.setNativeID(tmp); - if (sqlite3_column_type(stmt, 2) != SQLITE_NULL) spec.setMSLevel(sqlite3_column_int(stmt, 2)); - if (sqlite3_column_type(stmt, 3) != SQLITE_NULL) spec.setRT(sqlite3_column_double(stmt, 3)); - if (sqlite3_column_type(stmt, 4) != SQLITE_NULL) precursor.setCharge(sqlite3_column_int(stmt, 4)); - if (sqlite3_column_type(stmt, 5) != SQLITE_NULL) precursor.setDriftTime(sqlite3_column_double(stmt, 5)); - if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) precursor.setMZ(sqlite3_column_double(stmt, 6)); - if (sqlite3_column_type(stmt, 7) != SQLITE_NULL) precursor.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 7)); - if (sqlite3_column_type(stmt, 8) != SQLITE_NULL) precursor.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 8)); - if (Sql::extractValue(&tmp, stmt, 9)) precursor.setMetaValue("peptide_sequence", tmp); + if (Sql::extractValue(&tmp, stmt, 1)) + { + spec.setNativeID(tmp); + } + if (sqlite3_column_type(stmt, 2) != SQLITE_NULL) + { + spec.setMSLevel(sqlite3_column_int(stmt, 2)); + } + if (sqlite3_column_type(stmt, 3) != SQLITE_NULL) + { + spec.setRT(sqlite3_column_double(stmt, 3)); + } + if (sqlite3_column_type(stmt, 4) != SQLITE_NULL) + { + precursor.setCharge(sqlite3_column_int(stmt, 4)); + } + if (sqlite3_column_type(stmt, 5) != SQLITE_NULL) + { + precursor.setDriftTime(sqlite3_column_double(stmt, 5)); + } + if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) + { + precursor.setMZ(sqlite3_column_double(stmt, 6)); + } + if (sqlite3_column_type(stmt, 7) != SQLITE_NULL) + { + precursor.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 7)); + } + if (sqlite3_column_type(stmt, 8) != SQLITE_NULL) + { + precursor.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 8)); + } + if (Sql::extractValue(&tmp, stmt, 9)) + { + precursor.setMetaValue("peptide_sequence", tmp); + } // if (sqlite3_column_type(stmt, 10) != SQLITE_NULL) product.setCharge(sqlite3_column_int(stmt, 10)); - if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) product.setMZ(sqlite3_column_double(stmt, 11)); - if (sqlite3_column_type(stmt, 12) != SQLITE_NULL) product.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 12)); - if (sqlite3_column_type(stmt, 13) != SQLITE_NULL) product.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 13)); + if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) + { + product.setMZ(sqlite3_column_double(stmt, 11)); + } + if (sqlite3_column_type(stmt, 12) != SQLITE_NULL) + { + product.setIsolationWindowLowerOffset(sqlite3_column_double(stmt, 12)); + } + if (sqlite3_column_type(stmt, 13) != SQLITE_NULL) + { + product.setIsolationWindowUpperOffset(sqlite3_column_double(stmt, 13)); + } if (sqlite3_column_type(stmt, 14) != SQLITE_NULL) { int pol = sqlite3_column_int(stmt, 14); - if (pol == 0) spec.getInstrumentSettings().setPolarity(IonSource::NEGATIVE); - else spec.getInstrumentSettings().setPolarity(IonSource::POSITIVE); + if (pol == 0) + { + spec.getInstrumentSettings().setPolarity(IonSource::NEGATIVE); + } + else + { + spec.getInstrumentSettings().setPolarity(IonSource::POSITIVE); + } } if (sqlite3_column_type(stmt, 15) != SQLITE_NULL && sqlite3_column_int(stmt, 15) != -1 && sqlite3_column_int(stmt, 15) < static_cast(OpenMS::Precursor::SIZE_OF_ACTIVATIONMETHOD)) { precursor.getActivationMethods().insert(static_cast(sqlite3_column_int(stmt, 15))); } - if (sqlite3_column_type(stmt, 16) != SQLITE_NULL) precursor.setActivationEnergy(sqlite3_column_double(stmt, 16)); - - if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) spec.getPrecursors().push_back(std::move(precursor)); - if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) spec.getProducts().push_back(std::move(product)); - + if (sqlite3_column_type(stmt, 16) != SQLITE_NULL) + { + precursor.setActivationEnergy(sqlite3_column_double(stmt, 16)); + } + if (sqlite3_column_type(stmt, 6) != SQLITE_NULL) + { + spec.getPrecursors().push_back(std::move(precursor)); + } + if (sqlite3_column_type(stmt, 11) != SQLITE_NULL) + { + spec.getProducts().push_back(std::move(product)); + } sqlite3_step( stmt ); } @@ -912,8 +993,10 @@ namespace OpenMS void MzMLSqliteHandler::writeSpectra(const std::vector& spectra) { // prevent writing of empty data which would throw an SQL exception - if (spectra.empty()) return; - + if (spectra.empty()) + { + return; + } SqliteConnector conn(filename_); // prepare streams and set required precision (default is 6 digits) @@ -1127,16 +1210,24 @@ namespace OpenMS conn.executeStatement("BEGIN TRANSACTION"); conn.executeStatement(insert_spectra_sql.str()); - if (nr_precursors > 0) conn.executeStatement(insert_precursor_sql.str()); - if (nr_products > 0) conn.executeStatement(insert_product_sql.str()); + if (nr_precursors > 0) + { + conn.executeStatement(insert_precursor_sql.str()); + } + if (nr_products > 0) + { + conn.executeStatement(insert_product_sql.str()); + } conn.executeStatement("END TRANSACTION"); } void MzMLSqliteHandler::writeChromatograms(const std::vector& chroms) { // prevent writing of empty data which would throw an SQL exception - if (chroms.empty()) return; - + if (chroms.empty()) + { + return; + } SqliteConnector conn(filename_); // prepare streams and set required precision (default is 6 digits) @@ -1325,6 +1416,5 @@ namespace OpenMS conn.executeStatement("END TRANSACTION"); } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzMLSqliteSwathHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzMLSqliteSwathHandler.cpp index 0bdcb2e6b78..7cba2727fdf 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzMLSqliteSwathHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzMLSqliteSwathHandler.cpp @@ -40,10 +40,9 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + namespace Sql = Internal::SqliteHelper; @@ -137,6 +136,5 @@ namespace OpenMS return indices; } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzQuantMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzQuantMLHandler.cpp index 1f74a4e8ec4..02f4fba8bcb 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzQuantMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzQuantMLHandler.cpp @@ -38,10 +38,9 @@ using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + MzQuantMLHandler::MzQuantMLHandler(const MSQuantifications& msq, const String& filename, const String& version, const ProgressLogger& logger) : XMLHandler(filename, version), logger_(logger), @@ -628,14 +627,21 @@ namespace OpenMS { //TODO if (accession == "MOD:01522") + { current_assay_.mods_.push_back(std::make_pair("114", double(114))); + } else if (accession == "MOD:01523") + { current_assay_.mods_.push_back(std::make_pair("115", double(115))); + } else if (accession == "MOD:01524") + { current_assay_.mods_.push_back(std::make_pair("116", double(116))); + } else if (accession == "MOD:01525") + { current_assay_.mods_.push_back(std::make_pair("117", double(117))); - + } } else warning(LOAD, String("Unhandled cvParam '") + name + "' in tag '" + parent_tag + "'."); @@ -787,14 +793,14 @@ namespace OpenMS String idfile_tag, idfile_ref, searchdb_ref; std::vector pl = cmsq_->getDataProcessingList(); - for (std::vector::const_iterator dit = pl.begin(); dit != pl.end(); ++dit) + for (const DataProcessing& dit : pl) { //~ for (std::vector::const_iterator dit = cmsq_->getDataProcessingList().begin(); dit != cmsq_->getDataProcessingList().end(); ++dit) // soome wierd bug is making this impossible resulting in segfault - to tired to work this one out right now - if (dit->getSoftware().getName() == "IDMapper" && !cmsq_->getConsensusMaps().front().getProteinIdentifications().empty()) + if (dit.getSoftware().getName() == "IDMapper" && !cmsq_->getConsensusMaps().front().getProteinIdentifications().empty()) { searchdb_ref = "sdb_" + String(UniqueIdGenerator::getUniqueId()); idfile_ref = "idf_" + String(UniqueIdGenerator::getUniqueId()); - String idfile_name = dit->getMetaValue("parameter: id"); + String idfile_name = dit.getMetaValue("parameter: id"); idfile_tag += "\t\t\n"; idfile_tag += "\t\t\t\n"; @@ -805,13 +811,13 @@ namespace OpenMS String sw_ref; sw_ref = "sw_" + String(UniqueIdGenerator::getUniqueId()); - softwarelist_tag += "\t\tgetSoftware().getVersion()) + "\">\n"; - writeCVParams_(softwarelist_tag, dit->getSoftware().getCVTerms(), UInt(3)); // TODO fix up the tools with their cvparams and make them write it in the softwarelist! - if (dit->getSoftware().getCVTerms().empty()) + softwarelist_tag += "\t\t\n"; + writeCVParams_(softwarelist_tag, dit.getSoftware().getCVTerms(), UInt(3)); // TODO fix up the tools with their cvparams and make them write it in the softwarelist! + if (dit.getSoftware().getCVTerms().empty()) { - softwarelist_tag += "\t\t\tgetSoftware().getName()) + "\"/>\n"; + softwarelist_tag += "\t\t\t\n"; } - if (dit->getSoftware().getName() == "ITRAQAnalyzer") // tool does not exist any more. replace by IsobaricAnalyzer? + if (dit.getSoftware().getName() == "ITRAQAnalyzer") // tool does not exist any more. replace by IsobaricAnalyzer? { softwarelist_tag += "\t\t\t\n"; } @@ -819,7 +825,7 @@ namespace OpenMS ++order_d; dataprocessinglist_tag += "\t\t\n"; Size order_c = 0; - for (std::set::const_iterator pit = dit->getProcessingActions().begin(); pit != dit->getProcessingActions().end(); ++pit) + for (const DataProcessing::ProcessingAction& pit : dit.getProcessingActions()) { //~ TODO rewrite OpenMS::DataProcessing //~ TODO add CVTermList/MetaInfoInterfaceObject to DataProcessing and ParamGroup/Order to "ProcessingAction" or document implicit ordering @@ -827,7 +833,7 @@ namespace OpenMS dataprocessinglist_tag += "\t\t\t\n"; //~ writeUserParam_(dataprocessinglist_tag, pit->getUserParams(), UInt(4)); //writeUserParam_(String& s, const MetaInfoInterface& meta, UInt indent) //~ writeCVParams_(dataprocessinglist_tag, (pit->getCVParams.getCVTerms(), UInt(4)); //writeCVParams_(String& s, const Map< String, std::vector < CVTerm > > & , UInt indent) - dataprocessinglist_tag += "\t\t\t\tgetSoftware().getName()) + "\" />\n"; + dataprocessinglist_tag += "\t\t\t\t\n"; dataprocessinglist_tag += "\t\t\t\n"; } dataprocessinglist_tag += "\t\t\n"; @@ -844,12 +850,12 @@ namespace OpenMS { case 0: //~ register ratio elements in numden_r_ids_ and r_r_obj_ - for (std::vector::const_iterator mit = cmsq_->getConsensusMaps().begin(); mit != cmsq_->getConsensusMaps().end(); ++mit) + for (const ConsensusMap& mit : cmsq_->getConsensusMaps()) { //~ std::vector< std::vector > cmid; - for (ConsensusMap::const_iterator cit = mit->begin(); cit != mit->end(); ++cit) + for (const ConsensusFeature& cit : mit) { - std::vector rv = cit->getRatios(); + std::vector rv = cit.getRatios(); //~ for (std::vector::const_iterator rit = cit->getRatios().begin(); rit != cit->getRatios().end(); ++rit) for (Size i = 0; i < rv.size(); ++i) { @@ -898,7 +904,7 @@ namespace OpenMS // ---Assay & StudyVariables--- each "channel" gets its assay - each assay its raw file group String assay_xml("\t\n"), study_xml("\t\n"), inputfiles_xml("\t\n"); std::map files; - for (std::vector::const_iterator ait = cmsq_->getAssays().begin(); ait != cmsq_->getAssays().end(); ++ait) + for (const MSQuantifications::Assay& ait : cmsq_->getAssays()) { String rfgr, ar, vr; rfgr = String(UniqueIdGenerator::getUniqueId()); @@ -907,20 +913,20 @@ namespace OpenMS String rgs; bool group_exists = true; rgs += "\t\t\n"; - for (std::vector::const_iterator iit = ait->raw_files_.begin(); iit != ait->raw_files_.end(); ++iit) + for (const ExperimentalSettings& iit : ait.raw_files_) { - if (files.find(iit->getLoadedFilePath()) == files.end()) + if (files.find(iit.getLoadedFilePath()) == files.end()) { group_exists = false; glob_rfgr = rfgr; //TODO remove that when real rawfile grouping is done UInt64 rid = UniqueIdGenerator::getUniqueId(); - files.insert(std::make_pair(iit->getLoadedFilePath(), rfgr)); - rgs += "\t\t\tgetLoadedFilePath() + "\"/>\n"; + files.insert(std::make_pair(iit.getLoadedFilePath(), rfgr)); + rgs += "\t\t\t\n"; // TODO write proteowizards sourcefiles (if there is any mentioning of that in the mzml) into OpenMS::ExperimentalSettings of the exp } else { - rfgr = String(files.find(iit->getLoadedFilePath())->second); + rfgr = String(files.find(iit.getLoadedFilePath())->second); } //~ what about the other experimentalsettings? } @@ -931,13 +937,13 @@ namespace OpenMS inputfiles_xml += rgs; } - assay_xml += "\t\tuid_) + "\" rawFilesGroup_ref=\"rfg_" + rfgr + "\">\n"; + assay_xml += "\t\t\n"; assay_xml += "\t\t\t\n"; @@ -1037,12 +1043,12 @@ namespace OpenMS std::vector > f2i; String peptide_xml, feature_xml = ""; feature_xml += "\t\n"; //TODO make registerExperiment also register the consensusmaps (and featuremaps) - keep the grouping with ids - for (std::vector::const_iterator mit = cmsq_->getConsensusMaps().begin(); mit != cmsq_->getConsensusMaps().end(); ++mit) + for (const ConsensusMap& mit : cmsq_->getConsensusMaps()) { std::vector > cmid; - for (ConsensusMap::const_iterator cit = mit->begin(); cit != mit->end(); ++cit) + for (const ConsensusFeature& cit : mit) { - const ConsensusFeature::HandleSetType& feature_handles = cit->getFeatures(); + const ConsensusFeature::HandleSetType& feature_handles = cit.getFeatures(); switch (cmsq_->getAnalysisSummary().quant_type_) //enum QUANT_TYPES {MS1LABEL=0, MS2LABEL, LABELFREE, SIZE_OF_QUANT_TYPES}; // derived from processing applied { case 0: //ms1label @@ -1070,7 +1076,7 @@ namespace OpenMS { std::vector fi; fid.push_back(UniqueIdGenerator::getUniqueId()); - feature_xml += "\t\tgetRT()) + "\" mz=\"" + String(cit->getMZ()) + "\" charge=\"" + String(cit->getCharge()) + "\"/>\n"; + feature_xml += "\t\t\n"; //~ std::vector cidvec; //~ cidvec.push_back(fid.back()); for (std::set::const_iterator fit = feature_handles.begin(); fit != feature_handles.end(); ++fit) @@ -1114,9 +1120,9 @@ namespace OpenMS case 1: //ms2label { feature_xml += String("\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t"); - for (std::vector::const_iterator ait = cmsq_->getAssays().begin(); ait != cmsq_->getAssays().end(); ++ait) + for (const MSQuantifications::Assay& ait : cmsq_->getAssays()) { - feature_xml += String("a_") + String(ait->uid_) + String(" "); + feature_xml += String("a_") + String(ait.uid_) + String(" "); } feature_xml += String("\n\t\t\t\n"); for (Size i = 0; i < fid.size(); ++i) @@ -1187,10 +1193,10 @@ namespace OpenMS std::map r_values; std::vector temp_ratios = cmsq_->getConsensusMaps()[k][i].getRatios(); - for (std::vector::const_iterator rit = temp_ratios.begin(); rit != temp_ratios.end(); ++rit) + for (const ConsensusFeature::Ratio& rit : temp_ratios) { - String rd = rit->numerator_ref_ + rit->denominator_ref_; - r_values.insert(std::make_pair(rd, String(rit->ratio_value_))); + String rd = rit.numerator_ref_ + rit.denominator_ref_; + r_values.insert(std::make_pair(rd, String(rit.ratio_value_))); } std::vector dis; //TODO insert missing ratio_refs into r_values with value "-1" @@ -1258,13 +1264,13 @@ namespace OpenMS String inden((size_t)indent, '\t'); for (std::map >::const_iterator jt = cvl.begin(); jt != cvl.end(); ++jt) { - for (std::vector::const_iterator kt = (*jt).second.begin(); kt != (*jt).second.end(); ++kt) + for (const CVTerm& kt : (*jt).second) { s += inden; - s += "getCVIdentifierRef() + "\" accession=\"" + (*jt).first + "\" name=\"" + kt->getName(); - if (kt->hasValue()) + s += "getValue().toString() + "\"/>\n"; // value is OpenMS::DataValue + s += "\" value=\"" + kt.getValue().toString() + "\"/>\n"; // value is OpenMS::DataValue } else { @@ -1325,23 +1331,23 @@ namespace OpenMS std::vector idvec; idvec.push_back(UniqueIdGenerator::getUniqueId()); - for (std::vector::const_iterator fat = fm.begin(); fat != fm.end(); ++fat) + for (const FeatureMap& fat : fm) { - for (std::vector::const_iterator fit = fat->begin(); fit != fat->end(); ++fit) + for (const Feature& fit : fat) { fid.push_back(UniqueIdGenerator::getUniqueId()); idvec.push_back(fid.back()); - fin.push_back(fit->getIntensity()); - fwi.push_back(fit->getWidth()); - fqu.push_back(fit->getOverallQuality()); - feature_xml += String(indentation_level, '\t') + "getRT()) + "\" mz=\"" + String(fit->getMZ()) + "\" charge=\"" + String(fit->getCharge()) + "\">\n"; + fin.push_back(fit.getIntensity()); + fwi.push_back(fit.getWidth()); + fqu.push_back(fit.getOverallQuality()); + feature_xml += String(indentation_level, '\t') + "\n"; //~ writeUserParam_(os, *jt, UInt(2)); // FeatureHandle has no MetaInfoInterface!!! //~ feature_xml += "\t\t\tgetUniqueId()) + "\"/>\n"; feature_xml += String(indentation_level, '\t') + "\n"; - for (std::vector::const_iterator cit = fit->getConvexHulls().begin(); cit != fit->getConvexHulls().end(); ++cit) + for (const ConvexHull2D& cit : fit.getConvexHulls()) { feature_xml += String(indentation_level, '\t') + "\t"; - feature_xml += String(cit->getBoundingBox().minX()) + " " + String(cit->getBoundingBox().minY()) + " " + String(cit->getBoundingBox().maxX()) + " " + String(cit->getBoundingBox().maxY()); + feature_xml += String(cit.getBoundingBox().minX()) + " " + String(cit.getBoundingBox().minY()) + " " + String(cit.getBoundingBox().maxX()) + " " + String(cit.getBoundingBox().maxY()); feature_xml += "\n"; } } @@ -1412,5 +1418,4 @@ namespace OpenMS //~ os << indent << "\t\t\n"; } - } //namespace Internal -} // namespace OpenMS +} // namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/MzXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/MzXMLHandler.cpp index 1b9cbf5f2dc..dd9f3e7bfe1 100644 --- a/src/openms/source/FORMAT/HANDLERS/MzXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/MzXMLHandler.cpp @@ -41,10 +41,8 @@ #include #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { // class holding the byte offsets to '' tags in the mzXML file; req. to create the index at the end struct IndexPos @@ -153,8 +151,9 @@ namespace OpenMS //Skip all tags until the the next scan if (skip_spectrum_ && tag != "scan") + { return; - + } if (tag == "msRun") { Int count = 0; @@ -268,8 +267,9 @@ namespace OpenMS nesting_level_++; if (options_.getMetadataOnly()) + { throw EndParsingSoftly(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); - + } // check if the scan is in the desired MS / RT range UInt ms_level = attributeAsInt_(attributes, s_mslevel_); if (ms_level == 0) @@ -366,9 +366,13 @@ namespace OpenMS else if (type == "Full") { if (ms_level > 1) + { spectrum_data_.back().spectrum.getInstrumentSettings().setScanMode(InstrumentSettings::MSNSPECTRUM); + } else + { spectrum_data_.back().spectrum.getInstrumentSettings().setScanMode(InstrumentSettings::MASSSPECTRUM); + } } else if (type == "SIM") { @@ -495,8 +499,9 @@ namespace OpenMS String name = ""; optionalAttributeAsString_(name, attributes, s_name_); if (name == "") + { return; - + } String value = ""; optionalAttributeAsString_(value, attributes, s_value_); @@ -520,8 +525,9 @@ namespace OpenMS String name = ""; optionalAttributeAsString_(name, attributes, s_name_); if (name == "") + { return; - + } String value = ""; optionalAttributeAsString_(value, attributes, s_value_); @@ -569,8 +575,9 @@ namespace OpenMS { //Abort if this spectrum should be skipped if (skip_spectrum_) + { return; - + } if (open_tags_.back() == "peaks") { //chars may be split to several chunks => concatenate them @@ -639,7 +646,9 @@ namespace OpenMS { const SpectrumType& spec = (*cexp_)[s]; if (spec.size() != 0) + { ++count_tmp_; + } } if (count_tmp_ == 0) ++count_tmp_; @@ -942,8 +951,10 @@ namespace OpenMS type = "Full"; warning(STORE, String("Scan type unknown. Assuming 'Full' scan mode for MQ compatibility!")); } - if (!type.empty()) os << " scanType=\""<< type << "\""; - + if (!type.empty()) + { + os << " scanType=\""<< type << "\""; + } // filter line if (spec.metaValueExists("filter string")) { @@ -954,7 +965,10 @@ namespace OpenMS // retention time os << " retentionTime=\""; - if (spec.getRT() < 0) os << "-"; + if (spec.getRT() < 0) + { + os << "-"; + } os << "PT" << std::fabs(spec.getRT()) << "S\""; if (!spec.getInstrumentSettings().getScanWindows().empty()) { @@ -1295,5 +1309,5 @@ namespace OpenMS String(";FWHM;TenPercentValley;Baseline").split(';', cv_terms_[5]); cv_terms_[5].resize(MassAnalyzer::SIZE_OF_RESOLUTIONMETHOD); } - } -} +} //namespace OpenMS //namespace Internal + diff --git a/src/openms/source/FORMAT/HANDLERS/PTMXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/PTMXMLHandler.cpp index 6d4d4d062f1..199f89e77a3 100644 --- a/src/openms/source/FORMAT/HANDLERS/PTMXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/PTMXMLHandler.cpp @@ -37,10 +37,9 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + PTMXMLHandler::PTMXMLHandler(map > & ptm_informations, const String & filename) : XMLHandler(filename, ""), ptm_informations_(ptm_informations) @@ -96,6 +95,4 @@ namespace OpenMS } } } - - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/ParamXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/ParamXMLHandler.cpp index a496147c893..69864ff3da1 100644 --- a/src/openms/source/FORMAT/HANDLERS/ParamXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/ParamXMLHandler.cpp @@ -38,10 +38,9 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + ParamXMLHandler::ParamXMLHandler(Param& param, const String& filename, const String& version) : XMLHandler(filename, version), @@ -167,7 +166,9 @@ namespace OpenMS { val.split(':', parts); if (parts.size() != 2) + { val.split('-', parts); //for downward compatibility + } if (parts.size() == 2) { if (parts[0] != "") @@ -303,8 +304,10 @@ namespace OpenMS optionalAttributeAsString_(file_version, attributes, "version"); // default version is 1.0 - if (file_version == "") file_version = "1.0"; - + if (file_version == "") + { + file_version = "1.0"; + } VersionInfo::VersionDetails file_version_details = VersionInfo::VersionDetails::create(file_version); VersionInfo::VersionDetails parser_version = VersionInfo::VersionDetails::create(version_); @@ -348,7 +351,9 @@ namespace OpenMS { list_.restrictions.split(':', parts); if (parts.size() != 2) + { list_.restrictions.split('-', parts); //for downward compatibility + } if (parts.size() == 2) { if (parts[0] != "") @@ -373,7 +378,9 @@ namespace OpenMS { list_.restrictions.split(':', parts); if (parts.size() != 2) + { list_.restrictions.split('-', parts); //for downward compatibility + } if (parts.size() == 2) { if (parts[0] != "") @@ -401,5 +408,4 @@ namespace OpenMS } } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/ToolDescriptionHandler.cpp b/src/openms/source/FORMAT/HANDLERS/ToolDescriptionHandler.cpp index 965b2df569d..391733e8dcd 100644 --- a/src/openms/source/FORMAT/HANDLERS/ToolDescriptionHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/ToolDescriptionHandler.cpp @@ -36,10 +36,8 @@ using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { ToolDescriptionHandler::ToolDescriptionHandler(const String & filename, const String & version) : ParamXMLHandler(p_, filename, version), @@ -72,11 +70,17 @@ namespace OpenMS { String status = attributeAsString_(attributes, "status"); if (status == "external") + { td_.is_internal = false; + } else if (status == "internal") + { td_.is_internal = true; + } else + { error(LOAD, "ToolDescriptionHandler::startElement: Element 'status' if tag 'tool' has unknown value " + status + "'."); + } return; } if (tag_ == "mapping") @@ -111,7 +115,9 @@ namespace OpenMS } if (tag_ == "ttd" || tag_ == "category" || tag_ == "e_category" || tag_ == "type") + { return; + } if (td_.is_internal) { @@ -124,7 +130,9 @@ namespace OpenMS { if (tag_ == "external" || tag_ == "cloptions" || tag_ == "path" || tag_ == "mappings" || tag_ == "mapping" || tag_ == "ini_param" || tag_ == "text" || tag_ == "onstartup" || tag_ == "onfail" || tag_ == "onfinish" || tag_ == "workingdirectory") + { return; + } } error(LOAD, "ToolDescriptionHandler::startElement(): Unknown element found: '" + tag_ + "', ignoring."); @@ -141,31 +149,53 @@ namespace OpenMS //std::cout << "characters '" << sm_.convert(chars) << "' in tag " << tag_ << "\n"; if (tag_ == "ttd" || tag_ == "tool" || tag_ == "mappings" || tag_ == "external" || tag_ == "text") + { return; - + } if (tag_ == "name") + { td_.name = sm_.convert(chars); + } else if (tag_ == "category") + { td_.category = sm_.convert(chars); + } else if (tag_ == "type") + { td_.types.push_back(sm_.convert(chars)); + } else if (tag_ == "e_category") + { tde_.category = sm_.convert(chars); + } else if (tag_ == "cloptions") + { tde_.commandline = sm_.convert(chars); + } else if (tag_ == "path") + { tde_.path = sm_.convert(chars); + } else if (tag_ == "onstartup") + { tde_.text_startup = sm_.convert(chars); + } else if (tag_ == "onfail") + { tde_.text_fail = sm_.convert(chars); + } else if (tag_ == "onfinish") + { tde_.text_finish = sm_.convert(chars); + } else if (tag_ == "workingdirectory") + { tde_.working_directory = sm_.convert(chars); - + } else + { error(LOAD, "ToolDescriptionHandler::characters: Unknown character section found: '" + tag_ + "', ignoring."); + } } void ToolDescriptionHandler::endElement(const XMLCh * const uri, const XMLCh * const local_name, const XMLCh * const qname) @@ -180,9 +210,10 @@ namespace OpenMS open_tags_.pop_back(); //std::cout << "ending tag " << endtag_ << "\n"; if (open_tags_.size() > 0) + { tag_ = open_tags_.back(); //std::cout << " --> current Tag: " << tag_ << "\n"; - + } if (endtag_ == "ini_param") { in_ini_section_ = false; @@ -220,5 +251,4 @@ namespace OpenMS return td_vec_; } - } //namespace Internal -} // namespace OpenMS +} // namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/TraMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/TraMLHandler.cpp index 2e8fae71325..c73adc26059 100644 --- a/src/openms/source/FORMAT/HANDLERS/TraMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/TraMLHandler.cpp @@ -40,10 +40,9 @@ #include -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + TraMLHandler::TraMLHandler(const TargetedExperiment& exp, const String& filename, const String& version, const ProgressLogger& logger) : XMLHandler(filename, version), @@ -725,17 +724,17 @@ namespace OpenMS if (it->theoretical_mass > 0.0) { os << " theoretical_mass << "\" unitCvRef=\"UO\" unitAccession=\"UO:0000221\" unitName=\"dalton\"/>\n"; + it->theoretical_mass << "\" unitCvRef=\"UO\" unitAccession=\"UO:0000221\" unitName=\"dalton\"/>\n"; } if (!it->molecular_formula.empty()) { os << " molecular_formula << "\"/>\n"; + it->molecular_formula << "\"/>\n"; } if (!it->smiles_string.empty()) { os << " smiles_string << "\"/>\n"; + it->smiles_string << "\"/>\n"; } writeCVParams_(os, *it, 3); @@ -850,15 +849,15 @@ namespace OpenMS // NOTE: do not change that, the same default is implicitly assumed in ReactionMonitoringTransition if (!it->isDetectingTransition()) { - os << " \n"; + os << " \n"; } if (it->isIdentifyingTransition()) { - os << " \n"; + os << " \n"; } if (!it->isQuantifyingTransition()) { - os << " \n"; + os << " \n"; } writeUserParam_(os, (MetaInfoInterface) * it, 3); @@ -1764,22 +1763,21 @@ namespace OpenMS for (Map >::const_iterator it = cv_terms.begin(); it != cv_terms.end(); ++it) { - for (std::vector::const_iterator cit = it->second.begin(); cit != it->second.end(); ++cit) + for (const CVTerm& cit : it->second) { - os << String(2 * indent, ' ') << "getCVIdentifierRef() << "\" accession=\"" << cit->getAccession() << "\" name=\"" << cit->getName() << "\""; - if (cit->hasValue() && !cit->getValue().isEmpty() && !cit->getValue().toString().empty()) + os << String(2 * indent, ' ') << "getValue().toString() << "\""; + os << " value=\"" << cit.getValue().toString() << "\""; } - if (cit->hasUnit()) + if (cit.hasUnit()) { - os << " unitCvRef=\"" << cit->getUnit().cv_ref << "\" unitAccession=\"" << cit->getUnit().accession << "\" unitName=\"" << cit->getUnit().name << "\""; + os << " unitCvRef=\"" << cit.getUnit().cv_ref << "\" unitAccession=\"" << cit.getUnit().accession << "\" unitName=\"" << cit.getUnit().name << "\""; } os << "/>" << "\n"; } } } - } //namespace Internal -} // namespace OpenMS +} // namespace OpenMS //namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/UnimodXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/UnimodXMLHandler.cpp index 5f77735fb6a..2919b22e737 100644 --- a/src/openms/source/FORMAT/HANDLERS/UnimodXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/UnimodXMLHandler.cpp @@ -38,10 +38,9 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + UnimodXMLHandler::UnimodXMLHandler(vector& mods, const String& filename) : XMLHandler(filename, "2.0"), @@ -124,7 +123,10 @@ namespace OpenMS was_valid_peptide_modification_ = true; term_specs_.push_back(position); - if (site.size() > 1) site = "X"; // C-term/N-term + if (site.size() > 1) + { + site = "X"; // C-term/N-term + } sites_.push_back(site[0]); return; } @@ -237,5 +239,4 @@ namespace OpenMS // nothing to do here } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/XMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/XMLHandler.cpp index 45a5d486e69..3c093d63f08 100644 --- a/src/openms/source/FORMAT/HANDLERS/XMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/XMLHandler.cpp @@ -44,10 +44,8 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { // Specializations for character types, released by XMLString::release template<> void shared_xerces_ptr::doRelease_(char* item) @@ -316,6 +314,4 @@ namespace OpenMS } - } // namespace Internal - -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/HANDLERS/XQuestResultXMLHandler.cpp b/src/openms/source/FORMAT/HANDLERS/XQuestResultXMLHandler.cpp index a26b7df50ad..3cdddb7676e 100644 --- a/src/openms/source/FORMAT/HANDLERS/XQuestResultXMLHandler.cpp +++ b/src/openms/source/FORMAT/HANDLERS/XQuestResultXMLHandler.cpp @@ -47,10 +47,9 @@ using namespace std; using namespace xercesc; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + // Initialize static const members std::map< Size, String > XQuestResultXMLHandler::enzymes { @@ -900,7 +899,7 @@ namespace OpenMS } else { - throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "The separator has to occur in the input string an uneven number of times (and at least once)."); + throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "The separator has to occur in the input string an uneven number of times (and at least once)."); } } @@ -1257,5 +1256,4 @@ namespace OpenMS os << "" << std::endl; os << "" << std::endl; } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/IdXMLFile.cpp b/src/openms/source/FORMAT/IdXMLFile.cpp index 2e3155d937c..63ff07ade61 100644 --- a/src/openms/source/FORMAT/IdXMLFile.cpp +++ b/src/openms/source/FORMAT/IdXMLFile.cpp @@ -472,7 +472,9 @@ namespace OpenMS optionalAttributeAsString_(file_version, attributes, "version"); if (file_version == "") + { file_version = "1.0"; //default version is 1.0 + } if (file_version.toDouble() > version_.toDouble()) { warning(LOAD, "The XML file (" + file_version + ") is newer than the parser (" + version_ + "). This might lead to undefined program behavior."); @@ -865,7 +867,9 @@ namespace OpenMS { String spec = last_meta_->getMetaValue("EnzymeTermSpecificity"); if (spec != "unknown") + { param_.enzyme_term_specificity = static_cast(EnzymaticDigestion::getSpecificityByName(spec)); + } } last_meta_ = nullptr; parameters_[id_] = param_; @@ -946,7 +950,9 @@ namespace OpenMS acc_it != groups[g].accessions.end(); ++acc_it) { if (acc_it != groups[g].accessions.begin()) + { accessions += ","; + } const auto pos = accession_to_id.find(*acc_it); if (pos != accession_to_id.end()) { @@ -996,13 +1002,13 @@ namespace OpenMS bool has_aa_after_information(false); String aa_string; - for (std::vector::const_iterator it = pes.begin(); it != pes.end(); ++it) + for (const PeptideEvidence& it : pes) { - if (it->getAABefore() != PeptideEvidence::UNKNOWN_AA) + if (it.getAABefore() != PeptideEvidence::UNKNOWN_AA) { has_aa_before_information = true; } - if (it->getAAAfter() != PeptideEvidence::UNKNOWN_AA) + if (it.getAAAfter() != PeptideEvidence::UNKNOWN_AA) { has_aa_after_information = true; } @@ -1035,13 +1041,13 @@ namespace OpenMS bool has_aa_start_information(false); bool has_aa_end_information(false); - for (std::vector::const_iterator it = pes.begin(); it != pes.end(); ++it) + for (const PeptideEvidence& it : pes) { - if (it->getStart() != PeptideEvidence::UNKNOWN_POSITION) + if (it.getStart() != PeptideEvidence::UNKNOWN_POSITION) { has_aa_start_information = true; } - if (it->getEnd() != PeptideEvidence::UNKNOWN_POSITION) + if (it.getEnd() != PeptideEvidence::UNKNOWN_POSITION) { has_aa_end_information = true; } diff --git a/src/openms/source/FORMAT/InspectInfile.cpp b/src/openms/source/FORMAT/InspectInfile.cpp index 44870ba6b4f..d34ee3cf2fa 100644 --- a/src/openms/source/FORMAT/InspectInfile.cpp +++ b/src/openms/source/FORMAT/InspectInfile.cpp @@ -139,45 +139,57 @@ namespace OpenMS file_content << "spectra," << spectra_ << "\n"; if (!db_.empty()) + { file_content << "db," << db_ << "\n"; - + } if (!enzyme_.empty()) + { file_content << "protease," << enzyme_ << "\n"; - + } if (blind_ != 2) + { file_content << "blind," << blind_ << "\n"; - + } //mod,+57,C,fix,carbamidomethylation for (std::map >::iterator mods_i = PTMname_residues_mass_type_.begin(); mods_i != PTMname_residues_mass_type_.end(); ++mods_i) { // fix", "cterminal", "nterminal", and "opt mods_i->second[2].toLower(); if (mods_i->second[2].hasSuffix("term")) + { mods_i->second[2].append("inal"); + } file_content << "mod," << mods_i->second[1] << "," << mods_i->second[0] << "," << mods_i->second[2] << "," << mods_i->first << "\n"; } if (modifications_per_peptide_ > -1) + { file_content << "mods," << modifications_per_peptide_ << "\n"; - + } if (maxptmsize_ >= 0) + { file_content << "maxptmsize," << maxptmsize_ << "\n"; - + } if (precursor_mass_tolerance_ >= 0) + { file_content << "PM_tolerance," << precursor_mass_tolerance_ << "\n"; - + } if (peak_mass_tolerance_ >= 0) + { file_content << "IonTolerance," << peak_mass_tolerance_ << "\n"; - + } if (multicharge_ != 2) + { file_content << "multicharge," << multicharge_ << "\n"; - + } if (!instrument_.empty()) + { file_content << "instrument," << instrument_ << "\n"; - + } if (tag_count_ >= 0) + { file_content << "TagCount," << tag_count_ << "\n"; - + } ofs << file_content.str(); ofs.close(); @@ -194,8 +206,9 @@ namespace OpenMS vector modifications, mod_parts; modification_line.split(':', modifications); // get the single modifications if (modifications.empty()) + { modifications.push_back(modification_line); - + } // to get masses from a formula EmpiricalFormula add_formula, substract_formula; @@ -230,9 +243,13 @@ namespace OpenMS // to check whether the first part is a mass, it is converted into a float and then back into a string and compared to the given string // remove + signs because they don't appear in a float if (mass.hasPrefix("+")) + { mass.erase(0, 1); + } if (mass.hasSuffix("+")) + { mass.erase(mass.length() - 1, 1); + } if (mass.hasSuffix("-")) // a - sign at the end will not be converted { mass.erase(mass.length() - 1, 1); @@ -240,7 +257,9 @@ namespace OpenMS } // if it is a mass if (!String(mass.toFloat()).empty()) // just check if conversion does not throw, i.e. consumes the whole string + { mass_or_composition_or_name = 0; + } } catch (Exception::ConversionError& /*c_e*/) { @@ -277,7 +296,9 @@ namespace OpenMS // check whether it's an empirical formula / if a composition was given, get the mass if (mass_or_composition_or_name == -1) + { mass = mod_parts.front(); + } if (mass_or_composition_or_name == -1 || mass_or_composition_or_name == 2) { // check whether there is a positive and a negative formula @@ -295,11 +316,17 @@ namespace OpenMS } // sum up the masses if (monoisotopic) + { mass = String(add_formula.getMonoWeight() - substract_formula.getMonoWeight()); + } else + { mass = String(add_formula.getAverageWeight() - substract_formula.getAverageWeight()); + } if (mass_or_composition_or_name == -1) + { mass_or_composition_or_name = 1; + } } catch (Exception::ParseError& /*pe*/) { @@ -327,15 +354,21 @@ namespace OpenMS // get the type if (mod_parts.empty()) + { type = "OPT"; + } else { type = mod_parts.front(); type.toUpper(); if (types.find(type) != String::npos) + { mod_parts.erase(mod_parts.begin()); + } else + { type = "OPT"; + } } if (mod_parts.size() > 1) @@ -348,9 +381,13 @@ namespace OpenMS if (mass_or_composition_or_name < 2) { if (mod_parts.empty()) + { name = "PTM_" + String(PTMname_residues_mass_type_.size()); + } else + { name = mod_parts.front(); + } } // insert the modification diff --git a/src/openms/source/FORMAT/InspectOutfile.cpp b/src/openms/source/FORMAT/InspectOutfile.cpp index 5963d2462ad..395e2f537fd 100644 --- a/src/openms/source/FORMAT/InspectOutfile.cpp +++ b/src/openms/source/FORMAT/InspectOutfile.cpp @@ -69,8 +69,9 @@ namespace OpenMS InspectOutfile& InspectOutfile::operator=(const InspectOutfile& inspect_outfile) { if (this == &inspect_outfile) + { return *this; - + } return *this; } @@ -126,10 +127,13 @@ namespace OpenMS DateTime datetime = DateTime::now(); if (protein_identification.getSearchEngine().empty()) + { identifier = "InsPecT_" + datetime.getDate(); + } else + { protein_identification.getSearchEngine() + "_" + datetime.getDate(); - + } // to get the precursor retention time and mz values later, save the filename and the numbers of the scans vector > > > files_and_peptide_identification_with_scan_number; // the record number is mapped to the position in the protein hits, to retrieve their sequences @@ -181,8 +185,9 @@ namespace OpenMS // if the pvalue is too small, skip the line if (substrings[p_value_column].toFloat() > p_value_threshold) + { continue; - + } // the protein ProteinHit protein_hit; // get accession number and type @@ -351,7 +356,9 @@ namespace OpenMS database.get(sequence, trie_delimiter_); sequences.push_back(sequence.str()); if (sequences.back().empty()) + { not_found.push_back(wr_i->first); + } sequence.str(""); } @@ -375,9 +382,13 @@ namespace OpenMS // if it's a FASTA line if (line.hasPrefix(">")) + { line.erase(0, 1); + } if (!line.empty() && (line[line.length() - 1] < 33)) + { line.resize(line.length() - 1); + } line.trim(); // if it's a swissprot accession @@ -398,29 +409,45 @@ namespace OpenMS accession_type = line.substr(snd, third - 1 - snd); } if (accession_type == "gb") + { accession_type = "GenBank"; + } else if (accession_type == "emb") + { accession_type = "EMBL"; + } else if (accession_type == "dbj") + { accession_type = "DDBJ"; + } else if (accession_type == "ref") + { accession_type = "NCBI"; + } else if ((accession_type == "sp") || (accession_type == "tr")) + { accession_type = "SwissProt"; + } else if (accession_type == "gnl") { accession_type = accession; snd = line.find('|', third); third = line.find('|', ++snd); if (third != String::npos) + { accession = line.substr(snd, third - snd); + } else { third = line.find(' ', snd); if (third != String::npos) + { accession = line.substr(snd, third - snd); + } else + { accession = line.substr(snd); + } } } else @@ -453,8 +480,14 @@ namespace OpenMS else { snd = line.find(' ', 3); - if (snd != String::npos) accession = line.substr(3, snd - 3); - else accession = line.substr(3); + if (snd != String::npos) + { + accession = line.substr(3, snd - 3); + } + else + { + accession = line.substr(3); + } } } } @@ -487,9 +520,13 @@ namespace OpenMS { accession = line.substr(pos1, pos2 - pos1); if ((accession.size() == 6) && (String(swissprot_prefixes).find(accession[0], 0) != String::npos)) + { accession_type = "SwissProt"; + } else + { accession.clear(); + } } } if (accession.empty()) @@ -503,14 +540,20 @@ namespace OpenMS pos1 = line.find(' '); accession = line.substr(0, pos1); if ((accession.size() == 6) && (String(swissprot_prefixes).find(accession[0], 0) != String::npos)) + { accession_type = "SwissProt"; + } else { accession = line.substr(0, 6); if (String(swissprot_prefixes).find(accession[0], 0) != String::npos) + { accession_type = "SwissProt"; + } else + { accession.clear(); + } } } } @@ -592,9 +635,13 @@ namespace OpenMS // take the wanted records, copy their sequences to the new db and write the index file accordingly ofstream snd_database; if (append) + { snd_database.open(snd_database_filename.c_str(), std::ios::out | std::ios::app); + } else + { snd_database.open(snd_database_filename.c_str(), std::ios::out | std::ios::trunc); + } if (!snd_database) { database.close(); @@ -606,9 +653,13 @@ namespace OpenMS ofstream snd_index; if (append) + { snd_index.open(snd_index_filename.c_str(), std::ios::out | std::ios::binary | std::ios::app); + } else + { snd_index.open(snd_index_filename.c_str(), std::ios::out | std::ios::binary | std::ios::trunc); + } if (!snd_index) { database.close(); @@ -645,7 +696,9 @@ namespace OpenMS // all but the first sequence are preceded by an asterisk if (append) + { snd_database.put(trie_delimiter_); + } append = true; // check if we have to reverse the database_pos part (which is saved in little endian) @@ -692,7 +745,9 @@ namespace OpenMS if (empty_records) + { wanted_records.clear(); + } delete[] index_record; database.close(); database.clear(); @@ -967,10 +1022,13 @@ namespace OpenMS while (getline(source_database, line) && (sequence_start_label.empty())) { if (!line.empty() && (line[line.length() - 1] < 33)) + { line.resize(line.length() - 1); + } if (line.trim().empty()) + { continue; - + } else if (line.hasPrefix(">")) { ac_label = ">"; @@ -1051,10 +1109,14 @@ namespace OpenMS { ++line_number; if (!line.empty() && (line[line.length() - 1] < 33)) + { line.resize(line.length() - 1); + } line.trim(); if (line.empty()) + { continue; + } line.split('\t', substrings); // check whether the line has enough columns @@ -1066,12 +1128,14 @@ namespace OpenMS // check whether the line has enough columns if (substrings.size() != number_of_columns) + { continue; - + } // take only those peptides whose p-value is less or equal the given threshold if (substrings[p_value_column].toFloat() > p_value_threshold) + { continue; - + } wanted_records_set.insert(substrings[record_number_column].toInt()); } diff --git a/src/openms/source/FORMAT/MRMFeatureQCFile.cpp b/src/openms/source/FORMAT/MRMFeatureQCFile.cpp index e35e68edf1c..3694939a503 100644 --- a/src/openms/source/FORMAT/MRMFeatureQCFile.cpp +++ b/src/openms/source/FORMAT/MRMFeatureQCFile.cpp @@ -110,7 +110,10 @@ namespace OpenMS { MRMFeatureQC::ComponentGroupQCs cg; cg.component_group_name = getCastValue_(headers, line, "component_group_name", ""); - if (cg.component_group_name.empty()) return; + if (cg.component_group_name.empty()) + { + return; + } cg.retention_time_l = getCastValue_(headers, line, "retention_time_l", 0.0); cg.retention_time_u = getCastValue_(headers, line, "retention_time_u", 1e12); cg.intensity_l = getCastValue_(headers, line, "intensity_l", 0.0); diff --git a/src/openms/source/FORMAT/MSNumpressCoder.cpp b/src/openms/source/FORMAT/MSNumpressCoder.cpp index 20c5cd3947e..0d1bd2d865e 100644 --- a/src/openms/source/FORMAT/MSNumpressCoder.cpp +++ b/src/openms/source/FORMAT/MSNumpressCoder.cpp @@ -89,10 +89,14 @@ namespace OpenMS void MSNumpressCoder::encodeNPRaw(const std::vector& in, String& result, const NumpressConfig & config) { - if (in.empty()) return; - - if (config.np_compression == NONE) return; - + if (in.empty()) + { + return; + } + if (config.np_compression == NONE) + { + return; + } Size dataSize = in.size(); // using MSNumpress, from johan.teleman@immun.lth.se @@ -141,7 +145,10 @@ namespace OpenMS { fixedPoint = numpress::MSNumpress::optimalLinearFixedPointMass(&in[0], dataSize, config.linear_fp_mass_acc); // catch failure - if (fixedPoint < 0.0) fixedPoint = numpress::MSNumpress::optimalLinearFixedPoint(&in[0], dataSize); + if (fixedPoint < 0.0) + { + fixedPoint = numpress::MSNumpress::optimalLinearFixedPoint(&in[0], dataSize); + } } else { @@ -170,7 +177,10 @@ namespace OpenMS case SLOF: { - if (config.estimate_fixed_point) {fixedPoint = numpress::MSNumpress::optimalSlofFixedPoint(&in[0], dataSize); } + if (config.estimate_fixed_point) + { + fixedPoint = numpress::MSNumpress::optimalSlofFixedPoint(&in[0], dataSize); + } byteCount = numpress::MSNumpress::encodeSlof(&in[0], dataSize, &numpressed[0], fixedPoint); numpressed.resize(byteCount); if (config.numpressErrorTolerance > 0.0) // decompress to check accuracy loss @@ -313,7 +323,10 @@ namespace OpenMS case LINEAR: { initialSize = byteCount * 2; - if (out.size() < initialSize) { out.resize(initialSize); } + if (out.size() < initialSize) + { + out.resize(initialSize); + } size_t count = numpress::MSNumpress::decodeLinear(in, byteCount, &out[0]); out.resize(count); break; @@ -322,7 +335,10 @@ namespace OpenMS case PIC: { initialSize = byteCount * 2; - if (out.size() < initialSize) { out.resize(initialSize); } + if (out.size() < initialSize) + { + out.resize(initialSize); + } size_t count = numpress::MSNumpress::decodePic(in, byteCount, &out[0]); out.resize(count); break; @@ -331,7 +347,10 @@ namespace OpenMS case SLOF: { initialSize = byteCount / 2; - if (out.size() < initialSize) { out.resize(initialSize); } + if (out.size() < initialSize) + { + out.resize(initialSize); + } size_t count = numpress::MSNumpress::decodeSlof(in, byteCount, &out[0]); out.resize(count); break; diff --git a/src/openms/source/FORMAT/MSPFile.cpp b/src/openms/source/FORMAT/MSPFile.cpp index 008da82152f..6f67fc14e77 100644 --- a/src/openms/source/FORMAT/MSPFile.cpp +++ b/src/openms/source/FORMAT/MSPFile.cpp @@ -261,7 +261,10 @@ namespace OpenMS } else if (line.hasPrefix("Num peaks:") || line.hasPrefix("NumPeaks:")) { - if (line.hasPrefix("NumPeaks:")) {spectrast_format = true;} + if (line.hasPrefix("NumPeaks:")) + { + spectrast_format = true; + } if (!inst_type_correct) { @@ -380,22 +383,22 @@ namespace OpenMS ofstream out(filename.c_str()); - for (PeakMap::ConstIterator it = exp.begin(); it != exp.end(); ++it) + for (const MSSpectrum& it : exp) { - if (it->getPeptideIdentifications().size() > 0 && it->getPeptideIdentifications().begin()->getHits().size() > 0) + if (it.getPeptideIdentifications().size() > 0 && it.getPeptideIdentifications().begin()->getHits().size() > 0) { - PeptideHit hit = *it->getPeptideIdentifications().begin()->getHits().begin(); + PeptideHit hit = *it.getPeptideIdentifications().begin()->getHits().begin(); String peptide; - for (AASequence::ConstIterator pit = hit.getSequence().begin(); pit != hit.getSequence().end(); ++pit) + for (const Residue& pit : hit.getSequence()) { - if (pit->isModified() && pit->getOneLetterCode() == "M" && - fabs(pit->getModification()->getDiffFormula().getMonoWeight() - 16.0) < 0.01) + if (pit.isModified() && pit.getOneLetterCode() == "M" && + fabs(pit.getModification()->getDiffFormula().getMonoWeight() - 16.0) < 0.01) { peptide += "M(O)"; // TODO why are we writing specifically only oxidations? } else { - peptide += pit->getOneLetterCode(); + peptide += pit.getOneLetterCode(); } } out << "Name: " << peptide << "/" << hit.getCharge() << "\n"; @@ -441,24 +444,24 @@ namespace OpenMS out << " Mods=0"; } out << " Inst=it\n"; // @improvement write instrument type, protein...and other information - out << "Num peaks: " << it->size() << "\n"; + out << "Num peaks: " << it.size() << "\n"; // normalize to 10,000 - PeakSpectrum rich_spec = *it; + PeakSpectrum rich_spec = it; double max_int(0); - for (PeakSpectrum::ConstIterator sit = rich_spec.begin(); sit != rich_spec.end(); ++sit) + for (const Peak1D& sit : rich_spec) { - if (sit->getIntensity() > max_int) + if (sit.getIntensity() > max_int) { - max_int = sit->getIntensity(); + max_int = sit.getIntensity(); } } if (max_int != 0) { - for (PeakSpectrum::Iterator sit = rich_spec.begin(); sit != rich_spec.end(); ++sit) + for (Peak1D& sit : rich_spec) { - sit->setIntensity(sit->getIntensity() / max_int * 10000.0); + sit.setIntensity(sit.getIntensity() / max_int * 10000.0); } } else @@ -477,9 +480,9 @@ namespace OpenMS } Size k = 0; - for (PeakSpectrum::ConstIterator sit = rich_spec.begin(); sit != rich_spec.end(); ++sit) + for (const Peak1D& sit : rich_spec) { - out << sit->getPosition()[0] << "\t" << sit->getIntensity() << "\t"; + out << sit.getPosition()[0] << "\t" << sit.getIntensity() << "\t"; if (ion_name >= 0) { out << "\"" << rich_spec.getStringDataArrays()[ion_name][k] << "\""; diff --git a/src/openms/source/FORMAT/MSPGenericFile.cpp b/src/openms/source/FORMAT/MSPGenericFile.cpp index 1ef5d6c1857..a823fa33d28 100644 --- a/src/openms/source/FORMAT/MSPGenericFile.cpp +++ b/src/openms/source/FORMAT/MSPGenericFile.cpp @@ -196,9 +196,15 @@ namespace OpenMS for (const auto& peak : spectrum) { output_file << peak.getPos() << ":" << peak.getIntensity() << " "; - if ((++peak_counter % 5) == 0) output_file << '\n'; + if ((++peak_counter % 5) == 0) + { + output_file << '\n'; + } + } + if ((peak_counter % 5) != 0) + { + output_file << '\n'; } - if ((peak_counter % 5) != 0) output_file << '\n'; // separator output_file << '\n'; } @@ -211,8 +217,10 @@ namespace OpenMS MSExperiment& library ) { - if (static_cast(spectrum.getMetaValue("is_valid")) == 0) return; - + if (static_cast(spectrum.getMetaValue("is_valid")) == 0) + { + return; + } // Check that required metadata (Name, Num Peaks) is present // Num Peaks is checked later in the code (when verifying for the number of points parsed) if (spectrum.getName().empty()) diff --git a/src/openms/source/FORMAT/MSstatsFile.cpp b/src/openms/source/FORMAT/MSstatsFile.cpp index 73c44054703..1ed621c60b0 100644 --- a/src/openms/source/FORMAT/MSstatsFile.cpp +++ b/src/openms/source/FORMAT/MSstatsFile.cpp @@ -407,8 +407,10 @@ void MSstatsFile::storeLFQ(const String& filename, String frag_charge = "0"; String accession = ListUtils::concatenate(accs,accdelim_); - if (accession.empty()) accession = na_string_; //shouldn't really matter since we skip unquantifiable peptides - + if (accession.empty()) + { + accession = na_string_; //shouldn't really matter since we skip unquantifiable peptides + } // Write new line for each run for (Size j = 0; j < aggregatedInfo.consensus_feature_filenames[i].size(); j++) { @@ -740,13 +742,19 @@ bool MSstatsFile::isQuantifyable_( const std::set& accs, const std::unordered_map& accession_to_group) const { - if (accs.empty()) return false; - - if (accs.size() == 1) return true; - + if (accs.empty()) + { + return false; + } + if (accs.size() == 1) + { + return true; + } auto git = accession_to_group.find(*accs.begin()); - if (git == accession_to_group.end()) return false; - + if (git == accession_to_group.end()) + { + return false; + } const IndProtGrp* grp = git->second; // every prot accession in the set needs to belong to the same indist. group to make this peptide @@ -759,10 +767,15 @@ bool MSstatsFile::isQuantifyable_( // we assume that it is a singleton. Cannot be quantifiable anymore. // Set makes them unique. Non-membership in groups means that there is at least one other // non-agreeing protein in the set. - if (it == accession_to_group.end()) return false; - + if (it == accession_to_group.end()) + { + return false; + } // check if two different groups - if (it->second != grp) return false; + if (it->second != grp) + { + return false; + } } return true; diff --git a/src/openms/source/FORMAT/MascotGenericFile.cpp b/src/openms/source/FORMAT/MascotGenericFile.cpp index d1ded66bc0f..d8d1093df3b 100644 --- a/src/openms/source/FORMAT/MascotGenericFile.cpp +++ b/src/openms/source/FORMAT/MascotGenericFile.cpp @@ -420,7 +420,10 @@ namespace OpenMS for (PeakSpectrum::const_iterator it = spec.begin(); it != spec.end(); ++it) { PeakSpectrum::PeakType::IntensityType intensity = it->getIntensity(); - if (intensity == 0.0) continue; // skip zero-intensity peaks + if (intensity == 0.0) + { + continue; // skip zero-intensity peaks + } os << fixed << setprecision(HIGH_PRECISION) << it->getMZ() << " " << setprecision(LOW_PRECISION) << intensity << "\n"; } diff --git a/src/openms/source/FORMAT/MascotRemoteQuery.cpp b/src/openms/source/FORMAT/MascotRemoteQuery.cpp index 60fdb40ffe5..7f8faf872d8 100644 --- a/src/openms/source/FORMAT/MascotRemoteQuery.cpp +++ b/src/openms/source/FORMAT/MascotRemoteQuery.cpp @@ -720,8 +720,9 @@ namespace OpenMS server_path_ = param_.getValue("server_path").toString(); //MascotRemoteQuery_test if (server_path_ != "") + { server_path_ = "/" + server_path_; - + } host_name_ = param_.getValue("hostname").toString(); use_ssl_ = param_.getValue("use_ssl").toBool(); @@ -800,9 +801,14 @@ namespace OpenMS QUrl MascotRemoteQuery::buildUrl_(std::string path) { String protocol; - if (use_ssl_) protocol = "https"; - else protocol = "http"; - + if (use_ssl_) + { + protocol = "https"; + } + else + { + protocol = "http"; + } return QUrl(String(protocol + "://" + host_name_ + path).c_str()); } diff --git a/src/openms/source/FORMAT/MascotXMLFile.cpp b/src/openms/source/FORMAT/MascotXMLFile.cpp index 546df339faa..21e1acefaa2 100644 --- a/src/openms/source/FORMAT/MascotXMLFile.cpp +++ b/src/openms/source/FORMAT/MascotXMLFile.cpp @@ -75,16 +75,15 @@ namespace OpenMS filtered_hits.reserve(id_data.size()); Size missing_sequence = 0; // counter - for (vector::iterator id_it = id_data.begin(); - id_it != id_data.end(); ++id_it) + for (PeptideIdentification& id_it : id_data) { - const vector& peptide_hits = id_it->getHits(); + const vector& peptide_hits = id_it.getHits(); if (!peptide_hits.empty() && (peptide_hits.size() > 1 || !peptide_hits[0].getSequence().empty())) { - filtered_hits.push_back(*id_it); + filtered_hits.push_back(id_it); } - else if (!id_it->empty()) ++missing_sequence; + else if (!id_it.empty()) ++missing_sequence; } if (missing_sequence) { @@ -95,10 +94,12 @@ namespace OpenMS // check if we have (some) RT information: Size no_rt_count = 0; - for (vector::iterator id_it = id_data.begin(); - id_it != id_data.end(); ++id_it) + for (PeptideIdentification& id_it : id_data) { - if (!id_it->hasRT()) ++no_rt_count; + if (!id_it.hasRT()) + { + ++no_rt_count; + } } if (no_rt_count) { @@ -116,10 +117,9 @@ namespace OpenMS // argh! Mascot 2.2 tends to repeat the first hit (yes it appears twice), // so we delete one of them - for (vector::iterator it = id_data.begin(); - it != id_data.end(); ++it) + for (PeptideIdentification& pip : id_data) { - vector peptide_hits = it->getHits(); + vector peptide_hits = pip.getHits(); // check if equal, except for rank if (peptide_hits.size() > 1 && peptide_hits[0].getScore() == peptide_hits[1].getScore() && @@ -128,7 +128,7 @@ namespace OpenMS { // erase first hit peptide_hits.erase(peptide_hits.begin() + 1); - it->setHits(peptide_hits); + pip.setHits(peptide_hits); } } } diff --git a/src/openms/source/FORMAT/MzMLFile.cpp b/src/openms/source/FORMAT/MzMLFile.cpp index 6caae3002cb..030d8c28087 100644 --- a/src/openms/source/FORMAT/MzMLFile.cpp +++ b/src/openms/source/FORMAT/MzMLFile.cpp @@ -211,8 +211,10 @@ namespace OpenMS void MzMLFile::transform(const String& filename_in, Interfaces::IMSDataConsumer* consumer, PeakMap& map, bool skip_full_count, bool skip_first_pass) { // First pass through the file -> get the meta-data and hand it to the consumer - if (!skip_first_pass) transformFirstPass_(filename_in, consumer, skip_full_count); - + if (!skip_first_pass) + { + transformFirstPass_(filename_in, consumer, skip_full_count); + } // Second pass through the data, now read the spectra! { PeakFileOptions tmp_options(options_); diff --git a/src/openms/source/FORMAT/MzTab.cpp b/src/openms/source/FORMAT/MzTab.cpp index dcd148c02fd..8722267178f 100644 --- a/src/openms/source/FORMAT/MzTab.cpp +++ b/src/openms/source/FORMAT/MzTab.cpp @@ -1679,16 +1679,22 @@ namespace OpenMS addMetaInfoToOptionalColumns(feature_user_value_keys, row.opt_, String("global"), f); const vector& pep_ids = f.getPeptideIdentifications(); - if (pep_ids.empty()) { return row; } + if (pep_ids.empty()) + { + return row; + } // TODO: here we assume that all have the same score type etc. vector all_hits; - for (vector::const_iterator it = pep_ids.begin(); it != pep_ids.end(); ++it) + for (const PeptideIdentification& it : pep_ids) { - all_hits.insert(all_hits.end(), it->getHits().begin(), it->getHits().end()); + all_hits.insert(all_hits.end(), it.getHits().begin(), it.getHits().end()); } - if (all_hits.empty()) { return row; } + if (all_hits.empty()) + { + return row; + } // create new peptide id object to assist in sorting PeptideIdentification new_pep_id = pep_ids[0]; @@ -2044,7 +2050,10 @@ namespace OpenMS const vector& phs = pid.getHits(); // add the row and continue to next PepID, if the current one was an empty one - if (phs.empty()) { return row; } + if (phs.empty()) + { + return row; + } /////// Information that does require a peptide hit /////// PeptideHit current_ph; @@ -2608,7 +2617,10 @@ Not sure how to handle these: return ph.getAccession() == a; } ); - if (it == proteins.end()) { continue; } + if (it == proteins.end()) + { + continue; + } Size protein_index = std::distance(proteins.begin(), it); group2prot[idx].insert(protein_index); } diff --git a/src/openms/source/FORMAT/OMSSAXMLFile.cpp b/src/openms/source/FORMAT/OMSSAXMLFile.cpp index d817d53e732..76b21c91280 100644 --- a/src/openms/source/FORMAT/OMSSAXMLFile.cpp +++ b/src/openms/source/FORMAT/OMSSAXMLFile.cpp @@ -75,18 +75,18 @@ namespace OpenMS // post-processing set accessions; - for (vector::iterator it = peptide_identifications.begin(); it != peptide_identifications.end(); ++it) + for (PeptideIdentification& pep : peptide_identifications) { - it->setScoreType("OMSSA"); - it->setHigherScoreBetter(false); - it->setIdentifier(identifier); - it->assignRanks(); + pep.setScoreType("OMSSA"); + pep.setHigherScoreBetter(false); + pep.setIdentifier(identifier); + pep.assignRanks(); if (load_proteins) { - for (vector::const_iterator pit = it->getHits().begin(); pit != it->getHits().end(); ++pit) + for (const PeptideHit& pit : pep.getHits()) { - set hit_accessions = pit->extractProteinAccessionsSet(); + set hit_accessions = pit.extractProteinAccessionsSet(); accessions.insert(hit_accessions.begin(), hit_accessions.end()); } } diff --git a/src/openms/source/FORMAT/VALIDATORS/MzDataValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/MzDataValidator.cpp index 14c656acffe..ff6ec69ec91 100644 --- a/src/openms/source/FORMAT/VALIDATORS/MzDataValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/MzDataValidator.cpp @@ -41,10 +41,9 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + MzDataValidator::MzDataValidator(const CVMappings& mapping, const ControlledVocabulary& cv) : SemanticValidator(mapping, cv) { @@ -181,5 +180,4 @@ namespace OpenMS } } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/VALIDATORS/MzIdentMLValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/MzIdentMLValidator.cpp index 79dc6c0290a..fe104c34859 100644 --- a/src/openms/source/FORMAT/VALIDATORS/MzIdentMLValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/MzIdentMLValidator.cpp @@ -39,19 +39,15 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal + MzIdentMLValidator::MzIdentMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : + SemanticValidator(mapping, cv) { - MzIdentMLValidator::MzIdentMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : - SemanticValidator(mapping, cv) - { - setCheckUnits(true); - } + setCheckUnits(true); + } - MzIdentMLValidator::~MzIdentMLValidator() - { - } - - } // namespace Internal -} // namespace OpenMS + MzIdentMLValidator::~MzIdentMLValidator() + { + } +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/VALIDATORS/MzMLValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/MzMLValidator.cpp index 4998f21e15f..0bb9570746d 100644 --- a/src/openms/source/FORMAT/VALIDATORS/MzMLValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/MzMLValidator.cpp @@ -38,10 +38,9 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + MzMLValidator::MzMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : SemanticValidator(mapping, cv), binary_data_array_(), @@ -63,7 +62,9 @@ namespace OpenMS String tag = sm_.convert(qname); String parent_tag; if (open_tags_.size() > 0) + { parent_tag = open_tags_.back(); + } String path = getPath_() + "/" + cv_tag_ + "/@" + accession_att_; open_tags_.push_back(tag); @@ -138,11 +139,13 @@ namespace OpenMS { //some CVs cannot be validated because they use 'part_of' which spoils the inheritance if (parsed_term.accession.hasPrefix("GO:")) + { return; - + } if (parsed_term.accession.hasPrefix("BTO:")) + { return; - + } //check binary data array terms if (path.hasSuffix("/binaryDataArray/cvParam/@accession")) { @@ -169,5 +172,4 @@ namespace OpenMS SemanticValidator::handleTerm_(path, parsed_term); } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/VALIDATORS/MzQuantMLValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/MzQuantMLValidator.cpp index a5984dee71a..af9cb0c66bb 100644 --- a/src/openms/source/FORMAT/VALIDATORS/MzQuantMLValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/MzQuantMLValidator.cpp @@ -37,19 +37,17 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal + + MzQuantMLValidator::MzQuantMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : + SemanticValidator(mapping, cv) { - MzQuantMLValidator::MzQuantMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : - SemanticValidator(mapping, cv) - { - setCheckUnits(true); - } + setCheckUnits(true); + } - MzQuantMLValidator::~MzQuantMLValidator() - { - } + MzQuantMLValidator::~MzQuantMLValidator() + { + } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/VALIDATORS/SemanticValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/SemanticValidator.cpp index d069c10adf9..430e86b1c2a 100644 --- a/src/openms/source/FORMAT/VALIDATORS/SemanticValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/SemanticValidator.cpp @@ -43,10 +43,9 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal - { + SemanticValidator::SemanticValidator(const CVMappings& mapping, const ControlledVocabulary& cv) : XMLHandler("", 0), XMLFile(), @@ -586,5 +585,5 @@ namespace OpenMS } return false; } - } // namespace Internal -} // namespace OpenMS + +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/FORMAT/VALIDATORS/TraMLValidator.cpp b/src/openms/source/FORMAT/VALIDATORS/TraMLValidator.cpp index 1ccf3b29a5a..92180e692fc 100644 --- a/src/openms/source/FORMAT/VALIDATORS/TraMLValidator.cpp +++ b/src/openms/source/FORMAT/VALIDATORS/TraMLValidator.cpp @@ -37,19 +37,17 @@ using namespace xercesc; using namespace std; -namespace OpenMS +namespace OpenMS::Internal { - namespace Internal + + TraMLValidator::TraMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : + SemanticValidator(mapping, cv) { - TraMLValidator::TraMLValidator(const CVMappings & mapping, const ControlledVocabulary & cv) : - SemanticValidator(mapping, cv) - { - setCheckUnits(true); - } + setCheckUnits(true); + } - TraMLValidator::~TraMLValidator() - { - } + TraMLValidator::~TraMLValidator() + { + } - } // namespace Internal -} // namespace OpenMS +} // namespace OpenMS // namespace Internal diff --git a/src/openms/source/MATH/MISC/BSpline2d.cpp b/src/openms/source/MATH/MISC/BSpline2d.cpp index 5f0877b0201..23a93ea9e57 100644 --- a/src/openms/source/MATH/MISC/BSpline2d.cpp +++ b/src/openms/source/MATH/MISC/BSpline2d.cpp @@ -72,12 +72,6 @@ namespace OpenMS return spline_->slope(x); } - double BSpline2d::derivatives(const double x, unsigned /* order */) const - { - // OPENMS_PRECONDITION(order == 1, "Spline was not initialized properly.") - return derivative(x); - } - bool BSpline2d::ok() const { return spline_->ok(); diff --git a/src/openms/source/MATH/MISC/CubicSpline2d.cpp b/src/openms/source/MATH/MISC/CubicSpline2d.cpp index aaa1b5801e1..bec61afe734 100644 --- a/src/openms/source/MATH/MISC/CubicSpline2d.cpp +++ b/src/openms/source/MATH/MISC/CubicSpline2d.cpp @@ -105,6 +105,11 @@ namespace OpenMS return ((d_[i] * xx + c_[i]) * xx + b_[i]) * xx + a_[i]; } + double CubicSpline2d::derivative(const double x) const + { + return derivatives(x, 1); + } + double CubicSpline2d::derivatives(double x, unsigned order) const { if (x < x_.front() || x > x_.back()) diff --git a/src/openswathalgo/include/OpenMS/OPENSWATHALGO/ALGO/MRMScoring.h b/src/openswathalgo/include/OpenMS/OPENSWATHALGO/ALGO/MRMScoring.h index 0203374af67..23f941af2e5 100644 --- a/src/openswathalgo/include/OpenMS/OPENSWATHALGO/ALGO/MRMScoring.h +++ b/src/openswathalgo/include/OpenMS/OPENSWATHALGO/ALGO/MRMScoring.h @@ -133,14 +133,14 @@ namespace OpenSwath /// Initialize the scoring object and building the cross-correlation matrix of chromatograms of precursor isotopes and transitions void initializeXCorrPrecursorCombinedMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector& precursor_ids, const std::vector& native_ids); - /* + /** @brief Calculate the cross-correlation coelution score The score is a distance where zero indicates perfect coelution. */ double calcXcorrCoelutionScore(); - /* + /** @brief Calculate the weighted cross-correlation coelution score The score is a distance where zero indicates perfect coelution. The @@ -158,7 +158,7 @@ namespace OpenSwath /// calculate the precursor cross-correlation contrast score double calcXcorrPrecursorCoelutionScore(); - /* + /** @brief Calculate the precursor cross-correlation contrast score against the transitions The score is a distance where zero indicates perfect coelution. @@ -168,7 +168,7 @@ namespace OpenSwath /// calculate the precursor cross-correlation coelution score including the transitions double calcXcorrPrecursorCombinedCoelutionScore(); - /* + /** @brief Calculate the cross-correlation shape score The score is a correlation measure where 1 indicates perfect correlation @@ -176,7 +176,7 @@ namespace OpenSwath */ double calcXcorrShapeScore(); - /* + /** @brief Calculate the weighted cross-correlation shape score The score is a correlation measure where 1 indicates perfect correlation diff --git a/src/pyOpenMS/pxds/BSpline2d.pxd b/src/pyOpenMS/pxds/BSpline2d.pxd index 9f7191f0124..de4e7b5770a 100644 --- a/src/pyOpenMS/pxds/BSpline2d.pxd +++ b/src/pyOpenMS/pxds/BSpline2d.pxd @@ -8,17 +8,15 @@ cdef extern from "" namespace "OpenMS": double wave_length, BoundaryCondition boundary_condition, Size num_nodes) nogil except + - bool solve(libcpp_vector[double] y) nogil except + + bool solve(libcpp_vector[double] y) nogil except + # wrap-doc:Solve the spline curve for a new set of y values. Returns false if the solution fails. - double eval(double x) nogil except + + double eval(double x) nogil except + # wrap-doc:Return the evaluation of the smoothed curve at a particular x value. If current state is not ok(), returns zero. - double derivative(double x) nogil except + + double derivative(double x) nogil except + # wrap-doc:Return the first derivative of the spline curve at the given position x. Returns zero if the current state is not ok(). - bool ok() nogil except + + bool ok() nogil except + # wrap-doc:Return whether the spline fit was successful. - void debug(bool enable) nogil except + - - double derivatives(double x, unsigned order) nogil except + + void debug(bool enable) nogil except + # wrap-doc:Enable or disable debug messages from the B-spline library. cdef extern from "" namespace "OpenMS::BSpline2d": diff --git a/src/pyOpenMS/pxds/Base64.pxd b/src/pyOpenMS/pxds/Base64.pxd index 7764ed8b911..f93a245486f 100644 --- a/src/pyOpenMS/pxds/Base64.pxd +++ b/src/pyOpenMS/pxds/Base64.pxd @@ -6,7 +6,8 @@ from String cimport * cdef extern from "" namespace "OpenMS": cdef cppclass Base64 "OpenMS::Base64": - Base64() nogil except + + + Base64() nogil except + # wrap-doc:Class to encode and decode Base64, it supports two precisions 32 bit (float) and 64 bit (double). Base64(Base64 &) nogil except + # compiler void encode(libcpp_vector[ double ] & in_, ByteOrder to_byte_order, String &out, bool zlib_compression) nogil except +#wrap-ignore @@ -19,11 +20,11 @@ cdef extern from "" namespace "OpenMS": void encode32(libcpp_vector[ float ] & in_, ByteOrder to_byte_order, String &out, bool zlib_compression) nogil except + #wrap-ignore void decode32(const String & in_, ByteOrder from_byte_order, libcpp_vector[ float ] &out, bool zlib_compression) nogil except + #wrap-ignore - void encodeIntegers(libcpp_vector[ int ] & in_, ByteOrder to_byte_order, String &out, bool zlib_compression) nogil except + - void decodeIntegers(const String & in_, ByteOrder from_byte_order, libcpp_vector[ int ] &out, bool zlib_compression) nogil except + + void encodeIntegers(libcpp_vector[ int ] & in_, ByteOrder to_byte_order, String &out, bool zlib_compression) nogil except + # wrap-doc:Encodes a vector of integer point numbers to a Base64 string + void decodeIntegers(const String & in_, ByteOrder from_byte_order, libcpp_vector[ int ] &out, bool zlib_compression) nogil except + # wrap-doc:Decodes a Base64 string to a vector of integer numbers - void encodeStrings(libcpp_vector[ String ] & in_, String &out, bool zlib_compression) nogil except + - void decodeStrings(const String & in_, libcpp_vector[ String ] &out, bool zlib_compression) nogil except + + void encodeStrings(libcpp_vector[ String ] & in_, String &out, bool zlib_compression) nogil except + # wrap-doc:Encodes a vector of strings to a Base64 string + void decodeStrings(const String & in_, libcpp_vector[ String ] &out, bool zlib_compression) nogil except + # wrap-doc:Decodes a Base64 string to a vector of (null-terminated) strings # void decodeSingleString(const String & in, QByteArray & base64_uncompressed, bool zlib_compression); diff --git a/src/pyOpenMS/pxds/BaseFeature.pxd b/src/pyOpenMS/pxds/BaseFeature.pxd index 81360a0c751..b0789336c00 100644 --- a/src/pyOpenMS/pxds/BaseFeature.pxd +++ b/src/pyOpenMS/pxds/BaseFeature.pxd @@ -16,15 +16,15 @@ cdef extern from "" namespace "OpenMS": BaseFeature() nogil except + BaseFeature(BaseFeature &) nogil except + - float getQuality() nogil except + - void setQuality(float q) nogil except + + float getQuality() nogil except + # wrap-doc:Non-mutable access to the overall quality + void setQuality(float q) nogil except + # wrap-doc:Set the overall quality - float getWidth() nogil except + - void setWidth(float q) nogil except + + float getWidth() nogil except + # wrap-doc:Non-mutable access to the features width (full width at half max, FWHM) + void setWidth(float q) nogil except + # wrap-doc:Set the width of the feature (FWHM) - Int getCharge() nogil except + - void setCharge(Int q) nogil except + - AnnotationState getAnnotationState() nogil except + + Int getCharge() nogil except + # wrap-doc:Non-mutable access to charge state + void setCharge(Int q) nogil except + # wrap-doc:Set charge state + AnnotationState getAnnotationState() nogil except + # wrap-doc:State of peptide identifications attached to this feature. If one ID has multiple hits, the output depends on the top-hit only # returns a mutable reference to the PeptideIdentification vector libcpp_vector[PeptideIdentification] getPeptideIdentifications() nogil except + diff --git a/src/pyOpenMS/pxds/BaseGroupFinder.pxd b/src/pyOpenMS/pxds/BaseGroupFinder.pxd index ec0b9c1ad2d..a48c834b3d0 100644 --- a/src/pyOpenMS/pxds/BaseGroupFinder.pxd +++ b/src/pyOpenMS/pxds/BaseGroupFinder.pxd @@ -16,5 +16,5 @@ cdef extern from "" namespace "Op BaseGroupFinder() nogil except + BaseGroupFinder(BaseGroupFinder &) nogil except + # compiler # void run(libcpp_vector[ ConsensusMap ] & input_, ConsensusMap & result) nogil except + - void registerChildren() nogil except + + void registerChildren() nogil except + # wrap-doc:Register all derived classes here diff --git a/src/pyOpenMS/pxds/BiGaussFitter1D.pxd b/src/pyOpenMS/pxds/BiGaussFitter1D.pxd index 29eae4654be..d2e1baee461 100644 --- a/src/pyOpenMS/pxds/BiGaussFitter1D.pxd +++ b/src/pyOpenMS/pxds/BiGaussFitter1D.pxd @@ -9,5 +9,5 @@ cdef extern from "" name BiGaussFitter1D(BiGaussFitter1D &) nogil except + # QualityType fit1d(RawDataArrayType &range, InterpolationModel *&model) nogil except + # Fitter1D * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # wrap-doc:Name of the model (needed by Factory) diff --git a/src/pyOpenMS/pxds/BiGaussModel.pxd b/src/pyOpenMS/pxds/BiGaussModel.pxd index c6e19321f1f..5c9b98b1b7e 100644 --- a/src/pyOpenMS/pxds/BiGaussModel.pxd +++ b/src/pyOpenMS/pxds/BiGaussModel.pxd @@ -11,5 +11,5 @@ cdef extern from "" namespa void setSamples() nogil except + double getCenter() nogil except + # BaseModel[ 1 ] * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # wrap-doc:Name of the model (needed by Factory) diff --git a/src/pyOpenMS/pxds/BilinearInterpolation.pxd b/src/pyOpenMS/pxds/BilinearInterpolation.pxd index 671838a04bd..ca2dc5c61f6 100644 --- a/src/pyOpenMS/pxds/BilinearInterpolation.pxd +++ b/src/pyOpenMS/pxds/BilinearInterpolation.pxd @@ -12,26 +12,26 @@ cdef extern from "" namespace "OpenMS: BilinearInterpolation() nogil except + BilinearInterpolation(BilinearInterpolation &) nogil except + ValueType value(KeyType arg_pos_0, KeyType arg_pos_1) nogil except + - void addValue(KeyType arg_pos_0, KeyType arg_pos_1, ValueType arg_value) nogil except + + void addValue(KeyType arg_pos_0, KeyType arg_pos_1, ValueType arg_value) nogil except + # wrap-doc:Performs bilinear resampling. The arg_value is split up and added to the data points around arg_pos. ("forward resampling") Matrix[ValueType] getData() nogil except + - void setData(Matrix[ValueType] & data) nogil except + + void setData(Matrix[ValueType] & data) nogil except + # wrap-doc:Assigns data to the internal random access container storing the data. SourceContainer must be assignable to ContainerType. bool empty() nogil except + - KeyType key2index_0(KeyType pos) nogil except + - KeyType index2key_0(KeyType pos) nogil except + - KeyType key2index_1(KeyType pos) nogil except + - KeyType index2key_1(KeyType pos) nogil except + + KeyType key2index_0(KeyType pos) nogil except + # wrap-doc:The transformation from "outside" to "inside" coordinates. + KeyType index2key_0(KeyType pos) nogil except + # wrap-doc:The transformation from "inside" to "outside" coordinates. + KeyType key2index_1(KeyType pos) nogil except + # wrap-doc:The transformation from "outside" to "inside" coordinates. + KeyType index2key_1(KeyType pos) nogil except + # wrap-doc:The transformation from "inside" to "outside" coordinates. KeyType getScale_0() nogil except + void setScale_0(KeyType & scale) nogil except + KeyType getScale_1() nogil except + void setScale_1(KeyType & scale) nogil except + - KeyType getOffset_0() nogil except + - void setOffset_0(KeyType & offset) nogil except + - KeyType getOffset_1() nogil except + + KeyType getOffset_0() nogil except + # wrap-doc:Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". + void setOffset_0(KeyType & offset) nogil except + + KeyType getOffset_1() nogil except + # wrap-doc:Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". void setOffset_1(KeyType & offset) nogil except + void setMapping_0(KeyType & scale, KeyType & inside, KeyType & outside) nogil except + @@ -45,11 +45,11 @@ cdef extern from "" namespace "OpenMS: KeyType getOutsideReferencePoint_0() nogil except + KeyType getOutsideReferencePoint_1() nogil except + - KeyType supportMin_0() nogil except + - KeyType supportMin_1() nogil except + + KeyType supportMin_0() nogil except + # wrap-doc:Lower boundary of the support, in "outside" coordinates. + KeyType supportMin_1() nogil except + # wrap-doc:Lower boundary of the support, in "outside" coordinates. - KeyType supportMax_0() nogil except + - KeyType supportMax_1() nogil except + + KeyType supportMax_0() nogil except + # wrap-doc:Upper boundary of the support, in "outside" coordinates. + KeyType supportMax_1() nogil except + # wrap-doc:Upper boundary of the support, in "outside" coordinates. # BilinearInterpolation(KeyType scale, KeyType offset) nogil except + diff --git a/src/pyOpenMS/pxds/BinnedSpectrum.pxd b/src/pyOpenMS/pxds/BinnedSpectrum.pxd index 3c0a0189dc6..b81f1c77fe3 100644 --- a/src/pyOpenMS/pxds/BinnedSpectrum.pxd +++ b/src/pyOpenMS/pxds/BinnedSpectrum.pxd @@ -13,14 +13,14 @@ cdef extern from "" namespace "OpenM bool operator==(BinnedSpectrum & rhs) nogil except + bool operator!=(BinnedSpectrum & rhs) nogil except + - float getBinSize() nogil except + - UInt getBinSpread() nogil except + - UInt getBinIndex(float mz) nogil except + - float getBinLowerMZ(size_t i) nogil except + - float getBinIntensity(double mz) nogil except + + float getBinSize() nogil except + # wrap-doc:Get the bin size + UInt getBinSpread() nogil except + # wrap-doc:Get the bin spread + UInt getBinIndex(float mz) nogil except + # wrap-doc:Return the bin index of a given m/z position + float getBinLowerMZ(size_t i) nogil except + # wrap-doc:Return the lower m/z of a bin given its index + float getBinIntensity(double mz) nogil except + # wrap-doc:Returns the bin intensity at a given m/z position libcpp_vector[Precursor] getPrecursors() nogil except + bool isCompatible(BinnedSpectrum & a, BinnedSpectrum & b) nogil except + - float getOffset() nogil except + + float getOffset() nogil except + # wrap-doc:Return offset diff --git a/src/pyOpenMS/pxds/CVMappingFile.pxd b/src/pyOpenMS/pxds/CVMappingFile.pxd index 3d8e93efcc1..be98af4ef09 100644 --- a/src/pyOpenMS/pxds/CVMappingFile.pxd +++ b/src/pyOpenMS/pxds/CVMappingFile.pxd @@ -10,5 +10,5 @@ cdef extern from "" namespace "OpenMS": CVMappingFile() nogil except + # private CVMappingFile(CVMappingFile) nogil except + # wrap-ignore - void load(const String & filename, CVMappings & cv_mappings, bool strip_namespaces) nogil except + + void load(const String & filename, CVMappings & cv_mappings, bool strip_namespaces) nogil except + # wrap-doc:Loads CvMappings from the given file diff --git a/src/pyOpenMS/pxds/CVMappingRule.pxd b/src/pyOpenMS/pxds/CVMappingRule.pxd index 97e8f06fba8..6284865fd14 100644 --- a/src/pyOpenMS/pxds/CVMappingRule.pxd +++ b/src/pyOpenMS/pxds/CVMappingRule.pxd @@ -17,10 +17,11 @@ cdef extern from "" namespace "OpenMS": String getIdentifier() nogil except + # wrap-doc:Returns the identifier of the rule # sets the path of the element, where this rule is allowed - void setElementPath(String element_path) nogil except + # wrap-doc:Sets the path of the element, where this rule is allowed + void setElementPath(String element_path) nogil except + # wrap-doc:Sets the path of the DOM element, where this rule is allowed # returns the path of the element, where this rule is allowed - String getElementPath() nogil except + # wrap-doc:Returns the path of the element, where this rule is allowed + String getElementPath() nogil except + # wrap-doc:Returns the path of the DOM element, where this rule is allowed + # sets the requirement level of this rule void setRequirementLevel(RequirementLevel level) nogil except + # wrap-doc:Sets the requirement level of this rule diff --git a/src/pyOpenMS/pxds/CVMappingTerm.pxd b/src/pyOpenMS/pxds/CVMappingTerm.pxd index f5d576de8a7..05eba60c984 100644 --- a/src/pyOpenMS/pxds/CVMappingTerm.pxd +++ b/src/pyOpenMS/pxds/CVMappingTerm.pxd @@ -48,11 +48,11 @@ cdef extern from "" namespace "OpenMS": void setCVIdentifierRef(String cv_identifier_ref) nogil except + # wrap-doc:Sets the CV identifier reference string, e.g. UO for unit obo # returns the cv identifier reference string - String getCVIdentifierRef() nogil except + # wrap-doc:Returns the CV identifier reference string + String getCVIdentifierRef() nogil except + # wrap-doc:Returns the CV identifier reference string. + # equality operator bool operator==(CVMappingTerm rhs) nogil except + # inequality operator bool operator!=(CVMappingTerm rhs) nogil except + - diff --git a/src/pyOpenMS/pxds/CVTerm.pxd b/src/pyOpenMS/pxds/CVTerm.pxd index cabb8ff0b41..c12c27e8982 100644 --- a/src/pyOpenMS/pxds/CVTerm.pxd +++ b/src/pyOpenMS/pxds/CVTerm.pxd @@ -11,22 +11,22 @@ cdef extern from "" namespace "OpenMS": bool operator==(CVTerm) nogil except + - void setAccession(String accession) nogil except + - String getAccession() nogil except + + void setAccession(String accession) nogil except + # wrap-doc:Sets the accession string of the term + String getAccession() nogil except + # wrap-doc:Returns the accession string of the term - void setName(String name) nogil except + - String getName() nogil except + + void setName(String name) nogil except + # wrap-doc:Sets the name of the term + String getName() nogil except + # wrap-doc:Returns the name of the term - void setCVIdentifierRef(String cv_id_ref) nogil except + - String getCVIdentifierRef() nogil except + + void setCVIdentifierRef(String cv_id_ref) nogil except + # wrap-doc:Sets the CV identifier reference string, e.g. UO for unit obo + String getCVIdentifierRef() nogil except + # wrap-doc:Returns the CV identifier reference string - DataValue getValue() nogil except + - void setValue(DataValue value) nogil except + + DataValue getValue() nogil except + # wrap-doc:Returns the value of the term + void setValue(DataValue value) nogil except + # wrap-doc:Set the value of the term - void setUnit(Unit & unit) nogil except + - Unit getUnit() nogil except + - bool hasValue() nogil except + - bool hasUnit() nogil except + + void setUnit(Unit & unit) nogil except + # wrap-doc:Sets the unit of the term + Unit getUnit() nogil except + # wrap-doc:Returns the unit + bool hasValue() nogil except + # wrap-doc:Checks whether the term has a value + bool hasUnit() nogil except + # wrap-doc:Checks whether the term has a unit cdef extern from "" namespace "OpenMS::CVTerm": diff --git a/src/pyOpenMS/pxds/CVTermList.pxd b/src/pyOpenMS/pxds/CVTermList.pxd index 41d898a2677..7f621ec5514 100644 --- a/src/pyOpenMS/pxds/CVTermList.pxd +++ b/src/pyOpenMS/pxds/CVTermList.pxd @@ -20,17 +20,17 @@ cdef extern from "" namespace "OpenMS": CVTermList() nogil except + CVTermList(CVTermList &) nogil except + - void setCVTerms(libcpp_vector[CVTerm] & terms) nogil except + - void replaceCVTerm(CVTerm & term) nogil except + + void setCVTerms(libcpp_vector[CVTerm] & terms) nogil except + # wrap-doc:Sets the CV terms + void replaceCVTerm(CVTerm & term) nogil except + # wrap-doc:Replaces the specified CV term # will not wrap due to Cython inheritance issue void replaceCVTerms(libcpp_vector[CVTerm] cv_terms, String accession) nogil except + # void replaceCVTerms(Map[String, libcpp_vector[CVTerm] ] cv_term_map) nogil except + - void consumeCVTerms(Map[String, libcpp_vector[CVTerm] ] cv_term_map) nogil except + + void consumeCVTerms(Map[String, libcpp_vector[CVTerm] ] cv_term_map) nogil except + # wrap-doc:Merges the given map into the member map, no duplicate checking - Map[String, libcpp_vector[CVTerm] ] getCVTerms() nogil except + - void addCVTerm(CVTerm & term) nogil except + + Map[String, libcpp_vector[CVTerm] ] getCVTerms() nogil except + # wrap-doc:Returns the accession string of the term + void addCVTerm(CVTerm & term) nogil except + # wrap-doc:Adds a CV term bool operator==(CVTermList) nogil except + bool operator!=(CVTermList) nogil except + diff --git a/src/pyOpenMS/pxds/CVTermListInterface.pxd b/src/pyOpenMS/pxds/CVTermListInterface.pxd index 7a20a47636a..aed2f9ab91e 100644 --- a/src/pyOpenMS/pxds/CVTermListInterface.pxd +++ b/src/pyOpenMS/pxds/CVTermListInterface.pxd @@ -27,11 +27,11 @@ cdef extern from "" namespace "OpenMS": void replaceCVTerms(libcpp_vector[ CVTerm ] & cv_terms, const String & accession) nogil except + # void replaceCVTerms(Map[ String, libcpp_vector[ CVTerm ] ] & cv_term_map) nogil except + - void consumeCVTerms(Map[ String, libcpp_vector[ CVTerm ] ] & cv_term_map) nogil except + + void consumeCVTerms(Map[ String, libcpp_vector[ CVTerm ] ] & cv_term_map) nogil except + # wrap-doc:Merges the given map into the member map, no duplicate checking Map[ String, libcpp_vector[ CVTerm ] ] getCVTerms() nogil except + - void addCVTerm(CVTerm & term) nogil except + - bool hasCVTerm(const String & accession) nogil except + + void addCVTerm(CVTerm & term) nogil except + # wrap-doc:Adds a CV term + bool hasCVTerm(const String & accession) nogil except + # wrap-doc:Checks whether the term has a value bool empty() nogil except + diff --git a/src/pyOpenMS/pxds/CachedmzML.pxd b/src/pyOpenMS/pxds/CachedmzML.pxd index 882525bf0f2..c55ace6c5cf 100644 --- a/src/pyOpenMS/pxds/CachedmzML.pxd +++ b/src/pyOpenMS/pxds/CachedmzML.pxd @@ -10,8 +10,9 @@ cdef extern from "" namespace "OpenMS": cdef cppclass CachedmzML: - CachedmzML() nogil except + + CachedmzML() nogil except + # wrap-doc:A class that uses on-disk caching to read and write spectra and chromatograms CachedmzML(CachedmzML &) nogil except + + CachedmzML(String filename) nogil except + Size getNrSpectra() nogil except + @@ -29,4 +30,3 @@ cdef extern from "" namespace "OpenMS::CachedmzML": void store(const String& filename, MSExperiment exp) nogil except + # wrap-attach:CachedmzML void load(const String& filename, CachedmzML& exp) nogil except + # wrap-attach:CachedmzML - diff --git a/src/pyOpenMS/pxds/CachedmzMLHandler.pxd b/src/pyOpenMS/pxds/CachedmzMLHandler.pxd index a692007ff3d..f706adb8427 100644 --- a/src/pyOpenMS/pxds/CachedmzMLHandler.pxd +++ b/src/pyOpenMS/pxds/CachedmzMLHandler.pxd @@ -14,19 +14,19 @@ cdef extern from "" namespace "OpenM # wrap-inherits: # ProgressLogger - CachedMzMLHandler() nogil except + + CachedMzMLHandler() nogil except + # wrap-doc:An internal class that handles single spectra and chromatograms CachedMzMLHandler(CachedMzMLHandler &) nogil except + # compiler - void writeMemdump(MSExperiment exp, String out) nogil except + - void writeMetadata(MSExperiment exp, String out_meta) nogil except + - void readMemdump(MSExperiment exp, String filename) nogil except + + void writeMemdump(MSExperiment exp, String out) nogil except + # wrap-doc:Write complete spectra as a dump to the disk + void writeMetadata(MSExperiment exp, String out_meta) nogil except + # wrap-doc:Write only the meta data of an MSExperiment + + void readMemdump(MSExperiment exp, String filename) nogil except + # wrap-doc:Read all spectra from a dump from the disk # void readSingleSpectrum(MSSpectrum & spectrum, String & filename, Size & idx) nogil except + libcpp_vector[ streampos ] getSpectraIndex() nogil except + libcpp_vector[ streampos ] getChromatogramIndex() nogil except + - void createMemdumpIndex(String filename) nogil except + + void createMemdumpIndex(String filename) nogil except + # wrap-doc:Create an index on the location of all the spectra and chromatograms # NAMESPACE # void readSingleSpectrum(MSSpectrum & spectrum, std::ifstream & ifs, Size & idx) # NAMESPACE # void readSpectrumFast(OpenSwath::BinaryDataArrayPtr data1, OpenSwath::BinaryDataArrayPtr data2, std::ifstream & ifs, int ms_level, double rt) # NAMESPACE # void readChromatogramFast(OpenSwath::BinaryDataArrayPtr data1, OpenSwath::BinaryDataArrayPtr data2, std::ifstream & ifs) - diff --git a/src/pyOpenMS/pxds/CalibrationData.pxd b/src/pyOpenMS/pxds/CalibrationData.pxd index 90f40b04b63..ceb907d8042 100644 --- a/src/pyOpenMS/pxds/CalibrationData.pxd +++ b/src/pyOpenMS/pxds/CalibrationData.pxd @@ -8,26 +8,27 @@ cdef extern from "" namespace "OpenMS": cdef cppclass CalibrationData: CalibrationData() nogil except + + CalibrationData(CalibrationData &) nogil except + # compiler - double getMZ(Size) nogil except + - double getRT(Size) nogil except + - double getIntensity(Size) nogil except + - Size size() nogil except + - bool empty() nogil except + - void clear() nogil except + + double getMZ(Size) nogil except + # wrap-doc:Retrieve the observed m/z of the i'th calibration point + double getRT(Size) nogil except + # wrap-doc:Retrieve the observed RT of the i'th calibration point + double getIntensity(Size) nogil except + # wrap-doc:Retrieve the intensity of the i'th calibration point + Size size() nogil except + # wrap-doc:Number of calibration points + bool empty() nogil except + # wrap-doc:Returns `True` if there are no peaks. + void clear() nogil except + # wrap-doc:Remove all calibration points + void setUsePPM(bool) nogil except + - bool usePPM() nogil except + + bool usePPM() nogil except + # wrap-doc:Current error unit (ppm or Th) void insertCalibrationPoint(double rt, double mz_obs, float intensity, double mz_ref, double weight, int group) nogil except + - Size getNrOfGroups() nogil except + - double getError(Size) nogil except + - double getRefMZ(Size) nogil except + - double getWeight(Size) nogil except + - int getGroup(Size i) nogil except + - CalibrationData median(double, double) nogil except + - void sortByRT() nogil except + + Size getNrOfGroups() nogil except + # wrap-doc:Number of peak groups (can be 0). + double getError(Size) nogil except + # wrap-doc:Retrieve the error for i'th calibrant in either ppm or Th (depending on usePPM()) + double getRefMZ(Size) nogil except + # wrap-doc:Retrieve the theoretical m/z of the i'th calibration point + double getWeight(Size) nogil except + # wrap-doc:Retrieve the weight of the i'th calibration point + int getGroup(Size i) nogil except + # wrap-doc:Retrieve the group of the i'th calibration point. + CalibrationData median(double, double) nogil except + # wrap-doc:Compute the median in the given RT range for every peak group + void sortByRT() nogil except + # wrap-doc:Sort calibration points by RT, to allow for valid RT chunking cdef extern from "" namespace "OpenMS::CalibrationData": # static members StringList getMetaValues() nogil except + # wrap-attach:CalibrationData - diff --git a/src/pyOpenMS/pxds/ChargePair.pxd b/src/pyOpenMS/pxds/ChargePair.pxd index 9d6ba23fde9..ff17b7be51b 100644 --- a/src/pyOpenMS/pxds/ChargePair.pxd +++ b/src/pyOpenMS/pxds/ChargePair.pxd @@ -18,21 +18,21 @@ cdef extern from "" namespace "OpenMS": double mass_diff, bool active) nogil except + - Int getCharge(UInt pairID) nogil except + - void setCharge(UInt pairID, Int e) nogil except + + Int getCharge(UInt pairID) nogil except + # wrap-doc:Returns the charge (for element 0 or 1) + void setCharge(UInt pairID, Int e) nogil except + # wrap-doc:Set the charge (for element 0 or 1) - Size getElementIndex(UInt pairID) nogil except + - void setElementIndex(UInt pairID, Size e) nogil except + + Size getElementIndex(UInt pairID) nogil except + # wrap-doc:Returns the element index (for element 0 or 1) + void setElementIndex(UInt pairID, Size e) nogil except + # wrap-doc:Set the element index (for element 0 or 1) - Compomer getCompomer() nogil except + - void setCompomer( Compomer & compomer) nogil except + + Compomer getCompomer() nogil except + # wrap-doc:Returns the Id of the compomer that explains the mass difference + void setCompomer( Compomer & compomer) nogil except + # wrap-doc:Set the compomer id - double getMassDiff() nogil except + - void setMassDiff(double mass_diff) nogil except + + double getMassDiff() nogil except + # wrap-doc:Returns the mass difference + void setMassDiff(double mass_diff) nogil except + # wrap-doc:Sets the mass difference - double getEdgeScore() nogil except + - void setEdgeScore(double score) nogil except + + double getEdgeScore() nogil except + # wrap-doc:Returns the ILP edge score + void setEdgeScore(double score) nogil except + # wrap-doc:Sets the ILP edge score - bool isActive() nogil except + + bool isActive() nogil except + # wrap-doc:Is this pair realized? void setActive( bool active) nogil except + diff --git a/src/pyOpenMS/pxds/ChromatogramExtractor.pxd b/src/pyOpenMS/pxds/ChromatogramExtractor.pxd index 83b1c9b0783..a3980b07bf2 100644 --- a/src/pyOpenMS/pxds/ChromatogramExtractor.pxd +++ b/src/pyOpenMS/pxds/ChromatogramExtractor.pxd @@ -22,7 +22,7 @@ cdef extern from "" namespace bool ppm, TransformationDescription trafo, double rt_extraction_window, - String filter) nogil except + + String filter) nogil except + # wrap-doc:Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates. # TODO immutable types by reference # void extract_value_tophat(MSSpectrum input, double mz, diff --git a/src/pyOpenMS/pxds/ChromatogramExtractorAlgorithm.pxd b/src/pyOpenMS/pxds/ChromatogramExtractorAlgorithm.pxd index 5d4eb0b87e7..30e5258c6ae 100644 --- a/src/pyOpenMS/pxds/ChromatogramExtractorAlgorithm.pxd +++ b/src/pyOpenMS/pxds/ChromatogramExtractorAlgorithm.pxd @@ -28,34 +28,19 @@ cdef extern from "" bool ppm, double im_extraction_window, String filter) nogil except + - - void extractChromatograms( - shared_ptr[ SpectrumAccessOpenMSCached ] input, - libcpp_vector[ shared_ptr[OSChromatogram] ] & output, - libcpp_vector[ ExtractionCoordinates ] extraction_coordinates, - double mz_extraction_window, - bool ppm, - double im_extraction_window, - String filter) nogil except + - - void extractChromatograms( - shared_ptr[ SpectrumAccessOpenMSInMemory ] input, - libcpp_vector[ shared_ptr[OSChromatogram] ] & output, - libcpp_vector[ ExtractionCoordinates ] extraction_coordinates, - double mz_extraction_window, - bool ppm, - double im_extraction_window, - String filter) nogil except + - - void extractChromatograms( - shared_ptr[ SpectrumAccessQuadMZTransforming ] input, - libcpp_vector[ shared_ptr[OSChromatogram] ] & output, - libcpp_vector[ ExtractionCoordinates ] extraction_coordinates, - double mz_extraction_window, - bool ppm, - double im_extraction_window, - String filter) nogil except + - + # wrap-doc: + # Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates + # ----- + # :param: input Input spectral map + # :param output: Output chromatograms (XICs) + # :param extraction_coordinates: Extracts around these coordinates (from + # rt_start to rt_end in seconds - extracts the whole chromatogram if + # rt_end - rt_start < 0). + # :param mz_extraction_window: Extracts a window of this size in m/z + # dimension in Th or ppm (e.g. a window of 50 ppm means an extraction of + # 25 ppm on either side) + # :param ppm: Whether mz_extraction_window is in ppm or in Th + # :param filter: Which function to apply in m/z space (currently "tophat" only) # void extract_value_tophat # -> uses iterators @@ -72,4 +57,3 @@ cdef extern from "" double rt_end # rt end of extraction (in seconds) double ion_mobility # ion mobility value around which should be extracted libcpp_string id # identifier - diff --git a/src/pyOpenMS/pxds/ChromatogramPeak.pxd b/src/pyOpenMS/pxds/ChromatogramPeak.pxd index a049b84c0ef..4933fe28a53 100644 --- a/src/pyOpenMS/pxds/ChromatogramPeak.pxd +++ b/src/pyOpenMS/pxds/ChromatogramPeak.pxd @@ -12,7 +12,7 @@ cdef extern from "" namespace "OpenMS": cdef cppclass ChromatogramPeak: - ChromatogramPeak() nogil except + + ChromatogramPeak() nogil except + # wrap-doc:A 1-dimensional raw data point or peak for chromatograms ChromatogramPeak(ChromatogramPeak &) nogil except + ChromatogramPeak(PositionType retention_time, IntensityType intensity) nogil except + bool operator==(ChromatogramPeak) nogil except + @@ -21,19 +21,20 @@ cdef extern from "" namespace "OpenMS": # We will not catch C++ exceptions for get/set methods for performance # reasons (no memory allocation is involved). - IntensityType getIntensity() nogil - void setIntensity(IntensityType) nogil + IntensityType getIntensity() nogil except + # wrap-doc:Return the data point intensity + void setIntensity(IntensityType) nogil except + # wrap-doc:Set the data point intensity - DPosition1 getPosition() nogil - void setPosition(DPosition1) nogil + DPosition1 getPosition() nogil except + # TODO + void setPosition(DPosition1) nogil except + # TODO - CoordinateType getRT() nogil - void setRT(CoordinateType) nogil + CoordinateType getRT() nogil except + # wrap-doc:Return the data point retention time + void setRT(CoordinateType) nogil except + # wrap-doc:Set the data point retention time - CoordinateType getPos() nogil - void setPos(CoordinateType) nogil - - # alias for getRT - CoordinateType getMZ() nogil - void setMZ(CoordinateType) nogil + CoordinateType getPos() nogil except + # wrap-doc:Alias for getRT() + void setPos(CoordinateType) nogil except + # wrap-doc:Alias for setRT() + # alias for getRT!!! + # Current not exposed since it does the same as getRT()a + # and is probably used somewhere internally for filtering. + # CoordinateType getMZ() nogil except + # wrap-doc:Alias for getRT() + # void setMZ(CoordinateType) nogil except + # wrap-doc:Alias for setRT() diff --git a/src/pyOpenMS/pxds/ChromatogramSettings.pxd b/src/pyOpenMS/pxds/ChromatogramSettings.pxd index 1988566f939..a7a7bf85c86 100644 --- a/src/pyOpenMS/pxds/ChromatogramSettings.pxd +++ b/src/pyOpenMS/pxds/ChromatogramSettings.pxd @@ -25,42 +25,42 @@ cdef extern from "" namespace "OpenMS": Product getProduct() nogil except + # wrap-doc:Access to the product ion void setProduct(Product p) nogil except + # wrap-doc:Set the product ion - String getNativeID() nogil except + # wrap-doc:returns the native identifier for the spectrum, used by the acquisition software. - void setNativeID(String native_id) nogil except + # wrap-doc:sets the native identifier for the spectrum, used by the acquisition software. + String getNativeID() nogil except + # wrap-doc:Returns the native identifier for the spectrum, used by the acquisition software. + void setNativeID(String native_id) nogil except + # wrap-doc:Sets the native identifier for the spectrum, used by the acquisition software. # returns the free-text comment - String getComment() nogil except + + String getComment() nogil except + # wrap-doc:Returns the free-text comment # sets the free-text comment - void setComment(String comment) nogil except + + void setComment(String comment) nogil except + # wrap-doc:Sets the free-text comment # returns a mutable reference to the instrument settings of the current spectrum - InstrumentSettings getInstrumentSettings() nogil except + + InstrumentSettings getInstrumentSettings() nogil except + # wrap-doc:Returns the instrument settings of the current spectrum # sets the instrument settings of the current spectrum - void setInstrumentSettings(InstrumentSettings instrument_settings) nogil except + + void setInstrumentSettings(InstrumentSettings instrument_settings) nogil except + # wrap-doc:Sets the instrument settings of the current spectrum # returns a mutable reference to the acquisition info - AcquisitionInfo getAcquisitionInfo() nogil except + + AcquisitionInfo getAcquisitionInfo() nogil except + # wrap-doc:Returns the acquisition info # sets the acquisition info - void setAcquisitionInfo(AcquisitionInfo acquisition_info) nogil except + + void setAcquisitionInfo(AcquisitionInfo acquisition_info) nogil except + # wrap-doc:Sets the acquisition info # returns a mutable reference to the source file - SourceFile getSourceFile() nogil except + + SourceFile getSourceFile() nogil except + # wrap-doc:Returns the source file # sets the source file - void setSourceFile(SourceFile source_file) nogil except + + void setSourceFile(SourceFile source_file) nogil except + # wrap-doc:Sets the source file # returns a mutable reference to the precursors - Precursor getPrecursor() nogil except + + Precursor getPrecursor() nogil except + # wrap-doc:Returns the precursors # sets the precursors - void setPrecursor(Precursor precursor) nogil except + + void setPrecursor(Precursor precursor) nogil except + # wrap-doc:Sets the precursors # returns a mutable reference to the description of the applied processing - libcpp_vector[ shared_ptr[DataProcessing] ] getDataProcessing() nogil except + + libcpp_vector[ shared_ptr[DataProcessing] ] getDataProcessing() nogil except + # wrap-doc:Returns the description of the applied processing # sets the description of the applied processing - void setDataProcessing(libcpp_vector[ shared_ptr[DataProcessing] ]) nogil except + + void setDataProcessing(libcpp_vector[ shared_ptr[DataProcessing] ]) nogil except + # wrap-doc:Sets the description of the applied processing # sets the chromatogram type - void setChromatogramType(ChromatogramType type) nogil except + - ChromatogramType getChromatogramType() nogil except + + void setChromatogramType(ChromatogramType type) nogil except + # wrap-doc:Sets the chromatogram type + ChromatogramType getChromatogramType() nogil except + # wrap-doc:Get the chromatogram type cdef extern from "" namespace "OpenMS::ChromatogramSettings": @@ -79,4 +79,3 @@ cdef extern from "" namespace "OpenMS::C ABSORPTION_CHROMATOGRAM, EMISSION_CHROMATOGRAM, SIZE_OF_CHROMATOGRAM_TYPE - diff --git a/src/pyOpenMS/pxds/ChromatogramTools.pxd b/src/pyOpenMS/pxds/ChromatogramTools.pxd index 4866dcbbb41..024e538fc41 100644 --- a/src/pyOpenMS/pxds/ChromatogramTools.pxd +++ b/src/pyOpenMS/pxds/ChromatogramTools.pxd @@ -10,10 +10,10 @@ cdef extern from "" namespace "OpenMS": void convertChromatogramsToSpectra( MSExperiment & epx - ) nogil except + + ) nogil except + # wrap-doc:Converts the chromatogram to a list of spectra with instrument settings void convertSpectraToChromatograms( MSExperiment & epx, bool remove_spectra, bool force_conversion - ) nogil except + + ) nogil except + # wrap-doc:Converts e.g. SRM spectra to chromatograms diff --git a/src/pyOpenMS/pxds/ChromeleonFile.pxd b/src/pyOpenMS/pxds/ChromeleonFile.pxd index e1fcac2a634..23001d340e5 100644 --- a/src/pyOpenMS/pxds/ChromeleonFile.pxd +++ b/src/pyOpenMS/pxds/ChromeleonFile.pxd @@ -5,7 +5,7 @@ cdef extern from "" namespace "OpenMS": cdef cppclass ChromeleonFile: - ChromeleonFile() nogil except + + ChromeleonFile() nogil except + # wrap-doc:Load Chromeleon HPLC text file and save it into a `MSExperiment`. ChromeleonFile(ChromeleonFile &) nogil except + # compiler - void load(const String& filename, MSExperiment& experiment) nogil except + + void load(const String& filename, MSExperiment& experiment) nogil except + # wrap-doc:Load the file's data and metadata, and save it into a `MSExperiment`. diff --git a/src/pyOpenMS/pxds/ClusteringGrid.pxd b/src/pyOpenMS/pxds/ClusteringGrid.pxd index 52dc86ab4bf..4d928e0f0de 100644 --- a/src/pyOpenMS/pxds/ClusteringGrid.pxd +++ b/src/pyOpenMS/pxds/ClusteringGrid.pxd @@ -10,10 +10,10 @@ cdef extern from "" namespace "Op ClusteringGrid(ClusteringGrid &) nogil except + # compiler libcpp_vector[ double ] getGridSpacingX() nogil except + libcpp_vector[ double ] getGridSpacingY() nogil except + - void addCluster(libcpp_pair[int,int] cell_index, int & cluster_index) nogil except + - void removeCluster(libcpp_pair[int,int] cell_index, int & cluster_index) nogil except + - void removeAllClusters() nogil except + + void addCluster(libcpp_pair[int,int] cell_index, int & cluster_index) nogil except + # wrap-doc:Adds a cluster to this grid cell + void removeCluster(libcpp_pair[int,int] cell_index, int & cluster_index) nogil except + # wrap-doc:Removes a cluster from this grid cell and removes the cell if no other cluster left + void removeAllClusters() nogil except + # wrap-doc:Removes all clusters from this grid (and hence all cells) # NAMESPACE # std::list[ int ] getClusters(CellIndex & cell_index) nogil except + libcpp_pair[int,int] getIndex(DPosition2 position) nogil except + - bool isNonEmptyCell(libcpp_pair[int,int] cell_index) nogil except + - int getCellCount() nogil except + + bool isNonEmptyCell(libcpp_pair[int,int] cell_index) nogil except + # wrap-doc:Checks if there are clusters at this cell index + int getCellCount() nogil except + # wrap-doc:Returns number of grid cells occupied by one or more clusters diff --git a/src/pyOpenMS/pxds/CompNovoIdentification.pxd b/src/pyOpenMS/pxds/CompNovoIdentification.pxd index 14206cfff83..9175e393735 100644 --- a/src/pyOpenMS/pxds/CompNovoIdentification.pxd +++ b/src/pyOpenMS/pxds/CompNovoIdentification.pxd @@ -15,6 +15,5 @@ cdef extern from "" namespace " CompNovoIdentification() nogil except + CompNovoIdentification(CompNovoIdentification &) nogil except + - void getIdentifications(libcpp_vector[PeptideIdentification] & ids, MSExperiment) nogil except + - void getIdentification(PeptideIdentification & id, MSSpectrum cid_spec, MSSpectrum etd_spec) nogil except + - + void getIdentifications(libcpp_vector[PeptideIdentification] & ids, MSExperiment) nogil except + # wrap-doc:Performs and returns de novo identifications + void getIdentification(PeptideIdentification & id, MSSpectrum cid_spec, MSSpectrum etd_spec) nogil except + # wrap-doc:Performs and returns de novo identifications diff --git a/src/pyOpenMS/pxds/CompNovoIdentificationCID.pxd b/src/pyOpenMS/pxds/CompNovoIdentificationCID.pxd index ded515e94b9..68326206e06 100644 --- a/src/pyOpenMS/pxds/CompNovoIdentificationCID.pxd +++ b/src/pyOpenMS/pxds/CompNovoIdentificationCID.pxd @@ -15,6 +15,5 @@ cdef extern from "" namespac CompNovoIdentificationCID() nogil except + CompNovoIdentificationCID(CompNovoIdentificationCID &) nogil except + - void getIdentifications(libcpp_vector[PeptideIdentification] & ids, MSExperiment) nogil except + - void getIdentification(PeptideIdentification & id, MSSpectrum cid_spec) nogil except + - + void getIdentifications(libcpp_vector[PeptideIdentification] & ids, MSExperiment) nogil except + # wrap-doc:Performs and returns de novo identifications + void getIdentification(PeptideIdentification & id, MSSpectrum cid_spec) nogil except + # wrap-doc:Performs and returns de novo identifications diff --git a/src/pyOpenMS/pxds/ComplementFilter.pxd b/src/pyOpenMS/pxds/ComplementFilter.pxd index f0d898da769..f01c839e3d3 100644 --- a/src/pyOpenMS/pxds/ComplementFilter.pxd +++ b/src/pyOpenMS/pxds/ComplementFilter.pxd @@ -6,9 +6,10 @@ cdef extern from "" namespace cdef cppclass ComplementFilter(FilterFunctor) : # wrap-inherits: # FilterFunctor - ComplementFilter() nogil except + + + ComplementFilter() nogil except + # wrap-doc:Total intensity of peak pairs that could result from complementing fragments of charge state 1 ComplementFilter(ComplementFilter &) nogil except + - double apply(MSSpectrum & ) nogil except + - # POINTER # FilterFunctor * create() nogil except + - String getProductName() nogil except + + double apply(MSSpectrum & ) nogil except + # wrap-doc:Returns the total intensity of peak pairs which could result from complementing fragments + # POINTER # FilterFunctor * create() nogil except + + String getProductName() nogil except + # wrap-doc:Returns the name for registration at the factory diff --git a/src/pyOpenMS/pxds/ComplementMarker.pxd b/src/pyOpenMS/pxds/ComplementMarker.pxd index 6a7cde2723e..2dbc137423d 100644 --- a/src/pyOpenMS/pxds/ComplementMarker.pxd +++ b/src/pyOpenMS/pxds/ComplementMarker.pxd @@ -8,9 +8,10 @@ cdef extern from "" namespace cdef cppclass ComplementMarker(PeakMarker) : # wrap-inherits: # PeakMarker - ComplementMarker() nogil except + + + ComplementMarker() nogil except + # wrap-doc:ComplementMarker marks peak pairs which could represent y - b ion pairs ComplementMarker(ComplementMarker &) nogil except + + void apply(libcpp_map[ double, bool ] & , MSSpectrum & ) nogil except + PeakMarker * create() nogil except + # wrap-ignore # String getProductName() nogil except + - diff --git a/src/pyOpenMS/pxds/Compomer.pxd b/src/pyOpenMS/pxds/Compomer.pxd index 5af079eb4f8..19a230e2b7a 100644 --- a/src/pyOpenMS/pxds/Compomer.pxd +++ b/src/pyOpenMS/pxds/Compomer.pxd @@ -18,47 +18,51 @@ cdef extern from "" namespace "OpenMS": bool isConflicting(Compomer & cmp, UInt side_this, UInt side_other) nogil except + # /// set an Id which allows unique identification of a compomer - void setID(Size id) nogil except + + void setID(Size id) nogil except + # wrap-doc:Set an Id which allows unique identification of a compomer # /// return Id which allows unique identification of this compomer - Size getID() nogil except + + Size getID() nogil except + # wrap-doc:Return Id which allows unique identification of this compomer # /// left and right adducts of this compomer # TODO OpenMS Map type libcpp_vector[Map[String, Adduct] ] getComponent() nogil except + # wrap-ignore # /// net charge of compomer (i.e. difference between left and right side of compomer) - Int getNetCharge() nogil except + + Int getNetCharge() nogil except + # wrap-doc:Net charge of compomer (i.e. difference between left and right side of compomer) # /// mass of all contained adducts - double getMass() nogil except + + double getMass() nogil except + # wrap-doc:Mass of all contained adducts # /// summed positive charges of contained adducts - Int getPositiveCharges() nogil except + + Int getPositiveCharges() nogil except + # wrap-doc:Summed positive charges of contained adducts # /// summed negative charges of contained adducts - Int getNegativeCharges() nogil except + + Int getNegativeCharges() nogil except + # wrap-doc:Summed negative charges of contained adducts # /// return log probability - double getLogP() nogil except + + double getLogP() nogil except + # wrap-doc:Return log probability # /// return log probability - double getRTShift() nogil except + + double getRTShift() nogil except + # wrap-doc:Return log probability # /// get adducts with their abundance as compact string for both sides - String getAdductsAsString() nogil except + + String getAdductsAsString() nogil except + # wrap-doc:Get adducts with their abundance as compact string for both sides # /// get adducts with their abundance as compact string (amounts are absolute unless side=BOTH) # /// @param side Use LEFT for left, RIGHT for right - String getAdductsAsString(UInt side) nogil except + + String getAdductsAsString(UInt side) nogil except + # wrap-doc:Get adducts with their abundance as compact string (amounts are absolute unless side=BOTH) # /// check if Compomer only contains a single adduct on side @p side - bool isSingleAdduct(Adduct & a, UInt side) nogil except + + bool isSingleAdduct(Adduct & a, UInt side) nogil except + # wrap-doc:Check if Compomer only contains a single adduct on side @p side - Compomer removeAdduct(Adduct & a) nogil except + + Compomer removeAdduct(Adduct & a) nogil except + # wrap-doc:Remove ALL instances of the given adduct Compomer removeAdduct(Adduct & a, UInt side) nogil except + - StringList getLabels(UInt side) nogil except + + StringList getLabels(UInt side) nogil except + # wrap-doc:Returns the adduct labels from parameter(side) given. (LEFT or RIGHT) # void add(CompomerSide & add_side, UInt side) nogil except + + +cdef extern from "" namespace "OpenMS::Compomer": + # side of compomer (LEFT ^ substract; RIGHT ^ add) + cdef enum SIDE: LEFT, RIGHT, BOTH diff --git a/src/pyOpenMS/pxds/ConfidenceScoring.pxd b/src/pyOpenMS/pxds/ConfidenceScoring.pxd index fd680b7fcc2..35d37a76fc9 100644 --- a/src/pyOpenMS/pxds/ConfidenceScoring.pxd +++ b/src/pyOpenMS/pxds/ConfidenceScoring.pxd @@ -12,5 +12,5 @@ cdef extern from "" namespace "Op void initialize(TargetedExperiment & targeted, Size n_decoys, Size n_transitions, TransformationDescription trafo) nogil except + void initializeGlm(double intercept, double rt_coef, double int_coef) nogil except + - void scoreMap(FeatureMap & map) nogil except + + void scoreMap(FeatureMap & map) nogil except + # wrap-doc:Score a feature map -> make sure the class is properly initialized diff --git a/src/pyOpenMS/pxds/ConsensusFeature.pxd b/src/pyOpenMS/pxds/ConsensusFeature.pxd index 56d7aea25b1..3e408eba414 100644 --- a/src/pyOpenMS/pxds/ConsensusFeature.pxd +++ b/src/pyOpenMS/pxds/ConsensusFeature.pxd @@ -34,9 +34,9 @@ cdef extern from "" namespace "OpenMS": ConsensusFeature(UInt64, BaseFeature) nogil except + ConsensusFeature(UInt64, ConsensusFeature) nogil except + - void computeConsensus() nogil except + - void computeMonoisotopicConsensus() nogil except + - void computeDechargeConsensus(FeatureMap, bool) nogil except + + void computeConsensus() nogil except + # wrap-doc:Computes and updates the consensus position, intensity, and charge. + void computeMonoisotopicConsensus() nogil except + # wrap-doc:Computes and updates the consensus position, intensity, and charge. + void computeDechargeConsensus(FeatureMap, bool) nogil except + # wrap-doc:Computes the uncharged parent RT & mass, assuming the handles are charge variants. void insert(UInt64 map_idx, Peak2D, UInt64 element_idx) nogil except + void insert(UInt64 map_idx, BaseFeature) nogil except + @@ -49,9 +49,9 @@ cdef extern from "" namespace "OpenMS": bool operator==(ConsensusFeature) nogil except + bool operator!=(ConsensusFeature) nogil except + - void addRatio(Ratio r) nogil except + - void setRatios(libcpp_vector[Ratio] rs) nogil except + - libcpp_vector[Ratio] getRatios() nogil except + + void addRatio(Ratio r) nogil except + # wrap-doc:Connects a ratio to the ConsensusFeature. + void setRatios(libcpp_vector[Ratio] rs) nogil except + # wrap-doc:Connects the ratios to the ConsensusFeature. + libcpp_vector[Ratio] getRatios() nogil except + # wrap-doc:Get the ratio vector. void clear() nogil except + bool empty() nogil except + diff --git a/src/pyOpenMS/pxds/ConsensusIDAlgorithm.pxd b/src/pyOpenMS/pxds/ConsensusIDAlgorithm.pxd index 9428da79673..95998951f6d 100644 --- a/src/pyOpenMS/pxds/ConsensusIDAlgorithm.pxd +++ b/src/pyOpenMS/pxds/ConsensusIDAlgorithm.pxd @@ -16,5 +16,5 @@ cdef extern from "" namespace "OpenMS ConsensusIDAlgorithm() nogil except + # wrap-ignore # private ConsensusIDAlgorithm(ConsensusIDAlgorithm) nogil except + # wrap-ignore - void apply(libcpp_vector[ PeptideIdentification ] & ids, Size number_of_runs) nogil except + + void apply(libcpp_vector[ PeptideIdentification ] & ids, Size number_of_runs) nogil except + # wrap-doc:Calculates the consensus ID for a set of peptide identifications of one spectrum or (consensus) feature. diff --git a/src/pyOpenMS/pxds/ConsensusMap.pxd b/src/pyOpenMS/pxds/ConsensusMap.pxd index bd56ae21791..6010f1c470f 100644 --- a/src/pyOpenMS/pxds/ConsensusMap.pxd +++ b/src/pyOpenMS/pxds/ConsensusMap.pxd @@ -72,59 +72,59 @@ cdef extern from "" namespace "OpenMS": ConsensusFeature & operator[](int) nogil except + #wrap-upper-limit:size() void push_back(ConsensusFeature spec) nogil except + - ConsensusMap appendRows(ConsensusMap) nogil except + - ConsensusMap appendColumns(ConsensusMap) nogil except + + ConsensusMap appendRows(ConsensusMap) nogil except + # wrap-doc:Add consensus map entries as new rows. + ConsensusMap appendColumns(ConsensusMap) nogil except + # wrap-doc:Add consensus map entries as new columns. - void clear(bool clear_meta_data) nogil except + + void clear(bool clear_meta_data) nogil except + # wrap-doc:Clears all data and meta data void clear() nogil except + void updateRanges() nogil except + libcpp_vector[ProteinIdentification] getProteinIdentifications( - ) nogil except+ + ) nogil except + # TODO void setProteinIdentifications( libcpp_vector[ProteinIdentification] - ) nogil except+ + ) nogil except + # wrap-doc:Sets the protein identifications libcpp_vector[PeptideIdentification]\ - getUnassignedPeptideIdentifications() nogil except+ + getUnassignedPeptideIdentifications() nogil except + # TODO void setUnassignedPeptideIdentifications( libcpp_vector[PeptideIdentification] - ) nogil except+ + ) nogil except + # wrap-doc:Sets the unassigned peptide identifications - libcpp_vector[DataProcessing] getDataProcessing() nogil except + - void setDataProcessing(libcpp_vector[DataProcessing]) nogil except + + libcpp_vector[DataProcessing] getDataProcessing() nogil except + # wrap-doc:Returns a const reference to the description of the applied data processing + void setDataProcessing(libcpp_vector[DataProcessing]) nogil except + # wrap-doc:Sets the description of the applied data processing - void setPrimaryMSRunPath(StringList& s) nogil except + + void setPrimaryMSRunPath(StringList& s) nogil except + # wrap-doc:Set the file paths to the primary MS run (stored in ColumnHeaders) void setPrimaryMSRunPath(StringList& s, MSExperiment& e) nogil except + - void getPrimaryMSRunPath(StringList& toFill) nogil except + + void getPrimaryMSRunPath(StringList& toFill) nogil except + # wrap-doc:Returns the MS run path (stored in ColumnHeaders) libcpp_vector[ConsensusFeature].iterator begin( - ) nogil except + # wrap-iter-begin:__iter__(ConsensusFeature) + ) nogil except + # wrap-iter-begin:__iter__(ConsensusFeature) libcpp_vector[ConsensusFeature].iterator end( - ) nogil except + # wrap-iter-end:__iter__(ConsensusFeature) + ) nogil except + # wrap-iter-end:__iter__(ConsensusFeature) # wrapped in ../addons/ConsensusMap.pyx: void applyMemberFunction(Size(* fun)()) nogil except + # wrap-ignore - void sortByIntensity(bool reverse) nogil except + + void sortByIntensity(bool reverse) nogil except + # wrap-doc:Sorts the peaks according to ascending intensity. void sortByIntensity() nogil except + - void sortByRT() nogil except + - void sortByMZ() nogil except + - void sortByPosition() nogil except + - void sortByQuality(bool reverse) nogil except + + void sortByRT() nogil except + # wrap-doc:Sorts the peaks according to RT position + void sortByMZ() nogil except + # wrap-doc:Sorts the peaks according to m/z position + void sortByPosition() nogil except + # wrap-doc:Lexicographically sorts the peaks by their position (First RT then m/z) + void sortByQuality(bool reverse) nogil except + # wrap-doc:Sorts the peaks according to ascending quality. void sortByQuality() nogil except + - void sortBySize() nogil except + - void sortByMaps() nogil except + + void sortBySize() nogil except + # wrap-doc:Sorts with respect to the size (number of elements) + void sortByMaps() nogil except + # wrap-doc:Sorts with respect to the sets of maps covered by the consensus features (lexicographically) # wrapped in ../addons/ConsensusMap.pyx: void setColumnHeaders(ColumnHeaders &) #wrap-ignore ColumnHeaders & getColumnHeaders() #wrap-ignore - String getExperimentType() nogil except + - void setExperimentType(String experiment_type) nogil except + + String getExperimentType() nogil except + # wrap-doc:Non-mutable access to the experiment type + void setExperimentType(String experiment_type) nogil except + # wrap-doc:Mutable access to the experiment type - void sortPeptideIdentificationsByMapIndex() nogil except + + void sortPeptideIdentificationsByMapIndex() nogil except + # wrap-doc:Sorts PeptideIdentifications of consensus features with respect to their map index. diff --git a/src/pyOpenMS/pxds/ConsensusMapNormalizerAlgorithmMedian.pxd b/src/pyOpenMS/pxds/ConsensusMapNormalizerAlgorithmMedian.pxd index 2f05e71e092..aea1d6cc37f 100644 --- a/src/pyOpenMS/pxds/ConsensusMapNormalizerAlgorithmMedian.pxd +++ b/src/pyOpenMS/pxds/ConsensusMapNormalizerAlgorithmMedian.pxd @@ -18,9 +18,9 @@ cdef extern from "" namespace "OpenMS": cdef cppclass ConsensusXMLFile: ConsensusXMLFile() nogil except + - void load(String, ConsensusMap &) nogil except+ - void store(String, ConsensusMap &) nogil except+ + void load(String, ConsensusMap &) nogil except + # wrap-doc:Loads a consensus map from file and calls updateRanges + void store(String, ConsensusMap &) nogil except + # wrap-doc:Stores a consensus map to file - PeakFileOptions getOptions() nogil except + + PeakFileOptions getOptions() nogil except + # wrap-doc:Mutable access to the options for loading/storing diff --git a/src/pyOpenMS/pxds/ContactPerson.pxd b/src/pyOpenMS/pxds/ContactPerson.pxd index 245156b8c9b..72e84e81ff3 100644 --- a/src/pyOpenMS/pxds/ContactPerson.pxd +++ b/src/pyOpenMS/pxds/ContactPerson.pxd @@ -14,41 +14,41 @@ cdef extern from "" namespace "OpenMS": ContactPerson(ContactPerson &) nogil except + # returns the first name of the person - String getFirstName() nogil except + + String getFirstName() nogil except + # wrap-doc:Returns the first name of the person # sets the first name of the person - void setFirstName(String name) nogil except + + void setFirstName(String name) nogil except + # wrap-doc:Sets the first name of the person # returns the last name of the person - String getLastName() nogil except + + String getLastName() nogil except + # wrap-doc:Returns the last name of the person # sets the last name of the person - void setLastName(String name) nogil except + + void setLastName(String name) nogil except + # wrap-doc:Sets the last name of the person # sets the full name of the person (gets split into first and last name internally) - void setName(String name) nogil except + + void setName(String name) nogil except + # wrap-doc:Sets the full name of the person (gets split into first and last name internally) # returns the affiliation - String getInstitution() nogil except + + String getInstitution() nogil except + # wrap-doc:Returns the affiliation # sets the affiliation - void setInstitution(String institution) nogil except + + void setInstitution(String institution) nogil except + # wrap-doc:Sets the affiliation # returns the email address - String getEmail() nogil except + + String getEmail() nogil except + # wrap-doc:Returns the email address # sets the email address - void setEmail(String email) nogil except + + void setEmail(String email) nogil except + # wrap-doc:Sets the email address # returns the email address - String getURL() nogil except + + String getURL() nogil except + # wrap-doc:Returns the URL associated with the contact person (e.g., the institute webpage "https://www.higglesworth.edu/") # sets the email address - void setURL(String email) nogil except + + void setURL(String email) nogil except + # wrap-doc:Sets the URL associated with the contact person (e.g., the institute webpage "https://www.higglesworth.edu/") # returns the address - String getAddress() nogil except + + String getAddress() nogil except + # wrap-doc:Returns the address # sets the address - void setAddress(String email) nogil except + + void setAddress(String email) nogil except + # wrap-doc:Sets the address # returns miscellaneous info about the contact person - String getContactInfo() nogil except + + String getContactInfo() nogil except + # wrap-doc:Returns miscellaneous info about the contact person # sets miscellaneous info about the contact person - void setContactInfo(String contact_info) nogil except + + void setContactInfo(String contact_info) nogil except + # wrap-doc:Sets miscellaneous info about the contact person diff --git a/src/pyOpenMS/pxds/ContinuousWaveletTransform.pxd b/src/pyOpenMS/pxds/ContinuousWaveletTransform.pxd index 2a043bf8142..04f2e05ae98 100644 --- a/src/pyOpenMS/pxds/ContinuousWaveletTransform.pxd +++ b/src/pyOpenMS/pxds/ContinuousWaveletTransform.pxd @@ -6,23 +6,24 @@ cdef extern from " cdef cppclass ContinuousWaveletTransform "OpenMS::ContinuousWaveletTransform": ContinuousWaveletTransform() nogil except + + ContinuousWaveletTransform(ContinuousWaveletTransform &) nogil except + # compiler - libcpp_vector[ Peak1D ] getSignal() nogil except + - void setSignal(libcpp_vector[ Peak1D ] & signal) nogil except + - libcpp_vector[ double ] getWavelet() nogil except + - void setWavelet(libcpp_vector[ double ] & wavelet) nogil except + - double getScale() nogil except + - void setScale(double scale) nogil except + - double getSpacing() nogil except + - void setSpacing(double spacing) nogil except + - SignedSize getLeftPaddingIndex() nogil except + - void setLeftPaddingIndex(SignedSize end_left_padding) nogil except + - SignedSize getRightPaddingIndex() nogil except + - void setRightPaddingIndex(SignedSize begin_right_padding) nogil except + - SignedSize getSignalLength() nogil except + - void setSignalLength(SignedSize signal_length) nogil except + - int getSize() nogil except + - void init(double scale, double spacing) nogil except + + libcpp_vector[ Peak1D ] getSignal() nogil except + # wrap-doc:Non-mutable access to the wavelet transform of the signal + void setSignal(libcpp_vector[ Peak1D ] & signal) nogil except + # wrap-doc:Mutable access to the wavelet transform of the signal + libcpp_vector[ double ] getWavelet() nogil except + # wrap-doc:Non-mutable access to the wavelet + void setWavelet(libcpp_vector[ double ] & wavelet) nogil except + # wrap-doc:Mutable access to the signal + double getScale() nogil except + # wrap-doc:Non-mutable access to the scale of the wavelet + void setScale(double scale) nogil except + # wrap-doc:Mutable access to the spacing of raw data + double getSpacing() nogil except + # wrap-doc:Non-mutable access to the spacing of raw data + void setSpacing(double spacing) nogil except + # wrap-doc:Mutable access to the spacing of raw data + SignedSize getLeftPaddingIndex() nogil except + # wrap-doc:Non-mutable access to the position where the signal starts (in the interval [0,end_left_padding_) are the padded zeros) + void setLeftPaddingIndex(SignedSize end_left_padding) nogil except + # wrap-doc:Mutable access to position where the signal starts + SignedSize getRightPaddingIndex() nogil except + # wrap-doc:Non-mutable access to the position where the signal ends (in the interval (begin_right_padding_,end] are the padded zeros) + void setRightPaddingIndex(SignedSize begin_right_padding) nogil except + # wrap-doc:Mutable access to position where the signal starts + SignedSize getSignalLength() nogil except + # wrap-doc:Non-mutable access to signal length [end_left_padding,begin_right_padding] + void setSignalLength(SignedSize signal_length) nogil except + # wrap-doc:Mutable access to signal length [end_left_padding,begin_right_padding] + int getSize() nogil except + # wrap-doc:Non-mutable access to signal length including padded zeros [0,end] + void init(double scale, double spacing) nogil except + # wrap-doc:Perform possibly necessary preprocessing steps, like tabulating the Wavelet + # double <](unsigned int i) nogil except + # double <](unsigned int i) nogil except + - diff --git a/src/pyOpenMS/pxds/ControlledVocabulary.pxd b/src/pyOpenMS/pxds/ControlledVocabulary.pxd index f280cbc2cda..e92a207f318 100644 --- a/src/pyOpenMS/pxds/ControlledVocabulary.pxd +++ b/src/pyOpenMS/pxds/ControlledVocabulary.pxd @@ -16,27 +16,27 @@ cdef extern from "" namespace "OpenMS": ControlledVocabulary(ControlledVocabulary &) nogil except + # compiler # Returns the CV name (set in the load method) - String name() nogil except + + String name() nogil except + # wrap-doc:Returns the CV name (set in the load method) - void loadFromOBO(String name, String filename) nogil except + + void loadFromOBO(String name, String filename) nogil except + # wrap-doc:Loads the CV from an OBO file # Returns true if the term is in the CV. Returns false otherwise. - bool exists(String id) nogil except + + bool exists(String id) nogil except + # wrap-doc:Returns true if the term is in the CV. Returns false otherwise. # Returns true if a term with the given name is in the CV. Returns false otherwise. - bool hasTermWithName(String name) nogil except + + bool hasTermWithName(String name) nogil except + # wrap-doc:Returns true if a term with the given name is in the CV. Returns false otherwise. - CVTerm_ControlledVocabulary getTerm(String id) nogil except + + CVTerm_ControlledVocabulary getTerm(String id) nogil except + # wrap-doc:Returns a term specified by ID - CVTerm_ControlledVocabulary getTermByName(String name, String desc) nogil except + + CVTerm_ControlledVocabulary getTermByName(String name, String desc) nogil except + # wrap-doc:Returns a term specified by name # returns all the terms stored in the CV # TODO OpenMS Map type # Map[String, CVTerm_ControlledVocabulary] getTerms() nogil except + - void getAllChildTerms(libcpp_set[String] terms, String parent) nogil except + + void getAllChildTerms(libcpp_set[String] terms, String parent) nogil except + # wrap-doc:Writes all child terms recursively into terms - bool isChildOf(String child, String parent) nogil except + + bool isChildOf(String child, String parent) nogil except + # wrap-doc:Returns True if @param child is a child of @param parent cdef extern from "" namespace "OpenMS::ControlledVocabulary": @@ -58,8 +58,8 @@ cdef extern from "" namespace "OpenMS::Con CVTerm_ControlledVocabulary() nogil except + CVTerm_ControlledVocabulary(CVTerm_ControlledVocabulary rhs) nogil except + - String toXMLString(String ref, String value) nogil except + - String toXMLString(String ref, DataValue value) nogil except + + String toXMLString(String ref, String value) nogil except + # wrap-doc:Get mzidentml formatted string. i.e. a cvparam xml element, ref should be the name of the ControlledVocabulary (i.e. cv.name()) containing the CVTerm (e.g. PSI-MS for the psi-ms.obo - gets loaded in all cases like that??), value can be empty if not available + String toXMLString(String ref, DataValue value) nogil except + # wrap-doc:Get mzidentml formatted string. i.e. a cvparam xml element, ref should be the name of the ControlledVocabulary (i.e. cv.name()) containing the CVTerm (e.g. PSI-MS for the psi-ms.obo - gets loaded in all cases like that??), value can be empty if not available String getXRefTypeName(XRefType_CVTerm_ControlledVocabulary type) nogil except + bool isHigherBetterScore(CVTerm_ControlledVocabulary term) nogil except + diff --git a/src/pyOpenMS/pxds/ConvexHull2D.pxd b/src/pyOpenMS/pxds/ConvexHull2D.pxd index bf7cf33a1b2..57594ff691a 100644 --- a/src/pyOpenMS/pxds/ConvexHull2D.pxd +++ b/src/pyOpenMS/pxds/ConvexHull2D.pxd @@ -13,19 +13,19 @@ cdef extern from "" namespace "OpenMS": ConvexHull2D(ConvexHull2D &) nogil except + bool operator==(ConvexHull2D) nogil except + - void clear() nogil except + - Size compress() nogil except + - void expandToBoundingBox() nogil except + + void clear() nogil except + # wrap-doc:Removes all points + Size compress() nogil except + # wrap-doc:Allows to reduce the disk/memory footprint of a hull + void expandToBoundingBox() nogil except + # wrap-doc:Expand a convex hull to its bounding box. # as cython/autowrap have problems handling integer template args # we wrap following methods manually in ../addons/ConvexHull2D.pyx: # better/todo: implement converter in ../converters ! - bool addPoint(DPosition2 point) nogil except + - void addPoints(libcpp_vector[DPosition2] points) nogil except + + bool addPoint(DPosition2 point) nogil except + # wrap-doc:Adds a point to the hull if it is not already contained. Returns if the point was added. This will trigger recomputation of the outer hull points (thus points set with setHullPoints() will be lost) + void addPoints(libcpp_vector[DPosition2] points) nogil except + # wrap-doc:Adds points to the hull if it is not already contained. This will trigger recomputation of the outer hull points (thus points set with setHullPoints() will be lost) - bool encloses(DPosition2) nogil except + - libcpp_vector[DPosition2] getHullPoints() nogil except + - void setHullPoints(libcpp_vector[DPosition2] ) nogil except + - DBoundingBox2 getBoundingBox() nogil except + + bool encloses(DPosition2) nogil except + # wrap-doc:Returns if the @param point lies in the feature hull + libcpp_vector[DPosition2] getHullPoints() nogil except + # wrap-doc:Accessor for the outer points + void setHullPoints(libcpp_vector[DPosition2] ) nogil except + # wrap-doc:Accessor for the outer(!) points (no checking is performed if this is actually a convex hull) + DBoundingBox2 getBoundingBox() nogil except + # wrap-doc:Returns the bounding box of the feature hull points diff --git a/src/pyOpenMS/pxds/CsvFile.pxd b/src/pyOpenMS/pxds/CsvFile.pxd index f33a0d80190..bacf571369f 100644 --- a/src/pyOpenMS/pxds/CsvFile.pxd +++ b/src/pyOpenMS/pxds/CsvFile.pxd @@ -9,8 +9,8 @@ cdef extern from "" namespace "OpenMS": CsvFile() nogil except + CsvFile(CsvFile &) nogil except + # compiler - void load(const String& filename, char is_, bool ie_, int first_n) nogil except + - void store(const String& filename) nogil except + - void addRow(const StringList& list) nogil except + - void clear() nogil except + - bool getRow(int row, StringList& list) nogil except + + void load(const String& filename, char is_, bool ie_, int first_n) nogil except + # wrap-doc:Loads data from a text file. + void store(const String& filename) nogil except + # wrap-doc:Stores the buffer's content into a file. + void addRow(const StringList& list) nogil except + # wrap-doc:Add a row to the buffer. + void clear() nogil except + # wrap-doc:Clears the buffer + bool getRow(int row, StringList& list) nogil except + # wrap-doc:Writes all items from a row to list diff --git a/src/pyOpenMS/pxds/CubicSpline2d.pxd b/src/pyOpenMS/pxds/CubicSpline2d.pxd index c3badbf797c..9da19b23eb9 100644 --- a/src/pyOpenMS/pxds/CubicSpline2d.pxd +++ b/src/pyOpenMS/pxds/CubicSpline2d.pxd @@ -10,6 +10,6 @@ cdef extern from "" namespace "OpenMS": CubicSpline2d(CubicSpline2d &) nogil except + # compiler CubicSpline2d(libcpp_map[ double, double ] m) nogil except + - double eval(double x) nogil except + - double derivatives(double x, unsigned order) nogil except + + double eval(double x) nogil except + # wrap-doc:Evaluates the cubic spline + double derivatives(double x, unsigned order) nogil except + # wrap-doc:Returns first, second or third derivative of cubic spline diff --git a/src/pyOpenMS/pxds/ISpectrumAccess.pxd b/src/pyOpenMS/pxds/ISpectrumAccess.pxd index a7ab28ba5b1..058f7d8072a 100644 --- a/src/pyOpenMS/pxds/ISpectrumAccess.pxd +++ b/src/pyOpenMS/pxds/ISpectrumAccess.pxd @@ -18,12 +18,12 @@ cdef extern from "" namespace # virtual boost::shared_ptr lightClone() const = 0; - shared_ptr[OSSpectrum] getSpectrumById(int id_) nogil except + - libcpp_vector[size_t] getSpectraByRT(double RT, double deltaRT) nogil except + - size_t getNrSpectra() nogil except + + shared_ptr[OSSpectrum] getSpectrumById(int id_) nogil except + # wrap-doc:Return a pointer to a spectrum at the given string id + libcpp_vector[size_t] getSpectraByRT(double RT, double deltaRT) nogil except + # wrap-doc:Return a vector of ids of spectra that are within RT +/- deltaRT + size_t getNrSpectra() nogil except + # wrap-doc:Returns the number of spectra available # virtual SpectrumMeta getSpectrumMetaById(int id) const = 0; - shared_ptr[OSChromatogram] getChromatogramById(int id_) nogil except + - size_t getNrChromatograms() nogil except + + shared_ptr[OSChromatogram] getChromatogramById(int id_) nogil except + # wrap-doc:Return a pointer to a chromatogram at the given id + size_t getNrChromatograms() nogil except + # wrap-doc:Returns the number of chromatograms available libcpp_utf8_output_string getChromatogramNativeID(int id_) nogil except + diff --git a/src/pyOpenMS/pxds/IndexedMzMLFileLoader.pxd b/src/pyOpenMS/pxds/IndexedMzMLFileLoader.pxd index ba047262b7c..0b3cc58c9f3 100644 --- a/src/pyOpenMS/pxds/IndexedMzMLFileLoader.pxd +++ b/src/pyOpenMS/pxds/IndexedMzMLFileLoader.pxd @@ -8,12 +8,32 @@ cdef extern from "" namespace "OpenMS": cdef cppclass IndexedMzMLFileLoader: - IndexedMzMLFileLoader() nogil except + + IndexedMzMLFileLoader() nogil except + # wrap-doc:A class to load an indexedmzML file - bool load(String, OnDiscMSExperiment &) nogil except+ - void store(String, OnDiscMSExperiment &) nogil except+ - void store(String, MSExperiment &) nogil except+ + bool load(String, OnDiscMSExperiment &) nogil except + + # wrap-doc: + # Load a file + # ----- + # Tries to parse the file, success needs to be checked with the return value + # ----- + # :param filename: Filename determines where the file is located + # :param exp: Object which will contain the data after the call + # :returns: Indicates whether parsing was successful (if it is false, the file most likely was not an mzML or not indexed) - PeakFileOptions getOptions() nogil except + - void setOptions(PeakFileOptions) nogil except + + void store(String, OnDiscMSExperiment &) nogil except + + # wrap-doc: + # Store a file from an on-disc data-structure + # ----- + # :param filename: Filename determines where the file will be stored + # :param exp: MS data to be stored + + void store(String, MSExperiment &) nogil except + + # wrap-doc: + # Store a file from an in-memory data-structure + # ----- + # :param filename: Filename determines where the file will be stored + # :param exp: MS data to be stored + + PeakFileOptions getOptions() nogil except + # wrap-doc:Returns the options for loading/storing + void setOptions(PeakFileOptions) nogil except + # wrap-doc:Returns the options for loading/storing diff --git a/src/pyOpenMS/pxds/InspectInfile.pxd b/src/pyOpenMS/pxds/InspectInfile.pxd index 3d8155e902d..690e7873ea7 100644 --- a/src/pyOpenMS/pxds/InspectInfile.pxd +++ b/src/pyOpenMS/pxds/InspectInfile.pxd @@ -8,34 +8,47 @@ cdef extern from "" namespace "OpenMS": cdef cppclass InspectInfile "OpenMS::InspectInfile": - InspectInfile() nogil except + + InspectInfile() nogil except + # wrap-doc:Inspect input file adapter InspectInfile(InspectInfile &) nogil except + bool operator==(InspectInfile & inspect_infile) nogil except + - void store(const String & filename) nogil except + + void store(const String & filename) nogil except + # wrap-doc:Stores the experiment data in an Inspect input file that can be used as input for Inspect shell execution void handlePTMs(const String & modification_line, const String & modifications_filename, bool monoisotopic) nogil except + - String getSpectra() nogil except + - void setSpectra(const String & spectra) nogil except + - String getDb() nogil except + - void setDb(const String & db) nogil except + - String getEnzyme() nogil except + - void setEnzyme(const String & enzyme) nogil except + - Int getModificationsPerPeptide() nogil except + - void setModificationsPerPeptide(Int modifications_per_peptide) nogil except + - UInt getBlind() nogil except + - void setBlind(UInt blind) nogil except + - float getMaxPTMsize() nogil except + - void setMaxPTMsize(float maxptmsize) nogil except + - float getPrecursorMassTolerance() nogil except + - void setPrecursorMassTolerance(float precursor_mass_tolerance) nogil except + - float getPeakMassTolerance() nogil except + - void setPeakMassTolerance(float peak_mass_tolerance) nogil except + - UInt getMulticharge() nogil except + - void setMulticharge(UInt multicharge) nogil except + - String getInstrument() nogil except + - void setInstrument(const String & instrument) nogil except + - Int getTagCount() nogil except + - void setTagCount(Int TagCount) nogil except + + # wrap-doc: + # Retrieves the name, mass change, affected residues, type and position for all modifications from a string + # ----- + # :param modification_line + # :param modifications_filename + # :param monoisotopic: if true, masses are considered to be monoisotopic + # :raises: + # Exception: FileNotReadable if the modifications_filename could not be read + # :raises: + # Exception: FileNotFound if modifications_filename could not be found + # :raises: + # Exception: ParseError if modifications_filename could not be parsed + + String getSpectra() nogil except + # wrap-doc:Specifies a spectrum file to search + void setSpectra(const String & spectra) nogil except + # wrap-doc:Specifies a spectrum file to search + String getDb() nogil except + # wrap-doc:Specifies the name of a database (.trie file) to search + void setDb(const String & db) nogil except + # wrap-doc:Specifies the name of a database (.trie file) to search + String getEnzyme() nogil except + # wrap-doc:Specifies the name of a enzyme. "Trypsin", "None", and "Chymotrypsin" are the available values + void setEnzyme(const String & enzyme) nogil except + # wrap-doc:Specifies the name of a enzyme. "Trypsin", "None", and "Chymotrypsin" are the available values + Int getModificationsPerPeptide() nogil except + # wrap-doc:Number of PTMs permitted in a single peptide + void setModificationsPerPeptide(Int modifications_per_peptide) nogil except + # wrap-doc:Number of PTMs permitted in a single peptide + UInt getBlind() nogil except + # wrap-doc:Run inspect in a blind mode + void setBlind(UInt blind) nogil except + # wrap-doc:Run inspect in a blind mode + float getMaxPTMsize() nogil except + # wrap-doc:The maximum modification size (in Da) to consider in a blind search + void setMaxPTMsize(float maxptmsize) nogil except + # wrap-doc:The maximum modification size (in Da) to consider in a blind search + float getPrecursorMassTolerance() nogil except + # wrap-doc:Specifies the parent mass tolerance, in Daltons + void setPrecursorMassTolerance(float precursor_mass_tolerance) nogil except + # wrap-doc:Specifies the parent mass tolerance, in Daltons + float getPeakMassTolerance() nogil except + # wrap-doc:How far b and y peaks can be shifted from their expected masses. + void setPeakMassTolerance(float peak_mass_tolerance) nogil except + # wrap-doc:How far b and y peaks can be shifted from their expected masses + UInt getMulticharge() nogil except + # wrap-doc:If set to true, attempt to guess the precursor charge and mass, and consider multiple charge states if feasible + void setMulticharge(UInt multicharge) nogil except + # wrap-doc:If set to true, attempt to guess the precursor charge and mass, and consider multiple charge states if feasible + String getInstrument() nogil except + # wrap-doc:If set to QTOF, uses a QTOF-derived fragmentation model, and does not attempt to correct the parent mass + void setInstrument(const String & instrument) nogil except + # wrap-doc:If set to QTOF, uses a QTOF-derived fragmentation model, and does not attempt to correct the parent mass + Int getTagCount() nogil except + # wrap-doc:Number of tags to generate + void setTagCount(Int TagCount) nogil except + # wrap-doc:Number of tags to generate libcpp_map[ String, libcpp_vector[ String ] ] getModifications() nogil except + # wrap-ignore diff --git a/src/pyOpenMS/pxds/InspectOutfile.pxd b/src/pyOpenMS/pxds/InspectOutfile.pxd index 8b9d05bfb94..67ab5120929 100644 --- a/src/pyOpenMS/pxds/InspectOutfile.pxd +++ b/src/pyOpenMS/pxds/InspectOutfile.pxd @@ -11,31 +11,56 @@ from FileHandler cimport * cdef extern from "" namespace "OpenMS": cdef cppclass InspectOutfile "OpenMS::InspectOutfile": - InspectOutfile() nogil except + + + InspectOutfile() nogil except + # wrap-doc:This class serves to read in an Inspect outfile and write an idXML file InspectOutfile(InspectOutfile &) nogil except + + bool operator==(InspectOutfile & inspect_outfile) nogil except + libcpp_vector[ size_t ] load(const String & result_filename, libcpp_vector[ PeptideIdentification ] & peptide_identifications, ProteinIdentification & protein_identification, double p_value_threshold, const String & database_filename) nogil except + + # wrap-doc: + # Load the results of an Inspect search + # ----- + # :param result_filename: Input parameter which is the file name of the input file + # :param peptide_identifications: Output parameter which holds the peptide identifications from the given file + # :param protein_identification: Output parameter which holds the protein identifications from the given file + # :param p_value_threshold + # :param database_filename + # :raises: + # Exception: FileNotFound is thrown if the given file could not be found + # :raises: + # Exception: ParseError is thrown if the given file could not be parsed + # :raises: + # Exception: FileEmpty is thrown if the given file is empty libcpp_vector[ size_t ] getWantedRecords(const String & result_filename, double p_value_threshold) nogil except + + # wrap-doc: + # Loads only results which exceeds a given p-value threshold + # ----- + # :param result_filename: The filename of the results file + # :param p_value_threshold: Only identifications exceeding this threshold are read + # :raises: + # Exception: FileNotFound is thrown if the given file could not be found + # :raises: + # Exception: FileEmpty is thrown if the given file is empty void compressTrieDB(const String & database_filename, const String & index_filename, libcpp_vector[ size_t ] & wanted_records, const String & snd_database_filename, - const String & snd_index_filename, bool append) nogil except + + const String & snd_index_filename, bool append) nogil except + # wrap-doc:Generates a trie database from another one, using the wanted records only void generateTrieDB(const String & source_database_filename, const String & database_filename, const String & index_filename, bool - append, const String species) nogil except + + append, const String species) nogil except + # wrap-doc:Generates a trie database from a given one (the type of database is determined by getLabels) void getACAndACType(String line, String & accession, - String & accession_type) nogil except + + String & accession_type) nogil except + # wrap-doc:Retrieve the accession type and accession number from a protein description line # TODO mixed, nested STL void getPrecursorRTandMZ( @@ -47,15 +72,15 @@ cdef extern from "" namespace "OpenMS": String & sequence_start_label, String & sequence_end_label, String & comment_label, - String & species_label) nogil except + + String & species_label) nogil except + # wrap-doc:Retrieve the labels of a given database (at the moment FASTA and Swissprot) libcpp_vector[ size_t ] getSequences(const String & database_filename, libcpp_map[ size_t, size_t ] & wanted_records, - libcpp_vector[ String ] & sequences) nogil except + + libcpp_vector[ String ] & sequences) nogil except + # wrap-doc:Retrieve sequences from a trie database - void getExperiment(MSExperiment & exp, String & type_, const String & in_filename) nogil except + + void getExperiment(MSExperiment & exp, String & type_, const String & in_filename) nogil except + # wrap-doc:Get the experiment from a file - bool getSearchEngineAndVersion(const String & cmd_output, ProteinIdentification & protein_identification) nogil except + + bool getSearchEngineAndVersion(const String & cmd_output, ProteinIdentification & protein_identification) nogil except + # wrap-doc:Get the search engine and its version from the output of the InsPecT executable without parameters. Returns true on success, false otherwise void readOutHeader(const String & filename, const String & header_line, @@ -69,5 +94,5 @@ cdef extern from "" namespace "OpenMS": Int & record_number_column, Int & DB_file_pos_column, Int & spec_file_pos_column, - Size & number_of_columns) nogil except + + Size & number_of_columns) nogil except + # wrap-doc:Read the header of an inspect output file and retrieve various information diff --git a/src/pyOpenMS/pxds/Instrument.pxd b/src/pyOpenMS/pxds/Instrument.pxd index 640410af077..de5f65f5f64 100644 --- a/src/pyOpenMS/pxds/Instrument.pxd +++ b/src/pyOpenMS/pxds/Instrument.pxd @@ -12,51 +12,51 @@ cdef extern from "" namespace "OpenMS": # wrap-inherits: # MetaInfoInterface - Instrument() nogil except + + Instrument() nogil except + # wrap-doc:Description of a MS instrument Instrument(Instrument &) nogil except + # returns the name of the instrument - String getName() nogil except + + String getName() nogil except + # wrap-doc:Returns the name of the instrument # sets the name of the instrument - void setName(String name) nogil except + + void setName(String name) nogil except + # wrap-doc:Sets the name of the instrument # returns the instrument vendor - String getVendor() nogil except + + String getVendor() nogil except + # wrap-doc:Returns the instrument vendor # sets the instrument vendor - void setVendor(String vendor) nogil except + + void setVendor(String vendor) nogil except + # wrap-doc:Sets the instrument vendor # returns the instrument model - String getModel() nogil except + + String getModel() nogil except + # wrap-doc:Returns the instrument model # sets the instrument model - void setModel(String model) nogil except + + void setModel(String model) nogil except + # wrap-doc:Sets the instrument model # returns a description of customizations - String getCustomizations() nogil except + + String getCustomizations() nogil except + # wrap-doc:Returns a description of customizations # sets the a description of customizations - void setCustomizations(String customizations) nogil except + + void setCustomizations(String customizations) nogil except + # wrap-doc:Sets the a description of customizations # returns a mutable reference to the ion source list - libcpp_vector[IonSource] getIonSources() nogil except + + libcpp_vector[IonSource] getIonSources() nogil except + # wrap-doc:Returns the ion source list # sets the ion source list - void setIonSources(libcpp_vector[IonSource] ion_sources) nogil except + + void setIonSources(libcpp_vector[IonSource] ion_sources) nogil except + # wrap-doc:Sets the ion source list # returns a mutable reference to the mass analyzer list - libcpp_vector[MassAnalyzer] getMassAnalyzers() nogil except + + libcpp_vector[MassAnalyzer] getMassAnalyzers() nogil except + # wrap-doc:Returns the mass analyzer list # sets the mass analyzer list - void setMassAnalyzers(libcpp_vector[MassAnalyzer] mass_analyzers) nogil except + + void setMassAnalyzers(libcpp_vector[MassAnalyzer] mass_analyzers) nogil except + # wrap-doc:Sets the mass analyzer list # returns a mutable reference to the ion detector list - libcpp_vector[IonDetector] getIonDetectors() nogil except + + libcpp_vector[IonDetector] getIonDetectors() nogil except + # wrap-doc:Returns the ion detector list # sets the ion detector list - void setIonDetectors(libcpp_vector[IonDetector] ion_detectors) nogil except + + void setIonDetectors(libcpp_vector[IonDetector] ion_detectors) nogil except + # wrap-doc:Sets the ion detector list # returns a mutable reference to the instrument software - Software getSoftware() nogil except + + Software getSoftware() nogil except + # wrap-doc:Returns the instrument software # sets the instrument software - void setSoftware(Software software) nogil except + + void setSoftware(Software software) nogil except + # wrap-doc:Sets the instrument software - IonOpticsType getIonOptics() nogil except + - void setIonOptics(IonOpticsType ion_optics) nogil except + + IonOpticsType getIonOptics() nogil except + # wrap-doc:Returns the ion optics type + void setIonOptics(IonOpticsType ion_optics) nogil except + # wrap-doc:Sets the ion optics type cdef extern from "" namespace "OpenMS::Instrument": diff --git a/src/pyOpenMS/pxds/InstrumentSettings.pxd b/src/pyOpenMS/pxds/InstrumentSettings.pxd index 3055114cdf9..1472b8f93c9 100644 --- a/src/pyOpenMS/pxds/InstrumentSettings.pxd +++ b/src/pyOpenMS/pxds/InstrumentSettings.pxd @@ -8,18 +8,18 @@ cdef extern from "" namespace "OpenMS": # wrap-inherits: # MetaInfoInterface - InstrumentSettings() nogil except + + InstrumentSettings() nogil except + # wrap-doc:Description of the settings a MS Instrument was run with InstrumentSettings(InstrumentSettings &) nogil except + - Polarity getPolarity() nogil except + - void setPolarity(Polarity) nogil except + + Polarity getPolarity() nogil except + # wrap-doc:Returns the polarity + void setPolarity(Polarity) nogil except + # wrap-doc:Sets the polarity - ScanMode getScanMode() nogil except + - void setScanMode(ScanMode scan_mode) nogil except + - bool getZoomScan() nogil except + - void setZoomScan(bool zoom_scan) nogil except + - libcpp_vector[ ScanWindow ] getScanWindows() nogil except + - void setScanWindows(libcpp_vector[ ScanWindow ] scan_windows) nogil except + + ScanMode getScanMode() nogil except + # wrap-doc:Returns the scan mode + void setScanMode(ScanMode scan_mode) nogil except + # wrap-doc:Sets the scan mode + bool getZoomScan() nogil except + # wrap-doc:Return if this scan is a zoom (enhanced resolution) scan + void setZoomScan(bool zoom_scan) nogil except + # wrap-doc:Sets if this scan is a zoom (enhanced resolution) scan + libcpp_vector[ ScanWindow ] getScanWindows() nogil except + # wrap-doc:Get the m/z scan windows + void setScanWindows(libcpp_vector[ ScanWindow ] scan_windows) nogil except + # wrap-doc:Set the m/z scan windows cdef extern from "" namespace "OpenMS::InstrumentSettings": diff --git a/src/pyOpenMS/pxds/IntegerMassDecomposer.pxd b/src/pyOpenMS/pxds/IntegerMassDecomposer.pxd index f5c33cdc0fc..f56f628e334 100644 --- a/src/pyOpenMS/pxds/IntegerMassDecomposer.pxd +++ b/src/pyOpenMS/pxds/IntegerMassDecomposer.pxd @@ -16,10 +16,19 @@ cdef extern from "" name cdef cppclass IntensityBalanceFilter(FilterFunctor) : # wrap-inherits: # FilterFunctor - IntensityBalanceFilter() nogil except + + IntensityBalanceFilter() nogil except + # wrap-doc:It divides the m/z-range into ten regions and sums the intensity in these region IntensityBalanceFilter(IntensityBalanceFilter &) nogil except + double apply(MSSpectrum & ) nogil except + diff --git a/src/pyOpenMS/pxds/InternalCalibration.pxd b/src/pyOpenMS/pxds/InternalCalibration.pxd index 243eecd95ef..cd6429e9052 100644 --- a/src/pyOpenMS/pxds/InternalCalibration.pxd +++ b/src/pyOpenMS/pxds/InternalCalibration.pxd @@ -15,9 +15,10 @@ cdef extern from "" namespac # wrap-inherits: # ProgressLogger - InternalCalibration() nogil except + + InternalCalibration() nogil except + # wrap-doc:A mass recalibration method using linear/quadratic interpolation (robust/weighted) of given reference masses InternalCalibration(InternalCalibration &) nogil except + # compiler + Size fillCalibrants(MSExperiment, libcpp_vector[InternalCalibration_LockMass], double tol_ppm, @@ -25,9 +26,76 @@ cdef extern from "" namespac bool lock_require_iso, CalibrationData& failed_lock_masses, bool verbose) nogil except + + # wrap-doc: + # Extract calibrants from Raw data (mzML) + # ----- + # Lock masses are searched in each spectrum and added to the internal calibrant database + # ----- + # Filters can be used to exclude spurious peaks, i.e. require the calibrant peak to be monoisotopic or + # to have a +1 isotope (should not be used for very low abundant calibrants) + # If a calibrant is not found, it is added to a 'failed_lock_masses' database which is returned and not stored internally. + # The intensity of the peaks describe the reason for failed detection: 0.0 - peak not found with the given ppm tolerance; + # 1.0 - peak is not monoisotopic (can only occur if 'lock_require_mono' is true) + # 2.0 - peak has no +1 isotope (can only occur if 'lock_require_iso' is true) + # ----- + # :param exp: Peak map containing the lock masses + # :param ref_masses: List of lock masses + # :param tol_ppm: Search window for lock masses in 'exp' + # :param lock_require_mono: Require that a lock mass is the monoisotopic peak (i.e. not an isotope peak) -- lock mass is rejected otherwise + # :param lock_require_iso: Require that a lock mass has isotope peaks to its right -- lock mass is rejected otherwise + # :param failed_lock_masses: Set of calibration masses which were not found, i.e. their expected m/z and RT positions + # :param verbose: Print information on 'lock_require_XXX' matches during search + # :returns: Number of calibration masses found + Size fillCalibrants(FeatureMap, double) nogil except + + # wrap-doc: + # Extract calibrants from identifications + # ----- + # Extracts only the first hit from the first peptide identification of each feature + # Hits are sorted beforehand + # Ambiguities should be resolved before, e.g. using IDFilter + # RT and m/z are taken from the features, not from the identifications (for an exception see below)! + # ----- + # Unassigned peptide identifications are also taken into account! + # RT and m/z are naturally taken from the IDs, since to feature is assigned + # If you do not want these IDs, remove them from the feature map before calling this function + # ----- + # A filtering step is done in the m/z dimension using 'tol_ppm' + # Since precursor masses could be annotated wrongly (e.g. isotope peak instead of mono), + # larger outliers are removed before accepting an ID as calibrant + # ----- + # :param fm: FeatureMap with peptide identifications + # :param tol_ppm: Only accept ID's whose theoretical mass deviates at most this much from annotated + # :returns: Number of calibration masses found + Size fillCalibrants(libcpp_vector[PeptideIdentification], double) nogil except + + # wrap-doc: + # Extract calibrants from identifications + # ----- + # Extracts only the first hit from each peptide identification + # Hits are sorted beforehand + # Ambiguities should be resolved before, e.g. using IDFilter + # ----- + # Unassigned peptide identifications are also taken into account! + # RT and m/z are naturally taken from the IDs, since to feature is assigned + # If you do not want these IDs, remove them from the feature map before calling this function + # ----- + # A filtering step is done in the m/z dimension using 'tol_ppm' + # Since precursor masses could be annotated wrongly (e.g. isotope peak instead of mono), + # larger outliers are removed before accepting an ID as calibrant + # ----- + # :param pep_ids: Peptide ids (e.g. from an idXML file) + # :param tol_ppm: Only accept ID's whose theoretical mass deviates at most this much from annotated + # :returns: Number of calibration masses found + CalibrationData getCalibrationPoints() nogil except + + # wrap-doc: + # Get container of calibration points + # ----- + # Filled using fillCalibrants() methods + # ----- + # :returns: Container of calibration points + bool calibrate(MSExperiment, libcpp_vector[int], MZTrafoModel_MODELTYPE, @@ -40,6 +108,28 @@ cdef extern from "" namespac String file_residuals, String file_residuals_plot, String rscript_executable) nogil except + + # wrap-doc: + # Apply calibration to data + # ----- + # For each spectrum, a calibration model will be computed and applied. + # Make sure to call fillCalibrants() before, so a model can be created. + # ----- + # The MSExperiment will be sorted by RT and m/z if unsorted. + # ----- + # :param exp: MSExperiment holding the Raw data to calibrate + # :param target_mslvl: MS-levels where calibration should be applied to + # :param model_type: Linear or quadratic model; select based on your instrument + # :param rt_chunk: RT-window size (one-sided) of calibration points to collect around each spectrum. Set to negative values, to build one global model instead. + # :param use_RANSAC: Remove outliers before fitting a model?! + # :param post_ppm_median: The median ppm error of the calibrants must be at least this good after calibration; otherwise this method returns false(fail) + # :param post_ppm_MAD: The median absolute deviation of the calibrants must be at least this good after calibration; otherwise this method returns false(fail) + # :param file_models: Output CSV filename, where model parameters are written to (pass empty string to skip) + # :param file_models_plot: Output PNG image model parameters (pass empty string to skip) + # :param file_residuals: Output CSV filename, where ppm errors of calibrants before and after model fitting parameters are written to (pass empty string to skip) + # :param file_residuals_plot: Output PNG image of the ppm errors of calibrants (pass empty string to skip) + # :param rscript_executable: Full path to the Rscript executable + # :returns: true upon successful calibration + ## wrap static methods cdef extern from "" namespace "OpenMS::InternalCalibration": diff --git a/src/pyOpenMS/pxds/InterpolationModel.pxd b/src/pyOpenMS/pxds/InterpolationModel.pxd index f96b586c9ae..6c1e6847864 100644 --- a/src/pyOpenMS/pxds/InterpolationModel.pxd +++ b/src/pyOpenMS/pxds/InterpolationModel.pxd @@ -10,19 +10,20 @@ ctypedef double CoordinateType cdef extern from "" namespace "OpenMS": cdef cppclass InterpolationModel "OpenMS::InterpolationModel": - InterpolationModel() nogil except + + + InterpolationModel() nogil except + # wrap-doc:Abstract class for 1D-models that are approximated using linear interpolation InterpolationModel(InterpolationModel &) nogil except + # double getIntensity(DPosition1 &pos) nogil except + - double getIntensity(double coord) nogil except + - double getScalingFactor() nogil except + - void setOffset(double offset) nogil except + - double getCenter() nogil except + - void setSamples() nogil except + - void setInterpolationStep(double interpolation_step) nogil except + - void setScalingFactor(double scaling) nogil except + + double getIntensity(double coord) nogil except + # wrap-doc:Access model predicted intensity at position 'pos' + double getScalingFactor() nogil except + # wrap-doc:Returns the interpolation class + void setOffset(double offset) nogil except + # wrap-doc:Set the offset of the model + double getCenter() nogil except + # wrap-doc:Returns the "center" of the model, particular definition (depends on the derived model) + void setSamples() nogil except + # wrap-doc:Set sample/supporting points of interpolation wrt params + void setInterpolationStep(double interpolation_step) nogil except + # wrap-doc:Set the interpolation step for the linear interpolation of the model + void setScalingFactor(double scaling) nogil except + # TODO - LinearInterpolation[double,double] getInterpolation() nogil except + + LinearInterpolation[double,double] getInterpolation() nogil except + # wrap-doc:Returns the interpolation class # void getSamples(SamplesType &cont) nogil except + # typedef typename DPeak::Type PeakType; # typedef std::vector SamplesType; diff --git a/src/pyOpenMS/pxds/IonDetector.pxd b/src/pyOpenMS/pxds/IonDetector.pxd index 06f6f7dfa21..670d42e3036 100644 --- a/src/pyOpenMS/pxds/IonDetector.pxd +++ b/src/pyOpenMS/pxds/IonDetector.pxd @@ -7,33 +7,33 @@ cdef extern from "" namespace "OpenMS": cdef cppclass IonDetector(MetaInfoInterface): # wrap-inherits: # MetaInfoInterface - - IonDetector() nogil except + - IonDetector(IonDetector &) nogil except + + + IonDetector() nogil except + # wrap-doc:Description of a ion detector (part of a MS Instrument) + IonDetector(IonDetector &) nogil except + # returns the detector type - Type_IonDetector getType() nogil except + + Type_IonDetector getType() nogil except + # wrap-doc:Returns the detector type # sets the detector type - void setType(Type_IonDetector type_) nogil except + + void setType(Type_IonDetector type_) nogil except + # wrap-doc:Sets the detector type # returns the acquisition mode - AcquisitionMode getAcquisitionMode() nogil except + + AcquisitionMode getAcquisitionMode() nogil except + # wrap-doc:Returns the acquisition mode # sets the acquisition mode - void setAcquisitionMode(AcquisitionMode acquisition_mode) nogil except + + void setAcquisitionMode(AcquisitionMode acquisition_mode) nogil except + # wrap-doc:Sets the acquisition mode # returns the resolution (in ns) - double getResolution() nogil except + + double getResolution() nogil except + # wrap-doc:Returns the resolution (in ns) # sets the resolution (in ns) - void setResolution(double resolution) nogil except + + void setResolution(double resolution) nogil except + # wrap-doc:Sets the resolution (in ns) # returns the analog-to-digital converter sampling frequency (in Hz) - double getADCSamplingFrequency() nogil except + + double getADCSamplingFrequency() nogil except + # wrap-doc:Returns the analog-to-digital converter sampling frequency (in Hz) # sets the analog-to-digital converter sampling frequency (in Hz) - void setADCSamplingFrequency(double ADC_sampling_frequency) nogil except + + void setADCSamplingFrequency(double ADC_sampling_frequency) nogil except + # wrap-doc:Sets the analog-to-digital converter sampling frequency (in Hz) - Int getOrder() nogil except + + Int getOrder() nogil except + # wrap-doc:Returns the order # sets the order - void setOrder(Int order) nogil except + + void setOrder(Int order) nogil except + # wrap-doc:Sets the order cdef extern from "" namespace "OpenMS::IonDetector": diff --git a/src/pyOpenMS/pxds/IonSource.pxd b/src/pyOpenMS/pxds/IonSource.pxd index 1e7c41a3f9b..a9331b26419 100644 --- a/src/pyOpenMS/pxds/IonSource.pxd +++ b/src/pyOpenMS/pxds/IonSource.pxd @@ -9,33 +9,37 @@ cdef extern from "" namespace "OpenMS": # wrap-inherits: # MetaInfoInterface - IonSource() nogil except + + IonSource() nogil except + # wrap-doc:Description of an ion source (part of a MS Instrument) IonSource(IonSource &) nogil except + # returns the ionization mode - Polarity getPolarity() nogil except + + Polarity getPolarity() nogil except + # wrap-doc:Returns the ionization mode # sets the ionization mode - void setPolarity(Polarity polarity) nogil except + + void setPolarity(Polarity polarity) nogil except + # wrap-doc:Sets the ionization mode # returns the inlet type - InletType getInletType() nogil except + + InletType getInletType() nogil except + # wrap-doc:Returns the inlet type # sets the inlet type - void setInletType(InletType inlet_type) nogil except + + void setInletType(InletType inlet_type) nogil except + # wrap-doc:Sets the inlet type # returns the ionization method - IonizationMethod getIonizationMethod() nogil except + + IonizationMethod getIonizationMethod() nogil except + # wrap-doc:Returns the ionization method # sets the ionization method - void setIonizationMethod(IonizationMethod ionization_type) nogil except + + void setIonizationMethod(IonizationMethod ionization_type) nogil except + # wrap-doc:Sets the ionization method - # @brief returns the position of this part in the whole Instrument. - # Order can be ignored, as long the instrument has this default setup: - # - one ion source - # - one or many mass analyzers - # - one ion detector - # For more complex instruments, the order should be defined. Int getOrder() nogil except + + # wrap-doc: + # Returns the position of this part in the whole Instrument + # ----- + # Order can be ignored, as long the instrument has this default setup: + # - one ion source + # - one or many mass analyzers + # - one ion detector + # ----- + # For more complex instruments, the order should be defined. + # sets the order - void setOrder(Int order) nogil except + + void setOrder(Int order) nogil except + # wrap-doc:Sets the order cdef extern from "" namespace "OpenMS::IonSource": diff --git a/src/pyOpenMS/pxds/IsotopeCluster.pxd b/src/pyOpenMS/pxds/IsotopeCluster.pxd index f1798d18afd..9db732449dd 100644 --- a/src/pyOpenMS/pxds/IsotopeCluster.pxd +++ b/src/pyOpenMS/pxds/IsotopeCluster.pxd @@ -4,15 +4,17 @@ from Types cimport * cdef extern from "" namespace "OpenMS": cdef cppclass IsotopeCluster "OpenMS::IsotopeCluster": - IsotopeCluster() nogil except + + + IsotopeCluster() nogil except + # wrap-doc:Stores information about an isotopic cluster (i.e. potential peptide charge variants) IsotopeCluster(IsotopeCluster &) nogil except + # compiler + ChargedIndexSet peaks libcpp_vector[ size_t ] scans cdef extern from "" namespace "OpenMS::IsotopeCluster": cdef cppclass ChargedIndexSet "OpenMS::IsotopeCluster::ChargedIndexSet": - ChargedIndexSet() nogil except + + ChargedIndexSet() nogil except + # wrap-doc:Index set with associated charge estimate ChargedIndexSet(ChargedIndexSet) nogil except + #wrap-ignore Int charge diff --git a/src/pyOpenMS/pxds/IsotopeDiffFilter.pxd b/src/pyOpenMS/pxds/IsotopeDiffFilter.pxd index 7a0dddfa0d4..49ec51f42cd 100644 --- a/src/pyOpenMS/pxds/IsotopeDiffFilter.pxd +++ b/src/pyOpenMS/pxds/IsotopeDiffFilter.pxd @@ -6,9 +6,10 @@ cdef extern from "" namespace cdef cppclass IsotopeDiffFilter(FilterFunctor) : # wrap-inherits: # FilterFunctor - IsotopeDiffFilter() nogil except + + IsotopeDiffFilter() nogil except + # wrap-doc:IsotopeDiffFilter returns total intensity of peak pairs that could result from isotope peaks IsotopeDiffFilter(IsotopeDiffFilter &) nogil except + - double apply(MSSpectrum & ) nogil except + + double apply(MSSpectrum & ) nogil except + # TODO + # POINTER # FilterFunctor * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # TODO diff --git a/src/pyOpenMS/pxds/IsotopeDistribution.pxd b/src/pyOpenMS/pxds/IsotopeDistribution.pxd index 06bd27e94d1..20f12179a24 100644 --- a/src/pyOpenMS/pxds/IsotopeDistribution.pxd +++ b/src/pyOpenMS/pxds/IsotopeDistribution.pxd @@ -6,53 +6,58 @@ from EmpiricalFormula cimport * cdef extern from "" namespace "OpenMS": - cdef cppclass IsotopeDistribution: + cdef cppclass IsotopeDistribution: + # wrap-doc: + # Isotope distribution class + # ----- + # A container that holds an isotope distribution. It consists of mass values + # and their correspondent probabilities (stored in the intensity slot) + # ----- + # Isotope distributions can be calculated using either the + # CoarseIsotopePatternGenerator for quantized atomic masses which group + # isotopes with the same atomic number. Alternatively, the + # FineIsotopePatternGenerator can be used that calculates hyperfine isotopic + # distributions. + # ----- + # This class only describes the container that holds the isotopic + # distribution, calculations are done using classes derived from + # IsotopePatternGenerator. IsotopeDistribution() nogil except + IsotopeDistribution(IsotopeDistribution &) nogil except + - # overwrites the container which holds the distribution using @p distribution - void set(libcpp_vector[ Peak1D ]& distribution) nogil except + + void set(libcpp_vector[ Peak1D ]& distribution) nogil except + # wrap-doc:Overwrites the container which holds the distribution using 'distribution' void insert(double mass, float intensity) nogil except + libcpp_vector[Peak1D].iterator begin() nogil except + # wrap-iter-begin:__iter__(Peak1D) libcpp_vector[Peak1D].iterator end() nogil except + # wrap-iter-end:__iter__(Peak1D) - # returns the container which holds the distribution - libcpp_vector[ Peak1D ]& getContainer() nogil except + + libcpp_vector[ Peak1D ]& getContainer() nogil except + # wrap-doc:Returns the container which holds the distribution - # returns the maximal weight isotope which is stored in the distribution - Size getMax() nogil except + + Size getMax() nogil except + # wrap-doc:Returns the maximal weight isotope which is stored in the distribution - # returns the minimal weight isotope which is stored in the distribution - Size getMin() nogil except + + Size getMin() nogil except + # wrap-doc:Returns the minimal weight isotope which is stored in the distribution - # returns the most abundant isotope which is stored in the distribution - Peak1D getMostAbundant() nogil except + + Peak1D getMostAbundant() nogil except + # wrap-doc:Returns the most abundant isotope which is stored in the distribution - # returns the size of the distribution which is the number of isotopes in the distribution - Size size() nogil except + + Size size() nogil except + # wrap-doc:Returns the size of the distribution which is the number of isotopes in the distribution - # clears the distribution and resets max isotope to 0 - void clear() nogil except + + void clear() nogil except + # wrap-doc:Clears the distribution and resets max isotope to 0 - # renormalizes the sum of the probabilities of the isotopes to 1 - void renormalize() nogil except + + void renormalize() nogil except + # wrap-doc:Renormalizes the sum of the probabilities of the isotopes to 1 - # Trims the right side of the isotope distribution to isotopes with a significant contribution. - void trimRight(double cutoff) nogil except + + void trimRight(double cutoff) nogil except + # wrap-doc:Trims the right side of the isotope distribution to isotopes with a significant contribution - # Trims the left side of the isotope distribution to isotopes with a significant contribution. - void trimLeft(double cutoff) nogil except + + void trimLeft(double cutoff) nogil except + # wrap-doc:Trims the left side of the isotope distribution to isotopes with a significant contribution - void merge(double, double) nogil except + + void merge(double, double) nogil except + # wrap-doc:Merges distributions of arbitrary data points with constant defined resolution - void resize(UInt size) nogil except + - void trimIntensities(double cutoff) nogil except + - void sortByIntensity() nogil except + - void sortByMass() nogil except + - double averageMass() nogil except + + void resize(UInt size) nogil except + # wrap-doc:Resizes distribution container + void trimIntensities(double cutoff) nogil except + # wrap-doc:Remove intensities below the cutoff + void sortByIntensity() nogil except + # wrap-doc:Sort isotope distribution by intensity + void sortByMass() nogil except + # wrap-doc:Sort isotope distribution by mass + double averageMass() nogil except + # wrap-doc:Compute average mass of isotope distribution (weighted average of all isotopes) cdef extern from "" namespace "OpenMS::IsotopeDistribution": @@ -103,30 +108,22 @@ cdef extern from "" n cdef cppclass IsotopeDistributionCache "OpenMS::IsotopeDistributionCache": IsotopeDistributionCache(double max_mass, double mass_window_width, double intensity_percentage, double intensity_percentage_optional) nogil except + IsotopeDistributionCache(IsotopeDistributionCache &) nogil except + - TheoreticalIsotopePattern getIsotopeDistribution(double mass) nogil except + - + TheoreticalIsotopePattern getIsotopeDistribution(double mass) nogil except + # wrap-doc:Returns the isotope distribution for a certain mass window diff --git a/src/pyOpenMS/pxds/IsotopeFitter1D.pxd b/src/pyOpenMS/pxds/IsotopeFitter1D.pxd index e6e9d4e1215..1575f794020 100644 --- a/src/pyOpenMS/pxds/IsotopeFitter1D.pxd +++ b/src/pyOpenMS/pxds/IsotopeFitter1D.pxd @@ -4,9 +4,11 @@ from String cimport * cdef extern from "" namespace "OpenMS": cdef cppclass IsotopeFitter1D "OpenMS::IsotopeFitter1D": - IsotopeFitter1D() nogil except + + + IsotopeFitter1D() nogil except + # wrap-doc:Isotope distribution fitter (1-dim.) approximated using linear interpolation IsotopeFitter1D(IsotopeFitter1D &) nogil except + + # QualityType fit1d(RawDataArrayType &range, InterpolationModel *&model) nogil except + # Fitter1D * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # wrap-doc:Name of the model (needed by Factory) diff --git a/src/pyOpenMS/pxds/IsotopeLabelingMDVs.pxd b/src/pyOpenMS/pxds/IsotopeLabelingMDVs.pxd index 30d5a93c964..b29c33db502 100644 --- a/src/pyOpenMS/pxds/IsotopeLabelingMDVs.pxd +++ b/src/pyOpenMS/pxds/IsotopeLabelingMDVs.pxd @@ -17,14 +17,40 @@ cdef extern from "" namespac void isotopicCorrection(const Feature & normalized_feature, Feature & corrected_feature, Matrix[double] & correction_matrix, const DerivatizationAgent & correction_matrix_agent) nogil except + + # wrap-doc: + # This function performs an isotopic correction to account for unlabeled abundances coming from + # the derivatization agent (e.g., tBDMS) using correction matrix method and is calculated as follows: + # ----- + # :param normalized_feature: Feature with normalized values for each component and unlabeled chemical formula for each component group + # :param correction_matrix: Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of naturally abundant 13C contribute to spectral peaks that overlap (or convolve) the spectral peaks of the corrected MDV of the derivatization agent + # :param correction_matrix_agent: name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, only "TBDMS" is supported for now + # :returns: corrected_feature: Feature with corrected values for each component void isotopicCorrections( const FeatureMap & normalized_featureMap, FeatureMap & corrected_featureMap, Matrix[double] & correction_matrix, const DerivatizationAgent & correction_matrix_agent) nogil except + + # wrap-doc: + # This function performs an isotopic correction to account for unlabeled abundances coming from + # the derivatization agent (e.g., tBDMS) using correction matrix method and is calculated as follows: + # ----- + # :param normalized_featuremap: FeatureMap with normalized values for each component and unlabeled chemical formula for each component group + # :param correction_matrix: Square matrix holding correction factors derived either experimentally or theoretically which describe how spectral peaks of naturally abundant 13C contribute to spectral peaks that overlap (or convolve) the spectral peaks of the corrected MDV of the derivatization agent + # :param correction_matrix_agent: name of the derivatization agent, the internally stored correction matrix if the name of the agent is supplied, only "TBDMS" is supported for now + # :returns corrected_featuremap: FeatureMap with corrected values for each component void calculateIsotopicPurity( const Feature & normalized_feature, const libcpp_vector[double] & experiment_data, const String & isotopic_purity_name) nogil except + + # wrap-doc: + # This function calculates the isotopic purity of the MDV using the following formula: + # isotopic purity of tracer (atom % 13C) = n / [n + (M + n-1)/(M + n)], + # where n in M+n is represented as the index of the result + # The formula is extracted from "High-resolution 13C metabolic flux analysis", + # Long et al, doi:10.1038/s41596-019-0204-0 + # ----- + # :param normalized_feature: Feature with normalized values for each component and the number of heavy labeled e.g., carbons. Out is a Feature with the calculated isotopic purity for the component group + # :param experiment_data: Vector of experiment data in percent + # :param isotopic_purity_name: Name of the isotopic purity tracer to be saved as a meta value # void calculateIsotopicPurities( # const FeatureMap & normalized_feature, @@ -33,10 +59,24 @@ cdef extern from "" namespac void calculateMDVAccuracy( const Feature & normalized_feature, const String & feature_name, const String & fragment_isotopomer_theoretical_formula) nogil except + + # wrap-doc: + # This function calculates the accuracy of the MDV as compared to the theoretical MDV (only for 12C quality control experiments) + # using average deviation to the mean. The result is mapped to the meta value "average_accuracy" in the updated feature + # ----- + # :param normalized_feature: Feature with normalized values for each component and the chemical formula of the component group. Out is a Feature with the component group accuracy and accuracy for the error for each component + # :param fragment_isotopomer_measured: Measured scan values + # :param fragment_isotopomer_theoretical_formula: Empirical formula from which the theoretical values will be generated void calculateMDVAccuracies( const FeatureMap & normalized_featureMap, const String & feature_name, const libcpp_map[ libcpp_string, libcpp_string ] & fragment_isotopomer_theoretical_formulas) nogil except + + # wrap-doc: + # This function calculates the accuracy of the MDV as compared to the theoretical MDV (only for 12C quality control experiments) + # using average deviation to the mean + # ----- + # param normalized_featuremap: FeatureMap with normalized values for each component and the chemical formula of the component group. Out is a FeatureMap with the component group accuracy and accuracy for the error for each component + # param fragment_isotopomer_measured: Measured scan values + # param fragment_isotopomer_theoretical_formula: A map of ProteinName/peptideRef to Empirical formula from which the theoretical values will be generated void calculateMDV( const Feature & measured_feature, Feature & normalized_feature, diff --git a/src/pyOpenMS/pxds/IsotopeMarker.pxd b/src/pyOpenMS/pxds/IsotopeMarker.pxd index 379708fdcbf..ad91ae70415 100644 --- a/src/pyOpenMS/pxds/IsotopeMarker.pxd +++ b/src/pyOpenMS/pxds/IsotopeMarker.pxd @@ -10,8 +10,9 @@ cdef extern from "" namespace "Op cdef cppclass IsotopeMarker(PeakMarker) : # wrap-inherits: # PeakMarker - IsotopeMarker() nogil except + + IsotopeMarker() nogil except + # wrap-doc:IsotopeMarker marks peak pairs which could represent an ion and its isotope IsotopeMarker(IsotopeMarker &) nogil except + + void apply(libcpp_map[ double, bool ] & , MSSpectrum & ) nogil except + PeakMarker * create() nogil except + # wrap-ignore # TODO diff --git a/src/pyOpenMS/pxds/IsotopeModel.pxd b/src/pyOpenMS/pxds/IsotopeModel.pxd index 62deeaa5345..b79f243e105 100644 --- a/src/pyOpenMS/pxds/IsotopeModel.pxd +++ b/src/pyOpenMS/pxds/IsotopeModel.pxd @@ -5,17 +5,46 @@ from EmpiricalFormula cimport * cdef extern from "" namespace "OpenMS": cdef cppclass IsotopeModel "OpenMS::IsotopeModel": + # wrap-doc: + # Isotope distribution approximated using linear interpolation + # ----- + # This models a smoothed (widened) distribution, i.e. can be used to sample actual raw peaks (depending on the points you query) + # If you only want the distribution (no widening), use either + # EmpiricalFormula::getIsotopeDistribution() // for a certain sum formula + # or + # IsotopeDistribution::estimateFromPeptideWeight (double average_weight) // for averagine + # ----- + # Peak widening is achieved by either a Gaussian or Lorentzian shape + IsotopeModel() nogil except + IsotopeModel(IsotopeModel &) nogil except + UInt getCharge() nogil except + void setOffset(double offset) nogil except + - double getOffset() nogil except + - EmpiricalFormula getFormula() nogil except + - void setSamples(EmpiricalFormula &formula) nogil except + + # wrap-doc: + # Set the offset of the model + # ----- + # The whole model will be shifted to the new offset without being computing all over + # This leaves a discrepancy which is minor in small shifts (i.e. shifting by one or two + # standard deviations) but can get significant otherwise. In that case use setParameters() + # which enforces a recomputation of the model + + double getOffset() nogil except + # wrap-doc:Get the offset of the model + EmpiricalFormula getFormula() nogil except + # wrap-doc:Return the Averagine peptide formula (mass calculated from mean mass and charge -- use .setParameters() to set them) + void setSamples(EmpiricalFormula &formula) nogil except + # wrap-doc:Set sample/supporting points of interpolation double getCenter() nogil except + + # wrap-doc: + # Get the center of the Isotope model + # ----- + # This is a m/z-value not necessarily the monoisotopic mass + IsotopeDistribution getIsotopeDistribution() nogil except + + # wrap-doc: + # Get the Isotope distribution (without widening) from the last setSamples() call + # ----- + # Useful to determine the number of isotopes that the model contains and their position + # BaseModel[ 1 ] * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # wrap-doc:Name of the model (needed by Factory) cdef extern from "" namespace "OpenMS::IsotopeModel": cdef enum Averagines "OpenMS::IsotopeModel::Averagines": diff --git a/src/pyOpenMS/pxds/IsotopeWavelet.pxd b/src/pyOpenMS/pxds/IsotopeWavelet.pxd index 2d43742db5f..f2b94ccc4bf 100644 --- a/src/pyOpenMS/pxds/IsotopeWavelet.pxd +++ b/src/pyOpenMS/pxds/IsotopeWavelet.pxd @@ -12,22 +12,58 @@ cdef extern from "" names # IsotopeWavelet * init(double max_m, UInt max_charge) nogil except + # IsotopeWavelet * getInstance() nogil except + - void destroy() nogil except + + void destroy() nogil except + # wrap-doc:Deletes the singleton instance double getValueByMass(double t, double m, UInt z, Int mode) nogil except + + # wrap-doc: + # Returns the value of the isotope wavelet at position `t`. Usually, you do not need to call this function + # ----- + # Note that this functions returns the pure function value of psi and not the normalized (average=0) + # value given by Psi + # ----- + # :param t: The position at which the wavelet has to be drawn (within the coordinate system of the wavelet) + # :param m: The m/z position within the signal (i.e. the mass not de-charged) within the signal + # :param z: The charge `z` we want to detect + # :param mode: Indicates whether positive mode (+1) or negative mode (-1) has been used for ionization + double getValueByLambda(double lambda_, double tz1) nogil except + + # wrap-doc: + # Returns the value of the isotope wavelet at position `t` via a fast table lookup + # ----- + # Usually, you do not need to call this function + # Please use `sampleTheWavelet` instead + # Note that this functions returns the pure function value of psi and not the normalized (average=0) + # value given by Psi + # ----- + # :param lambda: The mass-parameter lambda + # :param tz1: t (the position) times the charge (z) plus 1 + double getValueByLambdaExtrapol(double lambda_, double tz1) nogil except + - double getValueByLambdaExact(double lambda_, double tz1) nogil except + - UInt getMaxCharge() nogil except + - void setMaxCharge(UInt max_charge) nogil except + - double getTableSteps() nogil except + - double getInvTableSteps() nogil except + - void setTableSteps(double table_steps) nogil except + - double getLambdaL(double m) nogil except + - # IsotopeDistribution::ContainerType getAveragine(double m, UInt *size) nogil except + - Size getGammaTableMaxIndex() nogil except + - Size getExpTableMaxIndex() nogil except + - float myPow(float a, float b) nogil except + - UInt getMzPeakCutOffAtMonoPos(double mass, UInt z) nogil except + - UInt getNumPeakCutOff(double mass, UInt z) nogil except + - UInt getNumPeakCutOff(double mz) nogil except + + # wrap-doc: + # Returns the value of the isotope wavelet at position `t` + # ----- + # This function is usually significantly slower than the table lookup performed in @see getValueByLambda + # Nevertheless, it might be necessary to call this function due to extrapolating reasons caused by the + # alignment of the wavelet + # ----- + # Usually, you do not need to call this function + # Please use `sampleTheWavelet` instead + # Note that this functions returns the pure function value of psi and not the normalized (average=0) + # value given by Psi + # ----- + # :param lambda: The mass-parameter lambda + # :param tz1: t (the position) times the charge (z) plus 1 + double getValueByLambdaExact(double lambda_, double tz1) nogil except +# TODO + UInt getMaxCharge() nogil except + # wrap-doc:Returns the largest charge state we will consider + void setMaxCharge(UInt max_charge) nogil except + # wrap-doc:Sets the `max_charge` parameter + double getTableSteps() nogil except + # wrap-doc:Returns the table_steps_ parameter + double getInvTableSteps() nogil except + # wrap-doc:Returns the inv_table_steps_ parameter + void setTableSteps(double table_steps) nogil except + # wrap-doc:Sets the `table_steps` parameter + double getLambdaL(double m) nogil except + # wrap-doc:Returns the mass-parameter lambda (linear fit) + # IsotopeDistribution::ContainerType getAveragine(double m, UInt *size) nogil except + + Size getGammaTableMaxIndex() nogil except + # wrap-doc:Returns the largest possible index for the pre-sampled gamma table + Size getExpTableMaxIndex() nogil except + # wrap-doc:Returns the largest possible index for the pre-sampled exp table + float myPow(float a, float b) nogil except + # wrap-doc:Internally used function; uses register shifts for fast computation of the power function + UInt getMzPeakCutOffAtMonoPos(double mass, UInt z) nogil except +# TODO + UInt getNumPeakCutOff(double mass, UInt z) nogil except +# TODO + UInt getNumPeakCutOff(double mz) nogil except +# TODO diff --git a/src/pyOpenMS/pxds/IsotopeWaveletTransform.pxd b/src/pyOpenMS/pxds/IsotopeWaveletTransform.pxd index 8b599ce2a82..1f34f135192 100644 --- a/src/pyOpenMS/pxds/IsotopeWaveletTransform.pxd +++ b/src/pyOpenMS/pxds/IsotopeWaveletTransform.pxd @@ -17,20 +17,80 @@ cdef extern from "" namespace "OpenMS": cdef cppclass ItraqConstants "OpenMS::ItraqConstants": + # wrap-doc: + # Some constants used throughout iTRAQ classes + # ----- + # Constants for iTRAQ experiments and a ChannelInfo structure to store information about a single channel + ItraqConstants() nogil except + # compiler ItraqConstants(ItraqConstants &) nogil except + # compiler @@ -24,7 +29,28 @@ cdef extern from "" namespace "Op # double ISOTOPECORRECTIONS_TMT_SIXPLEX() StringList getIsotopeMatrixAsStringList(int itraq_type, libcpp_vector[Matrix[double] ] & isotope_corrections) nogil except + + # wrap-doc: + # Convert isotope correction matrix to stringlist + # ----- + # Each line is converted into a string of the format channel:-2Da/-1Da/+1Da/+2Da ; e.g. '114:0/0.3/4/0' + # Useful for creating parameters or debug output + # ----- + # :param itraq_type: Which matrix to stringify. Should be of values from enum ITRAQ_TYPES + # :param isotope_corrections: Vector of the two matrices (4plex, 8plex) + void updateIsotopeMatrixFromStringList(int itraq_type, StringList & channels, libcpp_vector[Matrix[double] ] & isotope_corrections) nogil except + + # wrap-doc: + # Convert strings to isotope correction matrix rows + # ----- + # Each string of format channel:-2Da/-1Da/+1Da/+2Da ; e.g. '114:0/0.3/4/0' + # is parsed and the corresponding channel(row) in the matrix is updated + # Not all channels need to be present, missing channels will be left untouched + # Useful to update the matrix with user isotope correction values + # ----- + # :param itraq_type: Which matrix to stringify. Should be of values from enum ITRAQ_TYPES + # :param channels: New channel isotope values as strings + # :param isotope_corrections: Vector of the two matrices (4plex, 8plex) + # void initChannelMap(int itraq_type, ChannelMapType & map_) nogil except + # void updateChannelMap(StringList & active_channels, ChannelMapType & map_) nogil except + Matrix[ double ] translateIsotopeMatrix(int & itraq_type, libcpp_vector[Matrix[double] ] & isotope_corrections) nogil except + diff --git a/src/pyOpenMS/pxds/ItraqEightPlexQuantitationMethod.pxd b/src/pyOpenMS/pxds/ItraqEightPlexQuantitationMethod.pxd index 3fb1bd12295..fa153be4dba 100644 --- a/src/pyOpenMS/pxds/ItraqEightPlexQuantitationMethod.pxd +++ b/src/pyOpenMS/pxds/ItraqEightPlexQuantitationMethod.pxd @@ -6,6 +6,7 @@ cdef extern from "" namespace "OpenMS": cdef cppclass JavaInfo: - JavaInfo() nogil except + + JavaInfo() nogil except + # wrap-doc:Detect Java and retrieve information JavaInfo(JavaInfo &) nogil except + bool canRun(String java_executable) nogil except + + # wrap-doc: + # Determine if Java is installed and reachable + # ----- + # The call fails if either Java is not installed or if a relative location is given and Java is not on the search PATH + # ----- + # :param java_executable: Path to Java executable. Can be absolute, relative or just a filename + # :returns: Returns false if Java executable can not be called; true if Java executable can be executed diff --git a/src/pyOpenMS/pxds/KDTreeFeatureMaps.pxd b/src/pyOpenMS/pxds/KDTreeFeatureMaps.pxd index 7b0ca77be2b..b4b6ae00f2b 100644 --- a/src/pyOpenMS/pxds/KDTreeFeatureMaps.pxd +++ b/src/pyOpenMS/pxds/KDTreeFeatureMaps.pxd @@ -16,10 +16,10 @@ cdef extern from "" namespace cdef cppclass KDTreeFeatureMaps(DefaultParamHandler) : # wrap-inherits: # DefaultParamHandler - KDTreeFeatureMaps() nogil except + + KDTreeFeatureMaps() nogil except + # wrap-doc:Stores a set of features, together with a 2D tree for fast search KDTreeFeatureMaps(libcpp_vector[ FeatureMap ] & maps, Param & param) nogil except + KDTreeFeatureMaps(libcpp_vector[ ConsensusMap ] & maps, Param & param) nogil except + - void addMaps(libcpp_vector[ FeatureMap ] & maps) nogil except + + void addMaps(libcpp_vector[ FeatureMap ] & maps) nogil except + # wrap-doc:Add `maps` and balance kd-tree void addMaps(libcpp_vector[ ConsensusMap ] & maps) nogil except + # POINTER # void addFeature(Size mt_map_index, BaseFeature * feature) nogil except + # POINTER # BaseFeature * feature(Size i) nogil except + @@ -39,7 +39,7 @@ cdef extern from "" namespace double mz_tol, bool mz_ppm, bool include_features_from_same_map, - double max_pairwise_log_fc) nogil except + + double max_pairwise_log_fc) nogil except + # wrap-doc:Fill `result` with indices of all features compatible (wrt. RT, m/z, map index) to the feature with `index` void queryRegion(double rt_low, double rt_high, double mz_low, double mz_high, libcpp_vector[ size_t ] & result_indices, Size ignored_map_index) nogil except + # void applyTransformations(libcpp_vector[ TransformationModelLowess * ] & trafos) nogil except + diff --git a/src/pyOpenMS/pxds/KroenikFile.pxd b/src/pyOpenMS/pxds/KroenikFile.pxd index 4bae8d94c5e..966552bbc8d 100644 --- a/src/pyOpenMS/pxds/KroenikFile.pxd +++ b/src/pyOpenMS/pxds/KroenikFile.pxd @@ -8,8 +8,29 @@ from Feature cimport * cdef extern from "" namespace "OpenMS": cdef cppclass KroenikFile: + # wrap-doc: + # File adapter for Kroenik (HardKloer sibling) files + # ----- + # The first line is the header and contains the column names: + # File, First Scan, Last Scan, Num of Scans, Charge, Monoisotopic Mass, Base Isotope Peak, Best Intensity, Summed Intensity, First RTime, Last RTime, Best RTime, Best Correlation, Modifications + # ----- + # Every subsequent line is a feature + # ----- + # All properties in the file are converted to Feature properties, whereas "First Scan", "Last Scan", "Num of Scans" and "Modifications" are stored as + # metavalues with the following names "FirstScan", "LastScan", "NumOfScans" and "AveragineModifications" + # ----- + # The width in m/z of the overall convex hull of each feature is set to 3 Th in lack of a value provided by the Kroenik file KroenikFile() nogil except + - void store(String filename, MSSpectrum & spectrum) nogil except + + void store(String filename, MSSpectrum & spectrum) nogil except + # wrap-doc:Stores a MSExperiment into a Kroenik file void load(String filename, FeatureMap & feature_map) nogil except + + # wrap-doc: + # Loads a Kroenik file into a featureXML + # ----- + # The content of the file is stored in `features` + # ----- + # :raises: + # Exception: FileNotFound is thrown if the file could not be opened + # :raises: + # Exception: ParseError is thrown if an error occurs during parsing diff --git a/src/pyOpenMS/pxds/LPWrapper.pxd b/src/pyOpenMS/pxds/LPWrapper.pxd index c2ca5fa123f..7f69a6f6d12 100644 --- a/src/pyOpenMS/pxds/LPWrapper.pxd +++ b/src/pyOpenMS/pxds/LPWrapper.pxd @@ -6,49 +6,77 @@ cdef extern from "" namespace "OpenMS": cdef cppclass LPWrapper "OpenMS::LPWrapper": LPWrapper() nogil except + - Int addRow(libcpp_vector[ int ] row_indices, libcpp_vector[ double ] row_values, const String & name) nogil except + - Int addColumn() nogil except + - Int addColumn(libcpp_vector[ int ] column_indices, libcpp_vector[ double ] column_values, const String & name) nogil except + - Int addRow(libcpp_vector[ int ] & row_indices, libcpp_vector[ double ] & row_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + - Int addColumn(libcpp_vector[ int ] & column_indices, libcpp_vector[ double ] & column_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + - void deleteRow(Int index) nogil except + - void setColumnName(Int index, const String & name) nogil except + - String getColumnName(Int index) nogil except + - String getRowName(Int index) nogil except + - Int getRowIndex(const String & name) nogil except + - Int getColumnIndex(const String & name) nogil except + - double getColumnUpperBound(Int index) nogil except + - double getColumnLowerBound(Int index) nogil except + - double getRowUpperBound(Int index) nogil except + - double getRowLowerBound(Int index) nogil except + - void setRowName(Int index, const String & name) nogil except + - void setColumnBounds(Int index, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + - void setRowBounds(Int index, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + - void setColumnType(Int index, VariableType type_) nogil except + - VariableType getColumnType(Int index) nogil except + - void setObjective(Int index, double obj_value) nogil except + - double getObjective(Int index) nogil except + - void setObjectiveSense(Sense sense) nogil except + + LPWrapper(LPWrapper) nogil except + #wrap-ignore + Int addRow(libcpp_vector[ int ] row_indices, libcpp_vector[ double ] row_values, const String & name) nogil except + # wrap-doc:Adds a row to the LP matrix, returns index + Int addColumn() nogil except + # wrap-doc:Adds an empty column to the LP matrix, returns index + Int addColumn(libcpp_vector[ int ] column_indices, libcpp_vector[ double ] column_values, const String & name) nogil except + # wrap-doc:Adds a column to the LP matrix, returns index + Int addRow(libcpp_vector[ int ] & row_indices, libcpp_vector[ double ] & row_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + # wrap-doc:Adds a row with boundaries to the LP matrix, returns index + Int addColumn(libcpp_vector[ int ] & column_indices, libcpp_vector[ double ] & column_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + # wrap-doc:Adds a column with boundaries to the LP matrix, returns index + void deleteRow(Int index) nogil except + # wrap-doc:Delete index-th row + void setColumnName(Int index, const String & name) nogil except + # wrap-doc:Sets name of the index-th column + String getColumnName(Int index) nogil except + # wrap-doc:Gets name of the index-th column + String getRowName(Int index) nogil except + # wrap-doc:Sets name of the index-th row + Int getRowIndex(const String & name) nogil except + # wrap-doc:Gets index of the row with name + Int getColumnIndex(const String & name) nogil except + # wrap-doc:Gets index of the column with name + double getColumnUpperBound(Int index) nogil except + # wrap-doc:Gets column's upper bound + double getColumnLowerBound(Int index) nogil except + # wrap-doc:Gets column's lower bound + double getRowUpperBound(Int index) nogil except + # wrap-doc:Gets row's upper bound + double getRowLowerBound(Int index) nogil except + # wrap-doc:Gets row's lower bound + void setRowName(Int index, const String & name) nogil except + # wrap-doc:Sets name of the index-th row + void setColumnBounds(Int index, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + # wrap-doc:Set column bounds + void setRowBounds(Int index, double lower_bound, double upper_bound, LPWrapper_Type type_) nogil except + # wrap-doc:Set row bounds + void setColumnType(Int index, VariableType type_) nogil except + # wrap-doc:Set column/variable type. + VariableType getColumnType(Int index) nogil except + # wrap-doc:Get column/variable type. + void setObjective(Int index, double obj_value) nogil except + # wrap-doc:Set objective value for column with index + double getObjective(Int index) nogil except + # wrap-doc:Get objective value for column with index + void setObjectiveSense(Sense sense) nogil except + # wrap-doc:Set objective direction Sense getObjectiveSense() nogil except + - Int getNumberOfColumns() nogil except + - Int getNumberOfRows() nogil except + - void setElement(Int row_index, Int column_index, double value) nogil except + - double getElement(Int row_index, Int column_index) nogil except + + Int getNumberOfColumns() nogil except + # wrap-doc:Get number of columns + Int getNumberOfRows() nogil except + # wrap-doc:Get number of rows + void setElement(Int row_index, Int column_index, double value) nogil except +# TODO + double getElement(Int row_index, Int column_index) nogil except +# TODO void readProblem(String filename, String format_) nogil except + + # wrap-doc: + # Read LP from file + # ----- + # :param filename: Filename where to store the LP problem + # :param format: LP, MPS or GLPK + void writeProblem(const String & filename, WriteFormat format_) nogil except + + # wrap-doc: + # Write LP formulation to a file + # ----- + # :param filename: Output filename, if the filename ends with '.gz' it will be compressed + # :param format: MPS-format is supported by GLPK and COIN-OR; LP and GLPK-formats only by GLPK + Int solve(SolverParam & solver_param, Size verbose_level) nogil except + + # wrap-doc: + # Solve problems, parameters like enabled heuristics can be given via solver_param + # ----- + # The verbose level (0,1,2) determines if the solver prints status messages and internals + # ----- + # :param solver_param: Parameters of the solver introduced by SolverParam + # :param verbose_level: Sets verbose level + # :returns: solver dependent + SolverStatus getStatus() nogil except + + # wrap-doc: + # Get solution status + # ----- + # :returns: status: 1 - undefined, 2 - integer optimal, 3- integer feasible (no optimality proven), 4- no integer feasible solution + double getObjectiveValue() nogil except + double getColumnValue(Int index) nogil except + Int getNumberOfNonZeroEntriesInRow(Int idx) nogil except + void getMatrixRow(Int idx, libcpp_vector[ int ] & indexes) nogil except + - SOLVER getSolver() nogil except + + SOLVER getSolver() nogil except + # wrap-doc:Get currently active solver cdef extern from "" namespace "OpenMS::LPWrapper": cdef cppclass SolverParam "OpenMS::LPWrapper::SolverParam": - SolverParam() nogil except + - SolverParam(SolverParam &) nogil except + + SolverParam() nogil except + # wrap-doc:Hold the parameters of the LP solver + SolverParam(SolverParam) nogil except + #wrap-ignore + Int message_level Int branching_tech Int backtrack_tech diff --git a/src/pyOpenMS/pxds/LabeledPairFinder.pxd b/src/pyOpenMS/pxds/LabeledPairFinder.pxd index 1c5f3c39f7f..2e4f19aa6d8 100644 --- a/src/pyOpenMS/pxds/LabeledPairFinder.pxd +++ b/src/pyOpenMS/pxds/LabeledPairFinder.pxd @@ -5,11 +5,16 @@ from BaseGroupFinder cimport * cdef extern from "" namespace "OpenMS": cdef cppclass LabeledPairFinder(BaseGroupFinder) : + # wrap-doc: + # The LabeledPairFinder allows the matching of labeled features (features with a fixed distance) + # ----- + # Finds feature pairs that have a defined distance in RT and m/z in the same map + # wrap-inherits: # BaseGroupFinder LabeledPairFinder() nogil except + # private LabeledPairFinder(LabeledPairFinder &) nogil except + # wrap-ignore - void run(libcpp_vector[ ConsensusMap ] & input_maps, ConsensusMap & result_map) nogil except + + void run(libcpp_vector[ ConsensusMap ] & input_maps, ConsensusMap & result_map) nogil except + # wrap-doc:Run the LabeledPairFinder algorithm # POINTER # BaseGroupFinder * create() nogil except + - String getProductName() nogil except + + String getProductName() nogil except + # wrap-doc:Returns the name of this module diff --git a/src/pyOpenMS/pxds/LevMarqFitter1D.pxd b/src/pyOpenMS/pxds/LevMarqFitter1D.pxd index 2ff73e9fa37..7dcb59f6e4a 100644 --- a/src/pyOpenMS/pxds/LevMarqFitter1D.pxd +++ b/src/pyOpenMS/pxds/LevMarqFitter1D.pxd @@ -5,5 +5,5 @@ cdef extern from "" name cdef cppclass LevMarqFitter1D(Fitter1D): # wrap-ignore # no-pxd-import - LevMarqFitter1D() nogil except + + LevMarqFitter1D() nogil except + # wrap-doc:Abstract class for 1D-model fitter using Levenberg-Marquardt algorithm for parameter optimization LevMarqFitter1D(LevMarqFitter1D &) nogil except + diff --git a/src/pyOpenMS/pxds/LibSVMEncoder.pxd b/src/pyOpenMS/pxds/LibSVMEncoder.pxd index 9ca3da915d1..e62916eedcb 100644 --- a/src/pyOpenMS/pxds/LibSVMEncoder.pxd +++ b/src/pyOpenMS/pxds/LibSVMEncoder.pxd @@ -6,6 +6,13 @@ from SVMWrapper cimport * cdef extern from "" namespace "OpenMS": cdef cppclass LibSVMEncoder "OpenMS::LibSVMEncoder": + # wrap-doc: + # Serves for encoding sequences into feature vectors + # ----- + # The class can be used to construct composition vectors for + # sequences. Additionally the vectors can be encoded into + # the libsvm format + LibSVMEncoder() nogil except + LibSVMEncoder(LibSVMEncoder &) nogil except + # compiler diff --git a/src/pyOpenMS/pxds/LinearInterpolation.pxd b/src/pyOpenMS/pxds/LinearInterpolation.pxd index 84d906674db..fc495f17b98 100644 --- a/src/pyOpenMS/pxds/LinearInterpolation.pxd +++ b/src/pyOpenMS/pxds/LinearInterpolation.pxd @@ -5,28 +5,48 @@ from Types cimport * cdef extern from "" namespace "OpenMS::Math": cdef cppclass LinearInterpolation[KeyType,ValueType]: + # wrap-doc: + # Provides access to linearly interpolated values (and + # derivatives) from discrete data points. Values beyond the given range + # of data points are implicitly taken as zero. + # ----- + # The input is just a vector of values ("Data"). These are interpreted + # as the y-coordinates at the x-coordinate positions 0,...,data_.size-1. + # ----- + # The interpolated data can also be scaled and shifted in + # the x-dimension by an affine mapping. That is, we have "inside" and + # "outside" x-coordinates. The affine mapping can be specified in two + # ways: + # - using setScale() and setOffset(), + # - using setMapping() + # ----- + # By default the identity mapping (scale=1, offset=0) is used. + # ----- + # Using the value() and derivative() methods you can sample linearly + # interpolated values for a given x-coordinate position of the data and + # the derivative of the data. + # wrap-instances: # LinearInterpolation := LinearInterpolation[double, double] LinearInterpolation() nogil except + LinearInterpolation(LinearInterpolation &) nogil except + - ValueType value(KeyType arg_pos) nogil except + - void addValue(KeyType arg_pos, ValueType arg_value) nogil except + - ValueType derivative(KeyType arg_pos) nogil except + + ValueType value(KeyType arg_pos) nogil except + # wrap-doc:Returns the interpolated value + void addValue(KeyType arg_pos, ValueType arg_value) nogil except + # wrap-doc:Performs linear resampling. The `arg_value` is split up and added to the data points around `arg_pos` + ValueType derivative(KeyType arg_pos) nogil except + # wrap-doc:Returns the interpolated derivative - libcpp_vector[ValueType] getData() nogil except + - void setData(libcpp_vector[ValueType] & data) nogil except + - bool empty() nogil except + - KeyType key2index(KeyType pos) nogil except + - KeyType index2key(KeyType pos) nogil except + - KeyType getScale() nogil except + - void setScale(KeyType & scale) nogil except + - KeyType getOffset() nogil except + - void setOffset(KeyType & offset) nogil except + - void setMapping(KeyType & scale, KeyType & inside, KeyType & outside) nogil except + - void setMapping(KeyType & inside_low, KeyType & outside_low, KeyType & inside_high, KeyType & outside_high) nogil except + - KeyType getInsideReferencePoint() nogil except + + libcpp_vector[ValueType] getData() nogil except + # wrap-doc:Returns the internal random access container from which interpolated values are being sampled + void setData(libcpp_vector[ValueType] & data) nogil except + # wrap-doc:Assigns data to the internal random access container from which interpolated values are being sampled + bool empty() nogil except + # wrap-doc:Returns `true` if getData() is empty + KeyType key2index(KeyType pos) nogil except + # wrap-doc:The transformation from "outside" to "inside" coordinates + KeyType index2key(KeyType pos) nogil except + # wrap-doc:The transformation from "inside" to "outside" coordinates + KeyType getScale() nogil except + # wrap-doc:"Scale" is the difference (in "outside" units) between consecutive entries in "Data" + void setScale(KeyType & scale) nogil except + # wrap-doc:"Scale" is the difference (in "outside" units) between consecutive entries in "Data" + KeyType getOffset() nogil except + # wrap-doc:"Offset" is the point (in "outside" units) which corresponds to "Data[0]" + void setOffset(KeyType & offset) nogil except + # wrap-doc:"Offset" is the point (in "outside" units) which corresponds to "Data[0]" + void setMapping(KeyType & scale, KeyType & inside, KeyType & outside) nogil except +# TODO + void setMapping(KeyType & inside_low, KeyType & outside_low, KeyType & inside_high, KeyType & outside_high) nogil except +# TODO + KeyType getInsideReferencePoint() nogil except + KeyType getOutsideReferencePoint() nogil except + KeyType supportMin() nogil except + KeyType supportMax() nogil except + LinearInterpolation(KeyType scale, KeyType offset) nogil except + - diff --git a/src/pyOpenMS/pxds/LinearResampler.pxd b/src/pyOpenMS/pxds/LinearResampler.pxd index 27f8a4b201a..78ef4e61ec5 100644 --- a/src/pyOpenMS/pxds/LinearResampler.pxd +++ b/src/pyOpenMS/pxds/LinearResampler.pxd @@ -15,6 +15,5 @@ cdef extern from "" namespace " LinearResampler() nogil except + LinearResampler(LinearResampler &) nogil except + # compiler - void raster(MSSpectrum & input) nogil except + - void rasterExperiment(MSExperiment & input) nogil except + - + void raster(MSSpectrum & input) nogil except + # wrap-doc:Applies the resampling algorithm to an MSSpectrum + void rasterExperiment(MSExperiment & input) nogil except + # wrap-doc:Resamples the data in an MSExperiment diff --git a/src/pyOpenMS/pxds/LocalLinearMap.pxd b/src/pyOpenMS/pxds/LocalLinearMap.pxd index 53b6dc6206f..ef9872c8be8 100644 --- a/src/pyOpenMS/pxds/LocalLinearMap.pxd +++ b/src/pyOpenMS/pxds/LocalLinearMap.pxd @@ -5,16 +5,31 @@ from Matrix cimport * cdef extern from "" namespace "OpenMS": cdef cppclass LocalLinearMap "OpenMS::LocalLinearMap": + # wrap-doc: + # Trained Local Linear Map (LLM) model for peak intensity prediction + # ----- + # This class offers a model for predictions of peptide peak heights + # (referred to as intensities) by a Local Linear Map (LLM) model and + # is the basis of PeakIntensityPredictor + # ----- + # A general introduction to the Peak Intensity Predictor (PIP) + # can be found in the PIP Tutorial + # ----- + # The model trained needs two files for storing the position of the + # codebook vectors and the linear mappings (codebooks.data, linearMapping.data) + # This is the default model used by PeakIntensityPredictor + LocalLinearMap() nogil except + # private LocalLinearMap(LocalLinearMap &) nogil except + # wrap-ignore - LLMParam getLLMParam() nogil except + - Matrix[ double ] getCodebooks() nogil except + - Matrix[ double ] getMatrixA() nogil except + - libcpp_vector[ double ] getVectorWout() nogil except + + LLMParam getLLMParam() nogil except + # wrap-doc:Return parameters of the LocalLinearMap model + Matrix[ double ] getCodebooks() nogil except + # wrap-doc:Return position of the codebook vectors (18-dim) + Matrix[ double ] getMatrixA() nogil except + # wrap-doc:Return linear mappings of the codebooks + libcpp_vector[ double ] getVectorWout() nogil except + # wrap-doc:Return linear bias + # TODO STL attributes unsigned int # Matrix[ UInt ] getCord() nogil except + - void normalizeVector(libcpp_vector[ double ] & aaIndexVariables) nogil except + + void normalizeVector(libcpp_vector[ double ] & aaIndexVariables) nogil except + # wrap-doc:Calculate and return normalized amino acid index variables from string representation of peptide # libcpp_vector[ double ] neigh(Matrix[ unsigned int ] & cord, Size win, double radius) nogil except + @@ -26,4 +41,3 @@ cdef extern from "" namespace "OpenMS::Loc UInt xdim UInt ydim double radius - diff --git a/src/pyOpenMS/pxds/LowessSmoothing.pxd b/src/pyOpenMS/pxds/LowessSmoothing.pxd index 53474a3942d..15703e58400 100644 --- a/src/pyOpenMS/pxds/LowessSmoothing.pxd +++ b/src/pyOpenMS/pxds/LowessSmoothing.pxd @@ -16,5 +16,5 @@ cdef extern from "" namespace "Ope void smoothData(libcpp_vector[double] x, libcpp_vector[double] y, - libcpp_vector[double] & y_smoothed) nogil except + + libcpp_vector[double] & y_smoothed) nogil except + # wrap-doc:Smoothing method that receives x and y coordinates (e.g., RT and intensities) and computes smoothed intensities diff --git a/src/pyOpenMS/pxds/MRMAssay.pxd b/src/pyOpenMS/pxds/MRMAssay.pxd index 3be8197a93e..fb45405c9e3 100644 --- a/src/pyOpenMS/pxds/MRMAssay.pxd +++ b/src/pyOpenMS/pxds/MRMAssay.pxd @@ -21,21 +21,62 @@ cdef extern from "" namespace "OpenMS": bool enable_specific_losses, bool enable_unspecific_losses, int round_decPow) nogil except + + # wrap-doc: + # Annotates and filters transitions in a TargetedExperiment + # ----- + # :param exp: The input, unfiltered transitions + # :param precursor_mz_threshold: The precursor m/z threshold in Th for annotation + # :param product_mz_threshold: The product m/z threshold in Th for annotation + # :param fragment_types: The fragment types to consider for annotation + # :param fragment_charges: The fragment charges to consider for annotation + # :param enable_specific_losses: Whether specific neutral losses should be considered + # :param enable_unspecific_losses: Whether unspecific neutral losses (H2O1, H3N1, C1H2N2, C1H2N1O1) should be considered + # :param round_decPow: Round product m/z values to decimal power (default: -4) void restrictTransitions(TargetedExperiment & exp, double lower_mz_limit, double upper_mz_limit, libcpp_vector[ libcpp_pair[ double, double ] ] swathes) nogil except + + # wrap-doc: + # Restrict and filter transitions in a TargetedExperiment + # ----- + # :param exp: The input, unfiltered transitions + # :param lower_mz_limit: The lower product m/z limit in Th + # :param upper_mz_limit: The upper product m/z limit in Th + # :param swathes: The swath window settings (to exclude fragment ions falling into the precursor isolation window) void detectingTransitions(TargetedExperiment & exp, int min_transitions, int max_transitions) nogil except + + # wrap-doc: + # Select detecting fragment ions + # ----- + # :param exp: The input, unfiltered transitions + # :param min_transitions: The minimum number of transitions required per assay + # :param max_transitions: The maximum number of transitions required per assay void filterMinMaxTransitionsCompound(TargetedExperiment & exp, int min_transitions, int max_transitions) nogil except + + # wrap-doc: + # Filters target and decoy transitions by intensity, only keeping the top N transitions + # ----- + # :param exp: The transition list which will be filtered + # :param min_transitions: The minimum number of transitions required per assay (targets only) + # :param max_transitions: The maximum number of transitions allowed per assay void filterUnreferencedDecoysCompound(TargetedExperiment & exp) nogil except + + # wrap-doc: + # Filters decoy transitions, which do not have respective target transition + # based on the transitionID. + # ----- + # References between targets and decoys will be constructed based on the transitionsID + # and the "_decoy_" string. For example: + # ----- + # target: 84_CompoundName_[M+H]+_88_22 + # decoy: 84_CompoundName_decoy_[M+H]+_88_22 + # ----- + # :param exp: The transition list which will be filtered void uisTransitions(TargetedExperiment & exp, libcpp_vector[ String ] fragment_types, @@ -48,4 +89,36 @@ cdef extern from "" namespace "OpenMS": int round_decPow, size_t max_num_alternative_localizations, int shuffle_seed) nogil except + + # wrap-doc: + # Annotate UIS / site-specific transitions + # ----- + # Performs the following actions: + # ----- + # - Step 1: For each peptide, compute all theoretical alternative peptidoforms; see transitions generateTargetInSilicoMap_() + # - Step 2: Generate target identification transitions; see generateTargetAssays_() + # ----- + # - Step 3a: Generate decoy sequences that share peptidoform properties with targets; see generateDecoySequences_() + # - Step 3b: Generate decoy in silico peptide map containing theoretical transition; see generateDecoyInSilicoMap_() + # - Step 4: Generate decoy identification transitions; see generateDecoyAssays_() + # ----- + # The IPF algorithm uses the concept of "identification transitions" that + # are used to discriminate different peptidoforms, these are generated in + # this function. In brief, the algorithm takes the existing set of + # peptides and transitions and then appends these "identification + # transitions" for targets and decoys. The novel transitions are set to be + # non-detecting and non-quantifying and are annotated with the set of + # peptidoforms to which they map. + # ----- + # :param exp: The input, unfiltered transitions + # :param fragment_types: The fragment types to consider for annotation + # :param fragment_charges: The fragment charges to consider for annotation + # :param enable_specific_losses: Whether specific neutral losses should be considered + # :param enable_unspecific_losses: Whether unspecific neutral losses (H2O1, H3N1, C1H2N2, C1H2N1O1) should be considered + # :param enable_ms2_precursors: Whether MS2 precursors should be considered + # :param mz_threshold: The product m/z threshold in Th for annotation + # :param swathes: The swath window settings (to exclude fragment ions falling + # :param round_decPow: Round product m/z values to decimal power (default: -4) + # :param max_num_alternative_localizations: Maximum number of allowed peptide sequence permutations + # :param shuffle_seed: Set seed for shuffle (-1: select seed based on time) + # :param disable_decoy_transitions: Whether to disable generation of decoy UIS transitions diff --git a/src/pyOpenMS/pxds/MRMDecoy.pxd b/src/pyOpenMS/pxds/MRMDecoy.pxd index a5c926592c6..b80ec99123b 100644 --- a/src/pyOpenMS/pxds/MRMDecoy.pxd +++ b/src/pyOpenMS/pxds/MRMDecoy.pxd @@ -28,9 +28,37 @@ cdef extern from "" namespace "OpenMS": bool enable_specific_losses, bool enable_unspecific_losses, int round_decPow) nogil except + + # wrap-doc: + # Generate decoys from a TargetedExperiment + # ----- + # Will generate decoy peptides for each target peptide provided in exp and + # write them into the decoy experiment + # ----- + # Valid methods: shuffle, reverse, pseudo-reverse + # ----- + # If theoretical is true, the target transitions will be returned but their + # masses will be adjusted to match the theoretical value of the fragment ion + # that is the most likely explanation for the product + # ----- + # `mz_threshold` is used for the matching of theoretical ion series to the observed one + # ----- + # To generate decoys with different precursor mass, use the "switchKR" flag + # which switches terminal K/R (switches K to R and R to K). This generates + # different precursor m/z and ensures that the y ion series has a different + # mass. For a description of the procedure, see (supplemental material) + # ----- + # Bruderer et al. Mol Cell Proteomics. 2017. 10.1074/mcp.RA117.000314. + libcpp_vector[size_t] findFixedResidues(const String & sequence, bool keepN, bool keepC, const String & keep_const_pattern) nogil except + + # wrap-doc: + # Find all residues in a sequence that should not be reversed / shuffled + # ----- + # :param sequence: The amino acid sequence + # :param keepN: Whether to keep N terminus constant + # :param keepC: Whether to keep C terminus constant + # :param keep_const_pattern: A string containing the AA to not change (e.g. 'KRP') diff --git a/src/pyOpenMS/pxds/MRMFeature.pxd b/src/pyOpenMS/pxds/MRMFeature.pxd index c2c83b1f366..29612fe33a8 100644 --- a/src/pyOpenMS/pxds/MRMFeature.pxd +++ b/src/pyOpenMS/pxds/MRMFeature.pxd @@ -14,17 +14,17 @@ cdef extern from "" namespace "OpenMS": MRMFeature() nogil except + MRMFeature(MRMFeature &) nogil except + - OpenSwath_Scores getScores() nogil except + - void setScores(OpenSwath_Scores s) nogil except + + OpenSwath_Scores getScores() nogil except + # wrap-doc:Get all peakgroup scores + void setScores(OpenSwath_Scores s) nogil except + # wrap-doc:Set all peakgroup scores - Feature getFeature(String key) nogil except + - void addFeature(Feature & f, String key) nogil except + + Feature getFeature(String key) nogil except + # wrap-doc:Get a specified feature + void addFeature(Feature & f, String key) nogil except + # wrap-doc:Adds an feature from a single chromatogram into the feature libcpp_vector[Feature] getFeatures() nogil except + - void getFeatureIDs(libcpp_vector[String] & result) nogil except + + void getFeatureIDs(libcpp_vector[String] & result) nogil except + # wrap-doc:Get a list of IDs of available features - Feature getPrecursorFeature(String key) nogil except + - void addPrecursorFeature(Feature & f, String key) nogil except + - void getPrecursorFeatureIDs(libcpp_vector[String] & result) nogil except + + Feature getPrecursorFeature(String key) nogil except + # wrap-doc:Get a specified precursor feature + void addPrecursorFeature(Feature & f, String key) nogil except + # wrap-doc:Adds a precursor feature from a single chromatogram into the feature + void getPrecursorFeatureIDs(libcpp_vector[String] & result) nogil except + # wrap-doc:Get a list of IDs of available precursor features bool operator==(MRMFeature) nogil except + bool operator!=(MRMFeature) nogil except + diff --git a/src/pyOpenMS/pxds/MRMFeatureFilter.pxd b/src/pyOpenMS/pxds/MRMFeatureFilter.pxd index 1cc1dc5aaf9..e43f96506c6 100644 --- a/src/pyOpenMS/pxds/MRMFeatureFilter.pxd +++ b/src/pyOpenMS/pxds/MRMFeatureFilter.pxd @@ -14,6 +14,12 @@ cdef extern from "" namespace "Ope MRMFeatureFilter(MRMFeatureFilter &) nogil except + # compiler void FilterFeatureMap(FeatureMap features, MRMFeatureQC filter_criteria, TargetedExperiment transitions) nogil except + + # wrap-doc: + # Flags or filters features and subordinates in a FeatureMap + # ----- + # :param features: FeatureMap to flag or filter + # :param filter_criteria: MRMFeatureQC class defining QC parameters + # :param transitions: Transitions from a TargetedExperiment # could add support for other members if needed # however, they are only used internally for now diff --git a/src/pyOpenMS/pxds/MRMFeatureFinderScoring.pxd b/src/pyOpenMS/pxds/MRMFeatureFinderScoring.pxd index e4285912bfc..f43bc471025 100644 --- a/src/pyOpenMS/pxds/MRMFeatureFinderScoring.pxd +++ b/src/pyOpenMS/pxds/MRMFeatureFinderScoring.pxd @@ -38,6 +38,16 @@ cdef extern from "" namespa TargetedExperiment & transition_exp_, TransformationDescription trafo, MSExperiment & swath_map) nogil except + + # wrap-doc: + # Pick features in one experiment containing chromatogram + # ----- + # Function for for wrapping in Python, only uses OpenMS datastructures and does not return the map + # ----- + # :param chromatograms: The input chromatograms + # :param output: The output features with corresponding scores + # :param transition_exp: The transition list describing the experiment + # :param trafo: Optional transformation of the experimental retention time to the normalized retention time space used in the transition list + # :param swath_map: Optional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted ## void pickExperiment(shared_ptr[ SpectrumAccessOpenMS ] input_chrom, ## FeatureMap& output, @@ -59,8 +69,29 @@ cdef extern from "" namespa libcpp_vector[ SwathMap ] swath_maps, FeatureMap& output, bool ms1only) nogil except + + # wrap-doc: + # Score all peak groups of a transition group + # ----- + # Iterate through all features found along the chromatograms of the transition group and score each one individually + # ----- + # :param transition_group: The MRMTransitionGroup to be scored (input) + # :param trafo: Optional transformation of the experimental retention time + # to the normalized retention time space used in the + # transition list + # :param swath_maps: Optional SWATH-MS (DIA) map corresponding from which + # the chromatograms were extracted. Use empty map if no + # data is available + # :param output: The output features with corresponding scores (the found + # features will be added to this FeatureMap) + # :param ms1only: Whether to only do MS1 scoring and skip all MS2 scoring void prepareProteinPeptideMaps_(LightTargetedExperiment& transition_exp) nogil except + + # wrap-doc: + # Prepares the internal mappings of peptides and proteins + # ----- + # Calling this method _is_ required before calling scorePeakgroups + # ----- + # :param transition_exp: The transition list describing the experiment # # void mapExperimentToTransitionList(OpenSwath::SpectrumAccessPtr input, LightTargetedExperiment transition_exp, # # TransitionGroupMapType& transition_group_map, diff --git a/src/pyOpenMS/pxds/MRMFeaturePickerFile.pxd b/src/pyOpenMS/pxds/MRMFeaturePickerFile.pxd index 96d3894c181..1e0e7b29be2 100644 --- a/src/pyOpenMS/pxds/MRMFeaturePickerFile.pxd +++ b/src/pyOpenMS/pxds/MRMFeaturePickerFile.pxd @@ -5,8 +5,38 @@ from Types cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MRMFeaturePickerFile: + # wrap-doc: + # _MRMFeaturePickerFile_ loads components and components groups parameters from a .csv file + # ----- + # The structures defined in [MRMFeaturePicker](@ref MRMFeaturePicker) are used + # ----- + # It is required that columns `component_name` and `component_group_name` are present. + # Lines whose `component_name`'s or `component_group_name`'s value is an empty string, will be skipped. + # The class supports the absence of information within other columns. + # ----- + # A reduced example of the expected format (fewer columns are shown here): + # > component_name,component_group_name,TransitionGroupPicker:stop_after_feature,TransitionGroupPicker:PeakPickerMRM:sgolay_frame_length + # > arg-L.arg-L_1.Heavy,arg-L,2,15 + # > arg-L.arg-L_1.Light,arg-L,2,17 + # > orn.orn_1.Heavy,orn,3,21 + # > orn.orn_1.Light,orn,3,13 MRMFeaturePickerFile() nogil except + MRMFeaturePickerFile(MRMFeaturePickerFile &) nogil except + # compiler void load(const String& filename, libcpp_vector[MRMFP_ComponentParams]& cp_list, libcpp_vector[MRMFP_ComponentGroupParams]& cgp_list) nogil except + + # wrap-doc: + # Loads the file's data and saves it into vectors of `ComponentParams` and `ComponentGroupParams` + # ----- + # The file is expected to contain at least two columns: `component_name` and `component_group_name`. Otherwise, + # an exception is thrown + # ----- + # If a component group (identified by its name) is found multiple times, only the first one is saved + # ----- + # :param filename: Path to the .csv input file + # :param cp_list: Component params are saved in this list + # :param cgp_list: Component Group params are saved in this list + # :raises: + # Exception: MissingInformation If the required columns are not found + # :raises: + # Exception: FileNotFound If input file is not found diff --git a/src/pyOpenMS/pxds/MRMFeatureQCFile.pxd b/src/pyOpenMS/pxds/MRMFeatureQCFile.pxd index 4fe95439c05..d1ce947f9c7 100644 --- a/src/pyOpenMS/pxds/MRMFeatureQCFile.pxd +++ b/src/pyOpenMS/pxds/MRMFeatureQCFile.pxd @@ -4,9 +4,25 @@ from MRMFeatureQC cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MRMFeatureQCFile: + # wrap-doc: + # File adapter for MRMFeatureQC files + # ----- + # Loads and stores .csv or .tsv files describing an MRMFeatureQC MRMFeatureQCFile() nogil except + MRMFeatureQCFile(MRMFeatureQCFile &) nogil except + # compiler void load(const String& filename, MRMFeatureQC& mrmfqc, const bool is_component_group) nogil except + + # wrap-doc: + # Loads an MRMFeatureQC file + # ----- + # :param filename: The path to the input file + # :param mrmfqc: The output class which will contain the criteria + # :param is_component_group: True if the user intends to load ComponentGroupQCs data, false otherwise + # ----- + # :raises: + # Exception: FileNotFound is thrown if the file could not be opened + # :raises: + # Exception: ParseError is thrown if an error occurs during parsing + # void store(String filename, MRMFeatureQC mrmfqc) nogil except + diff --git a/src/pyOpenMS/pxds/MRMFragmentSelection.pxd b/src/pyOpenMS/pxds/MRMFragmentSelection.pxd index 9af7a1ab1e7..f5014709734 100644 --- a/src/pyOpenMS/pxds/MRMFragmentSelection.pxd +++ b/src/pyOpenMS/pxds/MRMFragmentSelection.pxd @@ -11,5 +11,6 @@ cdef extern from "" namespace "OpenM # DefaultParamHandler MRMFragmentSelection() nogil except + MRMFragmentSelection(MRMFragmentSelection&) nogil except + - void selectFragments(libcpp_vector[ Peak1D ] & selected_peaks, MSSpectrum & spec) nogil except + + void selectFragments(libcpp_vector[ Peak1D ] & selected_peaks, MSSpectrum & spec) nogil except + # wrap-doc:Selects accordingly to the parameters the best peaks of spec and writes them into `selected_peaks` + diff --git a/src/pyOpenMS/pxds/MRMIonSeries.pxd b/src/pyOpenMS/pxds/MRMIonSeries.pxd index 51850409be2..cea13c8f2ab 100644 --- a/src/pyOpenMS/pxds/MRMIonSeries.pxd +++ b/src/pyOpenMS/pxds/MRMIonSeries.pxd @@ -17,6 +17,11 @@ cdef extern from "" namespace "OpenMS" ## libcpp_pair[ String, double ] annotateIon(IonSeries ionseries, double ProductMZ, double mz_threshold) nogil except + void annotateTransitionCV(ReactionMonitoringTransition & tr, String annotation) nogil except + + # wrap-doc: + # Annotates transition with CV terms + # ----- + # :param tr: The transition to annotate + # :param annotation: The fragment ion annotation void annotateTransition(ReactionMonitoringTransition & tr, Peptide peptide, double @@ -26,6 +31,19 @@ cdef extern from "" namespace "OpenMS" libcpp_vector[ size_t ] fragment_charges, bool enable_specific_losses, bool enable_unspecific_losses, int round_decPow) nogil except + + # wrap-doc: + # Annotates transition + # ----- + # :param tr: The transition to annotate + # :param peptide: The corresponding peptide + # :param precursor_mz_threshold: The m/z threshold for annotation of the precursor ion + # :param product_mz_threshold: The m/z threshold for annotation of the fragment ion + # :param enable_reannotation: Whether the original (e.g. SpectraST) annotation should be used or reannotation should be conducted + # :param fragment_types: The fragment ion types for reannotation + # :param fragment_charges: The fragment ion charges for reannotation + # :param enable_specific_losses: Whether specific neutral losses should be considered + # :param enable_unspecific_losses: Whether unspecific neutral losses (H2O1, H3N1, C1H2N2, C1H2N1O1) should be considered + # :param round_decPow: Round precursor and product m/z values to decimal power (default: -4) ## IonSeries getIonSeries(AASequence sequence, size_t precursor_charge, ## libcpp_vector[ String ] fragment_types, diff --git a/src/pyOpenMS/pxds/MRMMapping.pxd b/src/pyOpenMS/pxds/MRMMapping.pxd index c3da7b4e79f..1cbf057f0b5 100644 --- a/src/pyOpenMS/pxds/MRMMapping.pxd +++ b/src/pyOpenMS/pxds/MRMMapping.pxd @@ -13,4 +13,23 @@ cdef extern from "" namespace "OpenMS": MRMMapping(MRMMapping) nogil except + #wrap-ignore void mapExperiment(MSExperiment input_chromatograms, TargetedExperiment targeted_exp, MSExperiment& output) nogil except + - + # wrap-doc: + # Maps input chromatograms to assays in a targeted experiment + # ----- + # The output chromatograms are an annotated copy of the input chromatograms + # with native id, precursor information and peptide sequence (if available) + # annotated in the chromatogram files + # ----- + # The algorithm tries to match a given set of chromatograms and targeted + # assays. It iterates through all the chromatograms retrieves one or more + # matching targeted assay for the chromatogram. By default, the algorithm + # assumes that a 1:1 mapping exists. If a chromatogram cannot be mapped + # (does not have a corresponding assay) the algorithm issues a warning, the + # user can specify that the program should abort in such a case (see + # error_on_unmapped) + # ----- + # :note If multiple mapping is enabled (see map_multiple_assays parameter) + # then each mapped assay will get its own chromatogram that contains the + # same raw data but different meta-annotation. This *can* be useful if the + # same transition is used to monitor multiple analytes but may also + # indicate a problem with too wide mapping tolerances diff --git a/src/pyOpenMS/pxds/MRMScoring.pxd b/src/pyOpenMS/pxds/MRMScoring.pxd index aadb6ca8b6b..cad5e7a66e6 100644 --- a/src/pyOpenMS/pxds/MRMScoring.pxd +++ b/src/pyOpenMS/pxds/MRMScoring.pxd @@ -17,15 +17,40 @@ cdef extern from "" namespace "OpenSwath # TODO create class for XCorrMatrix # XCorrMatrixType getXCorrMatrix() nogil except + # NAMESPACE # # POINTER # void initializeXCorrMatrix(OpenSwath::IMRMFeature * mrmfeature, OpenSwath::ITransitionGroup * transition_group, bool normalize) nogil except + - double calcXcorrCoelutionScore() nogil except + + double calcXcorrCoelutionScore() nogil except + # wrap-doc:Calculate the cross-correlation coelution score. The score is a distance where zero indicates perfect coelution double calcXcorrCoelutionWeightedScore(libcpp_vector[ double ] & normalized_library_intensity) nogil except + - libcpp_vector[ double ] calcSeparateXcorrContrastCoelutionScore() nogil except + + # wrap-doc: + # Calculate the weighted cross-correlation coelution score + # ----- + # The score is a distance where zero indicates perfect coelution. The + # score is weighted by the transition intensities, non-perfect coelution + # in low-intensity transitions should thus become less important + + libcpp_vector[ double ] calcSeparateXcorrContrastCoelutionScore() nogil except + # wrap-doc:Calculate the separate cross-correlation contrast score double calcXcorrPrecursorContrastCoelutionScore() nogil except + + # wrap-doc: + # Calculate the precursor cross-correlation contrast score against the transitions + # ----- + # The score is a distance where zero indicates perfect coelution double calcXcorrShapeScore() nogil except + + # wrap-doc: + # Calculate the cross-correlation shape score + # ----- + # The score is a correlation measure where 1 indicates perfect correlation + # and 0 means no correlation. + double calcXcorrShapeWeightedScore(libcpp_vector[ double ] & normalized_library_intensity) nogil except + - libcpp_vector[ double ] calcSeparateXcorrContrastShapeScore() nogil except + - double calcXcorrPrecursorContrastShapeScore() nogil except + + # wrap-doc: + # Calculate the weighted cross-correlation shape score + # ----- + # The score is a correlation measure where 1 indicates perfect correlation + # and 0 means no correlation. The score is weighted by the transition + # intensities, non-perfect coelution in low-intensity transitions should + # thus become less important + + libcpp_vector[ double ] calcSeparateXcorrContrastShapeScore() nogil except + # wrap-doc:Calculate the separate cross-correlation contrast shape score + double calcXcorrPrecursorContrastShapeScore() nogil except + # wrap-doc:Calculate the precursor cross-correlation shape score against the transitions # NAMESPACE # # POINTER # void calcLibraryScore(OpenSwath::IMRMFeature * mrmfeature, libcpp_vector[ TransitionType ] & transitions, double & correlation, double & rmsd, double & manhattan, double & dotprod) nogil except + double calcRTScore(LightCompound & peptide, double normalized_experimental_rt) nogil except + diff --git a/src/pyOpenMS/pxds/MRMTransitionGroup.pxd b/src/pyOpenMS/pxds/MRMTransitionGroup.pxd index 83881a07d83..9fbddb4086f 100644 --- a/src/pyOpenMS/pxds/MRMTransitionGroup.pxd +++ b/src/pyOpenMS/pxds/MRMTransitionGroup.pxd @@ -16,7 +16,7 @@ cdef extern from "" namespace "OpenMS": # MRMTransitionGroupCP := MRMTransitionGroup[MSChromatogram, ReactionMonitoringTransition] # LightMRMTransitionGroupCP := MRMTransitionGroup[MSChromatogram, LightTransition] - MRMTransitionGroup() nogil except + + MRMTransitionGroup() nogil except +# TODO(whole file) MRMTransitionGroup(MRMTransitionGroup[SpectrumT, TransitionT] &) nogil except + Size size() nogil except+ diff --git a/src/pyOpenMS/pxds/MSChromatogram.pxd b/src/pyOpenMS/pxds/MSChromatogram.pxd index 66e56b8ce1d..1a8bb6cebbb 100644 --- a/src/pyOpenMS/pxds/MSChromatogram.pxd +++ b/src/pyOpenMS/pxds/MSChromatogram.pxd @@ -30,11 +30,11 @@ cdef extern from "" namespace "OpenMS": MSChromatogram() nogil except + MSChromatogram(MSChromatogram &) nogil except + - double getMZ() nogil except + #wrap-doc:returns the mz of the product entry, makes sense especially for MRM scans + double getMZ() nogil except + # wrap-doc:Returns the mz of the product entry, makes sense especially for MRM scans # void setMZ(double) nogil except + - String getName() nogil except + - void setName(String) nogil except + + String getName() nogil except + # wrap-doc:Returns the name + void setName(String) nogil except + # wrap-doc:Sets the name Size size() nogil except + void reserve(size_t n) nogil except + @@ -43,24 +43,47 @@ cdef extern from "" namespace "OpenMS": void updateRanges() nogil except + void clear(int) nogil except + - void push_back(ChromatogramPeak) nogil except + #wrap-doc:Append a peak + # wrap-doc: + # Clears all data and meta data + # ----- + # :param clear_meta_data: If true, all meta data is cleared in addition to the data - bool isSorted() nogil except + + void push_back(ChromatogramPeak) nogil except + # wrap-doc:Append a peak + + bool isSorted() nogil except + # wrap-doc:Checks if all peaks are sorted with respect to ascending RT void sortByIntensity(bool reverse) nogil except + + # wrap-doc: + # Lexicographically sorts the peaks by their intensity + # ----- + # Sorts the peaks according to ascending intensity. Meta data arrays will be sorted accordingly + void sortByPosition() nogil except + + # wrap-doc: + # Lexicographically sorts the peaks by their position + # ----- + # The chromatogram is sorted with respect to position. Meta data arrays will be sorted accordingly - int findNearest(double) nogil except+ + int findNearest(double) nogil except + + # wrap-doc: + # Binary search for the peak nearest to a specific RT + # ----- + # :param rt: The searched for mass-to-charge ratio searched + # :returns: Returns the index of the peak. + # ----- + # :note: Make sure the chromatogram is sorted with respect to RT! Otherwise the result is undefined + # ----- + # :raises: + # Exception: Precondition is thrown if the chromatogram is empty (not only in debug mode) void assign(libcpp_vector[ChromatogramPeak].iterator, libcpp_vector[ChromatogramPeak].iterator) nogil except + # wrap-ignore libcpp_vector[ChromatogramPeak].iterator begin() nogil except + # wrap-iter-begin:__iter__(ChromatogramPeak) libcpp_vector[ChromatogramPeak].iterator end() nogil except + # wrap-iter-end:__iter__(ChromatogramPeak) - libcpp_vector[FloatDataArray] getFloatDataArrays() nogil except + - libcpp_vector[IntegerDataArray] getIntegerDataArrays() nogil except + - libcpp_vector[StringDataArray] getStringDataArrays() nogil except + - - void setFloatDataArrays(libcpp_vector[FloatDataArray] fda) nogil except + - void setIntegerDataArrays(libcpp_vector[IntegerDataArray] ida) nogil except + - void setStringDataArrays(libcpp_vector[StringDataArray] sda) nogil except + + libcpp_vector[FloatDataArray] getFloatDataArrays() nogil except + # wrap-doc:Returns a reference to the float meta data arrays + libcpp_vector[IntegerDataArray] getIntegerDataArrays() nogil except + # wrap-doc:Returns a reference to the integer meta data arrays + libcpp_vector[StringDataArray] getStringDataArrays() nogil except + # wrap-doc:Returns a reference to the string meta data arrays + void setFloatDataArrays(libcpp_vector[FloatDataArray] fda) nogil except + # wrap-doc:Sets the float meta data arrays + void setIntegerDataArrays(libcpp_vector[IntegerDataArray] ida) nogil except + # wrap-doc:Sets the integer meta data arrays + void setStringDataArrays(libcpp_vector[StringDataArray] sda) nogil except + # wrap-doc:Sets the string meta data arrays diff --git a/src/pyOpenMS/pxds/MSDataAggregatingConsumer.pxd b/src/pyOpenMS/pxds/MSDataAggregatingConsumer.pxd index 8e7d6646191..d47259b2037 100644 --- a/src/pyOpenMS/pxds/MSDataAggregatingConsumer.pxd +++ b/src/pyOpenMS/pxds/MSDataAggregatingConsumer.pxd @@ -9,7 +9,7 @@ cdef extern from "" namesp MSDataAggregatingConsumer(MSDataAggregatingConsumer &) nogil except + # compiler - void consumeSpectrum(MSSpectrum & s) nogil except + + void consumeSpectrum(MSSpectrum & s) nogil except +# TODO(whole file) void consumeChromatogram(MSChromatogram & ) nogil except + void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) nogil except + diff --git a/src/pyOpenMS/pxds/MSDataCachedConsumer.pxd b/src/pyOpenMS/pxds/MSDataCachedConsumer.pxd index 95f82c1c5df..220351f24d6 100644 --- a/src/pyOpenMS/pxds/MSDataCachedConsumer.pxd +++ b/src/pyOpenMS/pxds/MSDataCachedConsumer.pxd @@ -5,6 +5,13 @@ from ExperimentalSettings cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MSDataCachedConsumer: + # wrap-doc: + # Transforming and cached writing consumer of MS data + # ----- + # Is able to transform a spectrum on the fly while it is read using a + # function pointer that can be set on the object. The spectra is then + # cached to disk using the functions provided in CachedMzMLHandler. + MSDataCachedConsumer(String filename) nogil except + MSDataCachedConsumer(String filename, bool clear) nogil except + @@ -12,7 +19,16 @@ cdef extern from "" namespace " MSDataCachedConsumer(MSDataCachedConsumer &) nogil except + # wrap-ignore void consumeSpectrum(MSSpectrum & s) nogil except + + # wrap-doc: + # Write a spectrum to the output file + # ----- + # May delete data from spectrum (if clearData is set) + void consumeChromatogram(MSChromatogram & c) nogil except + + # wrap-doc: + # Write a chromatogram to the output file + # ----- + # May delete data from chromatogram (if clearData is set) void setExperimentalSettings(ExperimentalSettings& exp) nogil except + void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) nogil except + diff --git a/src/pyOpenMS/pxds/MSDataSqlConsumer.pxd b/src/pyOpenMS/pxds/MSDataSqlConsumer.pxd index 781478cfb9a..ab5362defdc 100644 --- a/src/pyOpenMS/pxds/MSDataSqlConsumer.pxd +++ b/src/pyOpenMS/pxds/MSDataSqlConsumer.pxd @@ -11,8 +11,14 @@ cdef extern from "" namespace "Ope MSDataSqlConsumer(MSDataSqlConsumer &) nogil except + # compiler void flush() nogil except + - void consumeSpectrum(MSSpectrum & s) nogil except + - void consumeChromatogram(MSChromatogram & c) nogil except + + # wrap-doc: + # Flushes the data for good + # ----- + # After calling this function, no more data is held in the buffer but the + # class is still able to receive new data + + void consumeSpectrum(MSSpectrum & s) nogil except + # wrap-doc:Write a spectrum to the output file + void consumeChromatogram(MSChromatogram & c) nogil except + # wrap-doc:Write a chromatogram to the output file void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) nogil except + void setExperimentalSettings(ExperimentalSettings & exp) nogil except + diff --git a/src/pyOpenMS/pxds/MSDataStoringConsumer.pxd b/src/pyOpenMS/pxds/MSDataStoringConsumer.pxd index 691d9c0e2db..c637dfd5fb7 100644 --- a/src/pyOpenMS/pxds/MSDataStoringConsumer.pxd +++ b/src/pyOpenMS/pxds/MSDataStoringConsumer.pxd @@ -6,11 +6,16 @@ from MSExperiment cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MSDataStoringConsumer : + # wrap-doc: + # Consumer class that simply stores the data + # ----- + # This class is able to keep spectra and chromatograms passed to it in memory + # and the data can be accessed through getData() MSDataStoringConsumer() nogil except + MSDataStoringConsumer(MSDataStoringConsumer &) nogil except + # compiler - void setExperimentalSettings(ExperimentalSettings & exp) nogil except + + void setExperimentalSettings(ExperimentalSettings & exp) nogil except +# TODO void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) nogil except + void consumeSpectrum(MSSpectrum & s) nogil except + diff --git a/src/pyOpenMS/pxds/MSDataWritingConsumer.pxd b/src/pyOpenMS/pxds/MSDataWritingConsumer.pxd index 1e7929f650c..d54dd604b13 100644 --- a/src/pyOpenMS/pxds/MSDataWritingConsumer.pxd +++ b/src/pyOpenMS/pxds/MSDataWritingConsumer.pxd @@ -16,16 +16,46 @@ cdef extern from "" namespace void consumeChromatogram(MSChromatogram & c) nogil except + void setExperimentalSettings(ExperimentalSettings& exp) nogil except + + # wrap-doc: + # Set experimental settings for the whole file + # ----- + # :param exp: Experimental settings to be used for this file (from this + # and the first spectrum/chromatogram, the class will deduce most of + # the header of the mzML file) + void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) nogil except + + # wrap-doc: + # Set expected size of spectra and chromatograms to be written + # ----- + # These numbers will be written in the spectrumList and chromatogramList + # tag in the mzML file. Therefore, these will contain wrong numbers if + # the expected size is not set correctly + # ----- + # :param expectedSpectra: Number of spectra expected + # :param expectedChromatograms: Number of chromatograms expected void addDataProcessing(DataProcessing d) nogil except + - Size getNrSpectraWritten() nogil except + - Size getNrChromatogramsWritten() nogil except + + # wrap-doc: + # Optionally add a data processing method to each chromatogram and spectrum + # ----- + # The provided DataProcessing object will be added to each chromatogram + # and spectrum written to to the mzML file + # ----- + # :param d: The DataProcessing object to be added + + Size getNrSpectraWritten() nogil except + # wrap-doc:Return the number of spectra written + Size getNrChromatogramsWritten() nogil except + # wrap-doc:Return the number of chromatograms written void setOptions(PeakFileOptions opt) nogil except + PeakFileOptions getOptions() nogil except + cdef cppclass NoopMSDataWritingConsumer: + # wrap-doc: + # Consumer class that perform no operation + # ----- + # This is sometimes necessary to fulfill the requirement of passing an + # valid MSDataWritingConsumer object or pointer but no operation is + # required. NoopMSDataWritingConsumer(String filename) nogil except + # copy constructor of 'NoopMSDataWritingConsumer' is implicitly deleted because base class 'OpenMS::MSDataWritingConsumer' has a deleted copy constructor (see XMLHandler) @@ -40,4 +70,3 @@ cdef extern from "" namespace void addDataProcessing(DataProcessing d) nogil except + Size getNrSpectraWritten() nogil except + Size getNrChromatogramsWritten() nogil except + - diff --git a/src/pyOpenMS/pxds/MSNumpressCoder.pxd b/src/pyOpenMS/pxds/MSNumpressCoder.pxd index 7b49ed02211..8f55dce1bf6 100644 --- a/src/pyOpenMS/pxds/MSNumpressCoder.pxd +++ b/src/pyOpenMS/pxds/MSNumpressCoder.pxd @@ -13,19 +13,83 @@ cdef extern from "" namespace "OpenMS": String & result, bool zlib_compression, NumpressConfig config) nogil except + + # wrap-doc: + # Encodes a vector of floating point numbers into a Base64 string using numpress + # ----- + # This code is obtained from the proteowizard implementation + # ./pwiz/pwiz/data/msdata/BinaryDataEncoder.cpp (adapted by Hannes Roest) + # ----- + # This function will first apply the numpress encoding to the data, then + # encode the result in base64 (with optional zlib compression before + # base64 encoding) + # ----- + # :note In case of error, result string is empty + # ----- + # :param in: The vector of floating point numbers to be encoded + # :param result: The resulting string + # :param zlib_compression: Whether to apply zlib compression after numpress compression + # :param config: The numpress configuration defining the compression strategy void decodeNP(const String& in_, libcpp_vector[double] & out, bool zlib_compression, NumpressConfig config) nogil except + + # wrap-doc: + # Decodes a Base64 string to a vector of floating point numbers using numpress + # ----- + # This code is obtained from the proteowizard implementation + # ./pwiz/pwiz/data/msdata/BinaryDataEncoder.cpp (adapted by Hannes Roest) + # ----- + # This function will first decode the input base64 string (with optional + # zlib decompression after decoding) and then apply numpress decoding to + # the data + # ----- + # :param in: The base64 encoded string + # :param out: The resulting vector of doubles + # :param zlib_compression: Whether to apply zlib de-compression before numpress de-compression + # :param config: The numpress configuration defining the compression strategy + # :raises: + # Exception: ConversionError if the string cannot be converted void encodeNPRaw(libcpp_vector[ double ] in_, String & result, NumpressConfig config) nogil except + + # wrap-doc: + # Encode the data vector "in" to a raw byte array + # ----- + # :note In case of error, "result" is given back unmodified + # :note The result is not a string but a raw byte array and may contain zero bytes + # ----- + # This performs the raw numpress encoding on a set of data and does no + # Base64 encoding on the result. Therefore the result string is likely + # *unsafe* to handle and is a raw byte array. + # ----- + # Please use the safe versions above unless you need access to the raw + # byte arrays. + # ----- + # :param in: The vector of floating point numbers to be encoded + # :param result: The resulting string + # :param config: The numpress configuration defining the compression strategy void decodeNPRaw(const String& in_, libcpp_vector[ double ] & out, NumpressConfig config) nogil except + + # wrap-doc: + # Decode the raw byte array "in" to the result vector "out" + # ----- + # :note The string in should *only* contain the data and _no_ extra + # null terminating byte + # ----- + # This performs the raw numpress decoding on a raw byte array (not Base64 + # encoded). Therefore the input string is likely *unsafe* to handle and is + # basically a byte container + # ----- + # Please use the safe versions above unless you need access to the raw + # byte arrays + # ----- + # :param in: The base64 encoded string + # :param out: The resulting vector of doubles + # :param config: The numpress configuration defining the compression strategy cdef extern from "" namespace "OpenMS::MSNumpressCoder": @@ -50,4 +114,3 @@ cdef extern from "" namespace "OpenMS::MSNumpre double linear_fp_mass_acc # desired mass accuracy for linear encoding (-1 no effect, use 0.0001 for 0.2 ppm accuracy @ 500 m/z) void setCompression(const String & compression) nogil except + - diff --git a/src/pyOpenMS/pxds/MSPFile.pxd b/src/pyOpenMS/pxds/MSPFile.pxd index 606a16e7d3f..5ae6b32cff5 100644 --- a/src/pyOpenMS/pxds/MSPFile.pxd +++ b/src/pyOpenMS/pxds/MSPFile.pxd @@ -7,8 +7,14 @@ cdef extern from "" namespace "OpenMS": cdef cppclass MSPFile: - MSPFile() nogil except + + MSPFile() nogil except + # wrap-doc:File adapter for MSP files (NIST spectra library) MSPFile(MSPFile &) nogil except + - void store(String filename, MSExperiment & exp) nogil except + + void store(String filename, MSExperiment & exp) nogil except + # wrap-doc:Stores a map in a MSPFile file void load(String filename, libcpp_vector[PeptideIdentification] & ids, MSExperiment & exp) nogil except + + # wrap-doc: + # Loads a map from a MSPFile file + # ----- + # :param exp: PeakMap which contains the spectra after reading + # :param filename: The filename of the experiment + # :param ids: Output parameter which contains the peptide identifications from the spectra annotations diff --git a/src/pyOpenMS/pxds/MSPGenericFile.pxd b/src/pyOpenMS/pxds/MSPGenericFile.pxd index 42f0b06b89f..d37c56658cd 100644 --- a/src/pyOpenMS/pxds/MSPGenericFile.pxd +++ b/src/pyOpenMS/pxds/MSPGenericFile.pxd @@ -13,6 +13,22 @@ cdef extern from "" namespace "OpenMS": MSPGenericFile(const String& filename, MSExperiment& library) nogil except + void load(const String& filename, MSExperiment& library) nogil except + + # wrap-doc: + # Load the file's data and metadata, and save it into an `MSExperiment` + # ----- + # :param filename: Path to the MSP input file + # :param library: The variable into which the extracted information will be saved + # :raises: + # Exception: FileNotFound If the file could not be found + void store(const String& filename, const MSExperiment& library) nogil except + - void getDefaultParameters(Param & params) nogil except + + # wrap-doc: + # Save data and metadata into a file + # ----- + # :param filename: Path to the MSP input file + # :param library: The variable from which extracted information will be saved + # :raises: + # Exception: FileNotWritable If the file is not writable + + void getDefaultParameters(Param & params) nogil except + # wrap-doc:Get the class' default parameters diff --git a/src/pyOpenMS/pxds/MSSim.pxd b/src/pyOpenMS/pxds/MSSim.pxd index b5e38d59849..69b57c8a4c1 100644 --- a/src/pyOpenMS/pxds/MSSim.pxd +++ b/src/pyOpenMS/pxds/MSSim.pxd @@ -19,32 +19,26 @@ cdef extern from "" namespace "OpenMS": MSSim() nogil except + MSSim(MSSim &) nogil except + - # General purpose function to simulate a mass spectrometry run - # - #@param rnd_gen random number generator which will be passed to the different classes - #@param peptides List of peptides and abundances that will be simulated void simulate(shared_ptr[SimRandomNumberGenerator] rnd_gen, SampleChannels peptides) nogil except + + # wrap-doc: + # General purpose function to simulate a mass spectrometry run + # ----- + # :param rnd_gen: Random number generator which will be passed to the different classes + # :param peptides: List of peptides and abundances that will be simulated + + MSExperiment getExperiment() nogil except + # wrap-doc:Access the simulated experiment - # Access the simulated experiment - MSExperiment getExperiment() nogil except + + FeatureMap getSimulatedFeatures() nogil except + # wrap-doc:Access the simulated features - # Access the simulated features - FeatureMap getSimulatedFeatures() nogil except + + ConsensusMap getChargeConsensus() nogil except + # wrap-doc:Access the charge consensus map of simulated features - # Access the charge consensus map of simulated features - ConsensusMap getChargeConsensus() nogil except + + FeatureMap getContaminants() nogil except + # wrap-doc:Access the contaminants feature map of simulated features - # Access the contaminants feature map of simulated features - FeatureMap getContaminants() nogil except + + ConsensusMap getLabelingConsensus() nogil except + # wrap-doc:Access the labeling consensus map of simulated features - # Access the labeling consensus map of simulated features - ConsensusMap getLabelingConsensus() nogil except + + MSExperiment getPeakMap() nogil except + # wrap-doc:Access the labeling consensus map of simulated features - # Access the labeling consensus map of simulated features - MSExperiment getPeakMap() nogil except + - - # Returns the default parameters for simulation including the labeling technique with name @p labeling_name - Param getParameters() nogil except + + Param getParameters() nogil except + # wrap-doc:Returns the default parameters for simulation including the labeling technique with name `labeling_name` void getIdentifications(libcpp_vector[ ProteinIdentification ] & proteins, libcpp_vector[ PeptideIdentification ] & peptides) nogil except + diff --git a/src/pyOpenMS/pxds/MSstatsFile.pxd b/src/pyOpenMS/pxds/MSstatsFile.pxd index ec657736c77..fef0a738ce3 100644 --- a/src/pyOpenMS/pxds/MSstatsFile.pxd +++ b/src/pyOpenMS/pxds/MSstatsFile.pxd @@ -20,7 +20,7 @@ cdef extern from "" namespace "OpenMS": bool is_isotope_label_type, String & bioreplicate, String & condition, - String & retention_time_summarization_method) nogil except + + String & retention_time_summarization_method) nogil except + # wrap-doc:Store label free experiment (MSstats) void storeISO(String & filename, ConsensusMap & consensus_map, @@ -29,4 +29,4 @@ cdef extern from "" namespace "OpenMS": String & bioreplicate, String & condition, String & mixture, - String & retention_time_summarization_method) nogil except + \ No newline at end of file + String & retention_time_summarization_method) nogil except + # wrap-doc:Store isobaric experiment (MSstatsTMT) diff --git a/src/pyOpenMS/pxds/MapAlignmentAlgorithmKD.pxd b/src/pyOpenMS/pxds/MapAlignmentAlgorithmKD.pxd index 2188f2a7a39..a4f0e376d33 100644 --- a/src/pyOpenMS/pxds/MapAlignmentAlgorithmKD.pxd +++ b/src/pyOpenMS/pxds/MapAlignmentAlgorithmKD.pxd @@ -5,16 +5,25 @@ from TransformationModelLowess cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MapAlignmentAlgorithmKD "OpenMS::MapAlignmentAlgorithmKD": + # wrap-doc: + # An efficient reference-free feature map alignment algorithm for unlabeled data + # ----- + # This algorithm uses a kd-tree to efficiently compute conflict-free connected components (CCC) + # in a compatibility graph on feature data. This graph is comprised of nodes corresponding + # to features and edges connecting features f and f' iff both are within each other's tolerance + # windows (wrt. RT and m/z difference). CCCs are those CCs that do not contain multiple features + # from the same input map, and whose features all have the same charge state + # ----- + # All CCCs above a user-specified minimum size are considered true sets of corresponding features + # and based on these, LOWESS transformations are computed for each input map such that the average + # deviation from the mean retention time within all CCCs is minimized. + # private MapAlignmentAlgorithmKD() nogil except + # wrap-ignore - - MapAlignmentAlgorithmKD(MapAlignmentAlgorithmKD) nogil except + # compiler - MapAlignmentAlgorithmKD(Size num_maps, Param & param) nogil except + - void addRTFitData(KDTreeFeatureMaps & kd_data) nogil except + - - void fitLOWESS() nogil except + - - void transform(KDTreeFeatureMaps & kd_data) nogil except + + MapAlignmentAlgorithmKD(MapAlignmentAlgorithmKD &) nogil except + # compiler + void addRTFitData(KDTreeFeatureMaps & kd_data) nogil except + # wrap-doc:Compute data points needed for RT transformation in the current `kd_data`, add to `fit_data_` + void fitLOWESS() nogil except + # wrap-doc:Fit LOWESS to fit_data_, store final models in `transformations_` + void transform(KDTreeFeatureMaps & kd_data) nogil except + # wrap-doc:Transform RTs for `kd_data` diff --git a/src/pyOpenMS/pxds/MapAlignmentAlgorithmPoseClustering.pxd b/src/pyOpenMS/pxds/MapAlignmentAlgorithmPoseClustering.pxd index 36993342975..2d4abdb0c60 100644 --- a/src/pyOpenMS/pxds/MapAlignmentAlgorithmPoseClustering.pxd +++ b/src/pyOpenMS/pxds/MapAlignmentAlgorithmPoseClustering.pxd @@ -27,7 +27,7 @@ cdef extern from "" namespace "OpenMS": cdef cppclass MapAlignmentTransformer: + # wrap-doc: + # This class collects functions for applying retention time transformations to data structures - MapAlignmentTransformer() nogil except + - + MapAlignmentTransformer() nogil except + MapAlignmentTransformer(MapAlignmentTransformer &) nogil except + - void transformRetentionTimes(MSExperiment&, TransformationDescription&, bool) nogil except + + void transformRetentionTimes(MSExperiment&, TransformationDescription&, bool) nogil except + # wrap-doc:Applies the given transformation to a peak map - void transformRetentionTimes(FeatureMap&, TransformationDescription&, bool) nogil except + + void transformRetentionTimes(FeatureMap&, TransformationDescription&, bool) nogil except + # wrap-doc:Applies the given transformation to a feature map - void transformRetentionTimes(ConsensusMap&, TransformationDescription&, bool) nogil except + + void transformRetentionTimes(ConsensusMap&, TransformationDescription&, bool) nogil except + # wrap-doc:Applies the given transformation to a consensus map - void transformRetentionTimes(libcpp_vector[PeptideIdentification]&, TransformationDescription&, bool) nogil except + + void transformRetentionTimes(libcpp_vector[PeptideIdentification]&, TransformationDescription&, bool) nogil except + # wrap-doc:Applies the given transformation to peptide identifications diff --git a/src/pyOpenMS/pxds/MarkerMower.pxd b/src/pyOpenMS/pxds/MarkerMower.pxd index 8478b144af1..d2ddf785cb0 100644 --- a/src/pyOpenMS/pxds/MarkerMower.pxd +++ b/src/pyOpenMS/pxds/MarkerMower.pxd @@ -19,7 +19,7 @@ cdef extern from "" namespace "Open void filterPeakSpectrum(MSSpectrum & spec) nogil except + void filterPeakMap(MSExperiment & exp) nogil except + - String getProductName() nogil except + + String getProductName() nogil except +# TODO - void insertmarker(PeakMarker * peak_marker) nogil except + + void insertmarker(PeakMarker * peak_marker) nogil except + # wrap-doc:Insert new Marker (violates the DefaultParamHandler interface) diff --git a/src/pyOpenMS/pxds/MascotGenericFile.pxd b/src/pyOpenMS/pxds/MascotGenericFile.pxd index 61311e30fb4..7e1d407b232 100644 --- a/src/pyOpenMS/pxds/MascotGenericFile.pxd +++ b/src/pyOpenMS/pxds/MascotGenericFile.pxd @@ -16,6 +16,21 @@ cdef extern from "" namespace "OpenMS": void store(const String & filename, MSExperiment & experiment) nogil except + # NAMESPACE # void store(std::ostream & os, const String & filename, MSExperiment & experiment) nogil except + void load(const String & filename, MSExperiment & exp) nogil except + + # wrap-doc: + # Loads a Mascot Generic File into a PeakMap + # ----- + # :param filename: File name which the map should be read from + # :param exp: The map which is filled with the data from the given file + # :raises: + # Exception: FileNotFound is thrown if the given file could not be found + libcpp_pair[ String, String ] getHTTPPeakListEnclosure(const String & filename) nogil except + - void updateMembers_() nogil except + + # wrap-doc: + # Enclosing Strings of the peak list body for HTTP submission + # ----- + # Can be used to embed custom content into HTTP submission (when writing only the MGF header in HTTP format and then + # adding the peaks (in whatever format, e.g. mzXML) enclosed in this body + # The `filename` can later be found in the Mascot response + + void updateMembers_() nogil except + # wrap-doc:Docu in base class diff --git a/src/pyOpenMS/pxds/MascotInfile.pxd b/src/pyOpenMS/pxds/MascotInfile.pxd index 7118246121c..3ab4c7c96c2 100644 --- a/src/pyOpenMS/pxds/MascotInfile.pxd +++ b/src/pyOpenMS/pxds/MascotInfile.pxd @@ -14,37 +14,45 @@ cdef extern from "" namespace "OpenMS": # ProgressLogger MascotInfile() nogil except + MascotInfile(MascotInfile &) nogil except + - void store(const String & filename, MSSpectrum & spec, double mz, double retention_time, String search_title) nogil except + - void store(const String & filename, MSExperiment & experiment, String search_title) nogil except + + void store(const String & filename, MSSpectrum & spec, double mz, double retention_time, String search_title) nogil except + # wrap-doc:Stores the peak list in a MascotInfile that can be used as input for MASCOT shell execution + void store(const String & filename, MSExperiment & experiment, String search_title) nogil except + # wrap-doc:Stores the experiment data in a MascotInfile that can be used as input for MASCOT shell execution + void load(const String & filename, MSExperiment & exp) nogil except + - String getBoundary() nogil except + - void setBoundary(const String & boundary) nogil except + - String getDB() nogil except + - void setDB(const String & db) nogil except + - String getSearchType() nogil except + - void setSearchType(const String & search_type) nogil except + - String getHits() nogil except + - void setHits(const String & hits) nogil except + - String getCleavage() nogil except + - void setCleavage(const String & cleavage) nogil except + - String getMassType() nogil except + - void setMassType(const String & mass_type) nogil except + - libcpp_vector[ String ] getModifications() nogil except + - void setModifications(libcpp_vector[ String ] & mods) nogil except + - libcpp_vector[ String ] getVariableModifications() nogil except + - void setVariableModifications(libcpp_vector[ String ] & mods) nogil except + - String getInstrument() nogil except + - void setInstrument(const String & instrument) nogil except + - UInt getMissedCleavages() nogil except + - void setMissedCleavages(UInt missed_cleavages) nogil except + - float getPrecursorMassTolerance() nogil except + - void setPrecursorMassTolerance(float precursor_mass_tolerance) nogil except + - float getPeakMassTolerance() nogil except + - void setPeakMassTolerance(float ion_mass_tolerance) nogil except + - String getTaxonomy() nogil except + - void setTaxonomy(const String & taxonomy) nogil except + - String getFormVersion() nogil except + - void setFormVersion(const String & form_version) nogil except + - String getCharges() nogil except + - void setCharges(libcpp_vector[ int ] & charges) nogil except + + # wrap-doc: + # Loads a Mascot Generic File into a PeakMap + # ----- + # :param filename: File name which the map should be read from + # :param exp: The map which is filled with the data from the given file + # :raises: + # Exception: FileNotFound is thrown if the given file could not be found + String getBoundary() nogil except + # wrap-doc:Returns the boundary used for the MIME format + void setBoundary(const String & boundary) nogil except + # wrap-doc:Sets the boundary used for the MIME format.By default a 22 character random string is used + String getDB() nogil except + # wrap-doc:Returns the DB to use + void setDB(const String & db) nogil except + # wrap-doc:Sets the DB (default MSDB). See mascot path /config/mascot.dat in "Databases" section for possible settings + String getSearchType() nogil except + # wrap-doc:Returns the search type + void setSearchType(const String & search_type) nogil except + # wrap-doc:Sets the search type (default MIS). So far only MIS is supported!Valid types are "MIS" (MS/MS Ion Search), "PMF" (Peptide Mass Fingerprint) , "SQ" (Sequence Query) + String getHits() nogil except + # wrap-doc:Returns the number of hits to report back + void setHits(const String & hits) nogil except + # wrap-doc:Sets the number of hits to report back (default 20) + String getCleavage() nogil except + # wrap-doc:Returns the enzyme used for cleavage + void setCleavage(const String & cleavage) nogil except + # wrap-doc:Sets the enzyme used for cleavage (default Trypsin). See mascot path /config/enzymes for possible settings + String getMassType() nogil except + # wrap-doc:Returns the used mass type ("Monoisotopic" or "Average") + void setMassType(const String & mass_type) nogil except + # wrap-doc:Sets the used mass type "Monoisotopic" or "Average" (default Monoisotopic) + libcpp_vector[ String ] getModifications() nogil except + # wrap-doc:Returns a vector containing the fixed modifications (default none) + void setModifications(libcpp_vector[ String ] & mods) nogil except + # wrap-doc:Sets the fixed modifications (default none). See mascot path /config/mod_file for possible settings + libcpp_vector[ String ] getVariableModifications() nogil except + # wrap-doc:Returns a vector containing the variable modifications (default none) + void setVariableModifications(libcpp_vector[ String ] & mods) nogil except + # wrap-doc:Sets the fixed modifications (default none). See mascot path /config/mod_file for possible settings + String getInstrument() nogil except + # wrap-doc:Returns the instrument type + void setInstrument(const String & instrument) nogil except + # wrap-doc:Sets the instrument type (Default Default). Possible instruments are ESI-QUAD-TOF, MALDI-TOF-PSD, ESI-TRAP, ESI-QUAD, ESI-FTICR, MALDI-TOF-TOF, ESI-4SECTOR, FTMS-ECD, MALDI-QUAD-TOF, MALDI-QIT-TOF + UInt getMissedCleavages() nogil except + # wrap-doc:Returns the number of allowed missed cleavages + void setMissedCleavages(UInt missed_cleavages) nogil except + # wrap-doc:Sets the number of allowed missed cleavages (default 1) + float getPrecursorMassTolerance() nogil except + # wrap-doc:Returns the precursor mass tolerance + void setPrecursorMassTolerance(float precursor_mass_tolerance) nogil except + # wrap-doc:Sets the precursor mass tolerance in Da (default 2.0) + float getPeakMassTolerance() nogil except + # wrap-doc:Returns the peak mass tolerance in Da + void setPeakMassTolerance(float ion_mass_tolerance) nogil except + # wrap-doc:Sets the peak mass tolerance in Da (default 1.0) + String getTaxonomy() nogil except + # wrap-doc:Returns the taxonomy + void setTaxonomy(const String & taxonomy) nogil except + # wrap-doc:Sets the taxonomy (default All entries). See mascot path /config/taxonomy for possible settings + String getFormVersion() nogil except + # wrap-doc:Returns the Mascot form version + void setFormVersion(const String & form_version) nogil except + # wrap-doc:Sets the Mascot form version (default 1.01) + String getCharges() nogil except + # wrap-doc:Returns the charges + void setCharges(libcpp_vector[ int ] & charges) nogil except + # wrap-doc:Sets the charges (default 1+, 2+ and 3+) diff --git a/src/pyOpenMS/pxds/MascotXMLFile.pxd b/src/pyOpenMS/pxds/MascotXMLFile.pxd index 0f3aa78af37..efcd26243a6 100644 --- a/src/pyOpenMS/pxds/MascotXMLFile.pxd +++ b/src/pyOpenMS/pxds/MascotXMLFile.pxd @@ -20,6 +20,17 @@ cdef extern from "" namespace "OpenMS": ProteinIdentification & protein_identification, libcpp_vector[ PeptideIdentification ] & id_data, SpectrumMetaDataLookup & rt_mapping) nogil except + + # wrap-doc: + # Loads data from a Mascot XML file + # ----- + # :param filename: The file to be loaded + # :param protein_identification: Protein identifications belonging to the whole experiment + # :param id_data: The identifications with m/z and RT + # :param lookup: Helper object for looking up spectrum meta data + # :raises: + # Exception: FileNotFound is thrown if the file does not exists + # :raises: + # Exception: ParseError is thrown if the file does not suit to the standard # TODO fix # void load(const String & filename, @@ -29,4 +40,10 @@ cdef extern from "" namespace "OpenMS": # SpectrumMetaDataLookup & rt_mapping) nogil except + void initializeLookup(SpectrumMetaDataLookup & lookup, MSExperiment& experiment, const String & scan_regex) nogil except + + # wrap-doc: + # Initializes a helper object for looking up spectrum meta data (RT, m/z) + # ----- + # :param lookup: Helper object to initialize + # :param experiment: Experiment containing the spectra + # :param scan_regex: Optional regular expression for extracting information from references to spectra diff --git a/src/pyOpenMS/pxds/MassAnalyzer.pxd b/src/pyOpenMS/pxds/MassAnalyzer.pxd index 141fc12e1a2..b6e5bd1cd18 100644 --- a/src/pyOpenMS/pxds/MassAnalyzer.pxd +++ b/src/pyOpenMS/pxds/MassAnalyzer.pxd @@ -12,75 +12,75 @@ cdef extern from "" namespace "OpenMS": MassAnalyzer(MassAnalyzer &) nogil except + # returns the analyzer type - AnalyzerType getType() nogil except + + AnalyzerType getType() nogil except + # wrap-doc:Returns the analyzer type # sets the analyzer type - void setType(AnalyzerType type) nogil except + + void setType(AnalyzerType type) nogil except + # wrap-doc:Sets the analyzer type # returns the method used for determination of the resolution - ResolutionMethod getResolutionMethod() nogil except + + ResolutionMethod getResolutionMethod() nogil except + # wrap-doc:Returns the method used for determination of the resolution # sets the method used for determination of the resolution - void setResolutionMethod(ResolutionMethod resolution_method) nogil except + + void setResolutionMethod(ResolutionMethod resolution_method) nogil except + # wrap-doc:Sets the method used for determination of the resolution # returns the resolution type - ResolutionType getResolutionType() nogil except + + ResolutionType getResolutionType() nogil except + # wrap-doc:Returns the resolution type # sets the resolution type - void setResolutionType(ResolutionType resolution_type) nogil except + + void setResolutionType(ResolutionType resolution_type) nogil except + # wrap-doc:Sets the resolution type # returns the direction of scanning - ScanDirection getScanDirection() nogil except + + ScanDirection getScanDirection() nogil except + # wrap-doc:Returns the direction of scanning # sets the direction of scanning - void setScanDirection(ScanDirection scan_direction) nogil except + + void setScanDirection(ScanDirection scan_direction) nogil except + # wrap-doc:Sets the direction of scanning # returns the scan law - ScanLaw getScanLaw() nogil except + + ScanLaw getScanLaw() nogil except + # wrap-doc:Returns the scan law # sets the scan law - void setScanLaw(ScanLaw scan_law) nogil except + + void setScanLaw(ScanLaw scan_law) nogil except + # wrap-doc:Sets the scan law # returns the reflectron state (for TOF) - ReflectronState getReflectronState() nogil except + + ReflectronState getReflectronState() nogil except + # wrap-doc:Returns the reflectron state (for TOF) # sets the reflectron state (for TOF) - void setReflectronState(ReflectronState reflecton_state) nogil except + + void setReflectronState(ReflectronState reflecton_state) nogil except + # wrap-doc:Sets the reflectron state (for TOF) - # @brief returns the resolution + # returns the resolution # The maximum m/z value at which two peaks can be resolved, according to one of the standard measures - double getResolution() nogil except + + double getResolution() nogil except + # wrap-doc:Returns the resolution. The maximum m/z value at which two peaks can be resolved, according to one of the standard measures # sets the resolution - void setResolution(double resolution) nogil except + + void setResolution(double resolution) nogil except + # wrap-doc:Sets the resolution # returns the mass accuracy i.e. how much the theoretical mass may differ from the measured mass (in ppm) - double getAccuracy() nogil except + + double getAccuracy() nogil except + # wrap-doc:Returns the mass accuracy i.e. how much the theoretical mass may differ from the measured mass (in ppm) # sets the accuracy i.e. how much the theoretical mass may differ from the measured mass (in ppm) - void setAccuracy(double accuracy) nogil except + + void setAccuracy(double accuracy) nogil except + # wrap-doc:Sets the accuracy i.e. how much the theoretical mass may differ from the measured mass (in ppm) # returns the scan rate (in s) - double getScanRate() nogil except + + double getScanRate() nogil except + # wrap-doc:Returns the scan rate (in s) # sets the scan rate (in s) - void setScanRate(double scan_rate) nogil except + + void setScanRate(double scan_rate) nogil except + # wrap-doc:Sets the scan rate (in s) # returns the scan time for a single scan (in s) - double getScanTime() nogil except + + double getScanTime() nogil except + # wrap-doc:Returns the scan time for a single scan (in s) # sets the scan time for a single scan (in s) - void setScanTime(double scan_time) nogil except + + void setScanTime(double scan_time) nogil except + # wrap-doc:Sets the scan time for a single scan (in s) # returns the path length for a TOF mass analyzer (in meter) - double getTOFTotalPathLength() nogil except + + double getTOFTotalPathLength() nogil except + # wrap-doc:Returns the path length for a TOF mass analyzer (in meter) # sets the path length for a TOF mass analyzer (in meter) - void setTOFTotalPathLength(double TOF_total_path_length) nogil except + + void setTOFTotalPathLength(double TOF_total_path_length) nogil except + # wrap-doc:Sets the path length for a TOF mass analyzer (in meter) # returns the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in m/z) - double getIsolationWidth() nogil except + + double getIsolationWidth() nogil except + # wrap-doc:Returns the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in m/z) # sets the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in m/z) - void setIsolationWidth(double isolation_width) nogil except + + void setIsolationWidth(double isolation_width) nogil except + # wrap-doc:Sets the isolation width i.e. in which m/z range the precursor ion is selected for MS to the n (in m/z) # returns the final MS exponent - Int getFinalMSExponent() nogil except + + Int getFinalMSExponent() nogil except + # wrap-doc:Returns the final MS exponent # sets the final MS exponent - void setFinalMSExponent(Int final_MS_exponent) nogil except + + void setFinalMSExponent(Int final_MS_exponent) nogil except + # wrap-doc:Sets the final MS exponent # returns the strength of the magnetic field (in T) - double getMagneticFieldStrength() nogil except + + double getMagneticFieldStrength() nogil except + # wrap-doc:Returns the strength of the magnetic field (in T) # sets the strength of the magnetic field (in T) - void setMagneticFieldStrength(double magnetic_field_strength) nogil except + + void setMagneticFieldStrength(double magnetic_field_strength) nogil except + # wrap-doc:Sets the strength of the magnetic field (in T) # # @brief returns the position of this part in the whole Instrument. diff --git a/src/pyOpenMS/pxds/MassDecomposer.pxd b/src/pyOpenMS/pxds/MassDecomposer.pxd index 341721cbfc1..09fad95a02a 100644 --- a/src/pyOpenMS/pxds/MassDecomposer.pxd +++ b/src/pyOpenMS/pxds/MassDecomposer.pxd @@ -10,6 +10,12 @@ cdef extern from "" nam MassDecomposer(MassDecomposer &) nogil except + # compiler bool exist(ValueType mass) nogil except + + # wrap-doc: + # Returns true if the decomposition for the given `mass` exists, otherwise - false + # ----- + # :param mass: Mass to be checked on decomposing + # :returns: True, if the decomposition for `mass` exist, otherwise - false + # decomposition_type getDecomposition(ValueType mass) nogil except + # decompositions_type getAllDecompositions(ValueType mass) nogil except + DecompositionValueType getNumberOfDecompositions(ValueType mass) nogil except + diff --git a/src/pyOpenMS/pxds/MassDecomposition.pxd b/src/pyOpenMS/pxds/MassDecomposition.pxd index 5736f86779e..54528189e4f 100644 --- a/src/pyOpenMS/pxds/MassDecomposition.pxd +++ b/src/pyOpenMS/pxds/MassDecomposition.pxd @@ -6,16 +6,23 @@ from String cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MassDecomposition "OpenMS::MassDecomposition": + # wrap-doc: + # Class represents a decomposition of a mass into amino acids + # ----- + # This class represents a mass decomposition into amino acids. A + # decomposition are amino acids given with frequencies which add + # up to a specific mass. + MassDecomposition() nogil except + MassDecomposition(MassDecomposition &) nogil except + MassDecomposition(const String & deco) nogil except + # MassDecomposition operator+=(MassDecomposition & d) nogil except + - String toString() nogil except + - String toExpandedString() nogil except + + String toString() nogil except + # wrap-doc:Returns the decomposition as a string + String toExpandedString() nogil except + # wrap-doc:Returns the decomposition as a string; instead of frequencies the amino acids are repeated # MassDecomposition operator+(MassDecomposition & rhs) nogil except + - Size getNumberOfMaxAA() nogil except + + Size getNumberOfMaxAA() nogil except + # wrap-doc:Returns the max frequency of this composition # bool operator<(MassDecomposition & rhs) nogil except + # bool operator==(const String & deco) nogil except + - bool containsTag(const String & tag) nogil except + - bool compatible(MassDecomposition & deco) nogil except + + bool containsTag(const String & tag) nogil except + # wrap-doc:Returns true if tag is contained in the mass decomposition + bool compatible(MassDecomposition & deco) nogil except + # wrap-doc:Returns true if the mass decomposition if contained in this instance diff --git a/src/pyOpenMS/pxds/MassDecompositionAlgorithm.pxd b/src/pyOpenMS/pxds/MassDecompositionAlgorithm.pxd index 819be41b45a..336e171b339 100644 --- a/src/pyOpenMS/pxds/MassDecompositionAlgorithm.pxd +++ b/src/pyOpenMS/pxds/MassDecompositionAlgorithm.pxd @@ -14,5 +14,5 @@ cdef extern from "" namespace "OpenMS": cdef cppclass MassExplainer "OpenMS::MassExplainer": - MassExplainer() nogil except + + MassExplainer() nogil except + # wrap-doc:Computes empirical formulas for given mass differences using a set of allowed elements MassExplainer(MassExplainer &) nogil except + # compiler MassExplainer(libcpp_vector[Adduct] adduct_base) nogil except + MassExplainer(Int q_min, Int q_max, Int max_span, double thresh_logp) nogil except + ## MassExplainer(libcpp_vector[Adduct] adduct_base, Int q_min, Int q_max, Int max_span, double thresh_logp, Size max_neutrals) nogil except + ## MassExplainer operator=(MassExplainer &rhs) nogil except + - void setAdductBase(libcpp_vector[Adduct] adduct_base) nogil except + - libcpp_vector[Adduct] getAdductBase() nogil except + - Compomer getCompomerById(Size id) nogil except + - void compute() nogil except + + void setAdductBase(libcpp_vector[Adduct] adduct_base) nogil except + # wrap-doc:Sets the set of possible adducts + libcpp_vector[Adduct] getAdductBase() nogil except + # wrap-doc:Returns the set of adducts + Compomer getCompomerById(Size id) nogil except + # wrap-doc:Return a compomer by its Id (useful after a query() ) + void compute() nogil except + # wrap-doc:Fill map with possible mass-differences along with their explanation diff --git a/src/pyOpenMS/pxds/MassTrace.pxd b/src/pyOpenMS/pxds/MassTrace.pxd index c794efd5e3a..ef1e6117af7 100644 --- a/src/pyOpenMS/pxds/MassTrace.pxd +++ b/src/pyOpenMS/pxds/MassTrace.pxd @@ -14,45 +14,51 @@ cdef extern from "" namespace "OpenMS": # public members double fwhm_mz_avg - Size getSize() nogil except + - String getLabel() nogil except + - void setLabel(String label) nogil except + - - double getCentroidMZ() nogil except + - double getCentroidRT() nogil except + - double getCentroidSD() nogil except + - double getFWHM() nogil except + - double getTraceLength() nogil except + - libcpp_pair[Size,Size] getFWHMborders() nogil except + - libcpp_vector[double] getSmoothedIntensities() nogil except + - double getAverageMS1CycleTime() nogil except + - - double computeSmoothedPeakArea() nogil except + - double computePeakArea() nogil except + - Size findMaxByIntPeak(bool) nogil except + - Size estimateFWHM(bool) nogil except + - double computeFwhmArea() nogil except + - double computeFwhmAreaSmooth() nogil except + + Size getSize() nogil except + # wrap-doc:Returns the number of peaks contained in the mass trace + String getLabel() nogil except + # wrap-doc:Gets label of mass trace + void setLabel(String label) nogil except + # wrap-doc:Sets label of mass trace + + double getCentroidMZ() nogil except + # wrap-doc:Returns the centroid m/z + double getCentroidRT() nogil except + # wrap-doc:Returns the centroid RT + double getCentroidSD() nogil except + # wrap-doc:Returns the centroid SD + double getFWHM() nogil except +# TODO + double getTraceLength() nogil except + # wrap-doc:Returns the length of the trace (as difference in RT) + libcpp_pair[Size,Size] getFWHMborders() nogil except +# TODO + libcpp_vector[double] getSmoothedIntensities() nogil except + # wrap-doc:Gets smoothed intensities (empty if no smoothing was explicitly done beforehand!) + double getAverageMS1CycleTime() nogil except + # wrap-doc:Get average scan time of mass trace + + double computeSmoothedPeakArea() nogil except + # wrap-doc:Sum all non-negative (smoothed!) intensities in the mass trace + double computePeakArea() nogil except + # wrap-doc:Sum intensities of all peaks in the mass trace + Size findMaxByIntPeak(bool) nogil except + # wrap-doc:Return the index of the mass trace's highest peak within the MassTrace container (based either on raw or smoothed intensities) + Size estimateFWHM(bool) nogil except + # wrap-doc:Estimate FWHM of chromatographic peak in seconds (based on either raw or smoothed intensities) + double computeFwhmArea() nogil except +# TODO + double computeFwhmAreaSmooth() nogil except + # wrap-doc:Compute chromatographic peak area within the FWHM range. # double computeFwhmAreaRobust() nogil except + # double computeFwhmAreaSmoothRobust() nogil except + - double getIntensity(bool) nogil except + - double getMaxIntensity(bool) nogil except + + double getIntensity(bool) nogil except + # wrap-doc:Returns the intensity + double getMaxIntensity(bool) nogil except + # wrap-doc:Returns the max intensity - ConvexHull2D getConvexhull() nogil except + + ConvexHull2D getConvexhull() nogil except + # wrap-doc:Return the mass trace's convex hull void setCentroidSD(double &tmp_sd) nogil except + - void setSmoothedIntensities(libcpp_vector[ double ] &db_vec) nogil except + + void setSmoothedIntensities(libcpp_vector[ double ] &db_vec) nogil except + # wrap-doc:Set smoothed intensities (smoothing is done externally, e.g. by LowessSmoothing) void updateSmoothedMaxRT() nogil except + - void updateWeightedMeanRT() nogil except + + void updateWeightedMeanRT() nogil except + # wrap-doc:Compute & update centroid RT as a intensity-weighted mean of RTs void updateSmoothedWeightedMeanRT() nogil except + - void updateMedianRT() nogil except + - void updateMedianMZ() nogil except + - void updateMeanMZ() nogil except + - void updateWeightedMeanMZ() nogil except + + void updateMedianRT() nogil except + # wrap-doc:Compute & update centroid RT as median position of intensities + void updateMedianMZ() nogil except + # wrap-doc:Compute & update centroid m/z as median of m/z values + void updateMeanMZ() nogil except + # wrap-doc:Compute & update centroid m/z as mean of m/z values + void updateWeightedMeanMZ() nogil except + # wrap-doc:Compute & update centroid m/z as weighted mean of m/z values void updateWeightedMZsd() nogil except + + # wrap-doc: + # Compute & update m/z standard deviation of mass trace as weighted mean of m/z values + # ----- + # Make sure to call update(Weighted)(Mean|Median)MZ() first!
+ # use getCentroidSD() to get result + - void setQuantMethod(MT_QUANTMETHOD method) nogil except + - MT_QUANTMETHOD getQuantMethod() nogil except + + void setQuantMethod(MT_QUANTMETHOD method) nogil except + # wrap-doc:Determine if area or median is used for quantification + MT_QUANTMETHOD getQuantMethod() nogil except + # wrap-doc:Check if area or median is used for quantification cdef extern from "" namespace "OpenMS::MassTrace": diff --git a/src/pyOpenMS/pxds/MasstraceCorrelator.pxd b/src/pyOpenMS/pxds/MasstraceCorrelator.pxd index 85edeb14d14..58d5f58e14f 100644 --- a/src/pyOpenMS/pxds/MasstraceCorrelator.pxd +++ b/src/pyOpenMS/pxds/MasstraceCorrelator.pxd @@ -25,6 +25,18 @@ cdef extern from "" namespace " double min_correlation, int max_lag, double max_rt_apex_difference) nogil except + + # wrap-doc: + # Compute pseudo-spectra from a set of (MS2) masstraces + # ----- + # This function will take a set of masstraces (consensus map) as input and + # produce a vector of pseudo spectra as output (pseudo_spectra result + # vector). + # ----- + # It basically makes an all-vs-all comparison of all masstraces against + # each other and scores them on how similar they are in their mass traces. + # ----- + # This assumes that the consensus feature is only from one (SWATH) map + # This assumes that the consensus map is sorted by intensity # void scoreHullpoints(const MasstracePointsType & hull_points1, # const MasstracePointsType & hull_points2, diff --git a/src/pyOpenMS/pxds/Matrix.pxd b/src/pyOpenMS/pxds/Matrix.pxd index 354fcdcc667..e5d0d825cf8 100644 --- a/src/pyOpenMS/pxds/Matrix.pxd +++ b/src/pyOpenMS/pxds/Matrix.pxd @@ -31,8 +31,8 @@ cdef extern from "" namespace "OpenMS": libcpp_pair[ size_t, size_t ] sizePair() nogil except + size_t index(size_t row, size_t col) nogil except + libcpp_pair[ size_t, size_t ] indexPair(size_t index) nogil except + - size_t colIndex(size_t index) nogil except + - size_t rowIndex(size_t index) nogil except + + size_t colIndex(size_t index) nogil except + # wrap-doc:Calculate the column from an index into the underlying vector. Note that Matrix uses the (row,column) lexicographic ordering for indexing + size_t rowIndex(size_t index) nogil except + # wrap-doc:Calculate the row from an index into the underlying vector. Note that Matrix uses the (row,column) lexicographic ordering for indexing ## bool operator==(Matrix & rhs) nogil except + ## bool operator<(Matrix & rhs) nogil except + # TEMPLATE # void setMatrix(ValueType matrix) nogil except + diff --git a/src/pyOpenMS/pxds/MetaInfo.pxd b/src/pyOpenMS/pxds/MetaInfo.pxd index 55e58659930..8ab647bb513 100644 --- a/src/pyOpenMS/pxds/MetaInfo.pxd +++ b/src/pyOpenMS/pxds/MetaInfo.pxd @@ -8,48 +8,64 @@ from MetaInfoRegistry cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MetaInfo: + # wrap-doc: + # A Type-Name-Value tuple class + # ----- + # MetaInfo maps an index (an integer corresponding to a string) to + # DataValue objects. The mapping of strings to the index is performed by + # the MetaInfoRegistry, which can be accessed by the method registry(). + # ----- + # There are two versions of nearly all members. One which operates with a + # string name and another one which operates on an index. The index version + # is always faster, as it does not need to look up the index corresponding + # to the string in the MetaInfoRegistry. + # ----- + # If you wish to add a MetaInfo member to a class, consider deriving that + # class from MetaInfoInterface, instead of simply adding MetaInfo as + # member. MetaInfoInterface implements a full interface to a MetaInfo + # member and is more memory efficient if no meta info gets added. MetaInfo() nogil except + MetaInfo(MetaInfo &) nogil except + # returns the value corresponding to a string - DataValue getValue(String name) nogil except + + DataValue getValue(String name) nogil except + # wrap-doc:Returns the value corresponding to a string # returns the value corresponding to an index - DataValue getValue(UInt index) nogil except + + DataValue getValue(UInt index) nogil except + # wrap-doc:Returns the value corresponding to an index - # returns the value corresponding to a string, with default - DataValue getValue(String name, DataValue default_value) nogil except + - # returns the value corresponding to an index, with default - DataValue getValue(UInt index, DataValue default_value) nogil except + + # returns the value corresponding to a string + DataValue getValue(String name, DataValue default_value) nogil except + # wrap-doc:Returns the value corresponding to a string + # returns the value corresponding to an index + DataValue getValue(UInt index, DataValue default_value) nogil except + # wrap-doc:Returns the value corresponding to an index # returns if this MetaInfo is set - bool exists(String name) nogil except + + bool exists(String name) nogil except + # wrap-doc:Returns if this MetaInfo is set # returns if this MetaInfo is set - bool exists(UInt index) nogil except + + bool exists(UInt index) nogil except + # wrap-doc:Returns if this MetaInfo is set # sets the DataValue corresponding to a name - void setValue(String name, DataValue value) nogil except + + void setValue(String name, DataValue value) nogil except + # wrap-doc:Sets the DataValue corresponding to a name # sets the DataValue corresponding to an index - void setValue(UInt index, DataValue value) nogil except + + void setValue(UInt index, DataValue value) nogil except + # wrap-doc:Sets the DataValue corresponding to an index # Removes the DataValue corresponding to @p name if it exists - void removeValue(String name) nogil except + + void removeValue(String name) nogil except + # wrap-doc:Removes the DataValue corresponding to `name` if it exists # Removes the DataValue corresponding to @p index if it exists - void removeValue(UInt index) nogil except + + void removeValue(UInt index) nogil except + # wrap-doc:Removes the DataValue corresponding to `index` if it exists # returns a reference to the MetaInfoRegistry # static MetaInfoRegistry registry() nogil except + # fills the given vector with a list of all keys for which a value is set - void getKeys(libcpp_vector[String] & keys) nogil except + + void getKeys(libcpp_vector[String] & keys) nogil except + # wrap-doc:Fills the given vector with a list of all keys for which a value is set # fills the given vector with a list of all keys for which a value is set void getKeys(libcpp_vector[unsigned int] & keys) nogil except + # wrap-as:getKeysAsIntegers # returns if the MetaInfo is empty - bool empty() nogil except + + bool empty() nogil except + # wrap-doc:Returns if the MetaInfo is empty # removes all meta values - void clear() nogil except + + void clear() nogil except + # wrap-doc:Removes all meta values MetaInfoRegistry registry() nogil except + diff --git a/src/pyOpenMS/pxds/MetaInfoDescription.pxd b/src/pyOpenMS/pxds/MetaInfoDescription.pxd index 7474acefbbf..9b2a1fdbbe8 100644 --- a/src/pyOpenMS/pxds/MetaInfoDescription.pxd +++ b/src/pyOpenMS/pxds/MetaInfoDescription.pxd @@ -18,9 +18,9 @@ cdef extern from "" namespace "OpenMS": bool operator==(MetaInfoDescription) nogil except + bool operator!=(MetaInfoDescription) nogil except + - String getName() nogil except + - void setName(String name) nogil except + + String getName() nogil except + # wrap-doc:Returns the name of the peak annotations + void setName(String name) nogil except + # wrap-doc:Sets the name of the peak annotations - libcpp_vector[ shared_ptr[DataProcessing] ] getDataProcessing() nogil except + - void setDataProcessing(libcpp_vector[ shared_ptr[DataProcessing] ]) nogil except + + libcpp_vector[ shared_ptr[DataProcessing] ] getDataProcessing() nogil except + # wrap-doc:Returns a reference to the description of the applied processing + void setDataProcessing(libcpp_vector[ shared_ptr[DataProcessing] ]) nogil except + # wrap-doc:Sets the description of the applied processing diff --git a/src/pyOpenMS/pxds/MetaInfoInterface.pxd b/src/pyOpenMS/pxds/MetaInfoInterface.pxd index 8e013c01d5d..fecbb1b1552 100644 --- a/src/pyOpenMS/pxds/MetaInfoInterface.pxd +++ b/src/pyOpenMS/pxds/MetaInfoInterface.pxd @@ -26,25 +26,25 @@ cdef extern from "" namespace "OpenMS": bool operator==(MetaInfoInterface) nogil except + bool operator!=(MetaInfoInterface) nogil except + - bool isMetaEmpty() nogil except + - void clearMetaInfo() nogil except + + bool isMetaEmpty() nogil except + # wrap-doc:Returns if the MetaInfo is empty + void clearMetaInfo() nogil except + # wrap-doc:Removes all meta values - MetaInfoRegistry metaRegistry() nogil except + + MetaInfoRegistry metaRegistry() nogil except + # wrap-doc:Returns a reference to the MetaInfoRegistry # Cython has a problem with inheritance of overloaded methods, so we # can only declare one of the methods here (most people will want # to use the String-based methods). # - void getKeys(libcpp_vector[String] & keys) + void getKeys(libcpp_vector[String] & keys) nogil except + # wrap-doc:Fills the given vector with a list of all keys for which a value is set #void getKeys(libcpp_vector[unsigned int] & keys) - DataValue getMetaValue(String) nogil except + + DataValue getMetaValue(String) nogil except + # wrap-doc:Returns the value corresponding to a string, or DataValue::EMPTY if not found #DataValue getMetaValue(String, DataValue) nogil except + #DataValue getMetaValue(unsigned int) nogil except + #DataValue getMetaValue(unsigned int, DataValue) nogil except + - void setMetaValue(String, DataValue) nogil except + + void setMetaValue(String, DataValue) nogil except + # wrap-doc:Sets the DataValue corresponding to a name #void setMetaValue(unsigned int, DataValue) nogil except + - bool metaValueExists(String) nogil except + + bool metaValueExists(String) nogil except + # wrap-doc:Returns whether an entry with the given name exists #bool metaValueExists(unsigned int) nogil except + - void removeMetaValue(String) nogil except + + void removeMetaValue(String) nogil except + # wrap-doc:Removes the DataValue corresponding to `name` if it exists #void removeMetaValue(unsigned int) nogil except + diff --git a/src/pyOpenMS/pxds/MetaInfoRegistry.pxd b/src/pyOpenMS/pxds/MetaInfoRegistry.pxd index cb31a2c890d..c19af2a6826 100644 --- a/src/pyOpenMS/pxds/MetaInfoRegistry.pxd +++ b/src/pyOpenMS/pxds/MetaInfoRegistry.pxd @@ -4,17 +4,37 @@ from String cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MetaInfoRegistry "OpenMS::MetaInfoRegistry": + # wrap-doc: + # Registry which assigns unique integer indices to strings + # ----- + # When registering a new name an index >= 1024 is assigned. + # Indices from 1 to 1023 are reserved for fast access and will never change: + # 1 - isotopic_range + # 2 - cluster_id + # 3 - label + # 4 - icon + # 5 - color + # 6 - RT + # 7 - MZ + # 8 - predicted_RT + # 9 - predicted_RT_p_value + # 10 - spectrum_reference + # 11 - ID + # 12 - low_quality + # 13 - charge + MetaInfoRegistry() nogil except + MetaInfoRegistry(MetaInfoRegistry &) nogil except + - UInt registerName(const String & name, const String & description, const String & unit) nogil except + - void setDescription(UInt index, const String & description) nogil except + - void setDescription(const String & name, const String & description) nogil except + - void setUnit(UInt index, const String & unit) nogil except + - void setUnit(const String & name, const String & unit) nogil except + - UInt getIndex(const String & name) nogil except + - String getName(UInt index) nogil except + - String getDescription(UInt index) nogil except + - String getDescription(const String & name) nogil except + - String getUnit(UInt index) nogil except + - String getUnit(const String & name) nogil except + + UInt registerName(const String & name, const String & description, const String & unit) nogil except + # wrap-doc:Registers a string, stores its description and unit, and returns the corresponding index. If the string is already registered, it returns the index of the string + void setDescription(UInt index, const String & description) nogil except + # wrap-doc:Sets the description (String), corresponding to an index + void setDescription(const String & name, const String & description) nogil except + # wrap-doc:Sets the description (String), corresponding to a name + void setUnit(UInt index, const String & unit) nogil except + # wrap-doc:Sets the unit (String), corresponding to an index + void setUnit(const String & name, const String & unit) nogil except + # wrap-doc:Sets the unit (String), corresponding to a name + UInt getIndex(const String & name) nogil except + # wrap-doc:Returns the integer index corresponding to a string. If the string is not registered, returns UInt(-1) (= UINT_MAX) + String getName(UInt index) nogil except + # wrap-doc:Returns the corresponding name to an index + String getDescription(UInt index) nogil except + # wrap-doc:Returns the description of an index + String getDescription(const String & name) nogil except + # wrap-doc:Returns the description of a name + String getUnit(UInt index) nogil except + # wrap-doc:Returns the unit of an index + String getUnit(const String & name) nogil except + # wrap-doc:Returns the unit of a name + diff --git a/src/pyOpenMS/pxds/MetaboTargetedAssay.pxd b/src/pyOpenMS/pxds/MetaboTargetedAssay.pxd index 498b5d6ff07..7d40e2e3468 100644 --- a/src/pyOpenMS/pxds/MetaboTargetedAssay.pxd +++ b/src/pyOpenMS/pxds/MetaboTargetedAssay.pxd @@ -9,7 +9,7 @@ cdef extern from "" namespace "O cdef cppclass MetaboTargetedAssay "OpenMS::MetaboTargetedAssay": - MetaboTargetedAssay() nogil except + + MetaboTargetedAssay() nogil except + # wrap-doc:This class provides methods for the extraction of targeted assays for metabolomics MetaboTargetedAssay(MetaboTargetedAssay &) nogil except + # compiler libcpp_vector[ MetaboTargetedAssay ] extractMetaboTargetedAssay(MSExperiment& spectra, @@ -23,6 +23,21 @@ cdef extern from "" namespace "O bool& method_consensus_spectrum, bool& exclude_ms2_precursor, unsigned int& file_counter) nogil except + + # wrap-doc: + # Extract a vector of MetaboTargetedAssays without using fragment annotation + # ----- + # :param spectra: Input of MSExperiment with spectra information + # :param feature_ms2_spectra_map: FeatureMapping class with associated MS2 spectra + # :param precursor_rt_tol: Retention time tolerance of the precursor + # :param precursor_mz_distance: Max m/z distance of the precursor entries of two spectra to be merged + # :param cosine_sim_threshold: Cosine similarty threshold for the usage of SpectraMerger + # :param transition_threshold: Intensity threshold for MS2 peak used in MetaboTargetedAssay + # :param min_fragment_mz: Minimum m/z a fragment ion has to have to be considered as a transition + # :param max_fragment_mz: Maximum m/z a fragment ion has to have to be considered as a transition + # :param method_consensus_spectrum: Boolean to use consensus spectrum method + # :param exclude_ms2_precursor: Boolean to exclude MS2 precursor from MetaboTargetedAssay + # :param file_counter: Count if multiple files are used + # :returns: Vector of MetaboTargetedAssay libcpp_vector[ MetaboTargetedAssay ] extractMetaboTargetedAssayFragmentAnnotation(libcpp_vector[ MetaboTargetedAssay_CompoundTargetDecoyPair ]& v_cmp_spec, double& transition_threshold, @@ -31,9 +46,26 @@ cdef extern from "" namespace "O bool& use_exact_mass, bool& exclude_ms2_precursor, unsigned int& file_counter) nogil except + + # wrap-doc: + # Extract a vector of MetaboTargetedAssays using fragment annotation + # ----- + # :param v_cmp_spec: Vector of CompoundInfo with associated fragment annotated MSspectrum + # :param transition_threshold: Intensity threshold for MS2 peak used in MetaboTargetedAssay + # :param min_fragment_mz: Minimum m/z a fragment ion has to have to be considered as a transition + # :param max_fragment_mz: Maximum m/z a fragment ion has to have to be considered as a transition + # :param use_exact_mass: Boolean if exact mass should be used as peak mass for annotated fragments + # :param exclude_ms2_precursor: Boolean to exclude MS2 precursor from MetaboTargetedAssay + # :param file_counter: Count if multiple files are used. + # :returns: Vector of MetaboTargetedAssay libcpp_vector[ MetaboTargetedAssay_CompoundTargetDecoyPair ] pairCompoundWithAnnotatedSpectra(libcpp_vector[ SiriusMSFile_CompoundInfo ]& v_cmpinfo, libcpp_vector[ SiriusFragmentAnnotation_SiriusTargetDecoySpectra]& annotated_spectra) nogil except + + # wrap-doc: + # Pair compound information (SiriusMSFile) with the annotated target and decoy spectrum from SIRIUS/Passatutto based on the m_id (unique identifier composed of description_filepath_native_id_k introduced in the SiriusMSConverter) + # ----- + # :param v_cmpinfo: Vector of SiriusMSFile::CompoundInfo + # :param annotated_spectra: Vector of SiriusTargetDecoySpectra + # :return: Vector of MetaboTargetedAssay::CompoundTargetDecoyPair # libcpp_unordered_map[ UInt64, libcpp_vector[ MetaboTargetedAssay ] ] buildAmbiguityGroup(libcpp_vector[ MetaboTargetedAssay]& v_mta, # double& ar_mz_tol, diff --git a/src/pyOpenMS/pxds/MetaboTargetedTargetDecoy.pxd b/src/pyOpenMS/pxds/MetaboTargetedTargetDecoy.pxd index 5e682b79ba4..3cdfd87bcf3 100644 --- a/src/pyOpenMS/pxds/MetaboTargetedTargetDecoy.pxd +++ b/src/pyOpenMS/pxds/MetaboTargetedTargetDecoy.pxd @@ -6,14 +6,30 @@ cdef extern from "" namesp cdef cppclass MetaboTargetedTargetDecoy "OpenMS::MetaboTargetedTargetDecoy": - MetaboTargetedTargetDecoy() nogil except + + MetaboTargetedTargetDecoy() nogil except + # wrap-doc:Resolve overlapping fragments and missing decoys for experimental specific decoy generation in targeted/pseudo targeted metabolomics MetaboTargetedTargetDecoy(MetaboTargetedTargetDecoy &) nogil except + # compiler libcpp_vector[ MetaboTargetedTargetDecoy_MetaboTargetDecoyMassMapping] constructTargetDecoyMassMapping(TargetedExperiment& t_exp) nogil except + + # wrap-doc: + # Constructs a mass mapping of targets and decoys using the unique m_id identifier + # ----- + # :param t_exp: TransitionExperiment holds compound and transition information used for the mapping void resolveOverlappingTargetDecoyMassesByIndividualMassShift(TargetedExperiment& t_exp, libcpp_vector[ MetaboTargetedTargetDecoy_MetaboTargetDecoyMassMapping ]& mappings, double& mass_to_add) nogil except + + # wrap-doc: + # Resolves overlapping target and decoy transition masses by adding a specifiable mass (e.g. CH2) to the overlapping decoy fragment + # ----- + # :param t_exp: TransitionExperiment holds compound and transition information + # :param mappings: Map of identifier to target and decoy masses + # :param mass_to_add: (e.g. CH2) void generateMissingDecoysByMassShift(TargetedExperiment& t_exp, libcpp_vector[ MetaboTargetedTargetDecoy_MetaboTargetDecoyMassMapping ]& mappings, double& mass_to_add) nogil except + + # wrap-doc: + # Generate a decoy for targets where fragmentation tree re-rooting was not possible, by adding a specifiable mass to the target fragments + # ----- + # :param t_exp: TransitionExperiment holds compound and transition information + # :param mappings: Map of identifier to target and decoy masses + # :param mass_to_add: The maximum number of transitions required per assay cdef cppclass MetaboTargetedTargetDecoy_MetaboTargetDecoyMassMapping "OpenMS::MetaboTargetedTargetDecoy::MetaboTargetDecoyMassMapping": diff --git a/src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd b/src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd index b6f4710568b..c50a90bb023 100644 --- a/src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd +++ b/src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd @@ -14,6 +14,15 @@ cdef extern from "" MetaboliteFeatureDeconvolution() nogil except + MetaboliteFeatureDeconvolution(MetaboliteFeatureDeconvolution &) nogil except + void compute(FeatureMap & fm_in, FeatureMap & fm_out, ConsensusMap & cons_map, ConsensusMap & cons_map_p) nogil except + + # wrap-doc: + # Compute a zero-charge feature map from a set of charged features + # ----- + # Find putative ChargePairs, then score them and hand over to ILP + # ----- + # :param fm_in: Input feature-map + # :param fm_out: Output feature-map (sorted by position and augmented with user params) + # :param cons_map: Output of grouped features belonging to a charge group + # :param cons_map_p: Output of paired features connected by an edge cdef extern from "" namespace "OpenMS::MetaboliteFeatureDeconvolution": diff --git a/src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd b/src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd index 3eb8fa5bfdb..91d37051ca5 100644 --- a/src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd +++ b/src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd @@ -21,8 +21,8 @@ cdef extern from "" namespace " cdef cppclass SpectralMatch: - SpectralMatch() nogil except + - SpectralMatch(SpectralMatch &) nogil except + + SpectralMatch() nogil except +# TODO(Whole file) + SpectralMatch(SpectralMatch &) nogil except + double getObservedPrecursorMass() nogil except + void setObservedPrecursorMass(double)nogil except + diff --git a/src/pyOpenMS/pxds/Modification.pxd b/src/pyOpenMS/pxds/Modification.pxd index 67747663531..b5c801c4e8e 100644 --- a/src/pyOpenMS/pxds/Modification.pxd +++ b/src/pyOpenMS/pxds/Modification.pxd @@ -14,17 +14,17 @@ cdef extern from "" namespace "OpenMS": # SampleTreatment * clone() nogil except + - String getReagentName() nogil except + - void setReagentName(const String & reagent_name) nogil except + + String getReagentName() nogil except + # wrap-doc:Returns the name of the reagent that was used (default "") + void setReagentName(const String & reagent_name) nogil except + # wrap-doc:Sets the name of the reagent that was used - double getMass() nogil except + - void setMass(double mass) nogil except + + double getMass() nogil except + # wrap-doc:Returns the mass change (default 0.0) + void setMass(double mass) nogil except + # wrap-doc:Sets the mass change - Modification_SpecificityType getSpecificityType() nogil except + - void setSpecificityType(Modification_SpecificityType & specificity_type) nogil except + + Modification_SpecificityType getSpecificityType() nogil except + # wrap-doc:Returns the specificity of the reagent (default AA) + void setSpecificityType(Modification_SpecificityType & specificity_type) nogil except + # wrap-doc:Sets the specificity of the reagent - String getAffectedAminoAcids() nogil except + - void setAffectedAminoAcids(const String & affected_amino_acids) nogil except + + String getAffectedAminoAcids() nogil except + # wrap-doc:Returns a string containing the one letter code of the amino acids that are affected by the reagent (default "") + void setAffectedAminoAcids(const String & affected_amino_acids) nogil except + # wrap-doc:Returns a string containing the one letter code of the amino acids that are affected by the reagent. Do not separate them by space, tab or comma! cdef extern from "" namespace "OpenMS::Modification": cdef enum Modification_SpecificityType "OpenMS::Modification::SpecificityType": @@ -36,4 +36,3 @@ cdef extern from "" namespace "OpenMS::Modificat CTERM NTERM SIZE_OF_SPECIFICITYTYPE - diff --git a/src/pyOpenMS/pxds/ModificationDefinition.pxd b/src/pyOpenMS/pxds/ModificationDefinition.pxd index a2c698736d3..652171d5ee7 100644 --- a/src/pyOpenMS/pxds/ModificationDefinition.pxd +++ b/src/pyOpenMS/pxds/ModificationDefinition.pxd @@ -22,12 +22,12 @@ cdef extern from "" namespace "OpenMS bool operator!=(ModificationDefinition &rhs) nogil except + bool operator<(ModificationDefinition &) nogil except + - void setFixedModification(bool fixed) nogil except + - bool isFixedModification() nogil except + - void setMaxOccurrences(UInt num) nogil except + - UInt getMaxOccurrences() nogil except + - String getModificationName() nogil except + - void setModification(const String &modification) nogil except + + void setFixedModification(bool fixed) nogil except + # wrap-doc:Sets whether this modification definition is fixed or variable (modification must occur vs. can occur) + bool isFixedModification() nogil except + # wrap-doc:Returns if the modification if fixed true, else false + void setMaxOccurrences(UInt num) nogil except + # wrap-doc:Set the maximal number of occurrences per peptide (unbounded if 0) + UInt getMaxOccurrences() nogil except + # wrap-doc:Returns the maximal number of occurrences per peptide + String getModificationName() nogil except + # wrap-doc:Returns the name of the modification + void setModification(const String &modification) nogil except + # wrap-doc:Sets the modification, allowed are unique names provided by ModificationsDB ResidueModification getModification() nogil except + diff --git a/src/pyOpenMS/pxds/ModificationDefinitionsSet.pxd b/src/pyOpenMS/pxds/ModificationDefinitionsSet.pxd index ade17e85fd2..af5077d2058 100644 --- a/src/pyOpenMS/pxds/ModificationDefinitionsSet.pxd +++ b/src/pyOpenMS/pxds/ModificationDefinitionsSet.pxd @@ -9,6 +9,12 @@ from AASequence cimport * cdef extern from "" namespace "OpenMS": cdef cppclass ModificationDefinitionsSet: + # wrap-doc: + # Representation of a set of modification definitions + # ----- + # This class enhances the modification definitions as defined in the + # class ModificationDefinition into a set of definitions. This is also + # e.g. used as input parameters in search engines. ModificationDefinitionsSet() nogil except + ModificationDefinitionsSet(ModificationDefinitionsSet &) nogil except + @@ -17,22 +23,29 @@ cdef extern from "" namespace "Op # The StringLists should contain UniMod (www.unimod.org) terms, e.g. 'Carbamidomethyl (C)' or 'Oxidation (M)' ModificationDefinitionsSet(StringList fixed_modifications, StringList variable_modifications) nogil except + - void setMaxModifications(Size max_mod) nogil except + - Size getMaxModifications() nogil except + - Size getNumberOfModifications() nogil except + - Size getNumberOfFixedModifications() nogil except + - Size getNumberOfVariableModifications() nogil except + - void addModification(ModificationDefinition &mod_def) nogil except + - void setModifications(libcpp_set[ ModificationDefinition ] &mod_defs) nogil except + + void setMaxModifications(Size max_mod) nogil except + # wrap-doc:Sets the maximal number of modifications allowed per peptide + Size getMaxModifications() nogil except + # wrap-doc:Return the maximal number of modifications allowed per peptide + Size getNumberOfModifications() nogil except + # wrap-doc:Returns the number of modifications stored in this set + Size getNumberOfFixedModifications() nogil except + # wrap-doc:Returns the number of fixed modifications stored in this set + Size getNumberOfVariableModifications() nogil except + # wrap-doc:Returns the number of variable modifications stored in this set + void addModification(ModificationDefinition &mod_def) nogil except + # wrap-doc:Adds a modification definition to the set + void setModifications(libcpp_set[ ModificationDefinition ] &mod_defs) nogil except + # wrap-doc:Sets the modification definitions void setModifications(const String &fixed_modifications, String &variable_modifications) nogil except + - void setModifications(StringList &fixed_modifications, StringList &variable_modifications) nogil except + - libcpp_set[ModificationDefinition] getModifications() nogil except + - libcpp_set[ModificationDefinition] getFixedModifications() nogil except + - libcpp_set[ModificationDefinition] getVariableModifications() nogil except + - void getModificationNames(StringList &fixed_modifications, StringList &variable_modifications) nogil except + - libcpp_set[String] getFixedModificationNames() nogil except + - libcpp_set[String] getVariableModificationNames() nogil except + - libcpp_set[String] getModificationNames() nogil except + - bool isCompatible(AASequence &peptide) nogil except + - void inferFromPeptides(libcpp_vector[ PeptideIdentification ] &peptides) nogil except + + # wrap-doc: + # Set the modification definitions from a string + # ----- + # The strings should contain a comma separated list of modifications. The names + # can be PSI-MOD identifier or any other unique name supported by PSI-MOD. TermSpec + # definitions and other specific definitions are given by the modifications themselves. + + void setModifications(StringList &fixed_modifications, StringList &variable_modifications) nogil except + # wrap-doc:Same as above, but using StringList instead of comma separated strings + libcpp_set[ModificationDefinition] getModifications() nogil except + # wrap-doc:Returns the stored modification definitions + libcpp_set[ModificationDefinition] getFixedModifications() nogil except + # wrap-doc:Returns the stored fixed modification definitions + libcpp_set[ModificationDefinition] getVariableModifications() nogil except + # wrap-doc:Returns the stored variable modification definitions + void getModificationNames(StringList &fixed_modifications, StringList &variable_modifications) nogil except + # wrap-doc:Populates the output lists with the modification names (use e.g. for ProteinIdentification::SearchParameters) + libcpp_set[String] getFixedModificationNames() nogil except + # wrap-doc:Returns only the names of the fixed modifications + libcpp_set[String] getVariableModificationNames() nogil except + # wrap-doc:Returns only the names of the variable modifications + libcpp_set[String] getModificationNames() nogil except + # wrap-doc:Returns only the names of the modifications stored in the set + bool isCompatible(AASequence &peptide) nogil except + # wrap-doc:Returns true if the peptide is compatible with the definitions, e.g. does not contain other modifications + void inferFromPeptides(libcpp_vector[ PeptideIdentification ] &peptides) nogil except + # wrap-doc:Infers the sets of defined modifications from the modifications present on peptide identifications diff --git a/src/pyOpenMS/pxds/ModificationsDB.pxd b/src/pyOpenMS/pxds/ModificationsDB.pxd index 256f49146a2..be6e5ee01fd 100644 --- a/src/pyOpenMS/pxds/ModificationsDB.pxd +++ b/src/pyOpenMS/pxds/ModificationsDB.pxd @@ -16,37 +16,60 @@ cdef extern from "" namespace "OpenMS": # private ModificationsDB(ModificationsDB) nogil except + # wrap-ignore - Size getNumberOfModifications() nogil except + + Size getNumberOfModifications() nogil except + # wrap-doc:Returns the number of modifications read from the unimod.xml file void searchModifications(libcpp_set[ const ResidueModification * ] & mods, const String& mod_name, const String& residue, TermSpecificity term_spec) nogil except + + # wrap-doc: + # Collects all modifications which have the given name as synonym + # ----- + # If `residue` is set, only modifications with matching residue of origin are considered. + # If `term_spec` is set, only modifications with matching term specificity are considered. + # The resulting set of modifications will be empty if no modification exists that fulfills the criteria. - const ResidueModification * getModification(Size index) nogil except + + const ResidueModification * getModification(Size index) nogil except + # wrap-doc:Returns the modification with the given index - const ResidueModification * getModification(const String & mod_name) nogil except + + const ResidueModification * getModification(const String & mod_name) nogil except + # wrap-doc:Returns the modification with the given name const ResidueModification * getModification(const String & mod_name, const String & residue, - TermSpecificity term_spec) nogil except + + TermSpecificity term_spec) nogil except + # wrap-doc:Returns the modification with the given arguments - bool has(String modification) nogil except + + bool has(String modification) nogil except + # wrap-doc:Returns true if the modification exists #void addModification(libcpp_unique_ptr[ResidueModification] new_mod) nogil except + - Size findModificationIndex(const String & mod_name) nogil except + + Size findModificationIndex(const String & mod_name) nogil except + # wrap-doc:Returns the index of the modification in the mods_ vector; a unique name must be given void searchModificationsByDiffMonoMass(libcpp_vector[ String ] & mods, double mass, double max_error, - const String & residue, TermSpecificity term_spec) nogil except + + const String & residue, TermSpecificity term_spec) nogil except + # wrap-doc:Collects all modifications with delta mass inside a tolerance window const ResidueModification* getBestModificationByDiffMonoMass(double mass, double max_error, const String& residue, TermSpecificity term_spec) nogil except + - - void getAllSearchModifications(libcpp_vector[ String ] & modifications) nogil except + - - bool isInstantiated() nogil except + + # wrap-doc: + # Returns the best matching modification for the given delta mass and residue + # ----- + # Query the modifications DB to get the best matching modification with + # the given delta mass at the given residue (NULL pointer means no result, + # maybe the maximal error tolerance needs to be increased). Possible + # input for CAM modification would be a delta mass of 57 and a residue + # of "C". + # ----- + # Note: If there are multiple possible matches with equal masses, it + # will choose the _first_ match which defaults to the first matching + # UniMod entry. + # ----- + # :param residue: The residue at which the modifications occurs + # :param mass: The monoisotopic mass of the residue including the mass of the modification + # :param max_error: The maximal mass error in the modification search + # :returns: A pointer to the best matching modification (or NULL if none was found) + + void getAllSearchModifications(libcpp_vector[ String ] & modifications) nogil except + # wrap-doc:Collects all modifications that can be used for identification searches + + bool isInstantiated() nogil except + # wrap-doc:Check whether ModificationsDB was instantiated before ## wrap static methods cdef extern from "" namespace "OpenMS::ModificationsDB": diff --git a/src/pyOpenMS/pxds/MorpheusScore.pxd b/src/pyOpenMS/pxds/MorpheusScore.pxd index ccc8c990aaf..0dbefb19d77 100644 --- a/src/pyOpenMS/pxds/MorpheusScore.pxd +++ b/src/pyOpenMS/pxds/MorpheusScore.pxd @@ -10,7 +10,7 @@ cdef extern from "" namespace "OpenMS": MorpheusScore_Result compute(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const MSSpectrum & exp_spectrum, - const MSSpectrum & theo_spectrum) nogil except + + const MSSpectrum & theo_spectrum) nogil except + # wrap-doc:Returns Morpheus Score cdef extern from "" namespace "OpenMS::MorpheusScore": diff --git a/src/pyOpenMS/pxds/MorphologicalFilter.pxd b/src/pyOpenMS/pxds/MorphologicalFilter.pxd index 0102c6b9574..d01932b039c 100644 --- a/src/pyOpenMS/pxds/MorphologicalFilter.pxd +++ b/src/pyOpenMS/pxds/MorphologicalFilter.pxd @@ -16,6 +16,23 @@ cdef extern from "" namespace " # private MorphologicalFilter(MorphologicalFilter) nogil except + # wrap-ignore - void filter(MSSpectrum & spectrum) nogil except + - void filterExperiment(MSExperiment & exp) nogil except + - + void filter(MSSpectrum & spectrum) nogil except + + # wrap-doc: + # Applies the morphological filtering operation to an MSSpectrum + # ----- + # If the size of the structuring element is given in 'Thomson', the number of data points for + # the structuring element is computed as follows: + # + # - The data points are assumed to be uniformly spaced. We compute the + # average spacing from the position of the first and the last peak and the + # total number of peaks in the input range + # - The number of data points in the structuring element is computed + # from struc_size and the average spacing, and rounded up to an odd + # number + + void filterExperiment(MSExperiment & exp) nogil except + + # wrap-doc: + # Applies the morphological filtering operation to an MSExperiment + # ----- + # The size of the structuring element is computed for each spectrum individually, if it is given in 'Thomson' + # See the filtering method for MSSpectrum for details diff --git a/src/pyOpenMS/pxds/MsInspectFile.pxd b/src/pyOpenMS/pxds/MsInspectFile.pxd index 378aad45c3a..0f02b6cbbfa 100644 --- a/src/pyOpenMS/pxds/MsInspectFile.pxd +++ b/src/pyOpenMS/pxds/MsInspectFile.pxd @@ -10,5 +10,14 @@ cdef extern from "" namespace "OpenMS": MsInspectFile() nogil except + MsInspectFile(MsInspectFile &) nogil except + # compiler void load(const String & filename, FeatureMap & feature_map) nogil except + - void store(const String & filename, MSSpectrum & spectrum) nogil except + + # wrap-doc: + # Loads a MsInspect file into a featureXML + # ----- + # The content of the file is stored in `features` + # :raises: + # Exception: FileNotFound is thrown if the file could not be opened + # :raises: + # Exception: ParseError is thrown if an error occurs during parsing + + void store(const String & filename, MSSpectrum & spectrum) nogil except + # wrap-doc:Stores a featureXML as a MsInspect file diff --git a/src/pyOpenMS/pxds/MultiplexDeltaMasses.pxd b/src/pyOpenMS/pxds/MultiplexDeltaMasses.pxd index c4c91d6af38..e5e612100e7 100644 --- a/src/pyOpenMS/pxds/MultiplexDeltaMasses.pxd +++ b/src/pyOpenMS/pxds/MultiplexDeltaMasses.pxd @@ -7,6 +7,21 @@ from String cimport * cdef extern from "" namespace "OpenMS": cdef cppclass MultiplexDeltaMasses "OpenMS::MultiplexDeltaMasses": + # wrap-doc: + # Data structure for mass shift pattern + # ----- + # Groups of labelled peptides appear with characteristic mass shifts + # ----- + # For example, for an Arg6 labeled SILAC peptide pair we expect to see + # mass shifts of 0 and 6 Da. Or as second example, for a + # peptide pair of a dimethyl labelled sample with a single lysine + # we will see mass shifts of 56 Da and 64 Da. + # 28 Da (N-term) + 28 Da (K) and 34 Da (N-term) + 34 Da (K) + # for light and heavy partners respectively. + # ----- + # The data structure stores the mass shifts and corresponding labels + # for a group of matching peptide features. + MultiplexDeltaMasses() nogil except + MultiplexDeltaMasses(MultiplexDeltaMasses &) nogil except + diff --git a/src/pyOpenMS/pxds/MultiplexIsotopicPeakPattern.pxd b/src/pyOpenMS/pxds/MultiplexIsotopicPeakPattern.pxd index d8cff732ed3..bc78aa80d00 100644 --- a/src/pyOpenMS/pxds/MultiplexIsotopicPeakPattern.pxd +++ b/src/pyOpenMS/pxds/MultiplexIsotopicPeakPattern.pxd @@ -8,12 +8,12 @@ cdef extern from "