Skip to content

Compatibility with Seurat & create empty layers

Compare
Choose a tag to compare
@slinnarsson slinnarsson released this 29 Jun 13:39
· 237 commits to master since this release
b828bcf

Compatibility with Seurat & loomR

In some cases, Seurat would create loom files with attributes being variable-length ascii. This technically violates the loom specification, but what's worse is that loompy would read them as byte arrays. We now handle such strings gracefully and they are returned as arrays of string objects (supporting unicode).

Create empty layers

Previously, there was no way to create an empty layer without supplying a dense matrix. This would cause problems when you wanted to add a larger-than-RAM layer to an existing file. We now support an elegant syntax for creating an empty layer, directly on disk, by assigning a data type to the layer name. For example:

with loompy.connect("filename.loom") as ds:
    ds.layers["intronic"] = "int16"

Or, using the shorthand syntax directly on the connection object:

with loompy.connect("filename.loom") as ds:
    ds["intronic"] = "int16"

Once the layer has been created, you can assign values to (parts of) the layer, building it up incrementally.