Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove unnecessary defaultdicts #56

wants to merge 1 commit into from

Conversation

juhaa
Copy link
Contributor

@juhaa juhaa commented Jun 17, 2022

Should fix #53

@juhaa juhaa added the enhancement New feature or request label Jun 17, 2022
@juhaa juhaa requested a review from Fedja June 17, 2022 19:30
@juhaa juhaa self-assigned this Jun 17, 2022
@@ -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)
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for compulsory columns and error out
2 participants