Search in sources :

Example 1 with SequencingControlType

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

the class Dtos method to.

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

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

the class HibernateSequencingControlTypeDaoIT method testGetUsage.

@Test
public void testGetUsage() throws Exception {
    SequencingControlType type = (SequencingControlType) currentSession().get(SequencingControlType.class, 1L);
    assertEquals(1L, sut.getUsage(type));
}
Also used : SequencingControlType(uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 3 with SequencingControlType

use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType 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 4 with SequencingControlType

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

the class HibernateSequencingControlTypeDaoIT method testCreate.

@Test
public void testCreate() throws Exception {
    String alias = "New Control Type";
    SequencingControlType type = new SequencingControlType();
    type.setAlias(alias);
    long savedId = sut.create(type);
    clearSession();
    SequencingControlType saved = (SequencingControlType) currentSession().get(SequencingControlType.class, savedId);
    assertNotNull(saved);
    assertEquals(alias, saved.getAlias());
}
Also used : SequencingControlType(uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 5 with SequencingControlType

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

the class HibernateSequencingControlTypeDaoIT method testGetByAlias.

@Test
public void testGetByAlias() throws Exception {
    String alias = "Positive";
    SequencingControlType type = sut.getByAlias(alias);
    assertNotNull(type);
    assertEquals(alias, type.getAlias());
}
Also used : SequencingControlType(uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

SequencingControlType (uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType)7 Test (org.junit.Test)5 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)5 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)2 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)2 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)2 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)2 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)2 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)2 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)2 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)2 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)2 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)2 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)2 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)2 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)2 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)1 Sample (uk.ac.bbsrc.tgac.miso.core.data.Sample)1 ScientificName (uk.ac.bbsrc.tgac.miso.core.data.ScientificName)1 Assay (uk.ac.bbsrc.tgac.miso.core.data.impl.Assay)1