Skip to content

Commit 585e3cc

Browse files
committed
fix an issue of HTML reporter
1 parent abc06cc commit 585e3cc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/multihtmlreporter.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ MultiHtmlReporter::MultiHtmlReporter(string filename, vector<Mutation>& mutation
99
mMutationList = mutationList;
1010
mMutationMatches = mutationMatches;
1111
mFilename = filename;
12+
mFolderPath = mFilename + ".files";
1213
mFolderName = basename(mFilename) + ".files";
13-
mkdir(mFolderName.c_str(), 0777);
14+
mkdir(mFolderPath.c_str(), 0777);
1415
stat();
1516
}
1617

@@ -55,7 +56,7 @@ void MultiHtmlReporter::printMainFrame() {
5556

5657
void MultiHtmlReporter::printMainPage() {
5758
ofstream file;
58-
string mainFile = mFolderName + "/main.html";
59+
string mainFile = mFolderPath + "/main.html";
5960
file.open(mainFile.c_str(), ifstream::out);
6061
printHeader(file);
6162
printAllChromosomeLink(file);
@@ -109,7 +110,7 @@ void MultiHtmlReporter::printMutationHtml() {
109110
vector<Match*> matches = mMutationMatches[m];
110111
if(matches.size()>=GlobalSettings::minReadSupport) {
111112
string chr = mMutationList[m].mChr;
112-
string folder = mFolderName + "/" + chr;
113+
string folder = mFolderPath + "/" + chr;
113114
string filename = folder + "/" + to_string(m) + ".html";
114115
vector<Mutation> mutList;
115116
mutList.push_back(mMutationList[m]);
@@ -121,7 +122,7 @@ void MultiHtmlReporter::printMutationHtml() {
121122

122123
void MultiHtmlReporter::printIndexPage() {
123124
ofstream file;
124-
string indexFile = mFolderName + "/index.html";
125+
string indexFile = mFolderPath + "/index.html";
125126
file.open(indexFile.c_str(), ifstream::out);
126127
printHeader(file);
127128
file << "<div id='logo' style='text-align:center;'> <span style='font-size:30px;font-weight:bold;'> MutScan </span> <span style='font-size:20px;'> " << MUTSCAN_VER << " </span> </div>";
@@ -141,10 +142,10 @@ void MultiHtmlReporter::printChrHtml() {
141142
map<string, int>::iterator iter;
142143
for(iter= mChrCount.begin(); iter!= mChrCount.end(); iter++){
143144
string chr = iter->first;
144-
string folder = mFolderName + "/" + chr;
145+
string folder = mFolderPath + "/" + chr;
145146
mkdir(folder.c_str(), 0777);
146147
ofstream file;
147-
string chrFilename = mFolderName + "/" + chr + ".html";
148+
string chrFilename = mFolderPath + "/" + chr + ".html";
148149
file.open(chrFilename.c_str(), ifstream::out);
149150
printHeader(file);
150151
file << "<ul id='menu'>";
@@ -178,7 +179,7 @@ void MultiHtmlReporter::printHeader(ofstream& file){
178179

179180
void MultiHtmlReporter::printCSS(){
180181
ofstream file;
181-
string filename = mFolderName + "/mutscan.css";
182+
string filename = mFolderPath + "/mutscan.css";
182183
file.open(filename.c_str(), ifstream::out);
183184
file << "td {border:1px solid #dddddd;padding-left:2px;padding-right:2px;font-size:10px;}";
184185
file << "table {border:1px solid #999999;padding:2x;border-collapse:collapse;}";
@@ -206,7 +207,7 @@ void MultiHtmlReporter::printCSS(){
206207

207208
void MultiHtmlReporter::printJS(){
208209
ofstream file;
209-
string filename = mFolderName + "/mutscan.js";
210+
string filename = mFolderPath + "/mutscan.js";
210211
file.open(filename.c_str(), ifstream::out);
211212
file << "function toggle(targetid){ \n\
212213
if (document.getElementById){ \n\

src/multihtmlreporter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class MultiHtmlReporter{
3737
private:
3838
string mFilename;
3939
string mFolderName;
40+
string mFolderPath;
4041
vector<Mutation> mMutationList;
4142
vector<Match*>* mMutationMatches;
4243
map<string, int> mChrCount;

0 commit comments

Comments
 (0)