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;
}
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);
}
}
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());
}
}
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;
}
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);
}
Aggregations