Search in sources :

Example 1 with DetailedQcStatusImpl

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

the class Dtos method to.

public static DetailedQcStatus to(@Nonnull DetailedQcStatusDto from) {
    DetailedQcStatus to = new DetailedQcStatusImpl();
    setLong(to::setId, from.getId(), false);
    setBoolean(to::setStatus, from.getStatus(), true);
    setString(to::setDescription, from.getDescription());
    setBoolean(to::setNoteRequired, from.isNoteRequired(), false);
    return to;
}
Also used : DetailedQcStatus(uk.ac.bbsrc.tgac.miso.core.data.DetailedQcStatus) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) 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 DetailedQcStatusImpl

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

the class HibernateDetailedQcStatusDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    String desc = "Unknown";
    DetailedQcStatus status = new DetailedQcStatusImpl();
    status.setDescription(desc);
    status.setStatus(null);
    status.setNoteRequired(true);
    User user = (User) getSessionFactory().getCurrentSession().get(UserImpl.class, 1L);
    status.setChangeDetails(user);
    long savedId = sut.create(status);
    clearSession();
    DetailedQcStatus saved = (DetailedQcStatus) getSessionFactory().getCurrentSession().get(DetailedQcStatusImpl.class, savedId);
    assertEquals(desc, saved.getDescription());
}
Also used : User(com.eaglegenomics.simlims.core.User) DetailedQcStatus(uk.ac.bbsrc.tgac.miso.core.data.DetailedQcStatus) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 3 with DetailedQcStatusImpl

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

the class Dtos method to.

public static LibraryAliquot to(@Nonnull LibraryAliquotDto from) {
    LibraryAliquot to = null;
    if (from instanceof DetailedLibraryAliquotDto) {
        to = toDetailed((DetailedLibraryAliquotDto) from);
    } else {
        to = new LibraryAliquot();
        setObject(to::setLibrary, LibraryImpl::new, from.getLibraryId());
        setObject(to::setParentAliquot, LibraryAliquot::new, from.getParentAliquotId());
    }
    setLong(to::setId, from.getId(), false);
    setString(to::setName, from.getName());
    setString(to::setAlias, from.getAlias());
    setString(to::setDescription, from.getDescription());
    setInteger(to::setDnaSize, from.getDnaSize(), true);
    to.setIdentificationBarcode(from.getIdentificationBarcode());
    setBigDecimal(to::setConcentration, from.getConcentration());
    to.setConcentrationUnits(from.getConcentrationUnits());
    setBigDecimal(to::setNgUsed, from.getNgUsed());
    setBigDecimal(to::setVolume, from.getVolume());
    to.setVolumeUnits(from.getVolumeUnits());
    setBigDecimal(to::setVolumeUsed, from.getVolumeUsed());
    to.setCreationDate(parseDate(from.getCreationDate()));
    if (from.getTargetedSequencingId() != null) {
        to.setTargetedSequencing(new TargetedSequencing());
        to.getTargetedSequencing().setId(from.getTargetedSequencingId());
    }
    to.setBoxPosition((LibraryAliquotBoxPosition) makeBoxablePosition(from, to));
    to.setDiscarded(from.isDiscarded());
    setObject(to::setDetailedQcStatus, DetailedQcStatusImpl::new, from.getDetailedQcStatusId());
    setString(to::setDetailedQcStatusNote, from.getDetailedQcStatusNote());
    setObject(to::setKitDescriptor, KitDescriptor::new, from.getKitDescriptorId());
    setString(to::setKitLot, from.getKitLot());
    return to;
}
Also used : KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) TargetedSequencing(uk.ac.bbsrc.tgac.miso.core.data.impl.TargetedSequencing) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) WorksetLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibraryAliquot) OrderLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) 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 4 with DetailedQcStatusImpl

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

the class Dtos method to.

public static Sample to(@Nonnull SampleDto from) {
    Sample to = null;
    if (from instanceof DetailedSampleDto) {
        to = toDetailedSample((DetailedSampleDto) from);
    } else {
        to = new SampleImpl();
    }
    if (from.getId() != null)
        to.setId(from.getId());
    to.setAccession(nullifyStringIfBlank(from.getAccession()));
    to.setName(from.getName());
    to.setDescription(nullifyStringIfBlank(from.getDescription()));
    to.setIdentificationBarcode(nullifyStringIfBlank(from.getIdentificationBarcode()));
    to.setLocationBarcode(nullifyStringIfBlank(from.getLocationBarcode()));
    to.setSampleType(from.getSampleType());
    setObject(to::setDetailedQcStatus, DetailedQcStatusImpl::new, from.getDetailedQcStatusId());
    setString(to::setDetailedQcStatusNote, from.getDetailedQcStatusNote());
    setObject(to::setScientificName, ScientificName::new, from.getScientificNameId());
    to.setTaxonIdentifier(from.getTaxonIdentifier());
    to.setAlias(from.getAlias());
    to.setDescription(from.getDescription());
    setBigDecimal(to::setInitialVolume, from.getInitialVolume());
    setBigDecimal(to::setVolume, from.getVolume());
    to.setVolumeUnits(from.getVolumeUnits());
    setBigDecimal(to::setConcentration, from.getConcentration());
    to.setConcentrationUnits(from.getConcentrationUnits());
    to.setDiscarded(from.isDiscarded());
    if (from.getProjectId() != null) {
        to.setProject(new ProjectImpl());
        to.getProject().setId(from.getProjectId());
    }
    to.setBoxPosition((SampleBoxPosition) makeBoxablePosition(from, (SampleImpl) to));
    setObject(to::setRequisition, Requisition::new, from.getRequisitionId());
    if (to.getRequisition() != null) {
        Requisition toRequisition = to.getRequisition();
        setString(toRequisition::setAlias, from.getRequisitionAlias());
        if (from.getRequisitionAssayId() != null) {
            setObject(toRequisition::setAssay, Assay::new, from.getRequisitionAssayId());
        }
    }
    setObject(to::setSequencingControlType, SequencingControlType::new, from.getSequencingControlTypeId());
    setObject(to::setSop, Sop::new, from.getSopId());
    to.setCreationReceiptInfo(toReceiptTransfer(from, to));
    return to;
}
Also used : Assay(uk.ac.bbsrc.tgac.miso.core.data.impl.Assay) SequencingControlType(uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType) Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop) ParentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentSample) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) WorksetSample(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetSample) GrandparentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) SampleNumberPerProjectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleNumberPerProjectImpl) ProjectImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) 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) ScientificName(uk.ac.bbsrc.tgac.miso.core.data.ScientificName) Requisition(uk.ac.bbsrc.tgac.miso.core.data.impl.Requisition) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Example 5 with DetailedQcStatusImpl

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

