use of ubic.gemma.model.expression.bioAssay.BioAssay in project Gemma by PavlidisLab.
the class BaseExpressionDataMatrix method setMatBioAssayValues.
<R, C, V> void setMatBioAssayValues(AbstractMatrix<R, C, V> mat, Integer rowIndex, V[] vals, Collection<BioAssay> bioAssays, Iterator<BioAssay> it) {
for (int j = 0; j < bioAssays.size(); j++) {
BioAssay bioAssay = it.next();
Integer column = this.columnAssayMap.get(bioAssay);
assert column != null;
mat.set(rowIndex, column, vals[j]);
}
}
use of ubic.gemma.model.expression.bioAssay.BioAssay 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.bioAssay.BioAssay in project Gemma by PavlidisLab.
the class ExpressionExperimentDeleteTest method testRemove.
@Test
public final void testRemove() {
ExpressionExperiment ee = getTestPersistentCompleteExpressionExperiment(false);
List<Long> ids = new ArrayList<>();
for (BioAssay ba : ee.getBioAssays()) {
ids.add(ba.getId());
}
svc.remove(ee);
assertNull(svc.load(ee.getId()));
// sure bioassays are gone.
for (Long id : ids) {
BioAssay ba = bioAssayService.load(id);
assertNull(ba);
}
}
use of ubic.gemma.model.expression.bioAssay.BioAssay in project Gemma by PavlidisLab.
the class ExpressionExperimentPlatformSwitchService method doMultiSample.
private BioAssayDimension doMultiSample(ExpressionExperiment ee, Collection<BioAssayDimension> unusedBADs, int maxSize) {
BioAssayDimension maxBAD = null;
for (BioAssay ba : ee.getBioAssays()) {
Collection<BioAssayDimension> oldBioAssayDims = bioAssayService.findBioAssayDimensions(ba);
for (BioAssayDimension bioAssayDim : oldBioAssayDims) {
unusedBADs.add(bioAssayDim);
int size = bioAssayDim.getBioAssays().size();
if (size > maxSize) {
maxSize = size;
maxBAD = bioAssayDim;
}
}
}
// otherwise we shouldn't be here.
assert unusedBADs.size() > 1;
unusedBADs.remove(maxBAD);
/*
* Make sure all biomaterials in the study are included in the chosen bioassaydimension. If not, we'd have
* to make a new BAD. I haven't implemented that case.
*/
if (maxBAD != null) {
Collection<BioMaterial> bmsInmaxBAD = new HashSet<>();
for (BioAssay ba : maxBAD.getBioAssays()) {
bmsInmaxBAD.add(ba.getSampleUsed());
}
for (BioAssay ba : ee.getBioAssays()) {
if (!bmsInmaxBAD.contains(ba.getSampleUsed())) {
ExpressionExperimentPlatformSwitchService.log.warn("This experiment looked like it had samples run on more than one platform, " + "but it also has no BioAssayDimension that is eligible to accomodate all samples (Example: " + ba.getSampleUsed() + ") The experiment will be switched to the merged platform, but no BioAssayDimension switch will be done.");
maxBAD = null;
break;
}
}
}
return maxBAD;
}
use of ubic.gemma.model.expression.bioAssay.BioAssay in project Gemma by PavlidisLab.
the class GeoServiceImpl method updateReports.
private void updateReports(Collection<?> entities) {
Collection<ArrayDesign> adsToUpdate = new HashSet<>();
for (Object entity : entities) {
if (entity instanceof ExpressionExperiment) {
ExpressionExperiment expressionExperiment = (ExpressionExperiment) entity;
expressionExperiment = this.expressionExperimentService.thaw(expressionExperiment);
this.expressionExperimentReportService.generateSummary(expressionExperiment.getId());
expressionExperiment = this.expressionExperimentService.thaw(expressionExperiment);
for (BioAssay ba : expressionExperiment.getBioAssays()) {
adsToUpdate.add(ba.getArrayDesignUsed());
}
} else if (entity instanceof ArrayDesign) {
adsToUpdate.add((ArrayDesign) entity);
}
}
for (ArrayDesign arrayDesign : adsToUpdate) {
this.arrayDesignReportService.generateArrayDesignReport(arrayDesign.getId());
}
}
Aggregations