From b5169f8a9e0b0d56232fcbbf4260858070d2a903 Mon Sep 17 00:00:00 2001 From: zhanxw Date: Tue, 18 Apr 2017 02:59:23 -0500 Subject: [PATCH] fix siteFile flag --- ChangeLog | 1 + src/GenotypeExtractor.cpp | 4 ++++ src/GenotypeExtractor.h | 5 +++-- src/Main.cpp | 10 +++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06e60bc..bb03f0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2017-04-14 Xiaowei Zhan * Fix a critical bug related to AF calculation (issue 15) + * Fix siteFile flag and provide prompt when it's used 2017-04-12 Xiaowei Zhan diff --git a/src/GenotypeExtractor.cpp b/src/GenotypeExtractor.cpp index 6878d95..d85c3c5 100644 --- a/src/GenotypeExtractor.cpp +++ b/src/GenotypeExtractor.cpp @@ -338,6 +338,10 @@ void GenotypeExtractor::setGQmax(int m) { this->GQmax = m; } +void GenotypeExtractor::setSiteFile(const std::string& fn) { + this->vin->setSiteFile(fn); +} + void GenotypeExtractor::setSiteQualMin(int q) { this->vin->setSiteQualMin(q); } void GenotypeExtractor::setSiteMACMin(int n) { this->vin->setSiteMACMin(n); } int GenotypeExtractor::setAnnoType(const std::string& s) { diff --git a/src/GenotypeExtractor.h b/src/GenotypeExtractor.h index 237338f..7bff904 100644 --- a/src/GenotypeExtractor.h +++ b/src/GenotypeExtractor.h @@ -61,6 +61,7 @@ class GenotypeExtractor { void setGQmin(int m); void setGQmax(int m); + void setSiteFile(const std::string& fn); void setSiteQualMin(int q); void setSiteMACMin(int n); int setAnnoType(const std::string& s); @@ -149,8 +150,8 @@ class GenotypeExtractor { const std::vector* sex; // external sex information // bool claytonCoding; // code male hemi region genotype from 0/1 to 0/2 std::vector genotype; // store extracted genotypes - std::vector variantName; // store extract variant names - int sampleSize; // number of extract vcf samples + std::vector variantName; // store extracted variant names + int sampleSize; // number of extracted vcf samples // for multiallelic bool multiAllelicMode; // default is false std::vector altAllele; // store alt alleles diff --git a/src/Main.cpp b/src/Main.cpp index 5c29a3f..989ac83 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -30,7 +30,7 @@ Logger* logger = NULL; -const char* VERSION = "20170414"; +const char* VERSION = "20170418"; void banner(FILE* fp) { const char* string = @@ -224,6 +224,9 @@ void welcome() { fprintf(stdout, " For questions and comments, send to Xiaowei Zhan " "\n"); + fprintf(stdout, + " For bugs and feature requests, please submit at: " + "https://github.com/zhanxw/rvtests/issues\n"); fprintf(stdout, "\n"); } @@ -492,6 +495,11 @@ int main(int argc, char** argv) { ge.excludePeople(FLAG_peopleExcludeID.c_str()); ge.excludePeopleFromFile(FLAG_peopleExcludeFile.c_str()); + if (!FLAG_siteFile.empty()) { + ge.setSiteFile(FLAG_siteFile); + logger->info("Restrict analysis based on specified site file [ %s ]", + FLAG_siteFile.c_str()); + } if (FLAG_siteDepthMin > 0) { ge.setSiteDepthMin(FLAG_siteDepthMin); logger->info("Set site depth minimum to %d", FLAG_siteDepthMin);