Search in sources :

Example 31 with QuantitationType

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

the class QuantitationTypeData method getUsefulQuantitationTypes.

/**
 * @param eeQtTypes the QTs
 * @return just the quantitation types that are likely to be 'useful': Preferred, present/absent, signals and background
 * from both channels (if present).
 */
public static Collection<QuantitationType> getUsefulQuantitationTypes(Collection<QuantitationType> eeQtTypes) {
    Collection<QuantitationType> neededQtTypes = new HashSet<>();
    for (QuantitationType qType : eeQtTypes) {
        String name = qType.getName();
        if (qType.getIsPreferred()) {
            ExpressionDataMatrixBuilder.log.info("Preferred=" + qType);
            neededQtTypes.add(qType);
        } else if (qType.getIsMaskedPreferred()) {
            ExpressionDataMatrixBuilder.log.info("Masked preferred=" + qType);
            neededQtTypes.add(qType);
        } else if (ChannelUtils.isBackgroundChannelA(name)) {
            neededQtTypes.add(qType);
            ExpressionDataMatrixBuilder.log.info("Background A=" + qType);
        } else if (ChannelUtils.isBackgroundChannelB(name)) {
            neededQtTypes.add(qType);
            ExpressionDataMatrixBuilder.log.info("Background B=" + qType);
        } else if (ChannelUtils.isSignalChannelA(name)) {
            neededQtTypes.add(qType);
            ExpressionDataMatrixBuilder.log.info("Signal A=" + qType);
        } else if (ChannelUtils.isSignalChannelB(name)) {
            neededQtTypes.add(qType);
            ExpressionDataMatrixBuilder.log.info("Signal B=" + qType);
        } else if (name.matches("CH1D_MEAN")) {
            /*
                 * Special case. This is the background subtracted channel 1 for GenePix data. It is only needed to
                 * reconstruct CH1 if it isn't present, which is surprisingly common in Stanford data sets
                 */
            neededQtTypes.add(qType);
        } else if (qType.getType().equals(StandardQuantitationType.PRESENTABSENT)) {
            ExpressionDataMatrixBuilder.log.info("Present/absent=" + qType);
            neededQtTypes.add(qType);
        }
    }
    return neededQtTypes;
}
Also used : QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType)

Example 32 with QuantitationType

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

the class QuantitationTypeData method isTwoColor.

private boolean isTwoColor() {
    for (DesignElementDataVector v : vectors) {
        CompositeSequence d = v.getDesignElement();
        TechnologyType technologyType = d.getArrayDesign().getTechnologyType();
        if (technologyType.equals(TechnologyType.ONECOLOR) || technologyType.equals(TechnologyType.NONE)) {
            continue;
        }
        QuantitationType qt = v.getQuantitationType();
        if ((qt.getIsPreferred() || qt.getIsMaskedPreferred()) && qt.getIsRatio()) {
            return true;
        }
    }
    return false;
}
Also used : TechnologyType(ubic.gemma.model.expression.arrayDesign.TechnologyType) 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 33 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType 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 34 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType 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)

Example 35 with QuantitationType

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

the class QuantitationTypeData method getBackgroundChannelB.

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

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