Skip to content

Commit

Permalink
fix siteFile flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanxw committed Apr 18, 2017
1 parent 5956f4c commit b5169f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2017-04-14 Xiaowei Zhan <zhanxw@bunny.swmed.edu>

* 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 <zhanxw@fantasia.csgstat.sph.umich.edu>

Expand Down
4 changes: 4 additions & 0 deletions src/GenotypeExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/GenotypeExtractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -149,8 +150,8 @@ class GenotypeExtractor {
const std::vector<int>* sex; // external sex information
// bool claytonCoding; // code male hemi region genotype from 0/1 to 0/2
std::vector<double> genotype; // store extracted genotypes
std::vector<std::string> variantName; // store extract variant names
int sampleSize; // number of extract vcf samples
std::vector<std::string> variantName; // store extracted variant names
int sampleSize; // number of extracted vcf samples
// for multiallelic
bool multiAllelicMode; // default is false
std::vector<std::string> altAllele; // store alt alleles
Expand Down
10 changes: 9 additions & 1 deletion src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

Logger* logger = NULL;

const char* VERSION = "20170414";
const char* VERSION = "20170418";

void banner(FILE* fp) {
const char* string =
Expand Down Expand Up @@ -224,6 +224,9 @@ void welcome() {
fprintf(stdout,
" For questions and comments, send to Xiaowei Zhan "
"<zhanxw@umich.edu>\n");
fprintf(stdout,
" For bugs and feature requests, please submit at: "
"https://github.com/zhanxw/rvtests/issues\n");
fprintf(stdout, "\n");
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b5169f8

Please sign in to comment.