Giter VIP home page Giter VIP logo

loomr's Introduction

Hello World

I am Paul Hoffman, a senior bioinformatician with the Satija and Lappalainen Labs at the New York Genome Center. My work revolves around building software and for bioinformatic analyses, including an R package for analyzing single-cell data, along with several extension packages, and a pipeline for processing RNA-seq data. I work primarily in R and Python, but am always learning.

Social

Connect on LinkedIn

Technologies Used

Basic Stats

GitHub stats Top languages

Recent Activity

loomr's People

Contributors

andrewwbutler avatar christophh avatar mojaveazure avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

loomr's Issues

System2 error during installation

Hey!

Installing as recommended here (https://rdrr.io/github/mojaveazure/loomR/), however getting the error below. Thanks in advance for any help!


> remotes::install_github("mojaveazure/loomR")
Downloading GitHub repo mojaveazure/loomR@master
✔  checking for file ‘/private/var/folders/ll/jmydhb6n7jqg5rv_c58jxkkh0000gn/T/RtmpV9Trlp/remotes581e717ca0/mojaveazure-loomR-df0144b/DESCRIPTION’ ...
   Error in system2("cp", "--version", stdout = TRUE, stderr = FALSE) : 
     error in running command
   Execution halted
   sh: rm: command not found
Error: Failed to install 'loomR' from GitHub:
  System command error, exit status: 1, stdout + stderr:
E> * checking for file ‘/private/var/folders/ll/jmydhb6n7jqg5rv_c58jxkkh0000gn/T/RtmpV9Trlp/remotes581e717ca0/mojaveazure-loomR-df0144b/DESCRIPTION’ ... OK
E> Error in system2("cp", "--version", stdout = TRUE, stderr = FALSE) : 
E>   error in running command
E> Execution halted
E> sh: rm: command not found
> 

Error combining loom outputs from velocyto

Hello loomR team!

I'm using loomR in order to work with loom files in R. I'm currently working with the outputs of velocyto from two different BAM files and would like to merge them. However, using the combine function renders me the following error:


> s <- loomR::connect('aCSF_O6S97.loom', mode ='r+')
> l <- loomR::connect(file = 'Leptin_SLQP8.loom', mode ='r+')
> 
> bl <- combine(list('aCSF_O6S97.loom', 'Leptin_SLQP8.loom'), chunk.size = 100, filename = 'combined.loom')
Validating 2 input loom files
  |======================================================================================================================| 100%
Error in dataset_create_pl$set_chunk(chunk_dims) : HDF5-API Errors:
    error #000: ../../../src/H5Pdcpl.c in H5Pset_chunk(): line 2030: all chunk dimensions must be positive
        class: HDF5
        major: Invalid arguments to routine
        minor: Out of range
In addition: Warning messages:
1: In max(nchar(x)) : no non-missing arguments to max; returning -Inf
2: In self$set_size(size) : NAs introduced by coercion to integer range

I was able to work with each of the loom files individualy in Seurat and Pagoda2. Any insights on what might be going on? I've installed loomR through the develop branch and I'm using R 3.6.

Can't write loom file from seurat object

I'm having trouble using the Seurat::Convert() function as described here. We'd like to use tools like loom-viewer and SCope to visualize some of our processed Seurat objects. I keep running into the following errors:

Error

Transposing input data: loom file will show input columns (cells) as rows and input rows (genes) as columns
This is to maintain compatibility with other loom tools
Error in dataset_create_pl$set_chunk(chunk_dims) : HDF5-API Errors:
    error #000: H5Pdcpl.c in H5Pset_chunk(): line 868: all chunk dimensions must be positive
        class: HDF5
        major: Invalid arguments to routine
        minor: Out of range
In addition: Warning messages:
1: In loomR::create(filename = filename, data = from@raw.data[gene.order,  :
  NAs introduced by coercion
2: In dataset_create_pl$set_chunk(chunk_dims) :
  During conversion, the following issues occured: H5T_CONV_EXCEPT_RANGE_LO

Any thoughts/advice/guidence much appreciated. Thanks!

Example

I'm using hdf5/1.8.20

> #install.packages("devtools")
> # Use devtools to install hdf5r and loomR from GitHub
> #devtools::install_github(repo = "hhoeflin/hdf5r")
> #devtools::install_github(repo = "mojaveazure/loomR", ref = "develop")
> #devtools::install_github(repo = "satijalab/seurat", ref = "loom")
> library(loomR)
Loading required package: R6
Loading required package: hdf5r
Loading required package: iterators
Loading required package: itertools

> library(Seurat)
Loading required package: ggplot2
Loading required package: cowplot

Attaching package:cowplotThe following object is masked frompackage:ggplot2:

    ggsave

Loading required package: Matrix
> data("pbmc_small")
> pbmc_small
An object of class seurat in project SeuratProject
 230 genes across 80 samples.
> pfile <- Convert(from = pbmc_small, to = "loom", filename = "pbmc_small.loom",
+                  display.progress = FALSE, overwrite=TRUE)
Transposing input data: loom file will show input columns (cells) as rows and input rows (genes) as columns
This is to maintain compatibility with other loom tools
Error in dataset_create_pl$set_chunk(chunk_dims) : HDF5-API Errors:
    error #000: H5Pdcpl.c in H5Pset_chunk(): line 868: all chunk dimensions must be positive
        class: HDF5
        major: Invalid arguments to routine
        minor: Out of range
In addition: Warning messages:
1: In loomR::create(filename = filename, data = from@raw.data[gene.order,  :
  NAs introduced by coercion
2: In dataset_create_pl$set_chunk(chunk_dims) :
  During conversion, the following issues occured: H5T_CONV_EXCEPT_RANGE_LO

Session Info

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03

Matrix products: default
BLAS: /omg/app/R/v3.5.1/lib64/R/lib/libRblas.so
LAPACK: /omg/app/R/v3.5.1/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] Seurat_2.3.1     Matrix_1.2-14    cowplot_0.9.3    ggplot2_3.1.0
[5] loomR_0.2.0      itertools_0.1-3  iterators_1.0.10 hdf5r_1.0.1
[9] R6_2.3.0

loaded via a namespace (and not attached):
  [1] snow_0.4-3           backports_1.1.2      Hmisc_4.1-1
  [4] VGAM_1.0-6           plyr_1.8.4           igraph_1.2.2
  [7] lazyeval_0.2.1       splines_3.5.1        digest_0.6.18
 [10] foreach_1.4.4        htmltools_0.3.6      lars_1.2
 [13] gdata_2.18.0         magrittr_1.5         checkmate_1.8.5
 [16] onlinePCA_1.3.1      cluster_2.0.7-1      mixtools_1.1.0
 [19] ROCR_1.0-7           sfsmisc_1.1-2        recipes_0.1.3
 [22] gower_0.1.2          dimRed_0.2.2         R.utils_2.7.0
 [25] colorspace_1.3-2     dplyr_0.7.8          jsonlite_1.5
 [28] crayon_1.3.4         bindr_0.1.1          survival_2.42-6
 [31] zoo_1.8-4            ape_5.2              glue_1.3.0
 [34] DRR_0.0.3            gtable_0.2.0         ipred_0.9-8
 [37] kernlab_0.9-27       ddalpha_1.3.4        prabclus_2.2-6
 [40] DEoptimR_1.0-8       abind_1.4-5          scales_1.0.0
 [43] mvtnorm_1.0-8        bibtex_0.4.2         Rcpp_1.0.0
 [46] metap_1.0            dtw_1.20-1           htmlTable_1.12
 [49] tclust_1.4-1         magic_1.5-9          reticulate_1.10
 [52] foreign_0.8-71       bit_1.1-14           proxy_0.4-22
 [55] mclust_5.4.1         SDMTools_1.1-221     Formula_1.2-3
 [58] tsne_0.1-3           stats4_3.5.1         lava_1.6.3
 [61] prodlim_2018.04.18   htmlwidgets_1.3      FNN_1.1.2.1
 [64] gplots_3.0.1         RColorBrewer_1.1-2   fpc_2.1-11.1
 [67] acepack_1.4.1        modeltools_0.2-22    ica_1.0-2
 [70] pkgconfig_2.0.2      R.methodsS3_1.7.1    flexmix_2.3-14
 [73] nnet_7.3-12          caret_6.0-80         tidyselect_0.2.5
 [76] rlang_0.3.0.1        reshape2_1.4.3       munsell_0.5.0
 [79] tools_3.5.1          ranger_0.10.1        pls_2.7-0
 [82] broom_0.5.0          ggridges_0.5.1       geometry_0.3-6
 [85] stringr_1.3.1        npsurv_0.4-0         ModelMetrics_1.2.2
 [88] knitr_1.20           bit64_0.9-7          fitdistrplus_1.0-11
 [91] robustbase_0.93-3    caTools_1.17.1.1     purrr_0.2.5
 [94] RANN_2.6             bindrcpp_0.2.2       pbapply_1.3-4
 [97] nlme_3.1-137         R.oo_1.22.0          RcppRoll_0.3.0
[100] compiler_3.5.1       rstudioapi_0.8       png_0.1-7
[103] lsei_1.2-0           tibble_1.4.2         stringi_1.2.4
[106] RSpectra_0.13-1      lattice_0.20-35      trimcluster_0.1-2.1
[109] diffusionMap_1.1-0.1 pillar_1.3.0         Rdpack_0.10-1
[112] lmtest_0.9-36        data.table_1.11.8    bitops_1.0-6
[115] irlba_2.3.2          gbRd_0.4-11          latticeExtra_0.6-28
[118] KernSmooth_2.23-15   gridExtra_2.3        codetools_0.2-15
[121] MASS_7.3-50          gtools_3.8.1         assertthat_0.2.0
[124] CVST_0.2-2           withr_2.1.2          diptest_0.75-7
[127] parallel_3.5.1       doSNOW_1.0.16        grid_3.5.1
[130] rpart_4.1-13         timeDate_3043.102    tidyr_0.8.2
[133] class_7.3-14         segmented_0.5-3.0    Rtsne_0.15
[136] scatterplot3d_0.3-41 lubridate_1.7.4      base64enc_0.1-3

Error in creating loom file

Dear loomR team,

I get following error when I create a loom file. Any hints that could help me to create loom file is highly appreciated.

`create("filename.loom", data = as.matrix(Read10X(path/to/file)) , transpose = TRUE, calc.count = TRUE)'

Transposing input data: loom file will show input columns (cells) as rows and input rows (features) as columns This is to maintain compatibility with other loom tools |======================================================================================================================================================| 100% Adding: CellID Adding: Gene Calculating number of UMIs per cell Writing results to col_attrs/nCount |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 09s Error in object$apply(name = "col_attrs/nCount", FUN = rowSums, MARGIN = 2, : attempt to apply non-function
if I run the command without `calc.count = TRUE' it works fine.
Thanks

Combine Issue

Hi, I'm trying to combine loom objects titled test and test2. (edit: I'm working with the development branch of loomR)
test:

Class: loom
Filename: <redacted>
Access type: H5F_ACC_RDWR
Listing:
       name    obj_type dataset.dims dataset.type_class
  col_attrs   H5I_GROUP         <NA>               <NA>
 col_graphs   H5I_GROUP         <NA>               <NA>
     layers   H5I_GROUP         <NA>               <NA>
     matrix H5I_DATASET 5000 x 33593          H5T_FLOAT
  row_attrs   H5I_GROUP         <NA>               <NA>
 row_graphs   H5I_GROUP         <NA>               <NA>

test2:

Class: loom
Filename: <redacted>
Access type: H5F_ACC_RDWR
Listing:
       name    obj_type dataset.dims dataset.type_class
  col_attrs   H5I_GROUP         <NA>               <NA>
 col_graphs   H5I_GROUP         <NA>               <NA>
     layers   H5I_GROUP         <NA>               <NA>
     matrix H5I_DATASET 5000 x 33593          H5T_FLOAT
  row_attrs   H5I_GROUP         <NA>               <NA>
 row_graphs   H5I_GROUP         <NA>               <NA>

And when I try: combine(c(test, test2), filename = "combined.loom")
I get

Error in combine(c(test, test2), filename = "combined.loom") : 
  Each entry in the list of looms to combine must have a length of one.

Additionally, when I close the connections and provide the filenames to combine I get this error:
Error in h5attr(this, "chunks") : Attribute does not exist

Any help would be appreciated, thank you!!

subset giving HDF5-API Errors

Hi,

I connected to a loom file with connect function; added metadata using add.col.attribute and add.row.attribute. Then trying to subset a loom file with subset function, based on the added metadata. File is created, and opened, but after reaching 100% "adding data" getting an error.

m <- grep(pattern = "mm10", x = lfile[["col_attrs/call"]][], value = FALSE)
s <- grep(pattern = "mm10", x = lfile[["row_attrs/Gene"]][], value = FALSE)
loom_out <- subset(lfile,
m = m,
n = s,
filename = NULL, overwrite = T, display.progress = TRUE)

Writing new loom file to cellranger/S_combined_subset.loom
Adding data for /matrix and 3 layers
|=================================================================================================================================================| 100%
Error in new.loom$create_group(name = group) : HDF5-API Errors:
error #000: H5G.c in H5Gcreate2(): line 323: unable to create group
class: HDF5
major: Symbol table
minor: Unable to initialize object

error #001: H5Gint.c in H5G__create_named(): line 157: unable to create and link to group
    class: HDF5
    major: Symbol table
    minor: Unable to initialize object

error #002: H5L.c in H5L_link_object(): line 1557: unable to create new link to object
    class: HDF5
    major: Links
    minor: Unable to initialize object

error #003: H5L.c in H5L__create_real(): line 1798: can't insert link
    class: HDF5
    major: Links
    minor: Unable to insert object

error #004: H5Gtraverse.c in H5G_traverse(): line 851: internal path traversal failed
    class: HDF5
    major: Symbol table
    minor: Object not found

error #005: H5Gtraverse.c in H5G__traverse_real(): line 627: traversal operator failed
    class: HDF5
    ma

Any ideas what is causing this? I can't find any troubleshooting threads so far.

Thank you in advance,
Maria

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] loomR_0.2.1.9000 R6_2.4.0 data.table_1.12.6 Signac_0.1.5 hdf5r_1.3.0 ggplot2_3.2.1 Seurat_3.1.1

Error connecting to loom file

Trying to connect to a loom file. I get this error:

l1 <- connect(filename="./data/raw/data.loom",mode="r+")
Error in obj$ls(..., recursive = recursive) : unused argument (full.names = TRUE)

loomR was installed through devtools::install_github(repo = "mojaveazure/loomR", ref = "develop").

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] loomR_0.2.0     itertools_0.1-3 iterators_1.0.9 hdf5r_1.0.0    
[5] R6_2.2.2       

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16    lattice_0.20-35 digest_0.6.15   withr_2.1.2    
 [5] grid_3.4.3      git2r_0.21.0    httr_1.3.1      curl_3.2       
 [9] Matrix_1.2-14   devtools_1.13.5 captioner_2.2.3 tools_3.4.3    
[13] bit64_0.9-7     bit_1.1-12      parallel_3.4.3  yaml_2.1.19    
[17] compiler_3.4.3  memoise_1.1.0   htmltools_0.3.6 knitr_1.20 

get.attribute.df error

For loom files created with velocyto, cell names are called labelled as CellID. I think this is why I'm getting an error with get.attribute.df because it expects the label cell_names.

attrs <- names(r1_loom$col.attrs)
attrs
# [1] "CellID"   "Clusters" "_X"       "_Y"

attr_df <- r1_loom$get.attribute.df(MARGIN = 2, attribute.names = attrs)
Error in `[[.H5File`(self, paste0(attribute.layer, "/", col.names)) : An object with name col_attrs/cell_names does not exist in this group

Loom file created with subset() not complaint with Loom spec version '2.0.1'

When I create a new loom file using the subset() method it makes it not compatible with loompy 2.0.17.

To reproduce here is a link to test.loom

In R

library(loomR)

loom_in <- connect("test.loom")
loom_out <- subset(loom_in, n = 1:10, filename = "test2.loom")
loom_in$close_all()
loom_out$close_all()

Then in python

import loompy as lp

test = lp.connect("test.loom")
test2 = lp.connect("test2.loom")

And it gives me the following error for test2.loom

ValueError: Row attribute 'Accession' dtype object is not allowed Row attribute 'Gene' dtype object is not allowed Row attribute 'chromosome' dtype object is not allowed Row attribute 'featuretype' dtype object is not allowed For help, see http://linnarssonlab.org/loompy/format/ test2.loom does not appead to be a valid Loom file according to Loom spec version '2.0.1'

loomR save sparse matrix

I tried to save the matrix as dense or sparse matrix into loom files, however, the size of the resulting loom files are nearly identical.

Once connected, in the loom file create with spare matrix, I still get the dense matrix.
Would be possible to save the sparse matrix? I installed the loomR in develop branch.

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19.2

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] Matrix_1.2-17     Seurat_3.1.0      loomR_0.2.1.9000  hdf5r_1.2.0      
 [5] R6_2.4.0          data.table_1.12.2 cowplot_1.0.0     ggplot2_3.2.1    
 [9] magrittr_1.5      colorout_1.2-1   

