Skip to content

Commit

Permalink
better and more informative output
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Apr 12, 2017
1 parent b98013c commit ed89a2b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef COMMON_H
#define COMMON_H

#define MUTSCAN_VER "1.11.0"
#define MUTSCAN_VER "1.11.1"

typedef long int64;
typedef unsigned long uint64;
Expand Down
11 changes: 6 additions & 5 deletions src/htmlreporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ void HtmlReporter::printHelper() {
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>";
mFile << "<div style='text-align:center;font-size:13;color:#0366d6;padding-top:5px;'><a href='javascript:window.print();'>Print</a></div>";
mFile << "<div id='helper'><p>Helpful tips:</p><ul>";
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>";
mFile << "<li> Move mouse over the base, it will show the quality value</li>";
mFile << "<li> Mutation point is in the center of the table.</li>";
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>";
mFile << "<li> Move mouse over the base, it will show the quality value.</li>";
if(GlobalSettings::outputOriginalReads)
mFile << "<li> Click on any row, the original read/pair will be displayed</li>";
mFile << "<li> In first column, <i>d</i> means the edit distance of match, and --> means forward, <-- means reverse </li>";
mFile << "<li> For pair-end sequencing, MutScan tries to merge each pair, and the overlapped bases will be assigned higher qualities </li>";
mFile << "<li> Click on any row, the original read/pair will be displayed.</li>";
mFile << "<li> In first column, <i>d</i> means the edit distance of match, and --> means forward, <-- means reverse. </li>";
mFile << "<li> For pair-end sequencing, MutScan tries to merge each pair, and the overlapped bases will be assigned higher qualities. </li>";
mFile << "</ul></div>";
}

Expand Down
10 changes: 10 additions & 0 deletions src/multihtmlreporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,33 @@ void MultiHtmlReporter::printMainPage() {
}

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

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

void MultiHtmlReporter::printMutationHtml() {
Expand Down
1 change: 0 additions & 1 deletion src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ vector<Mutation> Mutation::parseVcf(string vcfFile, string refFile) {
int lengthDiff = abs((int)v.ref.length() - (int)v.alt.length());
if(lengthDiff>=1 && lengthDiff<=2 )
mut.setSmallIndel(true);
cerr << name << ", " << left << ", " << center << ", " << right << ", " << chrom << endl;
mutations.push_back(mut);
}
if(mutations.size() <= 0){
Expand Down
5 changes: 5 additions & 0 deletions src/pescanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,11 @@ void PairEndScanner::consumerTask()

void PairEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {
//output result
bool found = false;
for(int i=0;i<mutationList.size();i++){
vector<Match*> matches = mutationMatches[i];
if(matches.size()>=GlobalSettings::minReadSupport){
found = true;
cout<<endl<<"---------------"<<endl;
mutationList[i].print();
for(int m=0; m<matches.size(); m++){
Expand All @@ -293,6 +295,9 @@ void PairEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *
}
}
}
if(found == false) {
cout << "MutScan didn't find any mutation" << endl;
}
}

void PairEndScanner::htmlReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {
Expand Down
5 changes: 5 additions & 0 deletions src/sescanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,11 @@ void SingleEndScanner::consumerTask()

void SingleEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *mutationMatches) {
//output result
bool found = false;
for(int i=0;i<mutationList.size();i++){
vector<Match*> matches = mutationMatches[i];
if(matches.size()>=GlobalSettings::minReadSupport){
found = true;
cout<<endl<<"---------------"<<endl;
mutationList[i].print();
for(int m=0; m<matches.size(); m++){
Expand All @@ -265,6 +267,9 @@ void SingleEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*>
}
}
}
if(found == false) {
cout << "MutScan didn't find any mutation" << endl;
}
}

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

0 comments on commit ed89a2b

Please sign in to comment.