Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhdf5 not working with .snap files #114

Closed
mathosi opened this issue Oct 7, 2019 · 2 comments
Closed

rhdf5 not working with .snap files #114

mathosi opened this issue Oct 7, 2019 · 2 comments

Comments

@mathosi
Copy link

mathosi commented Oct 7, 2019

Hi Rongxin,

I have a problem using the rhdf5 library together with snapfiles. When calling functions such as h5ls or h5read on .snap files, there is nothing returned and the function call becomes unstoppable (Strg+C not working). I have already tried to reinstall rhdf5 and rhdf5lib separately, which unfortunetly did not help. Do you have an idea how to resolve this problem?

Using h5ls from the command line on .snap file works fine:
h5ls ./SnapATAC/extdata/demo.snap

AM Group
BD Group
FM Group
GM Group
HD Group
PM Group

Other hdf5 files also work fine using the rhdf5 package in R (eg. cellranger output):

library(rhdf5)
h5ls('./outs/filtered_tf_bc_matrix.h5')
group name otype dclass dim
0 / matrix H5I_GROUP
1 /matrix barcodes H5I_DATASET STRING 13821
2 /matrix data H5I_DATASET INTEGER 7919224
3 /matrix features H5I_GROUP
4 /matrix/features _all_tag_keys H5I_DATASET STRING 2
5 /matrix/features derivation H5I_DATASET STRING 579
6 /matrix/features feature_type H5I_DATASET STRING 579
7 /matrix/features genome H5I_DATASET STRING 579
8 /matrix/features id H5I_DATASET STRING 579
9 /matrix/features name H5I_DATASET STRING 579
10 /matrix indices H5I_DATASET INTEGER 7919224
11 /matrix indptr H5I_DATASET INTEGER 13822
12 /matrix shape H5I_DATASET INTEGER 2

However, no result is returned when using rhdf5 with .snap files:

library(rhdf5)
h5ls('./SnapATAC/extdata/demo.snap')

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

Matrix products: default
BLAS: /usr/lib64/libblas.so.3.4.2
LAPACK: /usr/lib64/liblapack.so.3.4.2

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 datasets utils methods base

other attached packages:
[1] rhdf5_2.28.0

loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0 Rhdf5lib_1.6.1

@r3fang
Copy link
Owner

r3fang commented Oct 7, 2019

hello,

I am sorry for the error! This is a version issue for rhdf5. For R >=3.6.0, when installing rhdf5, it automatically installs version >2.28.0 which is not compatible with the snap file generated with h5py package in snaptools. There are two solutions:

  1. use R 3.5 or 3.4 (R 3.6 is a development version that has not been fully tested);
  2. install rhdf5==2.20.0 in R 3.6 which I have not tested yet.

Please let me know if this does not work.

Best,
Rongxin

@mathosi
Copy link
Author

mathosi commented Oct 8, 2019

Hi,

thanks for pointing this out.
I reinstalled SnapATAC in R 3.4.2 (rhdf5_2.22.0), and it is working fine now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants