Program: 81585
Project: 81585
Buggy source:
@Override protected BufferedDataTable[] execute(BufferedDataTable[] inData,ExecutionContext exec) throws Exception {
  BufferedDataTable input=inData[0];
  Attribute groupingAttribute=new InputTableAttribute(groupBy.getStringValue(),input);
  Attribute treatmentAttribute=new InputTableAttribute(this.treatmentAttribute.getStringValue(),input);
  List<String> posCtrls=getPosControls();
  List<String> negCtrls=getNegControls();
  HashSet<String> intersection=new HashSet<String>(posCtrls);
  intersection.retainAll(negCtrls);
  if (!intersection.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  List<Attribute> readouts=new ArrayList<Attribute>();
  for (  String item : propReadouts.getIncludeList()) {
    Attribute attribute=new InputTableAttribute(item,input);
    if (attribute.getType().equals(DoubleCell.TYPE)) {
      readouts.add(attribute);
    }
 else {
      logger.warn("String_Node_Str" + attribute.getName() + "String_Node_Str");
    }
  }
  Map<String,List<DataRow>> groups=AttributeUtils.splitRows(input,groupingAttribute);
  BufferedDataTable barcodeTable=prepareZPrimeTable(exec,new ArrayList<String>(groups.keySet()));
  TableUpdateCache updateCache=new TableUpdateCache(barcodeTable.getDataTableSpec());
  Attribute barcodeAttr=new InputTableAttribute(groupBy.getStringValue(),barcodeTable);
  Attribute positiveAttr=new InputTableAttribute(POSITIVE_CONTROL_DESC,barcodeTable);
  Attribute negativeAttr=new InputTableAttribute(NEGATIVE_CONTROL_DESC,barcodeTable);
  int counter=0;
  for (  DataRow dataRow : barcodeTable) {
    String barcode=barcodeAttr.getNominalAttribute(dataRow);
    String positiveControl=positiveAttr.getNominalAttribute(dataRow);
    String negativeControl=negativeAttr.getNominalAttribute(dataRow);
    logger.info("String_Node_Str" + barcode + "String_Node_Str");
    List<DataRow> plate=groups.get(barcode);
    List<DataRow> posCtrlWells=AttributeUtils.filterByAttributeValue(plate,treatmentAttribute,positiveControl);
    List<DataRow> negCtrlWells=AttributeUtils.filterByAttributeValue(plate,treatmentAttribute,negativeControl);
    RealMatrix posMatrix=extractMatrix(posCtrlWells,readouts);
    RealMatrix negMatrix=extractMatrix(negCtrlWells,readouts);
    Double zPrime=Double.NaN;
    Double classificationError=Double.NaN;
    if ((posMatrix != null) && (negMatrix != null)) {
      int[] columnIndex=checkColumns(posMatrix,negMatrix);
      int[] rowIndex=getRowIndices(posMatrix);
      posMatrix.getSubMatrix(rowIndex,columnIndex);
      rowIndex=getRowIndices(negMatrix);
      negMatrix.getSubMatrix(rowIndex,columnIndex);
      posMatrix=bootstrapMatrix(posMatrix);
      negMatrix=bootstrapMatrix(negMatrix);
      RealVector posMeanVect=computeColumnMeans(posMatrix);
      RealVector negMeanVect=computeColumnMeans(negMatrix);
      Covariance posCov=new Covariance(posMatrix);
      Covariance negCov=new Covariance(negMatrix);
      RealVector meanVect=posMeanVect.subtract(negMeanVect);
      RealMatrix cov=posCov.getCovarianceMatrix();
      cov.add(negCov.getCovarianceMatrix());
      try {
        DecompositionSolver solver=new SingularValueDecompositionImpl(cov).getSolver();
        RealMatrix inv=solver.getInverse();
        RealVector weights=inv.preMultiply(meanVect);
        double[] posProj=computeProjectedValues(posMatrix,weights);
        double[] negProj=computeProjectedValues(negMatrix,weights);
        classificationError=calculateClassificationError(weights,posMeanVect,negMeanVect,posProj,negProj);
        double posCtrlMean=StatUtils.mean(posProj);
        double posCtrlSD=Math.sqrt(StatUtils.variance(posProj));
        double negCtrlMean=StatUtils.mean(negProj);
        double negCtrlSD=Math.sqrt(StatUtils.variance(negProj));
        zPrime=1 - 3 * ((posCtrlSD + negCtrlSD) / Math.abs(posCtrlMean - negCtrlMean));
      }
 catch (      InvalidMatrixException e) {
        zPrime=Double.NaN;
      }
    }
    String posStatus=getSampilingStatus(posMatrix,posCtrlWells.size());
    String negStatus=getSampilingStatus(negMatrix,negCtrlWells.size());
    Attribute attribute;
    attribute=new Attribute(POSITIVE_CONTROL_DESC + "String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,new DoubleCell(negCtrlWells.size()));
    attribute=new Attribute(POSITIVE_CONTROL_DESC + "String_Node_Str",StringCell.TYPE);
    updateCache.add(dataRow,attribute,new StringCell(posStatus));
    attribute=new Attribute(NEGATIVE_CONTROL_DESC + "String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,new DoubleCell(negCtrlWells.size()));
    attribute=new Attribute(NEGATIVE_CONTROL_DESC + "String_Node_Str",StringCell.TYPE);
    updateCache.add(dataRow,attribute,new StringCell(negStatus));
    attribute=new Attribute("String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,isValidNumber(zPrime) ? DataType.getMissingCell() : new DoubleCell(zPrime));
    attribute=new Attribute("String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,isValidNumber(classificationError) ? DataType.getMissingCell() : new DoubleCell(classificationError));
    BufTableUtils.updateProgress(exec,counter++,groups.size());
  }
  ColumnRearranger c=updateCache.createColRearranger();
  BufferedDataTable out=exec.createColumnRearrangeTable(barcodeTable,c,exec);
  return new BufferedDataTable[]{out};
}

Fixed version (ground truth):
@Override protected BufferedDataTable[] execute(BufferedDataTable[] inData,ExecutionContext exec) throws Exception {
  BufferedDataTable input=inData[0];
  Attribute groupingAttribute=new InputTableAttribute(groupBy.getStringValue(),input);
  Attribute treatmentAttribute=new InputTableAttribute(this.treatmentAttribute.getStringValue(),input);
  List<String> posCtrls=getPosControls();
  List<String> negCtrls=getNegControls();
  HashSet<String> intersection=new HashSet<String>(posCtrls);
  intersection.retainAll(negCtrls);
  if (!intersection.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  List<Attribute> readouts=new ArrayList<Attribute>();
  for (  String item : propReadouts.getIncludeList()) {
    Attribute attribute=new InputTableAttribute(item,input);
    if (attribute.getType().equals(DoubleCell.TYPE)) {
      readouts.add(attribute);
    }
 else {
      logger.warn("String_Node_Str" + attribute.getName() + "String_Node_Str");
    }
  }
  Map<String,List<DataRow>> groups=AttributeUtils.splitRows(input,groupingAttribute);
  BufferedDataTable barcodeTable=prepareZPrimeTable(exec,new ArrayList<String>(groups.keySet()));
  TableUpdateCache updateCache=new TableUpdateCache(barcodeTable.getDataTableSpec());
  Attribute barcodeAttr=new InputTableAttribute(groupBy.getStringValue(),barcodeTable);
  Attribute positiveAttr=new InputTableAttribute(POSITIVE_CONTROL_DESC,barcodeTable);
  Attribute negativeAttr=new InputTableAttribute(NEGATIVE_CONTROL_DESC,barcodeTable);
  int counter=0;
  for (  DataRow dataRow : barcodeTable) {
    String barcode=barcodeAttr.getNominalAttribute(dataRow);
    String positiveControl=positiveAttr.getNominalAttribute(dataRow);
    String negativeControl=negativeAttr.getNominalAttribute(dataRow);
    logger.info("String_Node_Str" + barcode + "String_Node_Str");
    List<DataRow> plate=groups.get(barcode);
    List<DataRow> posCtrlWells=AttributeUtils.filterByAttributeValue(plate,treatmentAttribute,positiveControl);
    List<DataRow> negCtrlWells=AttributeUtils.filterByAttributeValue(plate,treatmentAttribute,negativeControl);
    RealMatrix posMatrix=extractMatrix(posCtrlWells,readouts);
    RealMatrix negMatrix=extractMatrix(negCtrlWells,readouts);
    Double zPrime=Double.NaN;
    Double classificationError=Double.NaN;
    if ((posMatrix != null) && (negMatrix != null)) {
      int[] columnIndex=checkColumns(posMatrix,negMatrix);
      int[] rowIndex=getRowIndices(posMatrix);
      posMatrix.getSubMatrix(rowIndex,columnIndex);
      rowIndex=getRowIndices(negMatrix);
      negMatrix.getSubMatrix(rowIndex,columnIndex);
      posMatrix=bootstrapMatrix(posMatrix);
      negMatrix=bootstrapMatrix(negMatrix);
      if ((posMatrix != null) && (negMatrix != null)) {
        RealVector posMeanVect=computeColumnMeans(posMatrix);
        RealVector negMeanVect=computeColumnMeans(negMatrix);
        Covariance posCov=new Covariance(posMatrix);
        Covariance negCov=new Covariance(negMatrix);
        RealVector meanVect=posMeanVect.subtract(negMeanVect);
        RealMatrix cov=posCov.getCovarianceMatrix();
        cov.add(negCov.getCovarianceMatrix());
        try {
          DecompositionSolver solver=new SingularValueDecompositionImpl(cov).getSolver();
          RealMatrix inv=solver.getInverse();
          RealVector weights=inv.preMultiply(meanVect);
          double[] posProj=computeProjectedValues(posMatrix,weights);
          double[] negProj=computeProjectedValues(negMatrix,weights);
          classificationError=calculateClassificationError(weights,posMeanVect,negMeanVect,posProj,negProj);
          double posCtrlMean=StatUtils.mean(posProj);
          double posCtrlSD=Math.sqrt(StatUtils.variance(posProj));
          double negCtrlMean=StatUtils.mean(negProj);
          double negCtrlSD=Math.sqrt(StatUtils.variance(negProj));
          zPrime=1 - 3 * ((posCtrlSD + negCtrlSD) / Math.abs(posCtrlMean - negCtrlMean));
        }
 catch (        InvalidMatrixException e) {
          zPrime=Double.NaN;
        }
      }
    }
    String posStatus=getSampilingStatus(posMatrix,posCtrlWells.size());
    String negStatus=getSampilingStatus(negMatrix,negCtrlWells.size());
    Attribute attribute;
    attribute=new Attribute(POSITIVE_CONTROL_DESC + "String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,new DoubleCell(posCtrlWells.size()));
    attribute=new Attribute(POSITIVE_CONTROL_DESC + "String_Node_Str",StringCell.TYPE);
    updateCache.add(dataRow,attribute,new StringCell(posStatus));
    attribute=new Attribute(NEGATIVE_CONTROL_DESC + "String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,new DoubleCell(negCtrlWells.size()));
    attribute=new Attribute(NEGATIVE_CONTROL_DESC + "String_Node_Str",StringCell.TYPE);
    updateCache.add(dataRow,attribute,new StringCell(negStatus));
    attribute=new Attribute("String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,isValidNumber(zPrime) ? DataType.getMissingCell() : new DoubleCell(zPrime));
    attribute=new Attribute("String_Node_Str",DoubleCell.TYPE);
    updateCache.add(dataRow,attribute,isValidNumber(classificationError) ? DataType.getMissingCell() : new DoubleCell(classificationError));
    BufTableUtils.updateProgress(exec,counter++,groups.size());
  }
  ColumnRearranger c=updateCache.createColRearranger();
  BufferedDataTable out=exec.createColumnRearrangeTable(barcodeTable,c,exec);
  return new BufferedDataTable[]{out};
}