Skip to content

Commit ade5922

Browse files
committed
For VCF scanning, output no-detected mutations to STDERR
1 parent 0faabe5 commit ade5922

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
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.2"
4+
#define MUTSCAN_VER "1.12.0"
55

66
typedef long int64;
77
typedef unsigned long uint64;

src/globalsettings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ bool GlobalSettings::markedOnlyForVCF = false;
44
bool GlobalSettings::legacyMode = false;
55
bool GlobalSettings::outputOriginalReads = true;
66
bool GlobalSettings::standaloneHtml = false;
7-
int GlobalSettings::minReadSupport = 2;
7+
int GlobalSettings::minReadSupport = 2;
8+
bool GlobalSettings::processingVCF = false;

src/globalsettings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ class GlobalSettings{
2727
inline static void setMinReadSupport(int val){
2828
minReadSupport = val;
2929
}
30+
inline static void setProcessingVCF(bool flag){
31+
processingVCF = flag;
32+
}
3033

3134
public:
3235
static bool markedOnlyForVCF;
3336
static bool legacyMode;
3437
static bool outputOriginalReads;
3538
static bool standaloneHtml;
3639
static int minReadSupport;
40+
static bool processingVCF;
3741
};
3842

3943

src/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ int main(int argc, char* argv[]){
7171
check_file_valid(refFile);
7272
// if the mutation file is a vcf, then the reference should be provided
7373
if(ends_with(mutationFile, ".vcf") || ends_with(mutationFile, ".VCF") || ends_with(mutationFile, ".Vcf")){
74+
GlobalSettings::setProcessingVCF(true);
7475
if(refFile == "") {
7576
cerr << "You should specify the reference fasta file by -r <ref.fa>, because your mutation file (-m) is a VCF"<<endl;
7677
exit(-1);

src/pescanner.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,17 @@ void PairEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*> *
298298
if(found == false) {
299299
cout << "MutScan didn't find any mutation" << endl;
300300
}
301+
// if processing VCF, output those with no supporting reads found
302+
if(GlobalSettings::processingVCF) {
303+
cerr << "Following mutations are not detected" << endl;
304+
for(int i=0;i<mutationList.size();i++){
305+
vector<Match*> matches = mutationMatches[i];
306+
if(matches.size()<GlobalSettings::minReadSupport){
307+
Mutation m = mutationList[i];
308+
cerr <<m.mChr << " " <<m.mName<<" "<<m.mLeft<<" "<<m.mCenter<<" "<<m.mRight <<endl;
309+
}
310+
}
311+
}
301312
}
302313

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

src/sescanner.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,17 @@ void SingleEndScanner::textReport(vector<Mutation>& mutationList, vector<Match*>
270270
if(found == false) {
271271
cout << "MutScan didn't find any mutation" << endl;
272272
}
273+
// if processing VCF, output those with no supporting reads found
274+
if(GlobalSettings::processingVCF) {
275+
cerr << "Following mutations are not detected" << endl;
276+
for(int i=0;i<mutationList.size();i++){
277+
vector<Match*> matches = mutationMatches[i];
278+
if(matches.size()<GlobalSettings::minReadSupport){
279+
Mutation m = mutationList[i];
280+
cerr <<m.mChr << " " <<m.mName<<" "<<m.mLeft<<" "<<m.mCenter<<" "<<m.mRight <<endl;
281+
}
282+
}
283+
}
273284
}
274285

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

0 commit comments

Comments
 (0)