-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bugfix] KeyError: 'no inserts_bedfile defined for protocol None'
- proto == None cast as a str
- Loading branch information
Showing
1 changed file
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ __maintainer__ = "Ivan Topolsky" | |
__email__ = "[email protected]" | ||
|
||
|
||
wildcard_constraints: | ||
proto=".*", | ||
|
||
|
||
def all_vocs(dir): | ||
if not dir: | ||
return [] | ||
|
@@ -14,7 +18,12 @@ def all_vocs(dir): | |
|
||
|
||
def proto_inserts(wildcards): | ||
return protocol_proto_option(proto=wildcards.proto, option="inserts_bedfile") | ||
proto = ( | ||
None | ||
if isinstance(wildcards.proto, str) and wildcards.proto in {"None", ""} | ||
else wildcards.proto | ||
) | ||
return protocol_proto_option(proto=proto, option="inserts_bedfile") | ||
|
||
|
||
rule amplicons: | ||
|
@@ -47,7 +56,8 @@ rule amplicons: | |
|
||
|
||
def get_sample_amplicons(wildcards): | ||
return cohortdir("amplicons.%s.yaml" % get_sample_protocol(wildcards)) | ||
proto = get_sample_protocol(wildcards) | ||
return cohortdir("amplicons.%s.yaml" % ("" if proto is None else proto)) | ||
|
||
|
||
rule cooc: | ||
|
@@ -86,10 +96,15 @@ rule cooc: | |
|
||
|
||
def proto_datasets(wildcards): | ||
proto = ( | ||
None | ||
if isinstance(wildcards.proto, str) and wildcards.proto in {"None", ""} | ||
else wildcards.proto | ||
) | ||
return [ | ||
sample_paths[s_rec] | ||
for s_rec, s_row in sample_table.items() | ||
if s_row.protocol == wildcards.proto | ||
if s_row.protocol == proto | ||
] | ||
|
||
|
||
|