private void createSummaryTable(StatsReporter reporter) throws IOException {
logLine("Creating summary...\n");
StatsKeeper summaryKeeper = reporter.getSummaryStatsKeeper();
StatsKeeper.Section section = new StatsKeeper.Section("Globals");
section.addRow("Number of samples", Integer.toString( bamQCResults.size() ));
summaryKeeper.addSection(section);
StatsKeeper tableDataKeeper = reporter.getTableDataStatsKeeper();
StatsKeeper.Section headerSection = new StatsKeeper.Section("header");
String[] header = {"Sample name", "Coverage mean", "Coverage std",
"GC percentage", "Mapping quality mean", "Insert size median" };
headerSection.addRow( header );
tableDataKeeper.addSection(headerSection);
StatsKeeper.Section dataSection = new StatsKeeper.Section("data");
for (SampleInfo bamQcResult : bamQCResults) {
String path = bamQcResult.path + File.separator + "genome_results.txt";
BamStats stats = loadSummaryStats(path);
String[] row = new String[header.length];
row[0] = bamQcResult.name;
row[1] = Double.toString( stats.getMeanCoverage() );
row[2] = Double.toString( stats.getStdCoverage() );
row[3] = Double.toString( stats.getMeanGcRelativeContent() );
row[4] = Double.toString( stats.getMeanMappingQualityPerWindow() );
row[5] = Double.toString( stats.getMedianInsertSize() );
dataSection.addRow(row);
double[] sample = new double[NUM_FEATURES];
sample[0] = stats.getMeanCoverage();
sample[1] = stats.getStdCoverage();
sample[2] = stats.getMeanGcRelativeContent();
sample[3] = stats.getMeanMappingQualityPerWindow();
sample[4] = stats.getMedianInsertSize();
sampleData.add(sample);
}
tableDataKeeper.addSection(dataSection);
}