Skip to content

Commit

Permalink
Merge branch 'release_21.01' into release_21.05
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Sep 7, 2021
2 parents cf5708e + e905161 commit fa3828a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/galaxy/datatypes/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Optional

import h5py
import numpy as np
import pysam
import pysam.bcftools
from bx.seq.twobit import TWOBIT_MAGIC_NUMBER, TWOBIT_MAGIC_NUMBER_SWAP
Expand Down Expand Up @@ -962,7 +963,12 @@ def set_meta(self, dataset, overwrite=True, **kwd):
dataset.metadata.description = loom_file.attrs.get('description')
dataset.metadata.url = loom_file.attrs.get('url')
dataset.metadata.doi = loom_file.attrs.get('doi')
dataset.metadata.loom_spec_version = loom_file.attrs.get('LOOM_SPEC_VERSION')
loom_spec_version = loom_file.attrs.get('LOOM_SPEC_VERSION')
if isinstance(loom_spec_version, np.ndarray):
loom_spec_version = loom_spec_version[0]
if isinstance(loom_spec_version, bytes):
loom_spec_version = loom_spec_version.decode()
dataset.metadata.loom_spec_version = loom_spec_version
dataset.creation_date = loom_file.attrs.get('creation_date')
dataset.metadata.shape = tuple(loom_file['matrix'].shape)

Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/galaxy/model/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ def to_JSON_dict(self, filename=None):
meta_dict['__validated_state__'] = dataset_meta_dict['__validated_state__']
if '__validated_state_message__' in dataset_meta_dict:
meta_dict['__validated_state_message__'] = dataset_meta_dict['__validated_state_message__']
encoded_meta_dict = galaxy.model.custom_types.json_encoder.encode(meta_dict)
try:
encoded_meta_dict = galaxy.model.custom_types.json_encoder.encode(meta_dict)
except Exception as e:
raise Exception(f"Failed encoding metadata dictionary: {meta_dict}") from e
if filename is None:
return encoded_meta_dict
with open(filename, 'wt+') as fh:
Expand Down

0 comments on commit fa3828a

Please sign in to comment.