@Override public int compare(Partition o1, Partition o2) { return o1.getPartitionNumber().compareTo(o2.getPartitionNumber()); }
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)); }
@Override protected void populate(Element xml, Pair<PoolableElementView, Partition> entry) { Run r = entry.getValue().getSequencerPartitionContainer().getLastRun(); xml.setAttribute("alias", "L00" + entry.getValue().getPartitionNumber() + ":" + entry.getKey().getDilutionName() + ":" + r.getAlias()); xml.setAttribute("run_center", centreName); if (r.getHealth() == HealthType.Completed) { xml.setAttribute("run_date", DF_TIMESTAMP.format(r.getCompletionDate())); } xml.setAttribute("center_name", centreName); for (Experiment e : submission.getExperiments()) { Element experimentRef = xml.getOwnerDocument().createElementNS(null, "EXPERIMENT_REF"); experimentRef.setAttribute("refname", e.getAlias()); experimentRef.setAttribute("refcenter", centreName); xml.appendChild(experimentRef); } Element dataBlock = xml.getOwnerDocument().createElementNS(null, "DATA_BLOCK"); dataBlock.setAttribute("sector", Integer.toString(entry.getValue().getPartitionNumber())); if (entry.getValue().getPool().getPoolDilutions().size() > 1) { // multiplexed dataBlock.setAttribute("member_name", entry.getKey().getDilutionName()); } }
@Override public int compareTo(Partition t) { if (getId() != 0L && t.getId() != 0L) { if (getId() < t.getId()) return -1; if (getId() > t.getId()) return 1; } else { if (getPartitionNumber() < t.getPartitionNumber()) return -1; if (getPartitionNumber() > t.getPartitionNumber()) return 1; } return 0; }
@Override protected void makeColumns(Run run, Partition p, PoolableElementView dilution, String userName, String[] output) { output[0] = p.getSequencerPartitionContainer().getIdentificationBarcode(); output[1] = p.getPartitionNumber().toString(); output[2] = String.format("%d_%s_%s", p.getSequencerPartitionContainer().getId(), dilution.getLibraryName(), dilution.getDilutionName()); output[3] = dilution.getSampleAlias().replaceAll("\\s", ""); output[4] = dilution.getIndices().stream()// .sorted(Comparator.comparingInt(Index::getPosition))// .map(i -> { if (run.getSequencer().getInstrumentModel().getDataManglingPolicy() == InstrumentDataManglingPolicy.I5_RC && i.getPosition() == 2) { return reverseComplement(i.getSequence()); } return i.getSequence(); })// .collect(Collectors.joining("-")); output[5] = dilution.getLibraryDescription(); output[6] = "N"; output[7] = "NA"; output[8] = userName; }
public static PartitionDto asDto(@Nonnull Partition from, boolean includePoolContents) { PartitionDto dto = new PartitionDto(); dto.setId(from.getId()); dto.setContainerId(from.getSequencerPartitionContainer().getId()); dto.setContainerName(from.getSequencerPartitionContainer().getIdentificationBarcode()); dto.setPartitionNumber(from.getPartitionNumber()); dto.setPool(from.getPool() == null ? null : asDto(from.getPool(), includePoolContents, false)); setString(dto::setLoadingConcentration, from.getLoadingConcentration()); dto.setLoadingConcentrationUnits(from.getLoadingConcentrationUnits()); return dto; }