use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl in project miso-lims by miso-lims.
the class OicrSampleAliasGeneratorTest method makeAliquotFromAliquot.
private SampleAliquot makeAliquotFromAliquot() throws Exception {
SampleAliquot aliquot = new SampleAliquotImpl();
SampleAliquot parent = makeAliquotFromStock();
parent.setAlias("PROJ_1234567_nn_n_nn_1-1_R_12");
SampleClass parentSc = new SampleClassImpl();
parentSc.setSampleCategory(SampleAliquot.CATEGORY_NAME);
aliquot.setParent(parent);
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleAliquot.CATEGORY_NAME);
sc.setSuffix("MR_");
aliquot.setSampleClass(sc);
aliquot.setSiblingNumber(2);
return aliquot;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl in project miso-lims by miso-lims.
the class OicrSampleAliasGeneratorTest method makeTissueFromTissue.
private SampleTissue makeTissueFromTissue() throws Exception {
SampleTissue parent = (SampleTissue) makeFullTissue();
parent.setAlias("PROJ_0001_Bn_P_nn_1-1");
parent.setParent(makeIdentity());
SampleTissue child = new SampleTissueImpl();
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleTissue.CATEGORY_NAME);
child.setSampleClass(sc);
child.setParent(parent);
child.setTimesReceived(1);
child.setTubeNumber(1);
TissueOrigin to = new TissueOriginImpl();
to.setAlias("Bn");
child.setTissueOrigin(to);
TissueType tt = new TissueTypeImpl();
tt.setAlias("O");
child.setTissueType(tt);
return child;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl in project miso-lims by miso-lims.
the class OicrSampleAliasGeneratorTest method makeStockFromStock.
private Sample makeStockFromStock() throws Exception {
SampleStock stock = new SampleStockImpl();
SampleStock parentStock = makeStockFromTissue();
parentStock.setAlias("PROJ_0001_nn_n_nn_1-1_D_S4");
stock.setParent(parentStock);
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleStock.CATEGORY_NAME);
sc.setSuffix("D_S");
stock.setSampleClass(sc);
stock.setSiblingNumber(6);
return stock;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl in project miso-lims by miso-lims.
the class DefaultSampleServiceTest method makeUnsavedParentTissue.
private SampleTissue makeUnsavedParentTissue() throws IOException {
SampleTissue sample = new SampleTissueImpl();
sample.setSampleClass(new SampleClassImpl());
sample.getSampleClass().setId(10L);
sample.getSampleClass().setAlias("tissue");
sample.getSampleClass().setSampleCategory(SampleTissue.CATEGORY_NAME);
Mockito.when(sampleClassService.get(sample.getSampleClass().getId())).thenReturn(sample.getSampleClass());
return sample;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl in project miso-lims by miso-lims.
the class Dtos method toDetailedSample.
private static DetailedSample toDetailedSample(@Nonnull DetailedSampleDto from) {
DetailedSample to = null;
if (from.getClass() == SampleIdentityDto.class) {
to = toIdentitySample((SampleIdentityDto) from);
} else if (from.getClass() == SampleTissueDto.class) {
to = toTissueSample((SampleTissueDto) from);
} else if (from instanceof SampleTissueProcessingDto) {
to = toTissueProcessingSample((SampleTissueProcessingDto) from);
} else if (from instanceof SampleAliquotDto) {
to = toAliquotSample((SampleAliquotDto) from);
} else if (from instanceof SampleStockDto) {
to = toStockSample((SampleStockDto) from);
} else {
to = new DetailedSampleImpl();
}
if (from.getSubprojectId() != null) {
Subproject subproject = new SubprojectImpl();
subproject.setId(from.getSubprojectId());
to.setSubproject(subproject);
}
if (from.getSampleClassId() != null) {
SampleClass sampleClass = new SampleClassImpl();
sampleClass.setId(from.getSampleClassId());
to.setSampleClass(sampleClass);
}
to.setGroupId(nullifyStringIfBlank(from.getGroupId()));
to.setGroupDescription(nullifyStringIfBlank(from.getGroupDescription()));
to.setSynthetic(from.getSynthetic());
to.setCreationDate(LimsUtils.isStringEmptyOrNull(from.getCreationDate()) ? null : parseDate(from.getCreationDate()));
if (from.getIdentityId() != null) {
to.setIdentityId(from.getIdentityId());
}
to.setNonStandardAlias(from.getNonStandardAlias());
to.setParent(getParent(from));
setBigDecimal(to::setVolumeUsed, from.getVolumeUsed());
setBigDecimal(to::setNgUsed, from.getNgUsed());
return to;
}
Aggregations