mojaveazure / loomR

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

get.attribute.df(): unused argument (attribute.names = ) #76

Closed jasminelmah closed 2 years ago

jasminelmah commented 3 years ago

Hi!

I just installed loomR_0.2.1.9000 from Github. I've encountered this error while trying to follow the tutorial:

row.attrs <- names(lfile$row.attrs) attr.df <- lfile$get.attribute.df(MARGIN=1, attribute.names=row.attrs) Error in lfile$get.attribute.df(MARGIN = 1, attribute.names = row.attrs) : unused argument (attribute.names = row.attrs)

I don't see where I've gone wrong - I am following the tutorial. Can you catch something?

I am able to access the matrix itself, but I need access to the gene names (row names) and cell ID names (column names) too, in addition to other annotated data.

Thanks for your help!

niehu2018 commented 2 years ago

try the following code:

library(dplyr)
attr.df <- lfile$get.attribute.df(MARGIN = 2, col.names = "cell_names", row.names = "gene_names")
attr.df %>% class # data.frame
attr.df %>% colnames # cell_names, nGene, nUMI, orig.ident
attr.df %>% nrow # 2700

generate the whole data.frame, then select what you want

jasminelmah commented 2 years ago

Thanks!

On Thu, Jun 16, 2022 at 8:35 AM Niehu @.***> wrote:

try the following code: library(dplyr) attr.df <- lfile$get.attribute.df(MARGIN = 2, col.names = "cell_names", row.names = "gene_names") attr.df %>% class # data.frame attr.df %>% colnames # cell_names, nGene, nUMI, orig.ident attr.df %>% nrow # 2700

— Reply to this email directly, view it on GitHub https://github.com/mojaveazure/loomR/issues/76#issuecomment-1157609644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJV26EEZPFHMFPMRAPDTTWTVPMNRTANCNFSM5ABQRBAA . You are receiving this because you authored the thread.Message ID: @.***>