Skip to content

Commit ed89a2b

Browse files
committed
better and more informative output
1 parent b98013c commit ed89a2b

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

src/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef COMMON_H
22
#define COMMON_H
33

4-
#define MUTSCAN_VER "1.11.0"
4+
#define MUTSCAN_VER "1.11.1"
55

66
typedef long int64;
77
typedef unsigned long uint64;

src/htmlreporter.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ void HtmlReporter::printHelper() {
3030
mFile << "<div id='logo' style='text-align:center;'> <span style='font-size:30px;font-weight:bold;'> MutScan </span> <span style='font-size:20px;'> " << MUTSCAN_VER << " Report </span> </div>";
3131
mFile << "<div style='text-align:center;font-size:13;color:#0366d6;padding-top:5px;'><a href='javascript:window.print();'>Print</a></div>";
3232
mFile << "<div id='helper'><p>Helpful tips:</p><ul>";
33-
mFile << "<li> Base color indicates quality: <font color='#78C6B9'>extremely high (Q40+)</font>, <font color='#33BBE2'>high (Q30~Q39) </font>, <font color='#666666'>moderate (Q20~Q29)</font>, <font color='#E99E5B'>low (Q15~Q19)</font>, <font color='#FF0000'>extremely low (0~Q14)</font> </li>";
34-
mFile << "<li> Move mouse over the base, it will show the quality value</li>";
33+
mFile << "<li> Mutation point is in the center of the table.</li>";
34+
mFile << "<li> Base color indicates quality: <font color='#78C6B9'>extremely high (Q40+)</font>, <font color='#33BBE2'>high (Q30~Q39) </font>, <font color='#666666'>moderate (Q20~Q29)</font>, <font color='#E99E5B'>low (Q15~Q19)</font>, <font color='#FF0000'>extremely low (0~Q14).</font> </li>";
35+
mFile << "<li> Move mouse over the base, it will show the quality value.</li>";
3536
if(GlobalSettings::outputOriginalReads)
36-
mFile << "<li> Click on any row, the original read/pair will be displayed</li>";
37-
mFile << "<li> In first column, <i>d</i> means the edit distance of match, and --> means forward, <-- means reverse </li>";
38-
mFile << "<li> For pair-end sequencing, MutScan tries to merge each pair, and the overlapped bases will be assigned higher qualities </li>";
37+
mFile << "<li> Click on any row, the original read/pair will be displayed.</li>";
38+
mFile << "<li> In first column, <i>d</i> means the edit distance of match, and --> means forward, <-- means reverse. </li>";
39+
mFile << "<li> For pair-end sequencing, MutScan tries to merge each pair, and the overlapped bases will be assigned higher qualities. </li>";
3940
mFile << "</ul></div>";
4041
}
4142

src/multihtmlreporter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,33 @@ void MultiHtmlReporter::printMainPage() {
6464
}
6565

6666
void MultiHtmlReporter::printAllChromosomeLink(ofstream& file) {
67+
bool found = false;
6768
map<string, int>::iterator iter;
6869
file << "<ul id='menu'>";
6970
file << "<div style='font-size:12px;padding-top:20px;text-align:left;color:#aaaaaa'>Mutations found of all chromosomes:</div>";
7071
for(int m=0; m<mMutationList.size(); m++) {
7172
vector<Match*> matches = mMutationMatches[m];
7273
if(matches.size()>=GlobalSettings::minReadSupport) {
74+
found = true;
7375
string chr = mMutationList[m].mChr;
7476
string filename = chr + "/" + to_string(m) + ".html";
7577
file << "<li class='menu_item'><a href='" << filename << "'>" << mMutationList[m].mName;
7678
file<< " (" << matches.size() << " reads support, " << Match::countUnique(matches) << " unique)"
7779
<< " </a></li>";
7880
}
7981
}
82+
if(!found) {
83+
file << "<span style='size:28px;font-weight:bold;color:blue;line-height:30px;'>MutScan didn't find any mutation</span>";
84+
}
8085
file << "</ul>";
8186
}
8287

8388
void MultiHtmlReporter::printChrLink(ofstream& file, string chr) {
89+
bool found = false;
8490
for(int m=0; m<mMutationList.size(); m++) {
8591
vector<Match*> matches = mMutationMatches[m];
8692
if(matches.size()>=GlobalSettings::minReadSupport) {
93+
found = true;
8794
if(chr == mMutationList[m].mChr) {
8895
string filename = chr + "/" + to_string(m) + ".html";
8996
file << "<li class='menu_item'><a href='" << filename << "'>" << mMutationList[m].mName;
@@ -92,6 +99,9 @@ void MultiHtmlReporter::printChrLink(ofstream& file, string chr) {
9299
}
93100
}
94101
}
102+
if(!found) {
103+
file << "<span style='size:28px;font-weight:bold;color:blue;line-height:30px;'>MutScan didn't find any mutation</span>";
104+
}
95105
}
96106

97107
void MultiHtmlReporter::printMutationHtml() {

src/mutation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ vector<Mutation> Mutation::parseVcf(string vcfFile, string refFile) {
263263
int lengthDiff = abs((int)v.ref.length() - (int)v.alt.length());
264264
if(lengthDiff>=1 && lengthDiff<=2 )
265265
mut.setSmallIndel(true);
266-
cerr << name << ", " << left << ", " << center << ", " << right << ", " << chrom << endl;
267266
mutations.push_back(mut);
268267
}
269268
if(mutations.size() <= 0){

src/pescanner.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,11 @@ void PairEndScanner::consumerTask()
282282

283283
void PairEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {
284284
//output result
285+
bool found = false;
285286
for(int i=0;i<mutationList.size();i++){
286287
vector<Match*> matches = mutationMatches[i];
287288
if(matches.size()>=GlobalSettings::minReadSupport){
289+
found = true;
288290
cout<<endl<<"---------------"<<endl;
289291
mutationList[i].print();
290292
for(int m=0; m<matches.size(); m++){
@@ -293,6 +295,9 @@ void PairEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *
293295
}
294296
}
295297
}
298+
if(found == false) {
299+
cout << "MutScan didn't find any mutation" << endl;
300+
}
296301
}
297302

298303
void PairEndScanner::htmlReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {

src/sescanner.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,11 @@ void SingleEndScanner::consumerTask()
254254

255255
void SingleEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {
256256
//output result
257+
bool found = false;
257258
for(int i=0;i<mutationList.size();i++){
258259
vector<Match*> matches = mutationMatches[i];
259260
if(matches.size()>=GlobalSettings::minReadSupport){
261+
found = true;
260262
cout<<endl<<"---------------"<<endl;
261263
mutationList[i].print();
262264
for(int m=0; m<matches.size(); m++){
@@ -265,6 +267,9 @@ void SingleEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*>
265267
}
266268
}
267269
}
270+
if(found == false) {
271+
cout << "MutScan didn't find any mutation" << endl;
272+
}
268273
}
269274

270275
void SingleEndScanner::htmlReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {

0 commit comments

Comments
 (0)