use of uk.ac.bbsrc.tgac.miso.core.data.impl.Sop in project miso-lims by miso-lims.
the class Dtos method to.
public static Run to(@Nonnull RunDto dto) {
Run to = getPlatformRun(dto);
setLong(to::setId, dto.getId(), false);
setString(to::setName, dto.getName());
setString(to::setAlias, dto.getAlias());
setString(to::setDescription, dto.getDescription());
setObject(to::setHealth, dto.getStatus(), status -> HealthType.get(status));
setString(to::setAccession, dto.getAccession());
setObject(to::setSequencer, InstrumentImpl::new, dto.getInstrumentId());
setDate(to::setStartDate, dto.getStartDate());
setDate(to::setCompletionDate, dto.getEndDate());
setObject(to::setSequencingParameters, SequencingParameters::new, dto.getSequencingParametersId());
setObject(to::setSequencingKit, KitDescriptor::new, dto.getSequencingKitId());
setString(to::setSequencingKitLot, dto.getSequencingKitLot());
setString(to::setFilePath, dto.getRunPath());
setBoolean(to::setQcPassed, dto.getQcPassed(), true);
setBoolean(to::setDataReview, dto.getDataReview(), true);
setObject(to::setSop, Sop::new, dto.getSopId());
setObject(to::setDataManglingPolicy, dto.getDataManglingPolicy(), InstrumentDataManglingPolicy::valueOf);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Sop in project miso-lims by miso-lims.
the class HibernateSopDaoIT method testListByCategory.
@Test
public void testListByCategory() throws Exception {
List<Sop> sops = getTestSubject().listByCategory(SopCategory.LIBRARY);
assertNotNull(sops);
assertEquals(2, sops.size());
for (Sop sop : sops) {
assertEquals(SopCategory.LIBRARY, sop.getCategory());
}
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Sop in project miso-lims by miso-lims.
the class Dtos method to.
public static Sop to(@Nonnull SopDto from) {
Sop to = new Sop();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
setString(to::setVersion, from.getVersion());
setObject(to::setCategory, from.getCategory(), SopCategory::valueOf);
setString(to::setUrl, from.getUrl());
setBoolean(to::setArchived, from.isArchived(), false);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Sop 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;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Sop 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;
}
Aggregations