Search in sources :

Example 61 with QuantitationType

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

the class QuantitationTypeData method getPreferredQuantitationTypes.

public static Collection<QuantitationType> getPreferredQuantitationTypes(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.getIsPreferred()) {
            ExpressionDataMatrixBuilder.log.debug("Preferred=" + qType);
            neededQtTypes.add(qType);
        }
    }
    return neededQtTypes;
}
Also used : QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 62 with QuantitationType

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

the class QuantitationTypeData method getRanksByMean.

public Map<CompositeSequence, Double> getRanksByMean() {
    Collection<QuantitationType> qtypes = this.getPreferredQTypes();
    Map<CompositeSequence, Double> ranks = new HashMap<>();
    for (DesignElementDataVector v : this.vectors) {
        if (qtypes.contains(v.getQuantitationType()) && v instanceof ProcessedExpressionDataVector) {
            ranks.put(v.getDesignElement(), ((ProcessedExpressionDataVector) v).getRankByMean());
        }
    }
    return ranks;
}
Also used : 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) CompositeSequence(ubic.gemma.model.expression.designElement.CompositeSequence)

Example 63 with QuantitationType

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

the class QuantitationTypeData method getSignalChannelB.

public ExpressionDataDoubleMatrix getSignalChannelB() {
    if (dat == null)
        dat = this.getQuantitationTypesNeeded();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    List<QuantitationType> qTypes = new ArrayList<>();
    for (BioAssayDimension dimension : dimensions) {
        QuantitationType qType = dat.getSignalChannelB(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 64 with QuantitationType

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

the class QuantitationTypeData method getSignalChannelA.

public ExpressionDataDoubleMatrix getSignalChannelA() {
    if (dat == null)
        dat = this.getQuantitationTypesNeeded();
    List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
    List<QuantitationType> qTypes = new ArrayList<>();
    for (BioAssayDimension dimension : dimensions) {
        QuantitationType signalChannelA = dat.getSignalChannelA(dimension);
        QuantitationType signalChannelB = dat.getSignalChannelB(dimension);
        QuantitationType backgroundChannelA = dat.getBackgroundChannelA(dimension);
        QuantitationType bkgSubChannelA = dat.getBkgSubChannelA(dimension);
        boolean channelANeedsReconstruction = this.checkChannelA(signalChannelA, signalChannelB, backgroundChannelA, bkgSubChannelA);
        if (channelANeedsReconstruction) {
            return this.getSignalChannelAFancy(dimension);
        }
        if (signalChannelA != null)
            qTypes.add(signalChannelA);
    }
    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 65 with QuantitationType

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

the class QuantitationTypeData method getSignalChannelAFancy.

private ExpressionDataDoubleMatrix getSignalChannelAFancy(BioAssayDimension dimension) {
    boolean channelANeedsReconstruction;
    /*
         * This is made messy by data sets where the non-background-subtracted data has been omitted, but the background
         * values are available.
         */
    if (dat == null)
        dat = this.getQuantitationTypesNeeded();
    QuantitationType signalChannelA = dat.getSignalChannelA(dimension);
    QuantitationType signalChannelB = dat.getSignalChannelB(dimension);
    QuantitationType backgroundChannelA = dat.getBackgroundChannelA(dimension);
    QuantitationType bkgSubChannelA = dat.getBkgSubChannelA(dimension);
    channelANeedsReconstruction = this.checkChannelA(signalChannelA, signalChannelB, backgroundChannelA, bkgSubChannelA);
    ExpressionDataDoubleMatrix signalDataA;
    if (channelANeedsReconstruction) {
        ExpressionDataDoubleMatrix bkgDataA = null;
        if (backgroundChannelA != null) {
            bkgDataA = new ExpressionDataDoubleMatrix(vectors, backgroundChannelA);
        }
        // use background-subtracted data and add bkg back on
        assert bkgDataA != null;
        assert bkgSubChannelA != null;
        signalDataA = new ExpressionDataDoubleMatrix(vectors, bkgSubChannelA);
        this.addBackgroundBack(signalDataA, bkgDataA);
        return signalDataA;
    }
    return this.getSignalChannelA();
}
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