From 4fddf2fe5ad2b5e03aac825fc6a50a03bc6f4128 Mon Sep 17 00:00:00 2001 From: Shifu Chen Date: Sun, 22 Oct 2017 11:48:56 +0800 Subject: [PATCH] split multi-alt variant to multiple single-alt variants --- src/pescanner.cpp | 7 +++++-- src/sescanner.cpp | 7 +++++-- src/vcfreader.cpp | 37 +++++++++++++++++++++---------------- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/pescanner.cpp b/src/pescanner.cpp index 469a559..f7d2723 100644 --- a/src/pescanner.cpp +++ b/src/pescanner.cpp @@ -283,6 +283,7 @@ void PairEndScanner::consumerTask() void PairEndScanner::textReport(vector& mutationList, vector *mutationMatches) { //output result bool found = false; + int undetected = 0; for(int i=0;i matches = mutationMatches[i]; if(matches.size()>=GlobalSettings::minReadSupport){ @@ -293,14 +294,16 @@ void PairEndScanner::textReport(vector& mutationList, vector * cout<print(mutationList[i].mLeft.length(), mutationList[i].mCenter.length(), mutationList[i].mRight.length()); } + } else { + undetected++; } } if(found == false) { cout << "MutScan didn't find any mutation" << endl; } // if processing VCF, output those with no supporting reads found - if(GlobalSettings::processingVCF) { - cerr << "Following mutations are not detected" << endl; + if(GlobalSettings::processingVCF && undetected>0) { + cerr << undetected << " mutations of this VCF are not detected" << endl; for(int i=0;i matches = mutationMatches[i]; if(matches.size()& mutationList, vector *mutationMatches) { //output result bool found = false; + int undetected = 0; for(int i=0;i matches = mutationMatches[i]; if(matches.size()>=GlobalSettings::minReadSupport){ @@ -265,14 +266,16 @@ void SingleEndScanner::textReport(vector& mutationList, vector cout<print(mutationList[i].mLeft.length(), mutationList[i].mCenter.length(), mutationList[i].mRight.length()); } + } else { + undetected++; } } if(found == false) { cout << "MutScan didn't find any mutation" << endl; } // if processing VCF, output those with no supporting reads found - if(GlobalSettings::processingVCF) { - cerr << "Following mutations are not detected" << endl; + if(GlobalSettings::processingVCF && undetected>0) { + cerr << undetected << " mutations of this VCF are not detected" << endl; for(int i=0;i matches = mutationMatches[i]; if(matches.size()=9) - var.format = trim(items[8]); - - mVariants.push_back(var); + //split the alt by comma to make multiple variants, GATK usually output such kind of variant like C>T,AT + vector alts; + split(trim(items[4]), alts, ","); + for(int a=0; a=9) + var.format = trim(items[8]); + + mVariants.push_back(var); + } return true; }