public String createSampleSheet(Run run, User user) { final List<String> columns = getColumns().collect(Collectors.toList()); return header(run) + Stream.concat(// Stream.of(String.join(",", columns)), // run.getSequencerPartitionContainers().stream()// .flatMap(container -> container.getPartitions().stream())// .filter(partition -> partition.getPool() != null)// .flatMap(partition -> createRowsForPartition(run, user, columns, partition))) .collect(Collectors.joining("\n")); }
private void updatePartitionContents(final GetLaneContents getLaneContents, SequencerPartitionContainer newContainer) { newContainer.getPartitions().stream().filter(partition -> partition.getPool() == null) .forEach(partition -> getLaneContents.getLaneContents(partition.getPartitionNumber()).filter(s -> !LimsUtils.isStringBlankOrNull(s)) .map(WhineyFunction.rethrow(poolService::getByBarcode)).ifPresent(partition::setPool)); }
posDto.setPools(run == null ? Collections.emptyList() .flatMap(c -> c.getPartitions().stream())//
case 1: SequencerPartitionContainer container = containers.iterator().next(); if (container.getPartitions().size() != laneCount) { throw new IllegalArgumentException(String.format("The container %s has %d partitions, but %d were detected by the scanner.", containerSerialNumber, container.getPartitions().size(), laneCount));
@Override public void applyChanges(SequencerPartitionContainer source, SequencerPartitionContainer managed) throws IOException { managed.setIdentificationBarcode(source.getIdentificationBarcode()); managed.setDescription(source.getDescription()); managed.setClusteringKit(source.getClusteringKit()); managed.setMultiplexingKit(source.getMultiplexingKit()); if (LimsUtils.isOxfordNanoporeContainer(managed)) { applyOxfordNanoporeChanges((OxfordNanoporeContainer) source, (OxfordNanoporeContainer) managed); } for (Partition sourcePartition : source.getPartitions()) { for (Partition managedPartition : managed.getPartitions()) { if (sourcePartition == null || managedPartition == null) { throw new IOException("Partition from " + (sourcePartition == null ? "client" : "database") + " is null."); } if (sourcePartition.getId() == managedPartition.getId()) { Pool sourcePool = sourcePartition.getPool(); Pool managedPool = managedPartition.getPool(); if (sourcePool == null) { managedPartition.setPool(null); } else if (managedPool == null || sourcePool.getId() != managedPool.getId()) { managedPartition.setPool(poolService.get(sourcePool.getId())); } break; } } } }
public static ContainerDto asDto(@Nonnull SequencerPartitionContainer from, boolean includePartitions, boolean includePoolContents) { ContainerDto dto = new ContainerDto(); dto.setId(from.getId()); dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setModel(asDto(from.getModel())); Run lastRun = from.getLastRun(); if (lastRun != null) { dto.setLastRunAlias(lastRun.getAlias()); dto.setLastRunId(lastRun.getId()); dto.setLastSequencerId(lastRun.getSequencer().getId()); dto.setLastSequencerName(lastRun.getSequencer().getName()); } if (from.getLastModified() != null) { dto.setLastModified(formatDateTime(from.getLastModified())); } if (from.getClusteringKit() != null) { dto.setClusteringKit(asDto(from.getClusteringKit())); } if (from.getMultiplexingKit() != null) { dto.setMultiplexingKit(asDto(from.getMultiplexingKit())); } if (includePartitions) { dto.setPartitions(asPartitionDtos(from.getPartitions(), includePoolContents)); } return dto; }