}
private void prepareHtmlSummary(StatsReporter reporter) {
StatsKeeper summaryKeeper = reporter.getSummaryStatsKeeper();
StringUtilsSwing sdf = new StringUtilsSwing();
TranscriptDataHandler th = computeCountsTask.getTranscriptDataHandler();
StatsKeeper.Section readsAlignment = new StatsKeeper.Section("Reads alignment");
readsAlignment.addRow("Aligned to genes:", sdf.formatLong(computeCountsTask.getTotalReadCounts()));
readsAlignment.addRow("No feature assigned:", sdf.formatLong(computeCountsTask.getNoFeatureNumber()));
readsAlignment.addRow("Non-unique alignment:", sdf.formatLong(computeCountsTask.getAlignmentNotUniqueNumber()));
readsAlignment.addRow("Ambiguous alignment:", sdf.formatLong(computeCountsTask.getAmbiguousNumber()));
readsAlignment.addRow("Not aligned:", sdf.formatLong(computeCountsTask.getNotAlignedNumber()));
summaryKeeper.addSection(readsAlignment);
StatsKeeper.Section readsOrigin = new StatsKeeper.Section("Reads genomic origin");
long totalReadCount = computeCountsTask.getTotalReadCounts() + computeCountsTask.getNoFeatureNumber();
long exonicReadCount = totalReadCount - computeCountsTask.getNoFeatureNumber();
long intronicReadCount = th.getNumIntronicReads();
long intergenicReadCount = th.getNumIntergenicReads();
readsOrigin.addRow("Exonic: ", sdf.formatLong(exonicReadCount) + " / " +
sdf.formatPercentage( (100.*exonicReadCount) / totalReadCount ));
readsOrigin.addRow("Intronic: ", sdf.formatLong(intronicReadCount) + " / " +
sdf.formatPercentage( (100.*intronicReadCount) / totalReadCount ));
readsOrigin.addRow("Intergenic: ", sdf.formatLong(intergenicReadCount) + " / " +
sdf.formatPercentage( (100.*intergenicReadCount) / totalReadCount ));
summaryKeeper.addSection(readsOrigin);
//TODO: fix this in case of SE reads
/*if (computeCountsTask.getLibraryProtocol() != LibraryProtocol.NON_STRAND_SPECIFIC) {
StatsKeeper.Section libraryProtocol = new StatsKeeper.Section("Library protocol");
double correctlyMappedPercentage =
(100.*computeCountsTask.getProtocolCorrectlyMapped()) / computeCountsTask.getTotalFragmentCount() ;
libraryProtocol.addRow("Concordant fragments: ",
sdf.formatLong(computeCountsTask.getProtocolCorrectlyMapped()) + " / " +
sdf.formatPercentage(correctlyMappedPercentage));
}*/
TranscriptDataHandler transcriptDataHandler = computeCountsTask.getTranscriptDataHandler();
StatsKeeper.Section transcriptCoverage = new StatsKeeper.Section("Transcript coverage profile");
transcriptCoverage.addRow("5' bias:", sdf.formatDecimal(transcriptDataHandler.getMedianFivePrimeBias()));
transcriptCoverage.addRow("3' bias:", sdf.formatDecimal(transcriptDataHandler.getMedianThreePrimeBias()));
transcriptCoverage.addRow("5'-3' bias:", sdf.formatDecimal(transcriptDataHandler.getMedianFiveToThreeBias()));
summaryKeeper.addSection(transcriptCoverage);
StatsKeeper.Section junctionAnalysisSection = new StatsKeeper.Section("Junction analysis");
long numReadsWithJunctions = th.getNumReadsWithJunctions();
junctionAnalysisSection.addRow("Reads at junctions:", sdf.formatLong(numReadsWithJunctions));
if (numReadsWithJunctions > 0) {
List<JunctionInfo> junctionList = th.computeSortedJunctionsMap();
int count = 0;
for(int i = junctionList.size() -1; i >= 0 && count <= 10; i--){
JunctionInfo info = junctionList.get(i);
junctionAnalysisSection.addRow(info.getJunctionString(), sdf.formatPercentage(info.getPercentage()));
count += 1;
}
}
summaryKeeper.addSection(junctionAnalysisSection);
}