Search in sources :

Example 56 with ArrayDesign

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

the class ArrayDesignRepeatScanCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception exception = this.processCommandLine(args);
    if (exception != null)
        return exception;
    bsService = this.getBean(BioSequenceService.class);
    Date skipIfLastRunLaterThan = this.getLimitingDate();
    if (!this.arrayDesignsToProcess.isEmpty()) {
        for (ArrayDesign arrayDesign : this.arrayDesignsToProcess) {
            if (!this.needToRun(skipIfLastRunLaterThan, arrayDesign, ArrayDesignRepeatAnalysisEvent.class)) {
                AbstractCLI.log.warn(arrayDesign + " was last run more recently than " + skipIfLastRunLaterThan);
                return null;
            }
            arrayDesign = this.thaw(arrayDesign);
            this.processArrayDesign(arrayDesign);
        }
    } else if (skipIfLastRunLaterThan != null) {
        AbstractCLI.log.warn("*** Running Repeatmasker for all Array designs *** ");
        Collection<ArrayDesign> allArrayDesigns = arrayDesignService.loadAll();
        for (ArrayDesign design : allArrayDesigns) {
            if (!this.needToRun(skipIfLastRunLaterThan, design, ArrayDesignRepeatAnalysisEvent.class)) {
                AbstractCLI.log.warn(design + " was last run more recently than " + skipIfLastRunLaterThan);
                // not really an error, but nice to get notification.
                errorObjects.add(design + ": " + "Skipped because it was last run after " + skipIfLastRunLaterThan);
                continue;
            }
            if (this.isSubsumedOrMerged(design)) {
                AbstractCLI.log.warn(design + " is subsumed or merged into another design, it will not be run.");
                // not really an error, but nice to get notification.
                errorObjects.add(design + ": " + "Skipped because it is subsumed by or merged into another design.");
                continue;
            }
            AbstractCLI.log.info("============== Start processing: " + design + " ==================");
            try {
                design = arrayDesignService.thaw(design);
                this.processArrayDesign(design);
                successObjects.add(design.getName());
                this.audit(design, "");
            } catch (Exception e) {
                errorObjects.add(design + ": " + e.getMessage());
                AbstractCLI.log.error("**** Exception while processing " + design + ": " + e.getMessage() + " ****");
                AbstractCLI.log.error(e, e);
            }
        }
        this.summarizeProcessing();
    } else {
        this.bail(ErrorCode.MISSING_ARGUMENT);
    }
    return null;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) BioSequenceService(ubic.gemma.persistence.service.genome.biosequence.BioSequenceService) Collection(java.util.Collection) ArrayDesignRepeatAnalysisEvent(ubic.gemma.model.common.auditAndSecurity.eventType.ArrayDesignRepeatAnalysisEvent) Date(java.util.Date)

Example 57 with ArrayDesign

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

the class ArrayDesignSequenceManipulatingCli method arraysFromCliList.

private void arraysFromCliList() {
    String arrayShortNames = this.getOptionValue('a');
    String[] shortNames = arrayShortNames.split(",");
    for (String shortName : shortNames) {
        if (StringUtils.isBlank(shortName))
            continue;
        ArrayDesign ad = this.locateArrayDesign(shortName, arrayDesignService);
        if (ad == null) {
            AbstractCLI.log.warn(shortName + " not found");
            continue;
        }
        arrayDesignsToProcess.add(ad);
    }
    if (arrayDesignsToProcess.size() == 0) {
        AbstractCLI.log.error("There were no valid experiments specified");
        this.bail(ErrorCode.INVALID_OPTION);
    }
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 58 with ArrayDesign

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

the class ExpressionExperimentPlatformSwitchCli method processExperiment.

private void processExperiment(ExpressionExperiment ee) {
    try {
        ee = this.eeService.thawLite(ee);
        AuditTrailService ats = this.getBean(AuditTrailService.class);
        AuditEventType type = ExpressionExperimentPlatformSwitchEvent.Factory.newInstance();
        if (this.arrayDesignName != null) {
            ArrayDesign ad = this.locateArrayDesign(this.arrayDesignName, arrayDesignService);
            if (ad == null) {
                AbstractCLI.log.error("Unknown array design");
                this.bail(ErrorCode.INVALID_OPTION);
            }
            ad = arrayDesignService.thaw(ad);
            ee = serv.switchExperimentToArrayDesign(ee, ad);
            ats.addUpdateEvent(ee, type, "Switched to use " + ad);
        } else {
            // Identify merged platform automatically; not really recommended as it might not make the optimal choice.
            ee = serv.switchExperimentToMergedPlatform(ee);
            ats.addUpdateEvent(ee, type, "Switched to use merged array Design ");
        }
        super.successObjects.add(ee.toString());
    } catch (Exception e) {
        AbstractCLI.log.error(e, e);
        super.errorObjects.add(ee + ": " + e.getMessage());
    }
}
Also used : AuditTrailService(ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService) AuditEventType(ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign)

Example 59 with ArrayDesign

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

the class BaseExpressionDataMatrix method columns.

@Override
public int columns(CompositeSequence el) {
    int j = 0;
    ArrayDesign ad = el.getArrayDesign();
    for (int i = 0; i < this.columns(); i++) {
        Collection<BioAssay> bioAssay = this.columnBioAssayMapByInteger.get(i);
        for (BioAssay assay : bioAssay) {
            if (assay.getArrayDesignUsed().equals(ad)) {
                j++;
                break;
            }
        }
    }
    return j;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) BioAssay(ubic.gemma.model.expression.bioAssay.BioAssay)

Example 60 with ArrayDesign

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

the class AuditTrailDaoTest method setup.

@Before
public void setup() {
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setName("test_" + RandomStringUtils.randomAlphabetic(10));
    ad.setPrimaryTaxon(this.getTaxon("mouse"));
    ad = (ArrayDesign) persisterHelper.persist(ad);
    auditable = ad;
    auditTrail = AuditTrail.Factory.newInstance();
    AuditEvent auditEvent0 = AuditEvent.Factory.newInstance(new Date(), AuditAction.CREATE, "ccccc", null, null, null);
    AuditEvent auditEvent1 = AuditEvent.Factory.newInstance(new Date(), AuditAction.CREATE, "ddddd", null, null, null);
    AuditEvent auditEvent2 = AuditEvent.Factory.newInstance(new Date(), AuditAction.CREATE, "aaaaa", null, null, null);
    AuditEvent auditEvent3 = AuditEvent.Factory.newInstance(new Date(), AuditAction.CREATE, "bbbbb", null, null, null);
    auditTrail.addEvent(auditEvent0);
    auditTrail.addEvent(auditEvent1);
    auditTrail.addEvent(auditEvent2);
    auditTrail.addEvent(auditEvent3);
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) Date(java.util.Date) Before(org.junit.Before)

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