Search in sources :

Example 1 with ComponentSelector

use of dulab.adap.workflow.decomposition.ComponentSelector in project mzmine2 by mzmine.

the class ADAP3DecompositionV2SetupDialog method shapeCluster.

/**
 * Cluster list of PeakInfo based on the chromatographic shapes
 */
private void shapeCluster() {
    ChromatogramPeakPair chromatogramPeakPair = cboPeakLists.getItemAt(cboPeakLists.getSelectedIndex());
    if (chromatogramPeakPair == null)
        return;
    PeakList chromatogramList = chromatogramPeakPair.chromatograms;
    PeakList peakList = chromatogramPeakPair.peaks;
    if (chromatogramList == null || peakList == null)
        return;
    final RetTimeClusterer.Cluster cluster = cboClusters.getItemAt(cboClusters.getSelectedIndex());
    if (cluster == null)
        return;
    Double retTimeTolerance = parameterSet.getParameter(ADAP3DecompositionV2Parameters.RET_TIME_TOLERANCE).getValue();
    Boolean adjustApexRetTime = parameterSet.getParameter(ADAP3DecompositionV2Parameters.ADJUST_APEX_RET_TIME).getValue();
    Integer minClusterSize = parameterSet.getParameter(ADAP3DecompositionV2Parameters.MIN_CLUSTER_SIZE).getValue();
    if (retTimeTolerance == null || retTimeTolerance <= 0.0 || adjustApexRetTime == null || minClusterSize == null || minClusterSize <= 0)
        return;
    List<BetterPeak> chromatograms = new ADAP3DecompositionV2Utils().getPeaks(chromatogramList);
    List<BetterComponent> components = null;
    try {
        components = new ComponentSelector().execute(chromatograms, cluster, retTimeTolerance, adjustApexRetTime, minClusterSize);
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (components != null)
        // chromatograms
        retTimeIntensityPlot.updateData(chromatograms, components);
}
Also used : BetterPeak(dulab.adap.datamodel.BetterPeak) ComponentSelector(dulab.adap.workflow.decomposition.ComponentSelector) BetterComponent(dulab.adap.datamodel.BetterComponent) RetTimeClusterer(dulab.adap.workflow.decomposition.RetTimeClusterer) PeakList(net.sf.mzmine.datamodel.PeakList)

Aggregations

BetterComponent (dulab.adap.datamodel.BetterComponent)1 BetterPeak (dulab.adap.datamodel.BetterPeak)1 ComponentSelector (dulab.adap.workflow.decomposition.ComponentSelector)1 RetTimeClusterer (dulab.adap.workflow.decomposition.RetTimeClusterer)1 PeakList (net.sf.mzmine.datamodel.PeakList)1