Search in sources :

Example 1 with SampleClassImpl

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;
}
Also used : SampleAliquot(uk.ac.bbsrc.tgac.miso.core.data.SampleAliquot) SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleAliquotImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleAliquotImpl)

Example 2 with SampleClassImpl

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;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) TissueOrigin(uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin) TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) TissueOriginImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl)

Example 3 with SampleClassImpl

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;
}
Also used : SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock)

Example 4 with SampleClassImpl

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;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl)

Example 5 with SampleClassImpl

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;
}
Also used : Subproject(uk.ac.bbsrc.tgac.miso.core.data.Subproject) SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) SubprojectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SubprojectImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)

Aggregations

SampleClassImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl)31 SampleClass (uk.ac.bbsrc.tgac.miso.core.data.SampleClass)22 SampleTissue (uk.ac.bbsrc.tgac.miso.core.data.SampleTissue)10 SampleStock (uk.ac.bbsrc.tgac.miso.core.data.SampleStock)9 SampleStockImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl)9 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)6 SampleTissueImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl)6 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)4 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)4 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)4 SampleAliquot (uk.ac.bbsrc.tgac.miso.core.data.SampleAliquot)4 SampleAliquotImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleAliquotImpl)4 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)4 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)4 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)4 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)4 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)4 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)4 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)4 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)4