public Confidence( final double value, final String type, final double sd ) { setValue( value ); setType( type ); setStandardDeviation( sd ); }
public void init() { setValue( CONFIDENCE_DEFAULT_VALUE ); setType( "" ); setStandardDeviation( CONFIDENCE_DEFAULT_VALUE ); }
public Confidence( final double value, final String type ) { setValue( value ); setType( type ); setStandardDeviation( CONFIDENCE_DEFAULT_VALUE ); }
/** * Convenience method. * Sets value for the first confidence value (created if not present, values overwritten otherwise). */ public static void setConfidence( final PhylogenyNode node, final double confidence_value, final String type ) { Confidence c = null; if ( node.getBranchData().getNumberOfConfidences() > 0 ) { c = node.getBranchData().getConfidence( 0 ); } else { c = new Confidence(); node.getBranchData().addConfidence( c ); } c.setType( type ); c.setValue( confidence_value ); }
@Override public PhylogenyData parse( final XmlElement element ) throws PhyloXmlDataFormatException { final Confidence confidence = new Confidence(); confidence.setValue( element.getValueAsDouble() ); if ( element.isHasAttribute( PhyloXmlMapping.CONFIDENCE_TYPE_ATTR ) ) { confidence.setType( element.getAttribute( PhyloXmlMapping.CONFIDENCE_TYPE_ATTR ) ); } if ( element.isHasAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR ) ) { try { confidence.setStandardDeviation( Double.parseDouble( element .getAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR ) ) ); } catch ( final NumberFormatException ex ) { throw new PhyloXmlDataFormatException( "attempt to parse [" + element.getAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR + "] into double" ) ); } } return confidence; }
if ( ( n.getBranchData() != null ) && n.getBranchData().isHasConfidences() && ( n.getBranchData().getConfidence( 0 ) != null ) ) { n.getBranchData().getConfidence( 0 ).setType( "bootstrap" );