diff --git a/SimpleVCF.cpp b/SimpleVCF.cpp index 8483ca8..f9010f6 100644 --- a/SimpleVCF.cpp +++ b/SimpleVCF.cpp @@ -109,7 +109,7 @@ void SimpleVCF::init2(){ observedGL=false; haploidCall=false; for(unsigned int i=0;isize();i++){ - // cerr<<"formatFieldNames["<at(i)<<" = "<at(i) == "GT"){ indexGenotype =i; formatFieldGT= formatFieldValues[i]; @@ -206,11 +206,16 @@ void SimpleVCF::init2(){ continue; } if(formatFieldNames->at(i) == "DP"){ - indexDepth =i; - if(!formatFieldValues[i].empty()) - formatFieldDP=destringify (formatFieldValues[i]); - else + indexDepth =i; + + if(formatFieldValues[i] == "."){ formatFieldDP=-1;//if the DP field is missing + }else{ + if(!formatFieldValues[i].empty()) + formatFieldDP=destringify (formatFieldValues[i]); + else + formatFieldDP=-1;//if the DP field is missing + } continue; }