Closed cbravo93 closed 4 years ago
Hi!
In the convert_to_loom_v3_spec, these two lines have to switch order:
loom$attr_delete(attr_name = global_attr_key) add_global_attr(loom = loom, key = global_attr_key, value = value)
Below the updated and functional version:
convert_to_loom_v3_spec <- function(loom) { if(is_loom_spec_version_3_or_greater(loom = loom)) { stop("The given loom is already in Loom version 3 specification.") } gmd<-get_global_meta_data(loom = loom) # Update loom spec version to 3 print("Updating to Loom v3 specification...") if(loom$attr_exists(attr_name = GA_LOOM_SPEC_VERSION)) { remove_global_attr(loom = loom, GA_LOOM_SPEC_VERSION) } # Create the global attrs group loom$create_group("attrs") add_global_loom_spec_version(loom, loom.spec.version = 3) for(global_attr_key in list.attributes(object = loom)) { print(paste0("Converting ", global_attr_key, " global attribute to Loom v3 specification...")) if(global_attr_key == "MetaData") { value <- rjson::toJSON(x = gmd) } else { value <- h5attr(x = loom, which = global_attr_key) } loom$attr_delete(attr_name = global_attr_key) add_global_attr(loom = loom, key = global_attr_key, value = value) } flush(loom = loom) return (loom) print("Done") }
Hi @cbravo93, Indeed this makes more sense I have fixed this bug in v0.9.2 Thanks for the bug report
v0.9.2
Hi!
In the convert_to_loom_v3_spec, these two lines have to switch order:
Below the updated and functional version: