Search in sources :

Example 6 with RunPurpose

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

the class Dtos method to.

public static RunPurpose to(@Nonnull RunPurposeDto from) {
    RunPurpose to = new RunPurpose();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    return to;
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) 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 7 with RunPurpose

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

the class Dtos method to.

public static SequencingOrder to(@Nonnull SequencingOrderDto from) {
    SequencingOrder to = new SequencingOrderImpl();
    if (from.getId() != null)
        to.setId(from.getId());
    to.setPool(to(from.getPool()));
    setObject(to::setContainerModel, SequencingContainerModel::new, from.getContainerModelId());
    to.setSequencingParameters(to(from.getParameters()));
    to.setPartitions(from.getPartitions());
    to.setDescription(from.getDescription());
    setObject(to::setPurpose, RunPurpose::new, from.getPurposeId());
    return to;
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) 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) SequencingOrderImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingOrderImpl)

Example 8 with RunPurpose

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

the class Dtos method to.

public static PoolOrder to(@Nonnull PoolOrderDto from) {
    PoolOrder to = new PoolOrder();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    setString(to::setDescription, from.getDescription());
    setObject(to::setPurpose, RunPurpose::new, from.getPurposeId());
    setInteger(to::setPartitions, from.getPartitions(), true);
    setObject(to::setContainerModel, SequencingContainerModel::new, from.getContainerModelId());
    setObject(to::setParameters, SequencingParameters::new, from.getParametersId());
    setBoolean(to::setDraft, from.isDraft(), false);
    if (from.getOrderAliquots() != null) {
        to.setOrderLibraryAliquots(from.getOrderAliquots().stream().map(libDto -> {
            OrderLibraryAliquot lib = Dtos.to(libDto);
            lib.setPoolOrder(to);
            return lib;
        }).collect(Collectors.toSet()));
    }
    setObject(to::setPool, PoolImpl::new, from.getPoolId());
    setObject(to::setSequencingOrder, SequencingOrderImpl::new, from.getSequencingOrderId());
    return to;
}
Also used : PoolOrder(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolOrder) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) OrderLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) 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) PoolImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl) SequencingOrderImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingOrderImpl)

Example 9 with RunPurpose

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

the class HibernateRunPartitionAliquotDaoIT method testSaveUpdate.

@Test
public void testSaveUpdate() throws Exception {
    Run run = (Run) currentSession().get(Run.class, 1L);
    Partition partition = (Partition) currentSession().get(PartitionImpl.class, 1L);
    LibraryAliquot aliquot = (LibraryAliquot) currentSession().get(LibraryAliquot.class, 1L);
    RunPartitionAliquotId id = new RunPartitionAliquotId(run, partition, aliquot);
    RunPartitionAliquot existing = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
    assertNotNull(existing);
    assertNull(existing.getPurpose());
    RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
    assertNull(existing.getPurpose());
    existing.setPurpose(purpose);
    sut.save(existing);
    clearSession();
    RunPartitionAliquot saved = (RunPartitionAliquot) currentSession().get(RunPartitionAliquot.class, id);
    assertNotNull(saved.getPurpose());
    assertEquals(purpose.getId(), saved.getPurpose().getId());
}
Also used : Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) RunPartitionAliquotId(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot.RunPartitionAliquotId) RunPartitionAliquot(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot) PartitionImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 10 with RunPurpose

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

the class HibernateRunPartitionDaoIT method testCreate.

@Test
public void testCreate() throws Exception {
    long runId = 2L;
    long partitionId = 2L;
    PartitionQCType type = (PartitionQCType) currentSession().get(PartitionQCType.class, 1L);
    RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
    RunPartition qc = new RunPartition();
    User user = (User) currentSession().get(UserImpl.class, 1L);
    qc.setRunId(runId);
    qc.setPartitionId(partitionId);
    qc.setQcType(type);
    qc.setPurpose(purpose);
    qc.setLastModifier(user);
    dao.create(qc);
    RunPartition fetchedQc = dao.get(runId, partitionId);
    assertNotNull(fetchedQc);
    assertEquals(qc.getQcType().getId(), fetchedQc.getQcType().getId());
    assertEquals(qc.getNotes(), fetchedQc.getNotes());
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) User(com.eaglegenomics.simlims.core.User) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Aggregations

RunPurpose (uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose)16 Test (org.junit.Test)8 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)6 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)5 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)5 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)5 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)5 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)5 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)5 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)5 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)5 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)5 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)5 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)5 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)5 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)4 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)4 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)4 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)4 User (com.eaglegenomics.simlims.core.User)3