Search in sources :

Example 1 with TechnologyType

use of ubic.gemma.model.expression.arrayDesign.TechnologyType in project Gemma by PavlidisLab.

the class ExpressionExperimentFilter method isTwoColor.

/**
 * Determine if the expression experiment uses two-color arrays.
 *
 * @throws UnsupportedOperationException if the ee uses both two color and one-color technologies.
 */
private Boolean isTwoColor() {
    Boolean answer = null;
    if (arrayDesignsUsed.isEmpty()) {
        throw new IllegalStateException();
    }
    for (ArrayDesign arrayDesign : arrayDesignsUsed) {
        TechnologyType techType = arrayDesign.getTechnologyType();
        boolean isTwoC = techType.equals(TechnologyType.TWOCOLOR) || techType.equals(TechnologyType.DUALMODE);
        if (answer != null && !answer.equals(isTwoC)) {
            throw new UnsupportedOperationException("Gemma cannot handle experiments that mix one- and two-color arrays");
        }
        answer = isTwoC;
    }
    return answer;
}
Also used : TechnologyType(ubic.gemma.model.expression.arrayDesign.TechnologyType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 2 with TechnologyType

use of ubic.gemma.model.expression.arrayDesign.TechnologyType in project Gemma by PavlidisLab.

the class TwoChannelMissingValueCLI method processForMissingValues.

private void processForMissingValues(ExpressionExperiment ee) {
    Collection<ArrayDesign> arrayDesignsUsed = eeService.getArrayDesignsUsed(ee);
    boolean wasProcessed = false;
    for (ArrayDesign design : arrayDesignsUsed) {
        TechnologyType tt = design.getTechnologyType();
        if (tt == TechnologyType.TWOCOLOR || tt == TechnologyType.DUALMODE) {
            AbstractCLI.log.info(ee + " uses a two-color array design, processing...");
            if (arrayDesignsUsed.size() == 1) {
                // save the slower query.
                wasProcessed = this.processExperiment(ee);
            } else {
                wasProcessed = this.processExperiment(ee);
            }
        }
    }
    if (!wasProcessed) {
        errorObjects.add(ee.getShortName());
    } else {
        successObjects.add(ee.toString());
    }
}
Also used : TechnologyType(ubic.gemma.model.expression.arrayDesign.TechnologyType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 3 with TechnologyType

use of ubic.gemma.model.expression.arrayDesign.TechnologyType in project Gemma by PavlidisLab.

the class LoadSimpleExpressionDataCli method configureArrayDesigns.

private void configureArrayDesigns(String[] fields, SimpleExpressionExperimentMetaData metaData) {
    int i;
    TechnologyType techType = TechnologyType.fromString(fields[LoadSimpleExpressionDataCli.TECHNOLOGY_TYPE_I]);
    Collection<ArrayDesign> ads = new HashSet<>();
    if (StringUtils.isBlank(fields[LoadSimpleExpressionDataCli.AD_SHORT_NAME_I])) {
        // that's okay, so long as we get an array design name
        ArrayDesign ad = this.getNewArrayDesignFromName(fields);
        ad.setTechnologyType(techType);
        ad.setPrimaryTaxon(metaData.getTaxon());
        ads.add(ad);
    } else if (fields[LoadSimpleExpressionDataCli.AD_SHORT_NAME_I].trim().equals("IMAGE")) {
        ArrayDesign ad = this.getNewArrayDesignFromName(fields);
        ad.setTechnologyType(techType);
        ad.setPrimaryTaxon(metaData.getTaxon());
        ads.add(ad);
        metaData.setProbeIdsAreImageClones(true);
    } else if (StringUtils.isNotBlank(fields[LoadSimpleExpressionDataCli.ARRAY_DESIGN_NAME_I])) {
        // allow for the case where there is an additional new array design to be added.
        ArrayDesign ad = this.getNewArrayDesignFromName(fields);
        ad.setTechnologyType(techType);
        ad.setPrimaryTaxon(metaData.getTaxon());
        ads.add(ad);
    } else {
        String[] allADs = fields[LoadSimpleExpressionDataCli.AD_SHORT_NAME_I].split("\\+");
        for (i = 0; i < allADs.length; i++) {
            ArrayDesign ad = adService.findByShortName(allADs[i]);
            if (ad == null) {
                Collection<ArrayDesign> existingAds = adService.findByAlternateName(allADs[i]);
                if (existingAds.size() == 1) {
                    ad = existingAds.iterator().next();
                } else if (existingAds.size() > 1) {
                    throw new IllegalStateException("Array Design " + allADs[i] + " is ambiguous, it is an alternate name of more than one array design");
                }
            }
            if (ad == null) {
                throw new IllegalStateException("Array Design " + allADs[i] + " is not loaded into the system yet; load it and try again.");
            }
            ads.add(ad);
        }
    }
    metaData.setArrayDesigns(ads);
}
Also used : TechnologyType(ubic.gemma.model.expression.arrayDesign.TechnologyType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) HashSet(java.util.HashSet)

Example 4 with TechnologyType

use of ubic.gemma.model.expression.arrayDesign.TechnologyType in project Gemma by PavlidisLab.

the class ProcessedExpressionDataVectorDaoImpl method isTwoChannel.

/**
 * @param expressionExperiment ee
 * @return true if any platform used by the ee is two-channel
 */
private boolean isTwoChannel(ExpressionExperiment expressionExperiment) {
    boolean isTwoChannel = false;
    Collection<ArrayDesign> arrayDesignsUsed = CommonQueries.getArrayDesignsUsed(expressionExperiment, this.getSessionFactory().getCurrentSession());
    for (ArrayDesign ad : arrayDesignsUsed) {
        TechnologyType technologyType = ad.getTechnologyType();
        if (technologyType == null) {
            throw new IllegalStateException("Array designs must have a technology type assigned before processed vector computation");
        }
        if (!technologyType.equals(TechnologyType.ONECOLOR) && !technologyType.equals(TechnologyType.NONE)) {
            isTwoChannel = true;
        }
    }
    return isTwoChannel;
}
Also used : TechnologyType(ubic.gemma.model.expression.arrayDesign.TechnologyType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 5 with TechnologyType

use of ubic.gemma.model.expression.arrayDesign.TechnologyType 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)

Aggregations

TechnologyType (ubic.gemma.model.expression.arrayDesign.TechnologyType)7 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)6 HashSet (java.util.HashSet)1 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)1 StandardQuantitationType (ubic.gemma.model.common.quantitationtype.StandardQuantitationType)1 DesignElementDataVector (ubic.gemma.model.expression.bioAssayData.DesignElementDataVector)1 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)1