use of ubic.basecode.math.linearmodels.DesignMatrix in project Gemma by PavlidisLab.
the class ComBat method computeDesignMatrix.
/**
* ComBat parameterizes the model without an intercept, instead using all possible columns for batch (what the heck
* do you call this parameterization?) This is important. Each batch has its own parameter.
*
* @return double matrix 2d
*/
private DoubleMatrix2D computeDesignMatrix() {
DoubleMatrix2D design;
/*
* Find the batch
*/
DesignMatrix d = null;
int batchFactorColumnIndex = sampleInfo.getColIndexByName(ComBat.BATCH_COLUMN_NAME);
Object[] batchFactor = sampleInfo.getColumn(batchFactorColumnIndex);
if (batchFactor != null) {
d = new DesignMatrix(batchFactor, 1, ComBat.BATCH_COLUMN_NAME);
}
if (d == null) {
throw new IllegalStateException("No batch factor was found");
}
ObjectMatrix<String, String, Object> sampleInfoWithoutBatchFactor = this.getSampleInfoWithoutBatchFactor(batchFactorColumnIndex);
d.add(sampleInfoWithoutBatchFactor);
design = d.getDoubleMatrix();
return design;
}
Aggregations