use of uk.ac.bbsrc.tgac.miso.core.data.SampleClass in project miso-lims by miso-lims.
the class Dtos method to.
public static SampleClass to(@Nonnull SampleClassDto from) {
SampleClass to = new SampleClassImpl();
setLong(to::setId, from.getId(), false);
to.setAlias(from.getAlias());
to.setSampleCategory(from.getSampleCategory());
to.setSampleSubcategory(from.getSampleSubcategory());
to.setSuffix(from.getSuffix());
setString(to::setV2NamingCode, from.getV2NamingCode());
to.setArchived(from.isArchived());
to.setDirectCreationAllowed(from.isDirectCreationAllowed());
setObject(to::setDefaultSampleType, from.getDefaultSampleType(), name -> {
SampleType st = new SampleType();
st.setName(name);
return st;
});
if (from.getParentRelationships() != null) {
to.getParentRelationships().addAll(from.getParentRelationships().stream().map(Dtos::to).collect(Collectors.toSet()));
}
if (from.getChildRelationships() != null) {
to.getChildRelationships().addAll(from.getChildRelationships().stream().map(Dtos::to).collect(Collectors.toSet()));
}
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleClass in project miso-lims by miso-lims.
the class V2SampleAliasGeneratorTest method makeStockFromProcessing.
private Sample makeStockFromProcessing() throws Exception {
SampleStock stock = new SampleStockImpl();
DetailedSample lcmTube = makeLcmTube();
lcmTube.setAlias("PROJ_0001_TL03");
stock.setParent(lcmTube);
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleStock.CATEGORY_NAME);
sc.setV2NamingCode("SG");
stock.setSampleClass(sc);
stock.setSiblingNumber(4);
return stock;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleClass in project miso-lims by miso-lims.
the class V2SampleAliasGeneratorTest method makeTissue.
private SampleTissue makeTissue() {
SampleTissue tissue = new SampleTissueImpl();
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleTissue.CATEGORY_NAME);
tissue.setSampleClass(sc);
tissue.setParent(makeIdentity());
tissue.setTimesReceived(1);
tissue.setTubeNumber(1);
return tissue;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleClass in project miso-lims by miso-lims.
the class V2SampleAliasGeneratorTest method makeStockFromTissue.
private SampleStock makeStockFromTissue() throws Exception {
SampleStock stock = new SampleStockImpl();
SampleTissue tissue = makeTissue();
tissue.setAlias("PROJ_0001_01");
stock.setParent(tissue);
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleStock.CATEGORY_NAME);
sc.setV2NamingCode("SG");
stock.setSampleClass(sc);
stock.setSiblingNumber(4);
return stock;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SampleClass in project miso-lims by miso-lims.
the class V2SampleAliasGeneratorTest method makeStockFromStock.
private Sample makeStockFromStock() throws Exception {
SampleStock stock = new SampleStockImpl();
SampleStock parentStock = makeStockFromTissue();
parentStock.setAlias("PROJ_0001_01_SG04");
stock.setParent(parentStock);
SampleClass sc = new SampleClassImpl();
sc.setSampleCategory(SampleStock.CATEGORY_NAME);
sc.setV2NamingCode("SG");
stock.setSampleClass(sc);
stock.setSiblingNumber(6);
return stock;
}
Aggregations