137 BINNING_TYPE = 1 << 0,
138 BIN_SIZE_MODEL = 1 << 1,
139 BIN_SIZE_DIVISOR = 1 << 2,
140 DECIMAL_PLACES = 1 << 3,
141 BINNING_LOGIC_PARTIAL = (BINNING_TYPE | BIN_SIZE_MODEL),
143 (BINNING_LOGIC_PARTIAL | BIN_SIZE_DIVISOR | DECIMAL_PLACES),
144 REMOVE_ZERO_DATA_POINTS = 1 << 4,
145 FULL = (REMOVE_ZERO_DATA_POINTS | BINNING_LOGIC_FULL),
147 Q_ENUM(InitializationResult)
151 QObject *parent =
nullptr);
154 BinningType binningType,
158 bool removeZeroValDataPoints,
159 QObject *parent =
nullptr);
164 Q_INVOKABLE InitializationResult initialize(
const QString &text);
166 Q_INVOKABLE
void initialize(
double minMz,
168 BinningType binningType,
172 bool removeZeroValDataPoints,
173 QObject *parent =
nullptr);
177 QObject *parent =
nullptr);
180 InitializationResult initialization_results);
182 Q_INVOKABLE
void setSmallestMz(
double value);
183 Q_INVOKABLE
void updateSmallestMz(
double value);
184 Q_INVOKABLE
double getSmallestMz()
const;
186 Q_INVOKABLE
void setGreatestMz(
double value);
187 Q_INVOKABLE
void updateGreatestMz(
double value);
188 Q_INVOKABLE
double getGreatestMz()
const;
190 Q_INVOKABLE
void setLowerAnchorMz(
double value);
191 Q_INVOKABLE
void updateLowerAnchorMz(
double value);
192 Q_INVOKABLE
double getLowerAnchorMz()
const;
194 Q_INVOKABLE
void setUpperAnchorMz(
double value);
195 Q_INVOKABLE
void updateUpperAnchorMz(
double value);
196 Q_INVOKABLE
double getUpperAnchorMz()
const;
198 Q_INVOKABLE
void setMzValues(
double smallest,
double greatest);
200 Q_INVOKABLE
void setBinningType(BinningType binningType);
201 Q_INVOKABLE BinningType getBinningType()
const;
206 Q_INVOKABLE
void setBinSizeDivisor(
int divisor);
207 Q_INVOKABLE
int getBinSizeDivisor()
const;
209 Q_INVOKABLE
void setDecimalPlaces(
int decimal_places);
210 Q_INVOKABLE
int getDecimalPlaces()
const;
212 Q_INVOKABLE
void setRemoveZeroValDataPoints(
bool removeOrNot =
true);
213 Q_INVOKABLE
bool isRemoveZeroValDataPoints()
const;
215 Q_INVOKABLE
void reset();
217 Q_INVOKABLE
bool isValid()
const;
219 Q_INVOKABLE
bool hasValidMzRange()
const;
221 Q_INVOKABLE std::vector<double> createBins();
222 Q_INVOKABLE std::vector<double>
225 Q_INVOKABLE QString toString(
int offset,
const QString &spacer =
" ")
const;
248 double m_smallestMz = std::numeric_limits<double>::max();
252 double m_greatestMz = std::numeric_limits<double>::min();
309 static_cast<uint32_t
>(
a) |
static_cast<uint32_t
>(
b));
317 static_cast<uint32_t
>(
a) &
static_cast<uint32_t
>(
b));
328extern std::map<MzIntegrationParams::BinningType, QString>
binningTypeMap;
The MzIntegrationParams class provides the parameters definining how m/z integrations must be perform...
void binSizeDivisorChanged()
Q_INVOKABLE int getDecimalPlaces() const
Q_INVOKABLE MzIntegrationParams(QObject *parent=nullptr)
void binSizeModelChanged()
Q_INVOKABLE int getBinSizeDivisor() const
BinningType m_binningType
void upperAnchorMzChanged()
std::vector< double > createDataBasedBinsOld(pappso::MassSpectrumCstSPtr massSpectrum)
Q_INVOKABLE double getLowerAnchorMz() const
Q_INVOKABLE void setBinSizeModel(pappso::PrecisionPtr bin_size_model_p)
Q_INVOKABLE void setBinSizeDivisor(int divisor)
std::vector< double > createArbitraryBins()
pappso::PrecisionPtr binSizeModel
Q_INVOKABLE void setGreatestMz(double value)
void lowerAnchorMzChanged()
Q_INVOKABLE void setSmallestMz(double value)
Q_INVOKABLE QString binsToStringWithDeltas(const std::vector< double > bins) const
Q_INVOKABLE bool isRemoveZeroValDataPoints() const
Q_INVOKABLE double getSmallestMz() const
pappso::PrecisionPtr m_binSizeModel
Q_INVOKABLE BinningType getBinningType() const
Q_INVOKABLE pappso::PrecisionPtr getBinSizeModel() const
@ ARBITRARY
binning based on arbitrary bin size value
void decimalPlacesChanged()
static void registerJsConstructor(QJSEngine *engine)
void removeZeroValDataPointsChanged()
bool removeZeroValDataPoints
Q_INVOKABLE QString toString(int offset, const QString &spacer=" ") const
void binningTypeChanged()
bool m_removeZeroValDataPoints
Q_INVOKABLE void setBinningType(BinningType binningType)
std::vector< double > createDataBasedBins(pappso::MassSpectrumCstSPtr massSpectrum)
Q_INVOKABLE void setDecimalPlaces(int decimal_places)
Q_INVOKABLE void setRemoveZeroValDataPoints(bool removeOrNot=true)
Q_INVOKABLE double getGreatestMz() const
Q_INVOKABLE void setLowerAnchorMz(double value)
static PrecisionPtr getResInstance(pappso_double value)
get a resolution precision pointer
#define PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
constexpr MzIntegrationParams::InitializationResult operator|=(MzIntegrationParams::InitializationResult &a, MzIntegrationParams::InitializationResult b)
MzIntegrationParams::BinningType getBinningTypeFromString(const QString &text)
std::map< MzIntegrationParams::BinningType, QString > binningTypeMap
Map relating the BinningType to a textual representation.
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
const PrecisionBase * PrecisionPtr
constexpr MzIntegrationParams::InitializationResult operator|(MzIntegrationParams::InitializationResult a, MzIntegrationParams::InitializationResult b)
constexpr MzIntegrationParams::InitializationResult operator&(MzIntegrationParams::InitializationResult a, MzIntegrationParams::InitializationResult b)