use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell in project miso-lims by miso-lims.
the class AbstractBulkSampleIT method assertAllForSingleCellAliquot.
protected void assertAllForSingleCellAliquot(Map<String, String> aliquot, Long sampleId, boolean newlyCreated) {
SampleAliquotSingleCell target = (SampleAliquotSingleCell) getSession().get(SampleAliquotSingleCellImpl.class, sampleId);
assertPlainSampleAttributes(aliquot, target, newlyCreated);
assertDetailedSampleAttributes(aliquot, target);
assertAnalyteAttributes(aliquot, target);
assertAliquotAttributes(aliquot, target);
assertSingleCellAliquotAttributes(aliquot, target);
if (newlyCreated) {
SampleStockSingleCell stockParent = LimsUtils.getParent(SampleStockSingleCell.class, target);
assertSingleCellStockAttributes(aliquot, stockParent);
SampleSingleCell singleCellParent = LimsUtils.getParent(SampleSingleCell.class, target);
assertSingleCellAttributes(aliquot, singleCellParent);
SampleTissue tissueParent = LimsUtils.getParent(SampleTissue.class, target);
assertTissueAttributes(aliquot, tissueParent);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell in project miso-lims by miso-lims.
the class AbstractBulkSampleIT method assertAllForSingleCellStock.
protected void assertAllForSingleCellStock(Map<String, String> stock, Long sampleId, boolean newlyCreated) {
SampleStockSingleCell target = (SampleStockSingleCell) getSession().get(SampleStockSingleCellImpl.class, sampleId);
assertPlainSampleAttributes(stock, target, newlyCreated);
assertDetailedSampleAttributes(stock, target);
assertStockAttributes(stock, target);
assertAnalyteAttributes(stock, target);
assertSingleCellStockAttributes(stock, target);
if (newlyCreated) {
SampleTissue tissueParent = LimsUtils.getParent(SampleTissue.class, target);
assertTissueAttributes(stock, tissueParent);
SampleSingleCell singleCellParent = LimsUtils.getParent(SampleSingleCell.class, target);
assertSingleCellAttributes(stock, singleCellParent);
SampleIdentity identityAncestor = LimsUtils.getParent(SampleIdentity.class, target);
assertIdentityAttributes(stock, identityAncestor);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell in project miso-lims by miso-lims.
the class Dtos method toStockSample.
private static SampleStock toStockSample(@Nonnull SampleStockDto from) {
SampleStock to = null;
if (from instanceof SampleStockSingleCellRelative) {
SampleStockSingleCellRelative scFrom = (SampleStockSingleCellRelative) from;
SampleStockSingleCell sc = new SampleStockSingleCellImpl();
setBigDecimal(sc::setTargetCellRecovery, scFrom.getTargetCellRecovery());
setBigDecimal(sc::setCellViability, scFrom.getCellViability());
setBigDecimal(sc::setLoadingCellConcentration, scFrom.getLoadingCellConcentration());
to = sc;
} else if (from instanceof SampleStockRnaRelative) {
SampleStockRnaRelative rnaFrom = (SampleStockRnaRelative) from;
SampleStockRna rna = new SampleStockRnaImpl();
setBoolean(rna::setDnaseTreated, rnaFrom.getDnaseTreated(), true);
to = rna;
} else {
to = new SampleStockImpl();
}
if (from.getStrStatus() != null) {
to.setStrStatus(from.getStrStatus());
}
setInteger(to::setSlidesConsumed, from.getSlidesConsumed(), true);
setObject(to::setReferenceSlide, SampleSlideImpl::new, from.getReferenceSlideId());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell in project miso-lims by miso-lims.
the class Dtos method asStockSampleDto.
private static SampleStockDto asStockSampleDto(@Nonnull SampleStock from) {
SampleStockDto dto = null;
if (isStockSingleCellSample(from)) {
SampleStockSingleCell scFrom = (SampleStockSingleCell) from;
SampleStockSingleCellDto sc = new SampleStockSingleCellDto();
setString(sc::setTargetCellRecovery, scFrom.getTargetCellRecovery());
setString(sc::setCellViability, scFrom.getCellViability());
setString(sc::setLoadingCellConcentration, scFrom.getLoadingCellConcentration());
dto = sc;
} else if (isStockRnaSample(from)) {
SampleStockRna rnaFrom = (SampleStockRna) from;
SampleStockRnaDto rna = new SampleStockRnaDto();
setBoolean(rna::setDnaseTreated, rnaFrom.getDnaseTreated(), true);
dto = rna;
} else {
dto = new SampleStockDto();
}
dto.setStrStatus(from.getStrStatus().getLabel());
setInteger(dto::setSlidesConsumed, from.getSlidesConsumed(), true);
setId(dto::setReferenceSlideId, from.getReferenceSlide());
return dto;
}
Aggregations