@Override public synchronized void writeRow(List<?> row) throws IOException { checkRowWidth(row.size()); // Add the data to the row assert rowData.size() == fixedColumns; rowData.addAll(row); try { // write the row baseWriter.writeRow(rowData); } finally { // reset the row rowData.removeElements(fixedColumns, rowData.size()); } }
/** * Construct a new prefixed table writer. * * @param writer The underlying table writer to write to. This writer is <b>not</b> closed * when the prefixed writer is closed. * @param values The initial values to write. Each row written to this table * writer is written to the base writer with these values prefixed. */ public PrefixedTableWriter(TableWriter writer, List<?> values) { baseWriter = writer; TableLayout baseLayout = writer.getLayout(); if (values.size() > baseLayout.getColumnCount()) { throw new IllegalArgumentException("Value array too wide"); } rowData = new ObjectArrayList<>(writer.getLayout().getColumnCount()); rowData.addAll(values); fixedColumns = values.size(); TableLayoutBuilder bld = new TableLayoutBuilder(); List<String> bheaders = baseLayout.getColumns(); for (String h : bheaders.subList(fixedColumns, bheaders.size())) { bld.addColumn(h); } layout = bld.build(); assert layout.getColumnCount() + rowData.size() == writer.getLayout().getColumnCount(); }
private List<BaseInformationRecords.NumberWithFrequency> modifiable(List<BaseInformationRecords.NumberWithFrequency> qualityScoresForwardStrandList) { ObjectArrayList list = new ObjectArrayList(); list.addAll(qualityScoresForwardStrandList); return list; }
@Override public synchronized void writeRow(List<?> row) throws IOException { checkRowWidth(row.size()); // Add the data to the row assert rowData.size() == fixedColumns; rowData.addAll(row); try { // write the row baseWriter.writeRow(rowData); } finally { // reset the row rowData.removeElements(fixedColumns, rowData.size()); } }
@Override public synchronized void writeRow(List<?> row) throws IOException { checkRowWidth(row.size()); // Add the data to the row assert rowData.size() == fixedColumns; rowData.addAll(row); try { // write the row baseWriter.writeRow(rowData); } finally { // reset the row rowData.removeElements(fixedColumns, rowData.size()); } } }
@Override public String[] performanceMetrics() { ObjectArrayList<String> metrics = new ObjectArrayList<>(); metrics.add("validationScore"); metrics.addAll(helper.getMetricNames()); return metrics.toArray(new String[metrics.size()]); }
/** * Construct a new prefixed table writer. * * @param writer The underlying table writer to write to. This writer is <b>not</b> closed * when the prefixed writer is closed. * @param values The initial values to write. Each row written to this table * writer is written to the base writer with these values prefixed. */ public PrefixedTableWriter(TableWriter writer, List<?> values) { baseWriter = writer; TableLayout baseLayout = writer.getLayout(); if (values.size() > baseLayout.getColumnCount()) { throw new IllegalArgumentException("Value array too wide"); } rowData = new ObjectArrayList<Object>(writer.getLayout().getColumnCount()); rowData.addAll(values); fixedColumns = values.size(); TableLayoutBuilder bld = new TableLayoutBuilder(); List<String> bheaders = baseLayout.getColumns(); for (String h : bheaders.subList(fixedColumns, bheaders.size())) { bld.addColumn(h); } layout = bld.build(); assert layout.getColumnCount() + rowData.size() == writer.getLayout().getColumnCount(); }
/** * Construct a new prefixed table writer. * * @param writer The underlying table writer to write to. This writer is <b>not</b> closed * when the prefixed writer is closed. * @param values The initial values to write. Each row written to this table * writer is written to the base writer with these values prefixed. */ public PrefixedTableWriter(TableWriter writer, List<?> values) { baseWriter = writer; TableLayout baseLayout = writer.getLayout(); if (values.size() > baseLayout.getColumnCount()) { throw new IllegalArgumentException("Value array too wide"); } rowData = new ObjectArrayList<>(writer.getLayout().getColumnCount()); rowData.addAll(values); fixedColumns = values.size(); TableLayoutBuilder bld = new TableLayoutBuilder(); List<String> bheaders = baseLayout.getColumns(); for (String h : bheaders.subList(fixedColumns, bheaders.size())) { bld.addColumn(h); } layout = bld.build(); assert layout.getColumnCount() + rowData.size() == writer.getLayout().getColumnCount(); }
/** * Returns the complete list of records, including those interleaved with genomic positions (for insertion/deletion). * * @return */ public Iterable<BaseInformationRecords.BaseInformation> getAllRecords(int startPosition, int endPosition) { ObjectArrayList<BaseInformationRecords.BaseInformation> list = new ObjectArrayList(); for (BaseInformationRecords.BaseInformation record : recordList) { if (record.getPosition() >= startPosition && record.getPosition() < endPosition) { if (!getHiddenRecords().contains(record)) { list.add(record); } list.addAll(getAfterRecords().getOrDefault(record, Collections.emptyList())); } } return list; }
@Override protected String[] createOutputHeader() { initializeStats(""); ObjectArrayList<String> values = new ObjectArrayList<>(); values.addAll(it.unimi.dsi.fastutil.objects.ObjectArrayList.wrap(orderStats)); values.add("AUC"); values.add("[AUC95"); values.add("AUC95]"); return values.toArray(new String[0]); }
/** * Returns the complete list of records, including those interleaved with genomic positions (for insertion/deletion). * * @return */ @Override public Iterable<BaseInformationRecords.BaseInformation> getAllRecords(int startPosition, int endPosition) { ObjectArrayList<BaseInformationRecords.BaseInformation> list = new ObjectArrayList(this.actualLength() * 3 / 2); for (BaseInformationRecords.BaseInformation record : parent.recordList) { if (record.getPosition() >= startPosition && record.getPosition() <= endPosition) { if (!getHiddenRecords().contains(record)) { list.add(record); } list.addAll(getAfterRecords().getOrDefault(record, Collections.emptyList())); } } return list; } @Override
splicedBlocks.addAll(ObjectArrayList.wrap(spliceHeadAlignment.block)); splicedBlocks.addAll(blocks); spliceHeadAlignment.block = splicedBlocks.toArray(new AlignmentBlockImpl[splicedBlocks.size()]); splicedInsertionBlocks.addAll(ObjectArrayList.wrap(spliceHeadAlignment.insertionBlock)); splicedInsertionBlocks.addAll(insertionBlocks); spliceHeadAlignment.insertionBlock = splicedInsertionBlocks.toArray(new AlignmentBlockImpl[splicedInsertionBlocks.size()]);
newBlocks.addAll(blocks); return newBlocks;