use of uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl in project miso-lims by miso-lims.
the class LoadSequencerWorkflow method execute.
@Override
public void execute(WorkflowExecutor workflowExecutor) throws IOException {
if (!isComplete())
throw new IllegalStateException("Workflow is not complete");
SequencerPartitionContainer spc;
if (containerStep.isExistingContainer()) {
spc = containerStep.getContainer();
} else {
spc = new SequencerPartitionContainerImpl();
SequencingContainerModel model = containerModelStep.getModel();
spc.setModel(model);
spc.setIdentificationBarcode(containerStep.getBarcode());
spc.setPartitionLimit(model.getPartitionCount());
}
for (int i = 0; i < partitionSteps.size(); ++i) {
spc.getPartitionAt(i + 1).setPool(partitionSteps.get(i).getPool());
}
workflowExecutor.save(spc);
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl in project miso-lims by miso-lims.
the class LoadSequencerWorkflowTest method makeContainerStep.
private SequencerPartitionContainerProgressStep makeContainerStep(String serialNumber, String modelAlias, int partitionCount, PlatformType platformType) {
SequencerPartitionContainer container = new SequencerPartitionContainerImpl();
container.setIdentificationBarcode(serialNumber);
container.setModel(makeModel(modelAlias, partitionCount, platformType));
container.setPartitionLimit(partitionCount);
SequencerPartitionContainerProgressStep step = new SequencerPartitionContainerProgressStep();
step.setInput(container);
return step;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl in project miso-lims by miso-lims.
the class DefaultRunServiceTest method makeContainer.
private static SequencerPartitionContainer makeContainer() {
SequencerPartitionContainer container = new SequencerPartitionContainerImpl();
container.setPartitionLimit(1);
container.setIdentificationBarcode(CONTAINER_SERIAL_NO);
container.setModel(makeContainerModel());
return container;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl 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;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SequencerPartitionContainerImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static QC to(@Nonnull QcDto dto) {
QC to;
switch(dto.getQcTarget()) {
case "Library":
LibraryQC newLibraryQc = new LibraryQC();
Library ownerLibrary = new LibraryImpl();
ownerLibrary.setId(dto.getEntityId());
newLibraryQc.setLibrary(ownerLibrary);
to = newLibraryQc;
break;
case "Sample":
SampleQC newSampleQc = new SampleQC();
Sample ownerSample = new SampleImpl();
ownerSample.setId(dto.getEntityId());
newSampleQc.setSample(ownerSample);
to = newSampleQc;
break;
case "Pool":
PoolQC newPoolQc = new PoolQC();
Pool ownerPool = new PoolImpl();
ownerPool.setId(dto.getEntityId());
newPoolQc.setPool(ownerPool);
to = newPoolQc;
break;
case "Container":
ContainerQC newContainerQc = new ContainerQC();
SequencerPartitionContainer ownerContainer = new SequencerPartitionContainerImpl();
ownerContainer.setId(dto.getEntityId());
newContainerQc.setContainer(ownerContainer);
to = newContainerQc;
break;
case "Requisition":
RequisitionQC newRequisitionQc = new RequisitionQC();
Requisition ownerRequisition = new Requisition();
ownerRequisition.setId(dto.getEntityId());
newRequisitionQc.setRequisition(ownerRequisition);
to = newRequisitionQc;
break;
default:
throw new IllegalArgumentException("No such QC target: " + dto.getQcTarget());
}
if (dto.getId() != null) {
to.setId(dto.getId());
}
to.setDate(parseDate(dto.getDate()));
setBigDecimal(to::setResults, dto.getResults());
setObject(to::setType, QcType::new, dto.getQcTypeId());
to.setDescription(dto.getDescription());
setObject(to::setInstrument, InstrumentImpl::new, dto.getInstrumentId());
setObject(to::setKit, KitDescriptor::new, dto.getKitDescriptorId());
setString(to::setKitLot, dto.getKitLot());
addQcControlRuns(dto.getControls(), to, QcTarget.valueOf(dto.getQcTarget()));
return to;
}
Aggregations