Search in sources :

Example 1 with OxfordNanoporeContainer

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

the class Dtos method to.

public static SequencerPartitionContainer to(@Nonnull ContainerDto from) {
    SequencerPartitionContainer to = null;
    if (from instanceof OxfordNanoporeContainerDto) {
        OxfordNanoporeContainerDto ontFrom = (OxfordNanoporeContainerDto) from;
        OxfordNanoporeContainer ontTo = new OxfordNanoporeContainer();
        setObject(ontTo::setPoreVersion, PoreVersion::new, ontFrom.getPoreVersionId());
        setDate(ontTo::setReceivedDate, ontFrom.getReceivedDate());
        setDate(ontTo::setReturnedDate, ontFrom.getReturnedDate());
        to = ontTo;
    } else {
        to = new SequencerPartitionContainerImpl();
    }
    setLong(to::setId, from.getId(), false);
    setString(to::setIdentificationBarcode, from.getIdentificationBarcode());
    setObject(to::setModel, SequencingContainerModel::new, maybeGetProperty(from.getModel(), SequencingContainerModelDto::getId));
    setString(to::setDescription, from.getDescription());
    setObject(to::setClusteringKit, KitDescriptor::new, from.getClusteringKitId());
    setString(to::setClusteringKitLot, from.getClusteringKitLot());
    setObject(to::setMultiplexingKit, KitDescriptor::new, from.getMultiplexingKitId());
    setString(to::setMultiplexingKitLot, from.getMultiplexingKitLot());
    return to;
}
Also used : SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) OxfordNanoporeContainer(uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer) SequencerPartitionContainerImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl) PoreVersion(uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion) 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 2 with OxfordNanoporeContainer

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

the class DefaultContainerService method loadChildEntities.

/**
 * Loads persisted objects into container fields. Should be called before saving new containers. Loads all member objects <b>except</b>
 * <ul>
 * <li>creator/lastModifier User objects</li>
 * </ul>
 *
 * @param container the SequencerPartitionContainer to load entities into. Must contain at least the IDs of objects to load (e.g. to load
 *          the persisted SequencingContainerModel
 *          into container.model, container.model.id must be set)
 * @throws IOException
 */
private void loadChildEntities(SequencerPartitionContainer container) throws IOException {
    container.setModel(containerModelService.get(container.getModel().getId()));
    if (container.getClusteringKit() != null) {
        KitDescriptor descriptor = kitService.get(container.getClusteringKit().getId());
        if (descriptor.getKitType() != KitType.CLUSTERING) {
            throw new IllegalArgumentException(descriptor.getName() + " is not a clustering kit.");
        }
        container.setClusteringKit(descriptor);
    }
    if (container.getMultiplexingKit() != null) {
        KitDescriptor descriptor = kitService.get(container.getMultiplexingKit().getId());
        if (descriptor.getKitType() != KitType.MULTIPLEXING) {
            throw new IllegalArgumentException(descriptor.getName() + " is not a multiplexing kit.");
        }
        container.setMultiplexingKit(descriptor);
    }
    if (LimsUtils.isOxfordNanoporeContainer(container)) {
        OxfordNanoporeContainer ontContainer = (OxfordNanoporeContainer) container;
        if (ontContainer.getPoreVersion() != null) {
            ontContainer.setPoreVersion(containerDao.getPoreVersion(ontContainer.getPoreVersion().getId()));
        }
    }
}
Also used : KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) OxfordNanoporeContainer(uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer)

Example 3 with OxfordNanoporeContainer

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

the class Dtos method asDto.

