Search in sources :

Example 1 with SampleSlideImpl

use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl in project miso-lims by miso-lims.

the class Dtos method toTissuePieceSample.

private static SampleTissuePiece toTissuePieceSample(@Nonnull SampleTissuePieceDto from) {
    SampleTissuePiece to = new SampleTissuePieceImpl();
    TissuePieceType tissuePieceType = new TissuePieceType();
    tissuePieceType.setId(from.getTissuePieceTypeId());
    to.setTissuePieceType(tissuePieceType);
    to.setSlidesConsumed(from.getSlidesConsumed());
    setObject(to::setReferenceSlide, SampleSlideImpl::new, from.getReferenceSlideId());
    return to;
}
Also used : SampleSlideImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl) TissuePieceType(uk.ac.bbsrc.tgac.miso.core.data.type.TissuePieceType) 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) SampleTissuePiece(uk.ac.bbsrc.tgac.miso.core.data.SampleTissuePiece) SampleTissuePieceImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissuePieceImpl)

Example 2 with SampleSlideImpl

use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl in project miso-lims by miso-lims.

the class Dtos method toSlideSample.

private static SampleSlide toSlideSample(@Nonnull SampleSlideDto from) {
    SampleSlide to = new SampleSlideImpl();
    setInteger(to::setInitialSlides, from.getInitialSlides(), true);
    setInteger(to::setSlides, from.getSlides(), true);
    setInteger(to::setThickness, from.getThickness(), true);
    setObject(to::setStain, Stain::new, from.getStainId());
    setBigDecimal(to::setPercentTumour, from.getPercentTumour());
    setBigDecimal(to::setPercentNecrosis, from.getPercentNecrosis());
    setBigDecimal(to::setMarkedArea, from.getMarkedArea());
    setBigDecimal(to::setMarkedAreaPercentTumour, from.getMarkedAreaPercentTumour());
    return to;
}
Also used : SampleSlideImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl) Stain(uk.ac.bbsrc.tgac.miso.core.data.Stain) SampleSlide(uk.ac.bbsrc.tgac.miso.core.data.SampleSlide) 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)

Example 3 with SampleSlideImpl

use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl in project miso-lims by miso-lims.

the class Dtos method getParent.

/**
 * Extracts parent details from the DTO, according to these possible cases:
 *
 * <ol>
 * <li>parent ID is provided. This implies that the parent exists, so no other parent information will be required</li>
 * <li>identity information and parentSampleClassId are provided. This implies that a tissue parent should be created, and that the
 * identity may or may not yet exist. If the sampleClassId is an aliquot, a stockClassId must be provided. ParentAliquotClassId may be
 * provided to indicate a second aliquot level in the hierarchy</li>
 * <li>identity information is provided, but no parentSampleClassId. You must be creating a tissue in this case.</li>
 * </ol>
 *
 * @param childDto
 *          the DTO to take parent details from
 * @return the parent details from the DTO, or null if there are none. A returned sample will also include its own parent if applicable.
 */
private static DetailedSample getParent(@Nonnull DetailedSampleDto childDto) {
    DetailedSample parent = null;
    if (childDto.getParentId() != null) {
        parent = new DetailedSampleImpl();
        parent.setId(childDto.getParentId());
    } else {
        if (childDto instanceof SampleIdentityDto && childDto.getClass() != SampleIdentityDto.class) {
            parent = toIdentitySample((SampleIdentityDto) childDto);
        }
        if (childDto instanceof SampleTissueDto && childDto.getClass() != SampleTissueDto.class) {
            if (childDto.getParentSampleClassId() == null) {
                throw new IllegalArgumentException("No tissue class specified.");
            }
            DetailedSample tissue = toTissueSample((SampleTissueDto) childDto);
            tissue.setSampleClass(new SampleClassImpl());
            tissue.getSampleClass().setId(childDto.getParentSampleClassId());
            tissue.setParent(parent);
            parent = tissue;
            if (childDto instanceof SampleTissuePieceDto) {
                SampleTissuePieceDto tissuePieceDto = (SampleTissuePieceDto) childDto;
                if (tissuePieceDto.getParentSlideClassId() != null) {
                    SampleSlide slide = new SampleSlideImpl();
                    slide.setSampleClass(new SampleClassImpl());
                    slide.getSampleClass().setId(tissuePieceDto.getParentSlideClassId());
                    slide.setSlides(0);
                    slide.setParent(parent);
                    parent = slide;
                }
            }
        }
        if (childDto instanceof SampleSingleCellRelative && childDto.getClass() != SampleSingleCellDto.class) {
            SampleStockDto stockDto = (SampleStockDto) childDto;
            DetailedSample tissueProcessing = toSingleCellSample((SampleSingleCellRelative) childDto);
            tissueProcessing.setSampleClass(new SampleClassImpl());
            tissueProcessing.getSampleClass().setId(stockDto.getTissueProcessingClassId());
            tissueProcessing.setParent(parent);
            parent = tissueProcessing;
        }
        if (childDto instanceof SampleStockDto && childDto.getClass() != SampleStockDto.class && childDto.getClass() != SampleStockSingleCellDto.class && childDto.getClass() != SampleStockRnaDto.class) {
            SampleAliquotDto aliquotDto = (SampleAliquotDto) childDto;
            DetailedSample stock = toStockSample((SampleStockDto) childDto);
            stock.setSampleClass(new SampleClassImpl());
            stock.getSampleClass().setId(aliquotDto.getStockClassId());
            stock.setParent(parent);
            parent = stock;
            if (aliquotDto.getParentAliquotClassId() != null) {
                DetailedSample parentAliquot = toAliquotSample(aliquotDto);
                parentAliquot.setSampleClass(new SampleClassImpl());
                parentAliquot.getSampleClass().setId(aliquotDto.getParentAliquotClassId());
                parentAliquot.setParent(parent);
                parent = parentAliquot;
            }
        }
    }
    return parent;
}
Also used : DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) SampleSlideImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleSlide(uk.ac.bbsrc.tgac.miso.core.data.SampleSlide) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Example 4 with SampleSlideImpl

use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl in project miso-lims by miso-lims.

the class LimsUtilsTest method testInstanceOfSampleTissueProcessing.

@Test
public void testInstanceOfSampleTissueProcessing() throws Exception {
    SampleSlide slide = new SampleSlideImpl();
    assertTrue("Slide is a type of Tissue Processing", LimsUtils.isTissueProcessingSample(slide));
}
Also used : SampleSlideImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl) SampleSlide(uk.ac.bbsrc.tgac.miso.core.data.SampleSlide) Test(org.junit.Test)

Example 5 with SampleSlideImpl

use of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl 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;
}
Also used : SampleSlideImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl) SampleStockRnaImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockRnaImpl) SampleStockRna(uk.ac.bbsrc.tgac.miso.core.data.SampleStockRna) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) SampleStockSingleCellImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockSingleCellImpl) 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) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock) SampleStockSingleCell(uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell)

Aggregations

SampleSlideImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleSlideImpl)5 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)3 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)3 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)3 SampleSlide (uk.ac.bbsrc.tgac.miso.core.data.SampleSlide)3 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)3 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)3 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)3 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)3 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)3 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)3 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)3 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)3 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)3 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)3 Test (org.junit.Test)1 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)1 SampleStock (uk.ac.bbsrc.tgac.miso.core.data.SampleStock)1 SampleStockRna (uk.ac.bbsrc.tgac.miso.core.data.SampleStockRna)1 SampleStockSingleCell (uk.ac.bbsrc.tgac.miso.core.data.SampleStockSingleCell)1