This is the current implementation of writing metadata in JSON format for ingest into HuBMAP infrastructure:
def extract_metadata_write_json(mdata: mudata.MuData, output_json: Path):
data = {}
if "ontology" in mdata.obsm:
if "Object type" in mdata.obsm["ontology"]:
data["object_types"] = sorted(set(mdata.obsm["ontology"]["Object type"]))
if "Annotation tool" in mdata.obs:
data["annotation_tools"] = sorted(set(mdata.obs["Annotation tool"]))
with open(output_json, "w") as f:
json.dump(data, f)
Verify this with @jpuerto-psc and others to ensure we're writing everything appropriate/useful/necessary.
This is the current implementation of writing metadata in JSON format for ingest into HuBMAP infrastructure:
Verify this with @jpuerto-psc and others to ensure we're writing everything appropriate/useful/necessary.