idekerlab / cellmaps_utils

MIT License
1 stars 0 forks source link

Check for None values when calling get_merged_rocrate_provenance_attrs #9

Closed dzoanka closed 2 months ago

dzoanka commented 2 months ago

User run into a problem when they have ro-crate with missing provenance information:

    return CellmapsCoEmbedder(outdir=theargs.outdir,
  File “/cellar/users/lvschaffer/miniconda3/envs/cellmaps_toolkit/lib/python3.8/site-packages/cellmaps_coembedding/runner.py”, line 660, in run
    self._update_provenance_fields()
  File “/cellar/users/lvschaffer/miniconda3/envs/cellmaps_toolkit/lib/python3.8/site-packages/cellmaps_coembedding/runner.py”, line 510, in _update_provenance_fields
    prov_attrs = self._provenance_utils.get_merged_rocrate_provenance_attrs(rocrate_dirs,
  File “/cellar/users/lvschaffer/miniconda3/envs/cellmaps_toolkit/lib/python3.8/site-packages/cellmaps_utils/provenance.py”, line 501, in get_merged_rocrate_provenance_attrs
    new_organization_name = merged_delimiter.join(sorted(list(org_set)))
TypeError: sequence item 0: expected str instance, NoneType found

Check for none for each provenance field, skip adding None to the respective sets, log error that the information is missing and its recommended to add it (the value will be empty string) - log which ones were missing and ro-crate path that was messed up.