Skip to content

how to convert loom file to seurat object? #35

Closed
@Sophia409

Description

@Sophia409

I need to merge my seurat data of 3 experimental time points with the Hippocampus data provided by loom edition. I merged my own data by using the merge command and do trajectory analysis using monocle. But I don't know how to convert this loom file to seurat object , so that I can merge them with my data and do next analysis.
The tutorial says that : Seurat offers a conversion function to go from Seurat objects to loom files. The reverse conversion is currently in progress.
Does it means that I could't convert loom file to seurat? So what should I do to merge them? Can you give me some advice?Thank you very much!
图片

Activity

mschilli87

mschilli87 commented on Mar 10, 2019

@mschilli87

cross-post of satijalab/seurat#1218

mojaveazure

mojaveazure commented on Mar 11, 2019

@mojaveazure
Owner

Using the loom branch of Seurat, you should be able to convert a loom file to a Seurat object. However, as mentioned in #25, you shouldn't need to as Seurat can run most functions directly on a loom object.

Sophia409

Sophia409 commented on Mar 12, 2019

@Sophia409
Author

@mojaveazure Thank you for your reply,I follow your advice and download the the loom branch of Seurat ,but it still failed to convert this loom file to a Seurat object.Below is the code.
It seems that this loom edition is rare,and there is little help documentation about how to convert loom to seurat.I think maybe it is difficult to convert directly, but I couldn't be able to modify the convert function.)
Can you help me to convert this thalamus loom file to seurat object and show me the code? I 'm a beginner and really hope for your help.Thank you very much!
图片

> lfile <- connect(filename = "/home/yuhong/Downloads/l1_thalamus.loom", mode = "r+")
> sthalamus <- Convert(from = lfile, to = "seurat")
Error in `[[.H5File`(from, gene.names) : 
  An object with name row_attrs/gene_names does not exist in this group
> lfile[["row_attrs"]]
Class: H5Group
Filename: /home/yuhong/Downloads/l1_thalamus.loom
Group: /row_attrs
Listing:
      name    obj_type dataset.dims dataset.type_class
 Accession H5I_DATASET        27998         H5T_STRING
      Gene H5I_DATASET        27998         H5T_STRING
    _LogCV H5I_DATASET        27998          H5T_FLOAT
  _LogMean H5I_DATASET        27998          H5T_FLOAT
 _Selected H5I_DATASET        27998          H5T_FLOAT
    _Total H5I_DATASET        27998          H5T_FLOAT
    _Valid H5I_DATASET        27998        H5T_INTEGER
> lfile[["col_attrs"]]
Class: H5Group
Filename: /home/yuhong/Downloads/l1_thalamus.loom
Group: /col_attrs
Listing:
                                name    obj_type dataset.dims dataset.type_class
                                 Age H5I_DATASET        36681         H5T_STRING
                              CellID H5I_DATASET        36681         H5T_STRING
                               Class H5I_DATASET        36681         H5T_STRING
          ClassProbability_Astrocyte H5I_DATASET        36681          H5T_FLOAT
   ClassProbability_Astrocyte,Immune H5I_DATASET        36681          H5T_FLOAT
  ClassProbability_Astrocyte,Neurons H5I_DATASET        36681          H5T_FLOAT
   ClassProbability_Astrocyte,Oligos H5I_DATASET        36681          H5T_FLOAT
 ClassProbability_Astrocyte,Vascular H5I_DATASET        36681          H5T_FLOAT
      ClassProbability_Bergmann-glia H5I_DATASET        36681          H5T_FLOAT
              ClassProbability_Blood H5I_DATASET        36681          H5T_FLOAT
< Printed 10, out of 46>
mojaveazure

mojaveazure commented on Mar 13, 2019

@mojaveazure
Owner

At the moment, our converters between Seurat and loom don't work, and we don't have an ETA for their replacement.

In the meantime, I would suggest reading the loompy documentation to learn how loom files are structured. Once you have an understanding of loom files, you can pull the data from the file and construct a Seurat object or any other kind of R object for analyzing the data. We also provide a tutorial that draws parallels between the loom and Seurat formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mojaveazure@mschilli87@Sophia409

        Issue actions

          how to convert loom file to seurat object? · Issue #35 · mojaveazure/loomR