Search in sources :

Example 16 with ExpressionDataDoubleMatrix

use of ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix in project Gemma by PavlidisLab.

the class ExpressionDataSVDTest method testUMatrixAsExpressionData.

@Test
public void testUMatrixAsExpressionData() {
    svd = new ExpressionDataSVD(testData, true);
    ExpressionDataDoubleMatrix matrixAsExpressionData = svd.uMatrixAsExpressionData();
    assertNotNull(matrixAsExpressionData);
}
Also used : ExpressionDataDoubleMatrix(ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix) ExpressionDataSVD(ubic.gemma.core.analysis.preprocess.svd.ExpressionDataSVD) Test(org.junit.Test)

Example 17 with ExpressionDataDoubleMatrix

use of ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix in project Gemma by PavlidisLab.

the class ExpressionDataSVDTest method testWinnow.

@Test
public void testWinnow() {
    ExpressionDataDoubleMatrix winnow = svd.winnow(0.5);
    assertEquals(100, winnow.rows());
}
Also used : ExpressionDataDoubleMatrix(ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix) Test(org.junit.Test)

Example 18 with ExpressionDataDoubleMatrix

use of ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix in project Gemma by PavlidisLab.

the class ExpressionDataFileServiceImpl method writeDataFile.

/**
 * @param compress if true, file will be output in GZIP format.
 */
private File writeDataFile(ExpressionExperiment ee, boolean filtered, File f, boolean compress) throws IOException {
    ExpressionDataFileServiceImpl.log.info("Creating new expression data file: " + f.getName());
    ExpressionDataDoubleMatrix matrix = this.getDataMatrix(ee, filtered);
    Collection<ArrayDesign> arrayDesigns = expressionExperimentService.getArrayDesignsUsed(ee);
    Map<CompositeSequence, String[]> geneAnnotations = this.getGeneAnnotationsAsStringsByProbe(arrayDesigns);
    this.writeMatrix(f, geneAnnotations, matrix, compress);
    return f;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ExpressionDataDoubleMatrix(ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix) CompositeSequence(ubic.gemma.model.expression.designElement.CompositeSequence)

Example 19 with ExpressionDataDoubleMatrix

use of ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix in project Gemma by PavlidisLab.

the class ExpressionDataFileServiceImpl method getDataMatrix.

private ExpressionDataDoubleMatrix getDataMatrix(ExpressionExperiment ee, boolean filtered) {
    ee = expressionExperimentService.thawLite(ee);
    ExpressionDataDoubleMatrix matrix;
    if (filtered) {
        FilterConfig filterConfig = new FilterConfig();
        filterConfig.setIgnoreMinimumSampleThreshold(true);
        filterConfig.setIgnoreMinimumRowsThreshold(true);
        matrix = expressionDataMatrixService.getFilteredMatrix(ee, filterConfig);
    } else {
        matrix = expressionDataMatrixService.getProcessedExpressionDataMatrix(ee);
    }
    return matrix;
}
Also used : ExpressionDataDoubleMatrix(ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix) FilterConfig(ubic.gemma.core.analysis.preprocess.filter.FilterConfig)

Example 20 with ExpressionDataDoubleMatrix

use of ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix in project Gemma by PavlidisLab.

the class ExpressionDataFileServiceImpl method writeOrLocateJSONDataFile.

@Override
public File writeOrLocateJSONDataFile(ExpressionExperiment ee, boolean forceWrite, boolean filtered) {
    try {
        File f = this.getOutputFile(ee, filtered);
        if (!forceWrite && f.canRead()) {
            ExpressionDataFileServiceImpl.log.info(f + " exists, not regenerating");
            return f;
        }
        ExpressionDataFileServiceImpl.log.info("Creating new JSON expression data file: " + f.getName());
        ExpressionDataDoubleMatrix matrix = this.getDataMatrix(ee, filtered);
        this.writeJson(f, matrix);
        return f;
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : ExpressionDataDoubleMatrix(ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)

Aggregations

ExpressionDataDoubleMatrix (ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)41 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)18 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)12 Test (org.junit.Test)9 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)7 ArrayList (java.util.ArrayList)6 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)6 DenseDoubleMatrix (ubic.basecode.dataStructure.matrix.DenseDoubleMatrix)5 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)5 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)5 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)5 DoubleMatrix1D (cern.colt.matrix.DoubleMatrix1D)4 DoubleMatrix2D (cern.colt.matrix.DoubleMatrix2D)4 InputStream (java.io.InputStream)4 DoubleVectorValueObject (ubic.gemma.model.expression.bioAssayData.DoubleVectorValueObject)4 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)4 Algebra (cern.colt.matrix.linalg.Algebra)3 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)3 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)3 BioAssayDimension (ubic.gemma.model.expression.bioAssayData.BioAssayDimension)3