/** * Composes the main output header. * * @param commandLine the tool command line. * @param groupBy the group-by argument used. * @param countColumnNames the column names. * @return never {@code null}. */ private static String composeMatrixOutputHeader( final String commandLine, final TargetOutInfo targetOutInfo, final GroupBy groupBy, final List<String> countColumnNames) { final String countColumnHeaderString = String.join(COLUMN_SEPARATOR, countColumnNames).replace("%", "%%"); final String formatString = String.join( LINE_SEPARATOR, "##fileFormat = tsv", "##commandLine = %s", "##title = Read counts per target and %s", String.join(COLUMN_SEPARATOR, targetOutInfo.headerString(), countColumnHeaderString)); return String.format(formatString, commandLine, groupBy.toString()); }
/** * Composes the row summary output header. * * @param commandLine the execution command line. * @param groupBy the value of the group-by argument used. * @param columnCount number of count-column involved in the analysis. * @return never {@code null}. */ private static String composeRowOutputHeader( final String commandLine, final TargetOutInfo targetOutInfo, final GroupBy groupBy, final int columnCount) { return String.format( String.join( LINE_SEPARATOR, "##fileFormat = tsv", "##commandLine = %s", "##title = Summary counts per target", "##metaData = {", "## groupBy = %s,", "## columnCount = %d", "##}", String.join( COLUMN_SEPARATOR, targetOutInfo.headerString(), SUM_COLUMN_NAME, AVG_COL_BP_COLUMN_NAME)), commandLine, groupBy, columnCount); }