the class Dtos method to.

public static Library to(@Nonnull LibraryDto from) {
    Library to = null;
    if (from instanceof DetailedLibraryDto) {
        to = toDetailedLibrary((DetailedLibraryDto) from);
    } else {
        to = new LibraryImpl();
    }
    if (from.getId() != null)
        to.setId(from.getId());
    to.setAlias(from.getAlias());
    to.setName(from.getName());
    to.setDescription(from.getDescription());
    to.setIdentificationBarcode(from.getIdentificationBarcode());
    setBigDecimal(to::setConcentration, from.getConcentration());
    to.setConcentrationUnits(from.getConcentrationUnits());
    to.setLowQuality(from.getLowQuality());
    if (from.getPaired() != null) {
        to.setPaired(from.getPaired());
    }
    to.setPlatformType(PlatformType.get(from.getPlatformType()));
    if (from.getParentSampleId() != null) {
        to.setSample(new SampleImpl());
        to.getSample().setId(from.getParentSampleId());
    }
    setObject(to::setLibrarySelectionType, LibrarySelectionType::new, from.getLibrarySelectionTypeId());
    if (from.getLibraryStrategyTypeId() != null) {
        LibraryStrategyType strat = new LibraryStrategyType();
        strat.setId(from.getLibraryStrategyTypeId());
        to.setLibraryStrategyType(strat);
    }
    if (from.getLibraryTypeId() != null) {
        LibraryType type = new LibraryType();
        type.setId(from.getLibraryTypeId());
        if (from.getLibraryTypeAlias() != null)
            type.setDescription(from.getLibraryTypeAlias());
        to.setLibraryType(type);
    }
    setObject(to::setDetailedQcStatus, DetailedQcStatusImpl::new, from.getDetailedQcStatusId());
    setString(to::setDetailedQcStatusNote, from.getDetailedQcStatusNote());
    if (from.getIndex1Id() != null) {
        Index tb1 = new Index();
        tb1.setId(from.getIndex1Id());
        to.setIndex1(tb1);
        if (from.getIndex2Id() != null) {
            Index tb2 = new Index();
            tb2.setId(from.getIndex2Id());
            to.setIndex2(tb2);
        }
    }
    setBigDecimal(to::setInitialVolume, from.getInitialVolume());
    setBigDecimal(to::setVolume, from.getVolume());
    to.setVolumeUnits(from.getVolumeUnits());
    setBigDecimal(to::setVolumeUsed, from.getVolumeUsed());
    setBigDecimal(to::setNgUsed, from.getNgUsed());
    to.setDnaSize(from.getDnaSize());
    if (from.getKitDescriptorId() != null) {
        KitDescriptor kitDescriptor = new KitDescriptor();
        kitDescriptor.setId(from.getKitDescriptorId());
        to.setKitDescriptor(kitDescriptor);
    }
    setString(to::setKitLot, from.getKitLot());
    to.setLocationBarcode(from.getLocationBarcode());
    to.setCreationDate(parseDate(from.getCreationDate()));
    to.setBoxPosition((LibraryBoxPosition) makeBoxablePosition(from, (LibraryImpl) to));
    to.setDiscarded(from.isDiscarded());
    setObject(to::setSpikeIn, LibrarySpikeIn::new, from.getSpikeInId());
    setBigDecimal(to::setSpikeInVolume, from.getSpikeInVolume());
    setObject(to::setSpikeInDilutionFactor, from.getSpikeInDilutionFactor(), DilutionFactor::get);
    setBoolean(to::setUmis, from.getUmis(), false);
    setObject(to::setWorkstation, Workstation::new, from.getWorkstationId());
    setObject(to::setThermalCycler, InstrumentImpl::new, from.getThermalCyclerId());
    setObject(to::setSop, Sop::new, from.getSopId());
    to.setCreationReceiptInfo(toReceiptTransfer(from, to));
    return to;
}
Also used : LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) LibrarySelectionType(uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType) LibraryType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType) DetailedQcStatusImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl) Index(uk.ac.bbsrc.tgac.miso.core.data.Index) Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) DilutionFactor(uk.ac.bbsrc.tgac.miso.core.data.type.DilutionFactor) KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) LibrarySpikeIn(uk.ac.bbsrc.tgac.miso.core.data.LibrarySpikeIn) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) WorksetLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibrary) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) 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) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Aggregations

DetailedQcStatusImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl)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 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 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)4 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)4 DetailedQcStatus (uk.ac.bbsrc.tgac.miso.core.data.DetailedQcStatus)3 DetailedLibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl)2 DetailedSampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)2 LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)2 SampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl)2 Sop (uk.ac.bbsrc.tgac.miso.core.data.impl.Sop)2