Skip to content

Commit

Permalink
adding vcf_to_ima file, plus minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredgk committed Aug 8, 2017
1 parent b9d954b commit b05d376
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jared/example/pop_a.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UK10K_ALS5085249
UK10K_ALS5085250
UK10K_ALS5085251
UK10K_ALS5085252
UK10K_ALS5085253
UK10K_ALS5085254
UK10K_ALS5085255
UK10K_ALS5085256
UK10K_ALS5085257
UK10K_ALS5085258
10 changes: 10 additions & 0 deletions jared/example/pop_b.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UK10K_ALS5085259
UK10K_ALS5085260
UK10K_ALS5085261
UK10K_ALS5085262
UK10K_ALS5085263
UK10K_ALS5085264
UK10K_ALS5085265
UK10K_ALS5085266
UK10K_ALS5085267
UK10K_ALS5085268
2 changes: 2 additions & 0 deletions jared/example/pop_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
example/pop_a.txt
example/pop_b.txt
10 changes: 10 additions & 0 deletions jared/parse_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,20 @@ def makeRequiredList(argdict, reqlist):
return req_arglist


def checkRequired(required_args, defaults):
for req in required_args:
if req in defaults and req[defaults] is not None:
raise Exception(('Required argument %s has value present '
' in config file (%s) and command line' %
(req, defaults[req])))


def getArgsWithConfig(parser, sys_args, required_args, func_name):
config_name, req_included = getConfigFilename(sys_args)
if config_name is not None:
defaults = defaultsDictForFunction(func_name, config_name)
if not req_included:
checkRequired(required_args, defaults)
parser.set_defaults(**defaults)
if not req_included:
return parser.parse_args(sys_args)
Expand Down

0 comments on commit b05d376

Please sign in to comment.