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
4 changes: 4 additions & 0 deletions gnomad/assessment/parse_validity_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def parse_log_file(log_file):
"compare_subset_freqs": "subset freqs",
"check_globals_for_retired_terms": "globals check",
"summarize_variant_filters": "variant summary",
"validate_config_fields_in_ht": "general info",
"log_field_validation_results": "general info",
"check_fields_not_in_requirements": "general info",
"load_gnomad_data": "load gnomAD data",
}

with hl.hadoop_open(log_file, "r") as f:
Expand Down
8 changes: 3 additions & 5 deletions gnomad/assessment/validity_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ def check_missingness_of_struct(
struct_expr: hl.expr.StructExpression, prefix: str = ""
) -> Dict[str, Any]:
"""
Recursively check the fraction of missing values of all fields within a StructExpression.
Recursively check the number of missing values of all fields within a StructExpression.

Either a standalone or nested struct can be provided. If the struct contains an array (or set) of values, the array
will be considered missing if it is NA, an empty array, or only has missing elements.
Expand All @@ -1468,11 +1468,9 @@ def check_missingness_of_struct(
elif isinstance(struct_expr, (hl.expr.ArrayExpression, hl.expr.SetExpression)):
# Count array/set as missing if it is NA, an empty array/set, or only has missing
# elements.
return hl.agg.fraction(
hl.or_else(struct_expr.all(lambda x: hl.is_missing(x)), True)
)
return hl.agg.sum(hl.or_else(struct_expr.all(lambda x: hl.is_missing(x)), True))
else:
return hl.agg.fraction(hl.is_missing(struct_expr))
return hl.agg.sum(hl.is_missing(struct_expr))


def flatten_missingness_struct(
Expand Down
Loading