Search in sources :

Example 26 with BioAssayDimension

use of ubic.gemma.model.expression.bioAssayData.BioAssayDimension 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 27 with BioAssayDimension

use of ubic.gemma.model.expression.bioAssayData.BioAssayDimension 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 28 with BioAssayDimension

use of ubic.gemma.model.expression.bioAssayData.BioAssayDimension in project Gemma by PavlidisLab.

the class QuantitationTypeData method getBioAssayDimensions.

/**
 * @return a single BioAssayDimension except if there are multiple array designs used in the experiment.
 */
public List<BioAssayDimension> getBioAssayDimensions() {
    List<BioAssayDimension> result = new ArrayList<>();
    if (dimMap.keySet().size() > 0) {
        result.addAll(dimMap.values());
        return result;
    }
    if (this.vectors.isEmpty()) {
        throw new IllegalStateException("No vectors, no bioassay dimensions");
    }
    ExpressionDataMatrixBuilder.log.debug("Checking all vectors to get bioAssayDimensions");
    Collection<BioAssayDimension> dimensions = new HashSet<>();
    for (DesignElementDataVector vector : vectors) {
        ArrayDesign adUsed = this.arrayDesignForVector(vector);
        if (!dimMap.containsKey(adUsed)) {
            dimMap.put(adUsed, vector.getBioAssayDimension());
        }
        dimensions.add(vector.getBioAssayDimension());
    }
    ExpressionDataMatrixBuilder.log.debug("got " + dimensions.size() + " bioAssayDimensions");
    result.addAll(dimensions);
    return result;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) DesignElementDataVector(ubic.gemma.model.expression.bioAssayData.DesignElementDataVector)

Example 29 with BioAssayDimension

use of ubic.gemma.model.expression.bioAssayData.BioAssayDimension in project Gemma by PavlidisLab.

the class QuantitationTypeData method getBkgSubChannelA.

public ExpressionDataDoubleMatrix getBkgSubChannelA() {
    if (dat == null)
        dat = this.getQuantitationTypesNeeded();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    List<QuantitationType> qTypes = new ArrayList<>();
    for (BioAssayDimension dimension : dimensions) {
        QuantitationType qType = dat.getBkgSubChannelA(dimension);
        if (qType != null)
            qTypes.add(qType);
    }
    if (qTypes.size() != 0) {
        return this.makeMatrix(qTypes);
    }
    return null;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 30 with BioAssayDimension

use of ubic.gemma.model.expression.bioAssayData.BioAssayDimension in project Gemma by PavlidisLab.

the class QuantitationTypeData method getBackgroundChannelA.

public ExpressionDataDoubleMatrix getBackgroundChannelA() {
    if (dat == null)
        dat = this.getQuantitationTypesNeeded();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    List<QuantitationType> qTypes = new ArrayList<>();
    for (BioAssayDimension dimension : dimensions) {
        QuantitationType qType = dat.getBackgroundChannelA(dimension);
        if (qType != null)
            qTypes.add(qType);
    }
    if (qTypes.size() != 0) {
        return this.makeMatrix(qTypes);
    }
    return null;
}
Also used : BioAssayDimension(ubic.gemma.model.expression.bioAssayData.BioAssayDimension) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Aggregations

BioAssayDimension (ubic.gemma.model.expression.bioAssayData.BioAssayDimension)59 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)29 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)20 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)16 DesignElementDataVector (ubic.gemma.model.expression.bioAssayData.DesignElementDataVector)15 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)15 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)15 ByteArrayConverter (ubic.basecode.io.ByteArrayConverter)11 StandardQuantitationType (ubic.gemma.model.common.quantitationtype.StandardQuantitationType)10 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)9 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)9 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)6 HashSet (java.util.HashSet)4 Test (org.junit.Test)4 Transactional (org.springframework.transaction.annotation.Transactional)4 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)4 StopWatch (org.apache.commons.lang3.time.StopWatch)3 ExpressionDataDoubleMatrix (ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)3 ExpressionExperimentValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject)3 DoubleArrayList (cern.colt.list.DoubleArrayList)2