public static ContainerDto asDto(@Nonnull SequencerPartitionContainer from, boolean includePartitions, boolean includePoolContents, IndexChecker indexChecker) {
    ContainerDto dto = null;
    if (from instanceof OxfordNanoporeContainer) {
        OxfordNanoporeContainer ontFrom = (OxfordNanoporeContainer) from;
        OxfordNanoporeContainerDto ontDto = new OxfordNanoporeContainerDto();
        if (ontFrom.getPoreVersion() != null) {
            ontDto.setPoreVersionId(ontFrom.getPoreVersion().getId());
        }
        ontDto.setReceivedDate(formatDate(ontFrom.getReceivedDate()));
        ontDto.setReturnedDate(formatDate(ontFrom.getReturnedDate()));
        dto = ontDto;
    } else {
        dto = new ContainerDto();
    }
    dto.setId(from.getId());
    dto.setIdentificationBarcode(from.getIdentificationBarcode());
    dto.setModel(asDto(from.getModel()));
    dto.setDescription(from.getDescription());
    Run lastRun = from.getLastRun();
    if (lastRun != null) {
        dto.setLastRunAlias(lastRun.getAlias());
        dto.setLastRunId(lastRun.getId());
        dto.setLastRunInstrumentModelId(lastRun.getSequencer().getInstrumentModel().getId());
        dto.setLastSequencerId(lastRun.getSequencer().getId());
        dto.setLastSequencerName(lastRun.getSequencer().getName());
    }
    if (from.getLastModified() != null) {
        dto.setLastModified(formatDateTime(from.getLastModified()));
    }
    if (from.getClusteringKit() != null) {
        dto.setClusteringKitId(from.getClusteringKit().getId());
    }
    setString(dto::setClusteringKitLot, from.getClusteringKitLot());
    if (from.getMultiplexingKit() != null) {
        dto.setMultiplexingKitId(from.getMultiplexingKit().getId());
    }
    setString(dto::setMultiplexingKitLot, from.getMultiplexingKitLot());
    if (includePartitions) {
        dto.setPartitions(asPartitionDtos(from.getPartitions(), includePoolContents, indexChecker));
    }
    return dto;
}
Also used : OxfordNanoporeContainer(uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer) OxfordNanoporeRun(uk.ac.bbsrc.tgac.miso.core.data.OxfordNanoporeRun) SolidRun(uk.ac.bbsrc.tgac.miso.core.data.SolidRun) QcControlRun(uk.ac.bbsrc.tgac.miso.core.data.qc.QcControlRun) LibraryQcControlRun(uk.ac.bbsrc.tgac.miso.core.data.qc.LibraryQcControlRun) SampleQcControlRun(uk.ac.bbsrc.tgac.miso.core.data.qc.SampleQcControlRun) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) ArrayRun(uk.ac.bbsrc.tgac.miso.core.data.ArrayRun) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) LS454Run(uk.ac.bbsrc.tgac.miso.core.data.LS454Run) IonTorrentRun(uk.ac.bbsrc.tgac.miso.core.data.IonTorrentRun) InstrumentStatusPositionRun(uk.ac.bbsrc.tgac.miso.core.data.impl.view.instrumentstatus.InstrumentStatusPositionRun) PoolQcControlRun(uk.ac.bbsrc.tgac.miso.core.data.qc.PoolQcControlRun) PacBioRun(uk.ac.bbsrc.tgac.miso.core.data.PacBioRun) ContainerQcControlRun(uk.ac.bbsrc.tgac.miso.core.data.qc.ContainerQcControlRun)

Aggregations

OxfordNanoporeContainer (uk.ac.bbsrc.tgac.miso.core.data.impl.OxfordNanoporeContainer)3 KitDescriptor (uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor)2 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)1 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)1 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)1 ArrayRun (uk.ac.bbsrc.tgac.miso.core.data.ArrayRun)1 IlluminaRun (uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun)1 IonTorrentRun (uk.ac.bbsrc.tgac.miso.core.data.IonTorrentRun)1 LS454Run (uk.ac.bbsrc.tgac.miso.core.data.LS454Run)1 OxfordNanoporeRun (uk.ac.bbsrc.tgac.miso.core.data.OxfordNanoporeRun)1 PacBioRun (uk.ac.bbsrc.tgac.miso.core.data.PacBioRun)1 Run (uk.ac.bbsrc.tgac.miso.core.data.Run)1 SequencerPartitionContainer (uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer)1 SolidRun (uk.ac.bbsrc.tgac.miso.core.data.SolidRun)1 PoreVersion (uk.ac.bbsrc.tgac.miso.core.data.impl.PoreVersion)1 SequencerPartitionContainerImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl)1 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)1 InstrumentStatusPositionRun (uk.ac.bbsrc.tgac.miso.core.data.impl.view.instrumentstatus.InstrumentStatusPositionRun)1 ContainerQcControlRun (uk.ac.bbsrc.tgac.miso.core.data.qc.ContainerQcControlRun)1 LibraryQcControlRun (uk.ac.bbsrc.tgac.miso.core.data.qc.LibraryQcControlRun)1