use of ubic.gemma.model.analysis.expression.coexpression.SampleCoexpressionAnalysis in project Gemma by PavlidisLab.
the class SampleCoexpressionAnalysisDaoImpl method create.
@Override
public SampleCoexpressionAnalysis create(DoubleMatrix<BioAssay, BioAssay> matrix, BioAssayDimension bad, ExpressionExperiment ee) {
/*
* First remove any old ones for the experiment.
*/
Collection<SampleCoexpressionAnalysis> old = this.findAnalysesByExperiment(ee);
this.remove(old);
SampleCoexpressionAnalysis sas = SampleCoexpressionAnalysis.Factory.newInstance();
sas.setExperimentAnalyzed(ee);
SampleCoexpressionMatrix scm = SampleCoexpressionMatrix.Factory.newInstance();
scm.setBioAssayDimension(bad);
byte[] coexpressionMatrix = SampleCoexpressionAnalysisDaoImpl.bac.doubleMatrixToBytes(matrix.getRawMatrix());
scm.setCoexpressionMatrix(coexpressionMatrix);
sas.setSampleCoexpressionMatrix(scm);
this.getSessionFactory().getCurrentSession().save(sas);
return sas;
}
Aggregations