org.knime.base.node.preproc.correlation.pmcc
Class PMCCPortObjectAndSpec

java.lang.Object
  extended by org.knime.base.node.preproc.correlation.pmcc.PMCCPortObjectAndSpec
All Implemented Interfaces:
PortObject, PortObjectSpec

public final class PMCCPortObjectAndSpec
extends Object
implements PortObject, PortObjectSpec

PortObject and PortObjectSpec of the model that's passed between the correlation nodes.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObject
PortObject.PortObjectSerializer<T extends PortObject>
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObjectSpec
PortObjectSpec.PortObjectSpecSerializer<T extends PortObjectSpec>
 
Field Summary
(package private) static double ROUND_ERROR_OK
          Values smaller than this are considered to be 0, used to avoid round-off errors.
(package private) static PortType TYPE
          Convenience access field for the port type.
 
Constructor Summary
PMCCPortObjectAndSpec(String[] includes)
          Creates new object, whereby no correlation values are available.
PMCCPortObjectAndSpec(String[] includes, HalfDoubleMatrix cors)
          Creates new object with content.
 
Method Summary
(package private)  BufferedDataTable createCorrelationMatrix(ExecutionContext con)
          Creates the correlation table, used in the view and as output table.
(package private) static DataTableSpec createOutSpec(String[] names)
          Creates output spec for correlation table.
(package private)  String[] getColNames()
           
static PortObject.PortObjectSerializer<PMCCPortObjectAndSpec> getPortObjectSerializer()
          Serializer required by the PortObject interface.
static PortObjectSpec.PortObjectSpecSerializer<PMCCPortObjectAndSpec> getPortObjectSpecSerializer()
          Serializer required by the PortObjectSpec interface.
(package private)  String[] getReducedSet(double threshold)
          Get set of column names that would be in the output table if a given correlation threshold is applied.
 PortObjectSpec getSpec()
          Get specification to this port object.
 String getSummary()
          Get a short summary of this PortObject.
 JComponent[] getViews()
          The returned views are displayed in the out port view of the referring node.
(package private)  boolean hasData()
           
static PMCCPortObjectAndSpec load(ConfigRO m)
          Factory method to load from config.
 void save(ConfigWO m)
          Saves this object to a config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

static final PortType TYPE
Convenience access field for the port type.


ROUND_ERROR_OK

static final double ROUND_ERROR_OK
Values smaller than this are considered to be 0, used to avoid round-off errors.

See Also:
Constant Field Values
Constructor Detail

PMCCPortObjectAndSpec

PMCCPortObjectAndSpec(String[] includes)
Creates new object, whereby no correlation values are available.

Parameters:
includes - The columns being analyzed.

PMCCPortObjectAndSpec

PMCCPortObjectAndSpec(String[] includes,
                      HalfDoubleMatrix cors)
                throws InvalidSettingsException
Creates new object with content. Used in the execute method.

Parameters:
includes - The names of the columns.
cors - The correlation values
Throws:
InvalidSettingsException - If cor-values don't match the columns or are out of range.
Method Detail

getPortObjectSerializer

public static PortObject.PortObjectSerializer<PMCCPortObjectAndSpec> getPortObjectSerializer()
Serializer required by the PortObject interface.

Returns:
Such a serializer.

getPortObjectSpecSerializer

public static PortObjectSpec.PortObjectSpecSerializer<PMCCPortObjectAndSpec> getPortObjectSpecSerializer()
Serializer required by the PortObjectSpec interface.

Returns:
Such a serializer.

getSpec

public PortObjectSpec getSpec()
Get specification to this port object. That is, the corresponding PortObjectSpec which is used to configure any successor node after execution, e.g. a BufferedDataTable can return a DataTableSpec.

Subclasses should narrow the return type if possible.

Specified by:
getSpec in interface PortObject
Returns:
underlying PortObjectSpec or any derived spec, never null.

getSummary

public String getSummary()
Get a short summary of this PortObject. The return value will be shown in a node port's tooltip, for instance.

Specified by:
getSummary in interface PortObject
Returns:
Summary of the object's content, suitable for a tooltip. Empty strings and null result values are ok (though not encouraged).

hasData

boolean hasData()
Returns:
If correlation values are available.

getReducedSet

String[] getReducedSet(double threshold)
Get set of column names that would be in the output table if a given correlation threshold is applied.

Parameters:
threshold - The threshold, in [0, 1]
Returns:
The set of string suggested as "survivors"

createCorrelationMatrix

BufferedDataTable createCorrelationMatrix(ExecutionContext con)
                                    throws CanceledExecutionException
Creates the correlation table, used in the view and as output table.

Parameters:
con - For progress info/cancelation
Returns:
The correlation table
Throws:
CanceledExecutionException - If canceled.

createOutSpec

static DataTableSpec createOutSpec(String[] names)
Creates output spec for correlation table.

Parameters:
names - the column names being analyzed.
Returns:
The new output spec.

save

public void save(ConfigWO m)
Saves this object to a config.

Parameters:
m - To save to.

load

public static PMCCPortObjectAndSpec load(ConfigRO m)
                                  throws InvalidSettingsException
Factory method to load from config.

Parameters:
m - to load from.
Returns:
new object loaded from argument
Throws:
InvalidSettingsException - If that fails.

getColNames

String[] getColNames()
Returns:
the colNames

getViews

public JComponent[] getViews()
The returned views are displayed in the out port view of the referring node. Each component is displayed in an extra tab. The name of the component is used as the title for the tab. It is important that no external members are kept in the component so it can be deleted, when the port object is deleted. If the port object has no view return an empty array.

Specified by:
getViews in interface PortObject
Specified by:
getViews in interface PortObjectSpec
Returns:
an array of views for the port object, each displayed as a tab in the out port view


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.