-
Notifications
You must be signed in to change notification settings - Fork 3
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
Read error on TabulaSapients 10X data #22
Comments
Hi @tecosaur, Unfortunately the At the moment, you need to use The good news is that it's probably an easy fix. I'll try to take look soon! |
I'm guessing you've been short on time, do let me know when you've been able to spare a bit more on this though. Speaking of the interface: from the impression I was able to get at JuliaCon and here, it does seem like SingleCellProjections is 80-90% of the way to a really nice go-to package for single cell analysis, with polish being the main thing needed. I still think it could be fun to see if you could write a julialang.org blog post on it once that's happened 🙂. |
Yes, I've been really busy lately unfortunately. But I did find some time today. Work in progress here: https://github.com/BioJulia/SingleCellProjections.jl/tree/h5adFixes What's missing for Down the line, I'll probably refactor the h5ad reading a bit. Thanks for the encouragement! I'm working on some things that I really think will make it easier to use |
A quick comment on this: adding |
I initially want to avoid a lazy-dep on However, I realize now that it's by far the quickest way to get good h5ad support:
Down the line, I can then replace the |
Perhaps the |
Here's a PR #24 which implements loading of h5ad files using create_datamatrix([T], a::AnnData; add_var=false, add_obs=false)
create_datamatrix([T], am::AlignedMapping, name; add_var=false, add_obs=false) Creates a The optional parameter kwargs:
ExamplesAll examples below assume that an AnnData object has been loaded first: julia> using Muon
julia> a = readh5ad("path/to/file.h5ad");
julia> create_datamatrix(a)
DataMatrix (123 variables and 456 observations)
SparseMatrixCSC{Float32, Int32}
Variables: id
Observations: cell_id
julia> create_datamatrix(a; add_var=true, add_obs=true)
DataMatrix (123 variables and 456 observations)
SparseMatrixCSC{Float32, Int32}
Variables: id, feature_type, ...
Observations: cell_id, cell_type, ...
julia> create_datamatrix(Int, a)
DataMatrix (123 variables and 456 observations)
SparseMatrixCSC{Int64, Int32}
Variables: id
Observations: cell_id
julia> create_datamatrix(Int, a.layers, "raw_counts")
DataMatrix (123 variables and 456 observations)
SparseMatrixCSC{Int64, Int32}
Variables: id
Observations: cell_id
julia> create_datamatrix(a.obsm, "UMAP")
DataMatrix (2 variables and 456 observations)
Matrix{Float64}
Variables: id
Observations: cell_id |
I've just registered a new release including the Muon.jl extension. After loading julia> anndata = readh5ad("path/to/TS_Eye.h5ad")
AnnData object 10650 ✕ 58870
julia> counts = SingleCellProjections.create_datamatrix(Int, anndata.layers, "raw_counts", add_var=true, add_obs=true)
DataMatrix (58870 variables and 10650 observations)
SparseArrays.SparseMatrixCSC{Int64, Int32}
Variables: id, gene_symbol, feature_type, ensemblid, highly_variable, means, dispersions, dispersions_norm, mean, ...
Observations: cell_id, organ_tissue, method, donor, anatomical_information, n_counts_UMIs, n_genes, cell_ontology_class, free_annotation, ... In general, you need to look inside the |
Brilliant, thanks for working on this! |
Transferred issue from here:
rasmushenningsson/SingleCell10x.jl#5
Hi Rasmus,
Just for fun, I thought I'd try applying
SingleCellProjections
to a dataset I had on hand, the TabulaSapiens eye.h5ad
file. If you want to grab this file yourself, you can find it here: https://figshare.com/articles/dataset/Tabula_Sapiens_release_1_0/14267219?file=34701970.However, it seems that
load_h5ad
isn't particularly happy with this file:Locally modifying
_read10x_features
to get the first 200 bytes of the IO thatreaddlm
was called on, this is what I find:The text was updated successfully, but these errors were encountered: