Skip to content

Commit

Permalink
no number quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Aug 20, 2018
1 parent ca08c22 commit 9d57fb2
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/json.h
Expand Up @@ -56,22 +56,29 @@ namespace bamstats
{
rfile << "{\"id\": \"summaryTable\",";
rfile << "\"title\": \"Summary Statistics\",";
rfile << "\"data\": {\"columns\": [\"Sample\", \"Library\", \"#QCFail\", \"QCFailFraction\", \"#DuplicateMarked\", \"DuplicateFraction\", \"#Unmapped\", \"UnmappedFraction\", \"#Mapped\", \"MappedFraction\"], \"rows\": [";
rfile << "\"data\": {\"columns\": [\"Sample\", \"Library\", \"#QCFail\", \"QCFailFraction\", \"#DuplicateMarked\", \"DuplicateFraction\", \"#Unmapped\", \"UnmappedFraction\", \"#Mapped\", \"MappedFraction\", \"#MappedRead1\", \"#MappedRead2\", \"RatioMapped2vsMapped1\", \"#MappedForward\", \"MappedForwardFraction\", \"#MappedReverse\", \"MappedReverseFraction\"], \"rows\": [";
for(typename TRGMap::const_iterator itRg = rgMap.begin(); itRg != rgMap.end(); ++itRg) {
uint64_t totalReadCount = _totalReadCount(itRg);
uint64_t mappedCount = itRg->second.rc.mapped1 + itRg->second.rc.mapped2;
if (itRg != rgMap.begin()) rfile << ",";
rfile << "[";
rfile << "\"" << c.sampleName << "\"" << ",";
rfile << "\"" << itRg->first << "\"" << ",";
rfile << "\"" << itRg->second.rc.qcfail << "\"" << ",";
rfile << "\"" << (double) itRg->second.rc.qcfail / (double) totalReadCount << "\"" << ",";
rfile << "\"" << itRg->second.rc.dup << "\"" << ",";
rfile << "\"" << (double) itRg->second.rc.dup / (double) totalReadCount << "\"" << ",";
rfile << "\"" << itRg->second.rc.unmap << "\"" << ",";
rfile << "\"" << (double) itRg->second.rc.unmap / (double) totalReadCount << "\"" << ",";
rfile << "\"" << mappedCount << "\"" << ",";
rfile << "\"" << (double) mappedCount / (double) totalReadCount << "\"";
rfile << itRg->second.rc.qcfail << ",";
rfile << (double) itRg->second.rc.qcfail / (double) totalReadCount << ",";
rfile << itRg->second.rc.dup << ",";
rfile << (double) itRg->second.rc.dup / (double) totalReadCount << ",";
rfile << itRg->second.rc.unmap << ",";
rfile << (double) itRg->second.rc.unmap / (double) totalReadCount << ",";
rfile << mappedCount << ",";
rfile << (double) mappedCount / (double) totalReadCount << ",";
rfile << itRg->second.rc.mapped1 << ",";
rfile << itRg->second.rc.mapped2 << ",";
rfile << (double) itRg->second.rc.mapped2 / (double) itRg->second.rc.mapped1 << ",";
rfile << itRg->second.rc.forward << ",";
rfile << (double) itRg->second.rc.forward / (double) mappedCount << ",";
rfile << itRg->second.rc.reverse << ",";
rfile << (double) itRg->second.rc.reverse / (double) mappedCount;
rfile << "]";
}
rfile << "]},";
Expand Down

0 comments on commit 9d57fb2

Please sign in to comment.