use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockRna in project miso-lims by miso-lims.
the class AbstractBulkSampleIT method assertAllForRnaAliquot.
protected void assertAllForRnaAliquot(Map<String, String> aliquot, Long sampleId, boolean newlyCreated) {
SampleAliquotRna target = (SampleAliquotRna) getSession().get(SampleAliquotRnaImpl.class, sampleId);
assertNotNull(target);
assertPlainSampleAttributes(aliquot, target, newlyCreated);
assertDetailedSampleAttributes(aliquot, target);
assertAnalyteAttributes(aliquot, target);
assertAliquotAttributes(aliquot, target);
if (newlyCreated) {
SampleStockRna stockParent = LimsUtils.getParent(SampleStockRna.class, target);
assertStockAttributes(aliquot, stockParent);
assertRnaStockSampleAttributes(aliquot, stockParent);
SampleTissue tissueParent = LimsUtils.getParent(SampleTissue.class, target);
assertTissueAttributes(aliquot, tissueParent);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockRna in project miso-lims by miso-lims.
the class AbstractBulkSampleIT method assertAllForRnaStock.
protected void assertAllForRnaStock(Map<String, String> stock, Long sampleId, boolean newlyCreated) {
SampleStockRna target = (SampleStockRna) getSession().get(SampleStockImpl.class, sampleId);
assertPlainSampleAttributes(stock, target, newlyCreated);
assertDetailedSampleAttributes(stock, target);
assertStockAttributes(stock, target);
assertRnaStockSampleAttributes(stock, target);
assertAnalyteAttributes(stock, target);
if (newlyCreated) {
SampleTissue tissueParent = LimsUtils.getParent(SampleTissue.class, target);
assertTissueAttributes(stock, tissueParent);
SampleIdentity identityAncestor = LimsUtils.getParent(SampleIdentity.class, target);
assertIdentityAttributes(stock, identityAncestor);
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleStockRna 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.SampleStockRna 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