Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions abcCallGenotypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ void abcCallGenotypes::getOptions(argStruct *arguments){
doCounts = angsd::getArg("-doCounts",doCounts,arguments);
if((geno_minDepth!=-1 || geno_maxDepth!=-1 || geno_minMM!=-1 ) &&doCounts==0){
fprintf(stderr,"Must supply -doCounts to use a minimum depth for GC calling\n");
exit(0);
exit(EXIT_FAILURE);
}
if(geno_maxDepth!=-1&&doCounts==0){
fprintf(stderr,"Must supply -doCounts to use a maximum depth for GC calling\n");
exit(0);
exit(EXIT_FAILURE);
}


if(arguments->inputtype!=INPUT_BEAGLE&&doPost==0&&arguments->inputtype!=INPUT_VCF_GP){
fprintf(stderr,"\n\t-> You need -doPost to call genotypes \n");
exit(0);
exit(EXIT_FAILURE);

}

if(doPost==1&&doMaf==0){
fprintf(stderr,"\n\t-> You need -doMaf inorder to get posterior probabilities when using freq as prior\n");
exit(0);
exit(EXIT_FAILURE);
}
minInd=angsd::getArg("-minInd",minInd,arguments);

Expand All @@ -103,7 +103,7 @@ abcCallGenotypes::abcCallGenotypes(const char *outfiles,argStruct *arguments,int
if(arguments->argc==2){
if(!strcasecmp(arguments->argv[1],"-doGeno")){
printArg(stdout);
exit(0);
exit(EXIT_FAILURE);
}else
return;
}
Expand Down Expand Up @@ -280,4 +280,3 @@ void abcCallGenotypes::run(funkyPars *pars){

getGeno(pars);
}

20 changes: 10 additions & 10 deletions abcGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void readError(double **errors,const char *fname){
FILE *fp=NULL;
if(NULL==(fp=fopen(fname,"r"))){
fprintf(stderr,"Error opening file: %s\n",fname);
exit(0);
exit(EXIT_FAILURE);
}

char buf[LENS];
Expand Down Expand Up @@ -112,13 +112,13 @@ void abcGL::getOptions(argStruct *arguments){
doMajorMinor=angsd::getArg("-doMajorMinor",doMajorMinor,arguments);
if(GL!=0 && (arguments->inputtype==INPUT_GLF || arguments->inputtype==INPUT_GLF3 || arguments->inputtype==INPUT_VCF_GL)){
fprintf(stderr,"Can't calculate genotype likelihoods from -glf/-glf3/VCF files\n");
exit(0);
exit(EXIT_FAILURE);
}
if(arguments->inputtype==INPUT_GLF||arguments->inputtype==INPUT_GLF3||arguments->inputtype==INPUT_VCF_GL||arguments->inputtype==INPUT_GLF10_TEXT)
return;
if(doGlf&&GL==0){
fprintf(stderr,"\t-> You need to choose a genotype likelihood model -GL for dumping genotype likelihoods\n");
exit(0);
exit(EXIT_FAILURE);
}
if(GL==0&&doGlf==0){
shouldRun[index] =0;
Expand All @@ -133,15 +133,15 @@ void abcGL::getOptions(argStruct *arguments){

if(( GL<0||GL>7 )) {
fprintf(stderr,"\t-> You've choosen a GL model=%d, only 1,2,3,4,5,6,7 are implemented\n",GL);
exit(0);
exit(EXIT_FAILURE);
}
if(GL==4&&(doCounts==0)){
fprintf(stderr,"\t-> Must supply -doCounts 1 for SYK model\n");
exit(0);
exit(EXIT_FAILURE);
}
if(GL==6&&(doCounts==0)){
fprintf(stderr,"\t-> Must supply -doCounts 1 for -gl 6\n");
exit(0);
exit(EXIT_FAILURE);
}
/*
if(doGlf==2){
Expand All @@ -155,16 +155,16 @@ void abcGL::getOptions(argStruct *arguments){
*/
if((doGlf==2||doGlf==3) && doMajorMinor==0){
fprintf(stderr,"\t-> For dumping beaglestyle output you need to estimate major/minor: -doMajorMinor\n");
exit(0);
exit(EXIT_FAILURE);
}
if(arguments->inputtype==INPUT_BEAGLE&&doGlf){
fprintf(stderr,"\t-> cannot output likelihoods (doGlf) when input is beagle\n");
exit(0);
exit(EXIT_FAILURE);
}

if(arguments->inputtype!=INPUT_BAM&&arguments->inputtype!=INPUT_PILEUP){
fprintf(stderr,"Error: Likelihoods can only be estimated based on BAM input and uppile input\n");
exit(0);
exit(EXIT_FAILURE);
}


Expand Down Expand Up @@ -192,7 +192,7 @@ abcGL::abcGL(const char *outfiles,argStruct *arguments,int inputtype){
if(arguments->argc==2){
if(!strcasecmp(arguments->argv[1],"-GL")){
printArg(stdout);
exit(0);
exit(EXIT_FAILURE);
}else
return;
}
Expand Down