-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary defaultdicts #56
base: master
Are you sure you want to change the base?
Conversation
@@ -93,7 +93,6 @@ task sumstat_to_vcf { | |||
|
|||
with gzip.open(sumstat, 'rt') as f: | |||
h_idx = {h:i for i,h in enumerate(f.readline().strip().split(delim))} | |||
h_idx = defaultdict(lambda: 1e9, h_idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and could error out with clear error message if there are missing columns.
@@ -188,7 +188,6 @@ task sumstat_to_vcf { | |||
|
|||
with gzip.open(sumstat, 'rt') as f: | |||
h_idx = {h:i for i,h in enumerate(f.readline().strip().split(delim))} | |||
h_idx = defaultdict(lambda: 1e9, h_idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is exactly the same sumstat_to_vcf, would be better to seaprate to commons wdl and import the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, of course that would be wise..
@@ -327,7 +326,6 @@ task lift_postprocess { | |||
s_f = gzip.open(sumstat, 'rt') | |||
sumstat_header = s_f.readline().strip().split(delim) | |||
sumstat_h_idx = {h:i for i,h in enumerate(sumstat_header)} | |||
sumstat_h_idx = defaultdict(lambda: None, sumstat_h_idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here that better explicitly check compulsory columns and error out instead of just key error.
Should fix #53