Search in sources :

Example 26 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class ExpressionExperimentDaoImpl method removeDataVectors.

private int removeDataVectors(Session session, Set<BioAssayDimension> dims, Set<QuantitationType> qts, Collection<RawExpressionDataVector> designElementDataVectors, int count) {
    AbstractDao.log.info("Removing Design Element Data Vectors ...");
    for (RawExpressionDataVector dv : designElementDataVectors) {
        BioAssayDimension bad = dv.getBioAssayDimension();
        dims.add(bad);
        QuantitationType qt = dv.getQuantitationType();
        qts.add(qt);
        dv.setBioAssayDimension(null);
        dv.setQuantitationType(null);
        session.delete(dv);
        if (++count % 1000 == 0) {
            session.flush();
        }
        // put back...
        dv.setBioAssayDimension(bad);
        dv.setQuantitationType(qt);
        if (count % 20000 == 0) {
            AbstractDao.log.info(count + " design Element data vectors deleted");
        }
    }
    count = 0;
    return count;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) RawExpressionDataVector(ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType)

Example 27 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class QuantitationTypeData method getPreferredDataVectors.

/**
 * @return The 'preferred' data vectors - NOT the processed data vectors!
 */
private Collection<DesignElementDataVector> getPreferredDataVectors() {
    Collection<DesignElementDataVector> result = new HashSet<>();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    List<QuantitationType> qtypes = this.getPreferredQTypes();
    for (DesignElementDataVector vector : vectors) {
        if (!(vector instanceof ProcessedExpressionDataVector) && dimensions.contains(vector.getBioAssayDimension()) && qtypes.contains(vector.getQuantitationType()))
            result.add(vector);
    }
    return result;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) ProcessedExpressionDataVector(ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector) DesignElementDataVector(ubic.gemma.model.expression.bioAssayData.DesignElementDataVector) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 28 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class QuantitationTypeData method populateMissingValueInfo.

private void populateMissingValueInfo() {
    ByteArrayConverter bac = new ByteArrayConverter();
    for (DesignElementDataVector vector : vectors) {
        QuantitationType qt = vector.getQuantitationType();
        if (!numMissingValues.containsKey(qt)) {
            numMissingValues.put(qt, 0);
        }
        for (Double d : bac.byteArrayToDoubles(vector.getData())) {
            if (d.isNaN()) {
                anyMissing = true;
                numMissingValues.put(qt, numMissingValues.get(qt) + 1);
            }
        }
    }
}
Also used : ByteArrayConverter(ubic.basecode.io.ByteArrayConverter) DesignElementDataVector(ubic.gemma.model.expression.bioAssayData.DesignElementDataVector) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 29 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class QuantitationTypeData method getMissingValueQTypes.

private List<QuantitationType> getMissingValueQTypes() {
    List<QuantitationType> result = new ArrayList<>();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    for (BioAssayDimension dim : dimensions) {
        for (DesignElementDataVector vector : vectors) {
            if (!vector.getBioAssayDimension().equals(dim))
                continue;
            QuantitationType qType = vector.getQuantitationType();
            if (!qType.getType().equals(StandardQuantitationType.PRESENTABSENT))
                continue;
            // ArrayDesign adUsed = arrayDesignForVector( vector );
            // if ( arrayDesign != null && !adUsed.equals( arrayDesign ) ) continue;
            // if we get here, we're in the right place.
            result.add(qType);
            // on to the next dimension.
            break;
        }
    }
    return result;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) DesignElementDataVector(ubic.gemma.model.expression.bioAssayData.DesignElementDataVector) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 30 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class QuantitationTypeData method getMissingValueQuantitationTypes.

/**
 * @param expressionExperiment (should be lightly thawed)
 * @return a collection of QTs
 */
public static Collection<QuantitationType> getMissingValueQuantitationTypes(ExpressionExperiment expressionExperiment) {
    Collection<QuantitationType> neededQtTypes = new HashSet<>();
    Collection<QuantitationType> eeQtTypes = expressionExperiment.getQuantitationTypes();
    if (eeQtTypes.size() == 0)
        throw new IllegalArgumentException("No quantitation types for " + expressionExperiment);
    ExpressionDataMatrixBuilder.log.debug("Experiment has " + eeQtTypes.size() + " quantitation types");
    for (QuantitationType qType : eeQtTypes) {
        if (qType.getType().equals(StandardQuantitationType.PRESENTABSENT)) {
            ExpressionDataMatrixBuilder.log.debug("Present/absent=" + qType);
            neededQtTypes.add(qType);
        }
    }
    return neededQtTypes;
}
Also used : QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Aggregations

QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)74 StandardQuantitationType (ubic.gemma.model.common.quantitationtype.StandardQuantitationType)30 BioAssayDimension (ubic.gemma.model.expression.bioAssayData.BioAssayDimension)20 DesignElementDataVector (ubic.gemma.model.expression.bioAssayData.DesignElementDataVector)18 Test (org.junit.Test)16 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)14 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)13 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)11 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)10 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)10 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)8 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)7 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)6 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)6 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)6 InputStream (java.io.InputStream)5 GZIPInputStream (java.util.zip.GZIPInputStream)5 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)5 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)5 ByteArrayConverter (ubic.basecode.io.ByteArrayConverter)4