loaded via a namespace (and not attached):
 [1] nlme_3.1-141        tsne_0.1-3          bitops_1.0-6       
 [4] bit64_0.9-7         RcppAnnoy_0.0.12    RColorBrewer_1.1-2 
 [7] httr_1.4.1          useful_1.2.6        sctransform_0.2.0  
[10] tools_3.6.1         irlba_2.3.3         KernSmooth_2.23-15 
[13] uwot_0.1.3          lazyeval_0.2.2      colorspace_1.4-1   
[16] npsurv_0.4-0        withr_2.1.2         tidyselect_0.2.5   
[19] gridExtra_2.3       bit_1.1-14          compiler_3.6.1     
[22] plotly_4.9.0        caTools_1.17.1.2    scales_1.0.0       
[25] lmtest_0.9-37       ggridges_0.5.1      pbapply_1.4-1      
[28] stringr_1.4.0       digest_0.6.20       R.utils_2.9.0      
[31] pkgconfig_2.0.2     htmltools_0.3.6     bibtex_0.4.2       
[34] htmlwidgets_1.3     rlang_0.4.0         RApiSerialize_0.1.0
[37] zoo_1.8-6           jsonlite_1.6        ica_1.0-2          
[40] gtools_3.8.1        dplyr_0.8.3         R.oo_1.22.0        
[43] Rcpp_1.0.2          munsell_0.5.0       ape_5.3            
[46] reticulate_1.13     R.methodsS3_1.7.1   stringi_1.4.3      
[49] gbRd_0.4-11         MASS_7.3-51.4       gplots_3.0.1.1     
[52] Rtsne_0.15          plyr_1.8.4          grid_3.6.1         
[55] parallel_3.6.1      gdata_2.18.0        listenv_0.7.0      
[58] ggrepel_0.8.1       crayon_1.3.4        lattice_0.20-38    
[61] splines_3.6.1       SDMTools_1.1-221.1  pillar_1.4.2       
[64] igraph_1.2.4.1      future.apply_1.3.0  reshape2_1.4.3     
[67] codetools_0.2-16    leiden_0.3.1        glue_1.3.1         
[70] lsei_1.2-0          metap_1.1           RcppParallel_4.4.3 
[73] png_0.1-7           Rdpack_0.11-0       gtable_0.3.0       
[76] RANN_2.6.1          purrr_0.3.2         tidyr_0.8.3        
[79] qs_0.18.3           future_1.14.0       assertthat_0.2.1   
[82] rsvd_1.0.2          survival_2.44-1.1   viridisLite_0.3.0  
[85] tibble_2.1.3        cluster_2.1.0       globals_0.12.4     
[88] fitdistrplus_1.0-14 ROCR_1.0-7         

