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