use of uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin 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.TissueOrigin in project miso-lims by miso-lims.
the class OicrSampleAliasGeneratorTest method makeFullTissue.
private Sample makeFullTissue() {
SampleTissue tissue = makeMinimalTissue();
TissueOrigin to = new TissueOriginImpl();
to.setAlias("Bn");
tissue.setTissueOrigin(to);
TissueType tt = new TissueTypeImpl();
tt.setAlias("P");
tissue.setTissueType(tt);
tissue.setPassageNumber(32);
tissue.setTimesReceived(2);
tissue.setTubeNumber(3);
return tissue;
}
use of uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin in project miso-lims by miso-lims.
the class Dtos method to.
public static TissueOrigin to(TissueOriginDto from) {
TissueOrigin to = new TissueOriginImpl();
if (from.getId() != null)
to.setId(from.getId());
setString(to::setAlias, from.getAlias());
setString(to::setDescription, from.getDescription());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin in project miso-lims by miso-lims.
the class HibernateTissueOriginDaoIT method testGetByAlias.
@Test
public void testGetByAlias() throws Exception {
String alias = "Test Origin";
TissueOrigin origin = getTestSubject().getByAlias(alias);
assertNotNull(origin);
assertEquals(alias, origin.getAlias());
}
use of uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin in project miso-lims by miso-lims.
the class Dtos method toTissueSample.
private static SampleTissue toTissueSample(@Nonnull SampleTissueDto from) {
SampleTissue to = new SampleTissueImpl();
to.setPassageNumber(from.getPassageNumber());
to.setTimesReceived(from.getTimesReceived());
to.setTubeNumber(from.getTubeNumber());
to.setRegion(nullifyStringIfBlank(from.getRegion()));
to.setSecondaryIdentifier(from.getSecondaryIdentifier());
if (from.getTissueOriginId() != null) {
TissueOrigin tissueOrigin = new TissueOriginImpl();
tissueOrigin.setId(from.getTissueOriginId());
to.setTissueOrigin(tissueOrigin);
}
if (from.getTissueTypeId() != null) {
TissueType tissueType = new TissueTypeImpl();
tissueType.setId(from.getTissueTypeId());
to.setTissueType(tissueType);
}
if (from.getTissueMaterialId() != null) {
TissueMaterial tissueMaterial = new TissueMaterialImpl();
tissueMaterial.setId(from.getTissueMaterialId());
to.setTissueMaterial(tissueMaterial);
}
if (from.getLabId() != null) {
Lab lab = new LabImpl();
lab.setId(from.getLabId());
to.setLab(lab);
}
setString(to::setTimepoint, from.getTimepoint());
return to;
}
Aggregations