Errors when combining loom files

Hi,

Thanks a lot for developing this package. I get an error when I try to combine loom files shown as below:
image

I am not familiar with loom files... Could you help me to solve this problem?
Thank you so much!

could not load loom file

The following error was encountered when reading a loom file.

################################
Error in obj$ls(..., recursive = recursive) : 
  unused argument (full.names = TRUE)
################################

May I know what could be the cause?

Creating and connecting to loom file created in R

Hello,

I have tried creating a loom file using create with the default parameters. However, when I try to connect to that file afterward, I get the following error:

Error in obj$ls(..., recursive = recursive) : 
  unused argument (full.names = TRUE)

This file also cannot be read by the current version of loompy.

R version 3.4.4
Platform: x86_64-apple-darwin15.6.0 (64-bit)
OS: El Capitan

Operating on loom files in parallel

I read in your source code that there're lots of for loops when validating matrices, layers, and attributes while those can be parallelized, and often chunk based operations on matrices stored in loom files are embarrassingly parallel. It seems that parallel operations on loom objects are possible, see http://www.msmith.de/2018/05/01/parallel-r-hdf5/. Can you provide parallel options to what can be parallelized, and provide parallel versions of map and apply? This can speed up operations on large datasets a lot, which is really slow at present.

col_attrs question

