Search in sources :

Example 31 with ArrayDesign

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

the class ArrayDesignProbeRenamerCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception e = this.processCommandLine(args);
    if (e != null) {
        return e;
    }
    if (fileName == null) {
        throw new IllegalArgumentException("filename cannot be null");
    }
    if (this.arrayDesignsToProcess.size() > 1) {
        throw new IllegalArgumentException("Cannot be applied to more than one array design given to the '-a' option");
    }
    ArrayDesign arrayDesign = this.arrayDesignsToProcess.iterator().next();
    arrayDesign = this.thaw(arrayDesign);
    File file = new File(fileName);
    if (!file.canRead()) {
        return new IOException("Cannot read from " + fileName);
    }
    try (InputStream newIdFile = new FileInputStream(file)) {
        this.rename(arrayDesign, newIdFile);
        newIdFile.close();
        this.audit(arrayDesign, "Probes renamed using file " + fileName);
    } catch (Exception ex) {
        return ex;
    }
    return null;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 32 with ArrayDesign

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

the class ArrayDesignSubsumptionTesterCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception err = this.processCommandLine(args);
    if (err != null) {
        this.bail(ErrorCode.INVALID_OPTION);
        return err;
    }
    if (this.arrayDesignsToProcess.size() > 1) {
        throw new IllegalArgumentException("Cannot be applied to more than one array design given to the '-a' option");
    }
    ArrayDesign arrayDesign = this.arrayDesignsToProcess.iterator().next();
    arrayDesign = this.thaw(arrayDesign);
    for (String otherArrayDesignName : otherArrayDesignNames) {
        ArrayDesign otherArrayDesign = this.locateArrayDesign(otherArrayDesignName, arrayDesignService);
        if (arrayDesign.equals(otherArrayDesign)) {
            continue;
        }
        if (otherArrayDesign == null) {
            AbstractCLI.log.error("No arrayDesign " + otherArrayDesignName + " found");
            this.bail(ErrorCode.INVALID_OPTION);
        }
        otherArrayDesign = this.thaw(otherArrayDesign);
        Boolean aSubsumes = this.arrayDesignService.updateSubsumingStatus(arrayDesign, otherArrayDesign);
        if (!aSubsumes) {
            // test other way around, but only if first way failed (to avoid cycles)
            this.arrayDesignService.updateSubsumingStatus(otherArrayDesign, arrayDesign);
        }
        this.audit(otherArrayDesign, "Tested to see if it is subsumed by " + arrayDesign);
    }
    this.audit(arrayDesign, "Tested to see if it subsumes: " + StringUtils.join(otherArrayDesignNames, ','));
    return null;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 33 with ArrayDesign

use of ubic.gemma.model.expression.arrayDesign.ArrayDesign 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 34 with ArrayDesign

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

the class WhatsNewServiceImpl method addAllADs.

private void addAllADs(Date date, Collection<ArrayDesign> ads, Collection<AuditableObject> updatedObjects) {
    for (ArrayDesign ad : ads) {
        AuditableObject ao = new AuditableObject();
        ao.date = date;
        ao.type = "ArrayDesign";
        ao.id = ad.getId();
        updatedObjects.add(ao);
    }
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 35 with ArrayDesign

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

the class GeoSuperSeriesLoadTest method removeOldData.

private void removeOldData(ExpressionExperiment ee2) {
    Collection<ArrayDesign> arrayDesignsUsed = ees.getArrayDesignsUsed(ee2);
    ees.remove(ee2);
    for (ArrayDesign ad : arrayDesignsUsed) {
        for (ExpressionExperiment ee3 : adService.getExpressionExperiments(ad)) {
            this.removeOldData(ee3);
        }
        for (ArrayDesign aa : ad.getMergees()) {
            adService.remove(aa);
        }
        adService.remove(ad);
    }
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Aggregations

ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)186 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)43 Test (org.junit.Test)32 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)26 InputStream (java.io.InputStream)25 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)24 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)24 Taxon (ubic.gemma.model.genome.Taxon)23 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)19 HashSet (java.util.HashSet)16 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)16 Collection (java.util.Collection)14 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)13 StopWatch (org.apache.commons.lang3.time.StopWatch)12 Before (org.junit.Before)12 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)12 BioAssayDimension (ubic.gemma.model.expression.bioAssayData.BioAssayDimension)9 GZIPInputStream (java.util.zip.GZIPInputStream)8 SimpleExpressionExperimentMetaData (ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData)8 File (java.io.File)7