mojaveazure / loomR

An R-based interface for loom files
61 stars 16 forks source link

col_attrs and row_attrs not saved #2

Open AmitLab opened 6 years ago

AmitLab commented 6 years ago

loom file created with the next command

loomR::create(
    filename="AB1706.loom",
    data=t(as.matrix(data)),
    gene.attrs = list('annotation' = rep('X', nrow(data)), length = rep('1300', nrow(data))),
    cell.attrs = list('AB' = rep('AB1706', ncol(data)))
)

This is the ds loaded for the loom file Listing:

      name      object.type dataset.dims dataset.type_class
 col_attrs   H5O_TYPE_GROUP         <NA>               <NA>
    layers   H5O_TYPE_GROUP         <NA>               <NA>
    matrix H5O_TYPE_DATASET  384 x 34016        H5T_INTEGER
 row_attrs   H5O_TYPE_GROUP         <NA>               <NA>
mojaveazure commented 6 years ago

The way that the loom object represented in R is a little weird: to view the row and column attributes, you have to view those groups, not just the overarching loom file.

lfile <- loomR::connect('AB1706.loom')
lfile[['row_attrs']]

The groups show no data.dims or dataset.type_class because they aren't datasets. Only datasets (H5O_TYPE_DATASET or H5D objects) get listed with the dataset.dims and dataset.type_class fields filled out.