When I type: lfile[["col_attrs"]] the result is a basic summary of col_attrs plus the first 10 rows. I've pasted the output below:

> lfile[["col_attrs"]]
Class: H5Group
Filename: /Users/juliesawitzke/LOOMstuff/L1_DRG.loom
Group: /col_attrs
Attributes: last_modified
Listing:
                             name    obj_type dataset.dims dataset.type_class
                                Age H5I_DATASET         2948         H5T_STRING
                      AnalysisPool H5I_DATASET         2948         H5T_STRING
                   AnalysisProject H5I_DATASET         2948         H5T_STRING
                          CellConc H5I_DATASET         2948         H5T_STRING
                            CellID H5I_DATASET         2948         H5T_STRING
                         Cell_Conc H5I_DATASET         2948        H5T_INTEGER
                            ChipID H5I_DATASET         2948         H5T_STRING
                             Class H5I_DATASET         2948         H5T_STRING
        ClassProbability_Astrocyte H5I_DATASET         2948          H5T_FLOAT
 ClassProbability_Astrocyte,Immune H5I_DATASET         2948          H5T_FLOAT
< Printed 10, out of 103>

The very last line of the output says that it printed 10 out of 103. How do I see what is beyond 10? I've tried everything to print rows 11:103. Seems like it should be easy, but it isn't! Any ideas?

DATA NOT CORRELATED WITH CLUSTERS

Hi, I am trying to work with the aggregated loom files. I have managed to convert to a .csv file the loom file, but it's missing the identification of the different clusters. My code is the following:

library(loomR)
lfile <- connect(filename = "l6_r4_spinal_cord_inhibitory_neurons.agg.loom", mode = "r+")
lfile
lfile[["col_attrs"]]
lfile[["row_attrs"]]
#make the matrix into a dataframe
numbers_df<-as.data.frame(lfile[["matrix"]][, ])
#transpose so columns becomes cells and rows becomes genes
numbers_df_t<-t(numbers_df)
#make gene names and accessions into a vector (THIS STEP DOESN'T WORK)
genes<-lfile[["row_attrs/Gene"]][]
accession<-lfile[["row_atters/Accession"]][]
#add them to the numbers_df_t
dataset<-cbind(genes, numbers_df_t)
write.csv(dataset, file="SingleCellSCinhbTrans.csv")


How can I get the columns identified by cluster?

thanks!

col_attrs and row_attrs not saved

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>

Subset

Hi, I'm having an issue with subset when I try to subset a loom object with layers. For example:

Edit: I'm using the loomR dev branch of Seurat for NormalizeData

test <- connect(filename = "test.loom", mode="r+")

test
Class: loom
Filename: test.loom
Access type: H5F_ACC_RDWR
Attributes: CreationDate, LOOM_SPEC_VERSION, version, last_modified
Listing:
name obj_type dataset.dims dataset.type_class
col_attrs H5I_GROUP
col_graphs H5I_GROUP
layers H5I_GROUP
matrix H5I_DATASET 9602 x 33593 H5T_FLOAT
row_attrs H5I_GROUP
row_graphs H5I_GROUP

This works fine:
test2 <- subset(test, m= which(!(test$col.attrs$filtered_out[])),
filename = "test2.loom")

but this doesn't:
NormalizeData(object = test2, chunk.size = 1000,
scale.factor = 10000, display.progress = FALSE)
test3 <- subset(test2, n=which(test2[["row_attrs/ex_attr"]][]>1),
filename="test3.loom")

