本文整理汇总了C++中TransformationDescription::apply方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformationDescription::apply方法的具体用法?C++ TransformationDescription::apply怎么用?C++ TransformationDescription::apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformationDescription
的用法示例。
在下文中一共展示了TransformationDescription::apply方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformRetentionTimes
void MapAlignmentTransformer::transformRetentionTimes(
MSExperiment<>& msexp, const TransformationDescription& trafo,
bool store_original_rt)
{
msexp.clearRanges();
// Transform spectra
for (MSExperiment<>::iterator mse_iter = msexp.begin();
mse_iter != msexp.end(); ++mse_iter)
{
double rt = mse_iter->getRT();
if (store_original_rt) storeOriginalRT_(*mse_iter, rt);
mse_iter->setRT(trafo.apply(rt));
}
// Also transform chromatograms
for (Size i = 0; i < msexp.getNrChromatograms(); ++i)
{
MSChromatogram<ChromatogramPeak>& chromatogram = msexp.getChromatogram(i);
vector<double> original_rts;
if (store_original_rt) original_rts.reserve(chromatogram.size());
for (Size j = 0; j < chromatogram.size(); j++)
{
double rt = chromatogram[j].getRT();
if (store_original_rt) original_rts.push_back(rt);
chromatogram[j].setRT(trafo.apply(rt));
}
if (store_original_rt && !chromatogram.metaValueExists("original_rt"))
{
chromatogram.setMetaValue("original_rt", original_rts);
}
}
msexp.updateRanges();
}
示例2: transformSinglePeakMap
void MapAlignmentTransformer::transformSinglePeakMap(MSExperiment<> & msexp,
const TransformationDescription & trafo)
{
msexp.clearRanges();
// Transform spectra
for (MSExperiment<>::iterator mse_iter = msexp.begin(); mse_iter != msexp.end(); ++mse_iter)
{
DoubleReal rt = mse_iter->getRT();
mse_iter->setRT(trafo.apply(rt));
}
// Also transform chromatograms
DoubleReal rt;
std::vector<MSChromatogram<ChromatogramPeak> > chromatograms;
for (Size i = 0; i < msexp.getChromatograms().size(); i++)
{
MSChromatogram<ChromatogramPeak> chromatogram = msexp.getChromatograms()[i];
for (Size j = 0; j < chromatogram.size(); j++)
{
rt = chromatogram[j].getRT();
chromatogram[j].setRT(trafo.apply(rt));
}
chromatograms.push_back(chromatogram);
}
msexp.setChromatograms(chromatograms);
msexp.updateRanges();
}
示例3: applyToFeature_
void MapAlignmentTransformer::applyToFeature_(Feature & feature,
const TransformationDescription & trafo)
{
applyToBaseFeature_(feature, trafo);
// loop over all convex hulls
vector<ConvexHull2D> & convex_hulls = feature.getConvexHulls();
for (vector<ConvexHull2D>::iterator chiter = convex_hulls.begin();
chiter != convex_hulls.end(); ++chiter)
{
// transform all hull point positions within convex hull
ConvexHull2D::PointArrayType points = chiter->getHullPoints();
chiter->clear();
for (ConvexHull2D::PointArrayType::iterator points_iter = points.begin();
points_iter != points.end();
++points_iter
)
{
DoubleReal rt = (*points_iter)[Feature::RT];
(*points_iter)[Feature::RT] = trafo.apply(rt);
}
chiter->setHullPoints(points);
}
// recurse into subordinates
for (vector<Feature>::iterator subiter = feature.getSubordinates().begin();
subiter != feature.getSubordinates().end();
++subiter)
{
applyToFeature_(*subiter, trafo);
}
}
示例4: transformSinglePeptideIdentification
void MapAlignmentTransformer::transformSinglePeptideIdentification(vector<PeptideIdentification>& pepids,
const TransformationDescription& trafo)
{
for (UInt pepid_index = 0; pepid_index < pepids.size(); ++pepid_index)
{
PeptideIdentification& pepid = pepids[pepid_index];
if (pepid.hasRT())
{
pepid.setRT(trafo.apply(pepid.getRT()));
}
}
}
示例5: applyToBaseFeature_
void MapAlignmentTransformer::applyToBaseFeature_(BaseFeature & feature,
const TransformationDescription & trafo)
{
// transform feature position:
DoubleReal rt = feature.getRT();
feature.setRT(trafo.apply(rt));
// adapt RT values of annotated peptides:
if (!feature.getPeptideIdentifications().empty())
{
transformSinglePeptideIdentification(feature.getPeptideIdentifications(),
trafo);
}
}
示例6: applyToConsensusFeature_
void MapAlignmentTransformer::applyToConsensusFeature_(
ConsensusFeature& feature, const TransformationDescription& trafo,
bool store_original_rt)
{
applyToBaseFeature_(feature, trafo, store_original_rt);
// apply to grouped features (feature handles):
for (ConsensusFeature::HandleSetType::const_iterator it =
feature.getFeatures().begin(); it != feature.getFeatures().end();
++it)
{
double rt = it->getRT();
it->asMutable().setRT(trafo.apply(rt));
}
}
示例7: applyToConsensusFeature_
void MapAlignmentTransformer::applyToConsensusFeature_(ConsensusFeature & feature,
const TransformationDescription & trafo)
{
typedef ConsensusFeature::HandleSetType::const_iterator TConstHandleSetIterator;
applyToBaseFeature_(feature, trafo);
// apply to grouped features (feature handles):
for (TConstHandleSetIterator it = feature.getFeatures().begin();
it != feature.getFeatures().end();
++it)
{
DoubleReal rt = it->getRT();
it->asMutable().setRT(trafo.apply(rt));
}
}
示例8: applyToBaseFeature_
void MapAlignmentTransformer::applyToBaseFeature_(
BaseFeature& feature, const TransformationDescription& trafo,
bool store_original_rt)
{
// transform feature position:
double rt = feature.getRT();
if (store_original_rt) storeOriginalRT_(feature, rt);
feature.setRT(trafo.apply(rt));
// adapt RT values of annotated peptides:
if (!feature.getPeptideIdentifications().empty())
{
transformRetentionTimes(feature.getPeptideIdentifications(), trafo,
store_original_rt);
}
}
示例9: transformSinglePeptideIdentification
void MapAlignmentTransformer::transformSinglePeptideIdentification(vector<PeptideIdentification> & pepids,
const TransformationDescription & trafo)
{
const UInt meta_index_RT = MetaInfo::registry().getIndex("RT");
for (UInt pepid_index = 0; pepid_index < pepids.size(); ++pepid_index)
{
PeptideIdentification & pepid = pepids[pepid_index];
DataValue dv = pepid.getMetaValue(meta_index_RT);
if (dv != DataValue::EMPTY)
{
DoubleReal rt(dv);
rt = trafo.apply(rt);
pepid.setMetaValue(meta_index_RT, rt);
}
}
}
示例10: outsideExtractionWindow_
bool ChromatogramExtractor::outsideExtractionWindow_(const ReactionMonitoringTransition& transition, double current_rt,
const TransformationDescription& trafo, double rt_extraction_window)
{
if (rt_extraction_window < 0)
{
return false;
}
// Get the expected retention time, apply the RT-transformation
// (which describes the normalization) and then take the difference.
// Note that we inverted the transformation in the beginning because
// we want to transform from normalized to real RTs here and not the
// other way round.
double expected_rt = PeptideRTMap_[transition.getPeptideRef()];
double de_normalized_experimental_rt = trafo.apply(expected_rt);
if (current_rt < de_normalized_experimental_rt - rt_extraction_window / 2.0 ||
current_rt > de_normalized_experimental_rt + rt_extraction_window / 2.0 )
{
return true;
}
return false;
}