Skip to content

Commit

Permalink
list unpacking and file reading updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikgoeller authored and HippocampusGirl committed Apr 19, 2024
1 parent dc35152 commit a363eca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gwas/src/gwas/plots/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main():

input_dir = args.input_directory

verify_metadata(input_dir)
verify_metadata(*input_dir)
resolved_chrs = resolve_chromosomes(input_dir, logger=logger)

phenotype_stat_names = enrich_phenotype_names(args.include_phenotype_list)
Expand Down
11 changes: 6 additions & 5 deletions src/gwas/src/gwas/plots/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ def chi2_pvalue(ustat: int | float, vstat: int | float) -> float:
def load_metadata(metadata_path: Path):
with CompressedBytesReader(metadata_path) as f:
decompressor = zstd.ZstdDecompressor()
compressed_data = f.read()
# compressed_data = f.read()
# decompressed_data = decompressor.decompress(compressed_data)
stream_reader = decompressor.stream_reader(compressed_data)
decompressed_data = stream_reader.read()
stream_reader.close()
metadata = pickle.loads(decompressed_data)
# stream_reader = decompressor.stream_reader(compressed_data)
with decompressor.stream_reader(f) as reader:
decompressed_data = reader.read()
reader.close()
metadata = pickle.loads(decompressed_data)
return metadata


Expand Down

0 comments on commit a363eca

Please sign in to comment.