yielding: Error in [[.H5File(new.loom, "layers") :
An object with name layers does not exist in this group

Thanks!!

Error creating loom file: "all chunk dimensions must be positive"

Issue:

> raw[1:5,1:5]
         7A_0_AAAAACTACTGG 7A_0_AAACAGGGTATG 7A_0_AAATCCGATATA 7A_0_AAATGACTGGCC 7A_0_AACCGCTACTCA
A4GALT                   0                 0                 0                 0                 0
AA413626                 0                 0                 0                 0                 0
AA414768                 0                 0                 0                 0                 0
AA465934                 0                 0                 0                 0                 0
AA987161                 0                 0                 0                 0                 0


> create("~/Desktop/TC1.loom", 
+        data = as.matrix(raw), 
+        gene.attrs = row.names(raw), 
+        cell.attrs = colnames(raw),
+        layers = NULL, 
+        chunk.dims = "auto", 
+        chunk.size = 1000,
+        do.transpose = TRUE, 
+        calc.numi = FALSE, 
+        overwrite = TRUE,
+        display.progress = TRUE)


Transposing input data: loom file will show input columns (cells) as rows and input rows (features) as columns
This is to maintain compatibility with other loom tools
Error in dataset_create_pl$set_chunk(chunk_dims) : HDF5-API Errors:
    error #000: H5Pdcpl.c in H5Pset_chunk(): line 2035: all chunk dimensions must be positive
        class: HDF5
        major: Invalid arguments to routine
        minor: Out of range
In addition: Warning messages:
1: In create("~/Desktop/TC1.loom", data = as.matrix(raw), gene.attrs = row.names(raw),  :
  NAs introduced by coercion
2: In dataset_create_pl$set_chunk(chunk_dims) :
  During conversion, the following issues occured: H5T_CONV_EXCEPT_RANGE_LOW
Session info

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] loomR_0.2.1.9000 hdf5r_1.2.0      R6_2.4.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        pillar_1.4.1      compiler_3.5.1    plyr_1.8.4        prettyunits_1.0.2 remotes_2.0.4     tools_3.5.1       bit_1.1-14        testthat_2.1.1    digest_0.6.19     pkgbuild_1.0.3    pkgload_1.0.2     lattice_0.20-38   tibble_2.1.3     
[15] memoise_1.1.0     gtable_0.3.0      pkgconfig_2.0.2   rlang_0.4.0       Matrix_1.2-17     cli_1.1.0         rstudioapi_0.10   parallel_3.5.1    curl_3.3          yaml_2.2.0        dplyr_0.8.1       withr_2.1.2       stringr_1.4.0     desc_1.2.0       
[29] fs_1.3.1          gtools_3.8.1      devtools_2.0.2    bit64_0.9-7       tidyselect_0.2.5  rprojroot_1.3-2   grid_3.5.1        cowplot_0.9.4     glue_1.3.1        processx_3.4.0    pbapply_1.4-1     pacman_0.5.1      sessioninfo_1.1.1 purrr_0.3.2      
[43] callr_3.2.0       reshape2_1.4.3    ggplot2_3.1.1     magrittr_1.5      scales_1.0.0      backports_1.1.4   ps_1.3.0          usethis_1.5.0     assertthat_0.2.1  colorspace_1.4-1  stringi_1.4.3     lazyeval_0.2.2    munsell_0.5.0     crayon_1.3.4    =

Seurat to LoomR: Error in attributes[[i]] : subscript out of bounds

I'm not sure if this is a problem necessarily for Seurat or LoomR, but when I try to convert my seurat object to a loom file, I get the following output:


Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: R6
Loading required package: hdf5r

Attaching package: 'loomR'

The following object is masked from 'package:dplyr':

    combine

Read matrix
added names
turned sparse
             used    (Mb) gc trigger    (Mb)   max used    (Mb)
Ncells   11256948   601.2   17353204   926.8   11269653   601.9
Vcells 1961739302 14966.9 5414633012 41310.4 5008710673 38213.5
removed the old matrix
An object of class Seurat 
26183 features across 2058652 samples within 1 assay 
Active assay: RNA (26183 features)
made object
Performing log-normalization
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
normalized data
Transposing input data: loom file will show input columns (cells) as rows and input rows (features) as columns
This is to maintain compatibility with other loom tools

[Lots of loading]                  
  |======================================================================| 100%
Adding: CellID
Adding: Gene
Adding a layer to norm_data (layer 1 of 1)

[Lots of loading]         
  |======================================================================| 100%
Error in attributes[[i]] : subscript out of bounds
Calls: as.loom ... as.loom.Seurat -> <Anonymous> -> <Anonymous> -> <Anonymous>

I suspected at first this might have been caused by create.names putting underscores in gene names (which Seurat should automatically be able to compensate for), but using gsub to remove those before creating a Seurat object didn't help. Does anyone know why I might be getting this error?

R is version 3.5.3. LoomR, Seurat are both the latest development versions and HDF5r is the most recent full release.

how to convert loom file to seurat object?

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!
图片

variable length strings in metadata prevent opening loomR output in loompy

The loompy specification says that strings must have fixed length. Using loomR version 0.2.0, I get hdf5 files that store strings as variable-length. Then, when I try to open them in Python, ValueError: Column attribute 'whatever' dtype object is not allowed.


$ python test_reader.py
Traceback (most recent call last):
  File "test_reader.py", line 8, in <module>
    loompy.connect("temp.loom")
  File "//anaconda/lib/python3.6/site-packages/loompy/loompy.py", line 1149, in connect
    return LoomConnection(filename, mode, validate=validate, spec_version=spec_version)
  File "//anaconda/lib/python3.6/site-packages/loompy/loompy.py", line 85, in __init__
    raise ValueError("\n".join(lv.errors) + f"\n{filename} does not appead to be a valid Loom file according to Loom spec version '{spec_version}'")
ValueError: Column attribute 'sample.LETTERS..size...100..replace...T.' dtype object is not allowed
For help, see http://linnarssonlab.org/loompy/format/
temp.loom does not appead to be a valid Loom file according to Loom spec version '2.0.1'

Here's the code I use to reproduce this bug.

loom_testing.zip

Version info:

r_session_info.txt

python version: 3.6.8 |Anaconda custom (64-bit)| (default, Dec 29 2018, 19:04:46)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
numpy version: 1.13.3
loompy version: 2.0.17

can't install loomR (non-zero exit status or not available for R v3.6.0)

Hi,
I am trying to install loomR with no luck. Even to install 'hdf5r', I had to use CRAN link. But I was able to install it. I have used commands provided in the tutorial. I have already seen the other similar issue in resolved issues. I am not aware of ways to update temp files etc.

devtools::install_github(repo = "mojaveazure/loomR", ref = "develop")
Downloading GitHub repo mojaveazure/loomR@develop
√ checking for file 'C:\Users\vg272\AppData\Local\Temp\RtmpgPXRFs\remotes26101518284\mojaveazure-loomR-1eca16a/DESCRIPTION' ...

  • preparing 'loomR':
    √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'loomR_0.2.1.9000.tar.gz'

Installing package into ‘C:/Users/vg272/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  • installing source package 'loomR' ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Error: (converted from warning) package 'hdf5r' was built under R version 3.6.1
    Execution halted
    ERROR: lazy loading failed for package 'loomR'
  • removing 'C:/Users/vg272/Documents/R/win-library/3.6/loomR'
    Error: Failed to install 'loomR' from GitHub:
    (converted from warning) installation of package ‘C:/Users/vg272/AppData/Local/Temp/RtmpgPXRFs/file261020e35d55/loomR_0.2.1.9000.tar.gz’ had non-zero exit status

devtools::install_github(repo = "mojaveazure/loomR", ref = "develop")
Downloading GitHub repo mojaveazure/loomR@develop
√ checking for file 'C:\Users\vg272\AppData\Local\Temp\RtmpgPXRFs\remotes2610dde2b81\mojaveazure-loomR-1eca16a/DESCRIPTION' ...

  • preparing 'loomR':
    √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'loomR_0.2.1.9000.tar.gz'

Installing package into ‘C:/Users/vg272/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  • installing source package 'loomR' ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    Error: (converted from warning) package 'hdf5r' was built under R version 3.6.1
    Execution halted
    ERROR: lazy loading failed for package 'loomR'
  • removing 'C:/Users/vg272/Documents/R/win-library/3.6/loomR'
    Error: Failed to install 'loomR' from GitHub:
    (converted from warning) installation of package ‘C:/Users/vg272/AppData/Local/Temp/RtmpgPXRFs/file2610611c29cd/loomR_0.2.1.9000.tar.gz’ had non-zero exit status

library(loomR)
Error in library(loomR) : there is no package called ‘loomR’
install.packages("https://github.com/mojaveazure/loomR.git")
Installing package into ‘C:/Users/vg272/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘https://github.com/mojaveazure/loomR.git’ is not available (for R version 3.6.0)

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] bdsmatrix_1.3-3

loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 rstudioapi_0.10 magrittr_1.5 usethis_1.5.1 devtools_2.1.0 pkgload_1.0.2 R6_2.4.0
[8] rlang_0.4.0 tools_3.6.0 pkgbuild_1.0.5 sessioninfo_1.1.1 cli_1.1.0 withr_2.1.2 remotes_2.1.0
[15] assertthat_0.2.1 digest_0.6.20 rprojroot_1.3-2 crayon_1.3.4 processx_3.4.1 callr_3.3.1 fs_1.3.1
[22] ps_1.3.0 curl_4.0 testthat_2.2.1 glue_1.3.1 memoise_1.1.0 compiler_3.6.0 desc_1.2.0
[29] backports_1.1.4 prettyunits_1.0.2

Any help would be appreciated. Also, is there a direct command to convert 10X matrices to loom file? Something similar to loomPy.

can't connect the .loom file created through loompy

Hi, I am having this exception when I try to connect a .loom file.

> lfile <- connect(filename = "melanoma_S2.loom", mode = "r")

 # Connect to the loom file in read/write mode

lfile <- connect(filename = "melanoma_S2.loom", mode = "r")

Error in h5attr(x = self, which = "chunks"): Attribute does not exist
Traceback:

1. connect(filename = "melanoma_S2.loom", mode = "r")
2. loom$new(filename = filename, mode = mode, skip.validate = skip.validate)
3. .subset2(public_bind_env, "initialize")(...)
4. h5attr(x = self, which = "chunks")
5. stop("Attribute does not exist")

To repeat the error you can basically create a simple .loom file as described in the loompy documentation (http://linnarssonlab.org/loompy/apiwalkthrough/index.html#creating-and-connecting) then you can try to connect it with the command below

> lfile <- connect(filename = "melanoma_S2.loom", mode = "r")

Vice-versa (create from LoomR then connect from LoomPy) is also not possible.

If you solve this issue, could you provide a simple example that creates a .loom file from LoomPy & connects from LoomR and vice-versa, please?

Thanks in advance,
anilbey

HDF5-API Error when attempting to connect to loom file

Hello everyone

I'm trying to connect to a loom file in order to extract counts for further analysis. However, when I run connect(), I get the following error output:

> lfile <- connect(filename = "l1_hypothalamus.loom", mode = "r+")
Error in H5File.open(filename, mode, file_create_pl, file_access_pl) : 
  HDF5-API Errors:
    error #000: ../../../src/H5F.c in H5Fopen(): line 579: unable to open file
        class: HDF5
        major: File accessibilty
        minor: Unable to open file

    error #001: ../../../src/H5Fint.c in H5F_open(): line 1100: unable to open file: time = Thu Apr 25 04:42:56 2019
, name = '/home/rstudio/analysis/linnarson/l1_hypothalamus.loom', tent_flags = 1
        class: HDF5
        major: File accessibilty
        minor: Unable to open file

    error #002: ../../../src/H5FD.c in H5FD_open(): line 812: open failed
        class: HDF5
        major: Virtual File Layer
        minor: Unable to initialize object

    error #003: ../../../src/H5FDsec2.c in H5FD_sec2_open(): line 348: unable to open file: name = '/home/rstudio/analysis/linnarson/l1_hypothalamus.loom', errno = 13, error message = 'Permission denied', flags = 1, o_flags = 2
        class: HDF5
        major: File accessibilty
        minor: Unable to open file

I have already installed and reinstalled hdf5, both in the rocker/tidyverse docker image in which I'm running RStudio and in our local cluster operating system (I'm running a Ubuntu 18.10.04 LTS). I've never had this error before.

Any insights on what this could be?

LICENSE file missing

In order to package loomR in conda, it would be great to to have a LICENSE file. Please also note that GPL requires you to ship the license with the package.

Thanks!

how to merge loom file with my seurat object?help!!!

Hello, @satijalab @mojaveazure.
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!
default

failed to install loomR

devtools::install_github(repo = 'mojaveazure/loomR', ref = 'develop')
Skipping install of 'loomR' from a github remote, the SHA1 (f52d0b7) has not changed since last install.
Use force = TRUE to force installation
Can you help me with it?
image

Remove cells from loom objects

In Seurat, we can filter and remove cells that don't meet certain conditions. I read the loom class documentation and found a function that can add cells. But is there a way to remove cells from a loom object without having to create a new object altogether?

row_attrs from create loom vs add.row.attribute

I've attached row and column attributes at loom file creation as follows: -

>create(paste(LOOMDIR, "test.loom", sep = ""),
       data = counts(sce),
       layers = list(logcounts = logcounts(sce)),
       gene.attrs = as.list(rowData(sce)), 
       cell.attrs = as.list(colData(sce)))

This works successfully for the col_attrs, however the row_attrs are absent: -

>lfile[['row_attrs']]
Class: H5Group
Filename: /home/ckhozoie/Documents/ms-sc/data/raw/loom/test.loom
Group: /row_attrs
Attributes: last_modified
Listing:
 name    obj_type dataset.dims dataset.type_class
 Gene H5I_DATASET        64914         H5T_STRING

After adding manually after file creation: -

> lfile$add.row.attribute(as.list(rowData(sce)), overwrite = TRUE)
> lfile[['row_attrs']]
Class: H5Group
Filename: /home/ckhozoie/Documents/ms-sc/data/raw/loom/test.loom
Group: /row_attrs
Attributes: last_modified
Listing:
                  name    obj_type dataset.dims dataset.type_class
                  Gene H5I_DATASET        64914         H5T_STRING
       ensembl_gene_id H5I_DATASET        64914         H5T_STRING
                  gene H5I_DATASET        64914         H5T_STRING
    is_feature_control H5I_DATASET        64914           H5T_ENUM
                  keep H5I_DATASET        64914           H5T_ENUM
     log10_mean_counts H5I_DATASET        64914          H5T_FLOAT
    log10_total_counts H5I_DATASET        64914          H5T_FLOAT
           mean_counts H5I_DATASET        64914          H5T_FLOAT
     n_cells_by_counts H5I_DATASET        64914        H5T_INTEGER
 pct_dropout_by_counts H5I_DATASET        64914          H5T_FLOAT
< Printed 10, out of 11>

Using the add.row.attribute() approach with the same attribute data as.list(rowData(sce)) seems to work correctly. Possible bug?

ERROR: lazy loading failed for package 'loomR'

#Hi, I'm trying to follow the instructions for Windows. I have noproblem in installing devtools, but from there I got:
#is it because of my R version? I am working under 3.5.2...
package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Sara Villa\AppData\Local\Temp\Rtmpg7EOjN\downloaded_packages

devtools::install_github(repo = "hhoeflin/hdf5r")
Downloading GitHub repo hhoeflin/hdf5r@master
√ checking for file 'C:\Users\Sara Villa\AppData\Local\Temp\Rtmpg7EOjN\remotes523896123f2\hhoeflin-hdf5r-c1d7f00/DESCRIPTION' ...

  • preparing 'hdf5r': (4.3s)
    √ checking DESCRIPTION meta-information
  • cleaning src
  • checking for LF line-endings in source and make files and shell scripts (898ms)
  • checking for empty or unneeded directories (1.5s)
  • building 'hdf5r_1.2.0.tar.gz'
    Warning: file 'hdf5r/cleanup' did not have execute permissions: corrected
    Warning: file 'hdf5r/configure' did not have execute permissions: corrected

Installing package into ‘D:/Documents/R’
(as ‘lib’ is unspecified)
ERROR: failed to lock directory 'D:/Documents/R' for modifying
Try removing 'D:/Documents/R/00LOCK-hdf5r'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/Sara Villa/AppData/Local/Temp/Rtmpg7EOjN/file52383eb745e7/hdf5r_1.2.0.tar.gz’ had non-zero exit status

library("hdf5r", lib.loc="D:/Documents/R")
Warning message:
package ‘hdf5r’ was built under R version 3.5.3

devtools::install_github(repo = "mojaveazure/loomR", ref = "develop")
Downloading GitHub repo mojaveazure/loomR@develop
√ checking for file 'C:\Users\Sara Villa\AppData\Local\Temp\Rtmpg7EOjN\remotes523836c44a37\mojaveazure-loomR-1eca16a/DESCRIPTION' ...

  • preparing 'loomR':
    √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'loomR_0.2.1.9000.tar.gz'

Installing package into ‘D:/Documents/R’
(as ‘lib’ is unspecified)

  • installing source package 'loomR' ...
    ** R
    ** byte-compile and prepare package for lazy loading
    Error : (converted from warning) package 'R6' was built under R version 3.5.3
    ERROR: lazy loading failed for package 'loomR'
  • removing 'D:/Documents/R/loomR'
    In R CMD INSTALL
    Error in i.p(...) :
    (converted from warning) installation of package ‘C:/Users/Sara Villa/AppData/Local/Temp/Rtmpg7EOjN/file52385091385a/loomR_0.2.1.9000.tar.gz’ had non-zero exit status

Error when adding column attributes with NAs

When column attributes with NAs are added using:

lfile$add.col.attribute(newCol, overwrite = TRUE)

It gives this error:
"Error in if (size == Inf) { : missing value where TRUE/FALSE needed"

It's a pretty cryptic error message. Would be good to set an error catch. Thanks for developing this package!

Error creating loom file from Seurat - Error in attributes[[i]] : subscript out of bounds

Hello,

I am having a problem when trying to convert an integrate Seurat object into a loom file.

I am using the code below to create the loom file:

singlecell.combined.loom <- as.loom(singlecell.combined, filename = "/PATH/singlecell.combined.loom", verbose = FALSE)

The output writes:

Transposing input data: loom file will show input columns (cells) as rows and input rows (features) as columns
This is to maintain compatibility with other loom tools
Adding: CellID
Adding: Gene
Error in attributes[[i]] : subscript out of bounds

Any ideas on how to fix this?

Thank you!!

Error combining loom files

Hello,

Thank you for creating loomR. I'm having difficulty combining two loom files. I'm running R 3.5.2 and the develop version of loomR. All other packages are the most recent version.

I can connect to my files and view the row_attrs/Gene for both with no problems as follows:

> lfile <- connect(filename = "file1.loom", mode = "r+")
> lfile[["row_attrs/Gene"]]
Class: H5D
Dataset: /row_attrs/Gene
Filename: <redacted>/file1.loom
Access type: H5F_ACC_RDWR
Attributes: last_modified
Datatype: H5T_STRING {
      STRSIZE 25;
      STRPAD H5T_STR_NULLPAD;
      CSET H5T_CSET_ASCII;
      CTYPE H5T_C_S1;
   }
Space: Type=Simple     Dims=58735     Maxdims=58735
Not chunked

> lfile2 = connect(filename = "file2.loom", mode = "r+")
> lfile2[["row_attrs/Gene"]]
Class: H5D
Dataset: /row_attrs/Gene
Filename: <redacted>/file2.loom
Access type: H5F_ACC_RDWR
Attributes: last_modified
Datatype: H5T_STRING {
      STRSIZE 25;
      STRPAD H5T_STR_NULLPAD;
      CSET H5T_CSET_ASCII;
      CTYPE H5T_C_S1;
   }
Space: Type=Simple     Dims=58735     Maxdims=58735
Not chunked

However, I'm unable to combine these two files:

> combine(looms = list(lfile, lfile2), filename = "combined.loom", order.by = "Gene")
Validating 2 input loom files
  |==========================================================================| 100%
Error in combine(looms = list(lfile, lfile2), filename = "combined.loom",  : 
  Cannot find 'row_attrs/Gene' in the row attributes for the loom files provided
In addition: Warning message:
In if (!grepl(pattern = order.by, x = row.attrs)) { :
  the condition has length > 1 and only the first element will be used

I'm unsure why combine is unable to find 'row_attrs/Gene' for the loom files when I seem to be able to access it ok. Are you able to see what I'm doing wrong?

Best wishes,
Sara

Troubles installing loomR

Hey,
Thanks for this wonderful tool. I am using loomR for quite some time for Single-cell analysis. (with Seurat). Installation was never a problem before. After I installed R 3.6.1 with conda, I am not able to download loomR by any means. I tried to install it from Github as suggested (via devtools). Please find the error attached herewith.

loomR_conda_error

I have also tried to install it with conda: conda install -c bioconda r-loom
But the installation didn't proceed because of the following incompatibility reason:
loomR_incompatibility

I have hdf5r successfully installed in my conda environment as well as the other major dependencies. Can you please suggest if I am missing something here? I can only imagine conda being a problem here.

Best,
Olivia

Not working with loompy v2

Hi,
Current loomR version is not working with loompy v2.
Planning to upgrade loomR to be compatible with loompy v2?
M

Creating loom files

Hi,

My apologies in advance for a naive question. I am new to single cell RNA seq data analysis. I aim to create loom files for my scRNA data.

I have fastq that have been processed using STAR and I have three output files:

1. barcodes.tsv
AAACCTGAGAACTCGG-1
AAACCTGAGTAGGCCA-1
AAACCTGGTCGAAAGC-1
AAACCTGTCCTTAATC-1
AAACCTGTCGCGTAGC-1
AAACCTGTCGTGACAT-1
AAACGGGAGTTAAGTG-1
AAACGGGCACAGGTTT-1
AAACGGGGTGCGCTTG-1
AAACGGGTCTGCGGCA-1
2. Genes.tsv
ENSMUSG00000051951      Xkr4
ENSMUSG00000089699      Gm1992
ENSMUSG00000102343      Gm37381
ENSMUSG00000025900      Rp1
ENSMUSG00000109048      Rp1
ENSMUSG00000025902      Sox17
ENSMUSG00000104328      Gm37323
ENSMUSG00000033845      Mrpl15
ENSMUSG00000025903      Lypla1
ENSMUSG00000104217      Gm37988
  1. matrix.mtx
%%MatrixMarket matrix coordinate integer general
%
27998 3903 5884446
27921 1 13
27919 1 2
27918 1 8
27917 1 1
27916 1 1
27915 1 36
27914 1 49

My question is how can I generate a loom file from the above data.

I see that by using create::loom, can you please guide me through this function and also let me know, if I need anymore files then the ones that I have.

Thank you.

matrix dimensions transposed

It's confusing, but I think matrix data is read / written transposed from native hdf5 format

> create(fl <- tempfile(), matrix(1:6, 3))
Class: loom
Filename: /tmp/RtmpuMT4OX/file308568716c66
Access type: H5F_ACC_RDWR
Attributes: version, chunks
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        3 x 2        H5T_INTEGER
 row_attrs   H5O_TYPE_GROUP         <NA>               <NA>
> system2("h5ls", fl)
col_attrs                Group
layers                   Group
matrix                   Dataset {2/Inf, 3/Inf}
row_attrs                Group

Similarly with test_loom.loom

> connect("test_loom.loom")
Class: loom
Filename: /home/mtmorgan/Downloads/test_loom.loom
Access type: H5F_ACC_RDONLY
Attributes: creation_date, chunks
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    2100 x 21          H5T_FLOAT
 row_attrs   H5O_TYPE_GROUP         <NA>               <NA>
> x = connect("test_loom.loom")
> dim(x$matrix$read())
[1] 2100   21
> system2("h5ls", "test_loom.loom")
col_attrs                Group
layers                   Group
matrix                   Dataset {21, 2100/Inf}
row_attrs                Group

I guess this is an issue in hdf5r that needs to be fixed or accomodated in loomR; rhdf5 has the same issue

> dim(rhdf5::h5read("test_loom.loom", "matrix"))
[1] 2100   21
> length(rhdf5::h5read("test_loom.loom", "row_attrs")$Gene)
[1] 21

Trouble connecting to loom files

I'm unable to connect to loom files. Using the command
lfile <- connect(filename = "l1_amygdala.loom", mode = "r+")
I receive the following error message:
Error in obj$ls(..., recursive = recursive) : unused argument (full.names = TRUE)
Any idea whats going on?
Thanks
Lincoln

failed to get metadata from loomR

I want to get metadata from a loom file,but I'm getting an error with the function: get.attribute.df.Can anyone help me?

> lfile
Class: loom
Filename: /home/yuhong/snap/firefox/common/Downloads/l1_thalamus.loom
Access type: H5F_ACC_RDWR
Attributes: CreationDate, version
Listing:
       name    obj_type  dataset.dims dataset.type_class
  col_attrs   H5I_GROUP          <NA>               <NA>
 col_graphs   H5I_GROUP          <NA>               <NA>
     layers   H5I_GROUP          <NA>               <NA>
     matrix H5I_DATASET 36681 x 27998          H5T_FLOAT
  row_attrs   H5I_GROUP          <NA>               <NA>
 row_graphs   H5I_GROUP          <NA>               <NA>
> lfile[["col_attrs/"]]
Class: H5Group
Filename: /home/yuhong/snap/firefox/common/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>

> attrs <- names(lfile$col.attrs)
> tha.meatdata <- lfile$get.attribute.df(MARGIN = 2, attribute.names = attrs)
Error in `[[.H5File`(self, paste0(attribute.layer, "/", col.names)) : 
  An object with name col_attrs/cell_names does not exist in this group
> df = lfile$get.attribute.df(MARGIN = 2, attribute.names = c("CellID", "Clusters"), col.names = "CellID")
Error in `.rowNamesDF<-`(x, value = value) : 
  duplicate 'row.names' are not allowed
此外: Warning message:
non-unique values when setting 'row.names':10X50_5_AAGTGACCAAGT-’, ‘10X50_5_ACCGGACTCGCT-’, ‘10X50_5_ACCTTGTCTCTA-’, ‘10X50_5_ACGTCTGGCATT-’, ‘10X50_5_ACTCTGTTACCT-’, ‘10X50_5_ACTTCTGCTCCT-’, ‘10X50_5_CAGTTGCCCTTG-’, ‘10X50_5_CGGAACCTGAGT-’, ‘10X50_5_CTCACTGCCATA-’, ‘10X50_5_CTGAGACATGGT-’, ‘10X50_5_GAAACTTAACGC-’, ‘10X50_5_GAAGACACACAC-’, ‘10X50_5_GACCCTTGGGAG-’, ‘10X50_5_GATAGACAACTG-’, ‘10X50_5_GATATGTAGAAG-’, ‘10X50_5_GCACACAGAGAT-’, ‘10X50_5_GCCATGTCCGTC-’, ‘10X50_5_TCGAACTGCTGA-’, ‘10X50_6_AACACTGAGCAG-’, ‘10X50_6_ACGAACGTGTCA-’, ‘10X50_6_ACTTTGGTTTCT-’, ‘10X50_6_AGAACTTAAGCC-’, ‘10X50_6_AGGATGTTCCGC-’, ‘10X50_6_ATACTGAGGTCT-’, ‘10X50_6_CCAGCTTCCGTC-’, ‘10X50_6_TAGAGAATCTCT-’, ‘10X50_6_TCAACTGCCATA-’, ‘10X50_6_TCAGGAGAAGGC-’, ‘10X50_6_TCCAGAGGTACT-’, ‘10X50_6_TCGAACATCACG-’, ‘10X50_6_TGGATGACCTCC-’, ‘10X50_6_TTAAGAGGGACA-’, ‘10X50_7_AACAGATCAAGC-’, [... truncated] 

@mojaveazure

Where to store pca/tsne results in loomR?

Hi,

I use loomR to convert Seurat objects into .loom files to read into other packages. Everything works wells except that the @dr from Seurat objects containing dimension reduction results (pca/tsne) are not saved into .loom files. Hope there is a way to implement this. Thanks!

Yueqi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.