@Override public String getLongestIndex() { Map<Integer, Integer> lengths = poolDilutions.stream() .flatMap(element -> element.getPoolableElementView().getIndices().stream()) .collect(Collectors.toMap(Index::getPosition, index -> index.getSequence().length(), Integer::max)); if (lengths.isEmpty()) { return "0"; } return lengths.entrySet().stream() .sorted((a, b) -> a.getKey().compareTo(b.getKey())) .map(Entry<Integer, Integer>::getValue) .map(length -> length.toString()) .collect(Collectors.joining(",")); }
public String getLabel() { if (getSequence() == null || getFamily().hasFakeSequence()) return getName(); return getName() + " (" + getSequence() + ")"; }
@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; }
StringBuilder vsb = new StringBuilder(); for (Index index : dilution.getIndices()) { tsb.append(index.getSequence()); vsb.append(index.getName());
public static IndexDto asDto(@Nonnull Index from, boolean includeFamily) { IndexDto dto = new IndexDto(); dto.setId(from.getId()); dto.setLabel(from.getLabel()); dto.setName(from.getName()); dto.setPosition(from.getPosition()); dto.setSequence(from.getSequence()); if (includeFamily) { dto.setFamily(asDto(from.getFamily(), false)); } return dto; }