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

altExps not being written to .h5ad file with writeH5AD #97

Open
ScreachingFire opened this issue Jun 7, 2023 · 1 comment
Open

altExps not being written to .h5ad file with writeH5AD #97

ScreachingFire opened this issue Jun 7, 2023 · 1 comment
Labels
question Further information is requested

Comments

@ScreachingFire
Copy link

ScreachingFire commented Jun 7, 2023

Hello!

I am having an issue where Alternative Experiments aren't being loaded when I try to read a .h5ad file after writing with writeH5AD().
For example:

> scdata
class: SingleCellExperiment
dim: 21703 22058
metadata(0): 
assays(1): counts
rownames(21703): RP11-34P13.7 FO538757.2 ... BPIFB4 KLF1 
rowData names(0): 
colnames(22058): hu_092618_AAACCTGAGGGAACGG hu_092618_AAACCTGAGGGCTTCC ... hu_080619_TTTGTTGTCCCATGGG hu_080619_TTTGTTGTCTCAATCT 
colData names(2): sample sex 
reducedDimNames(0): 
mainExpName: NULL 
altExpNames(1): test

I generated an SCE object with an alternative experiment test storing a 3000x22058 matrix. However, when writing it out and then reading it back in I get the following:

writeH5AD(scdata, "path_to_file", compression = 'lzf')
scdata <- readH5AD("path_to_file")


> scdata
class: SingleCellExperiment
dim: 21703 22058
metadata(0):
assays(1): counts
rownames(21703): RP11-34P13.7 FO538757.2 ... BPIFB4 KLF1
rowData names(0): 
colnames(22058): hu_092618_AAACCTGAGGGAACGG hu_092618_AAACCTGAGGGCTTCC ... hu_080619_TTTGTTGTCCCATGGG hu_080619_TTTGTTGTCTCAATCT
colData names(2): sample sex
reducedDimNames(0):
mainExpName: NULL
altExpNames(0):

Is there anyway Alternative Experiments could be stored such that you can read/write them, as well as have them show up as a layer in anndata?

@lazappi lazappi added the question Further information is requested label Jun 19, 2023
@lazappi
Copy link
Member

lazappi commented Jun 19, 2023

Hi @ScreachingFire

Thanks for giving {zellkonverter} a go. Firstly, just for clarification, the .h5ad file format doesn't have a concept of alternative experiments so this is one of the things that can't be directly converted from a SingleCellExperiment. The closest thing is the raw slot which is similar but there can only be one in a file.

We are currently able to read the raw slot from a file but not write it to a new .h5ad. There may have been a technical reason for this but more likely it was just overlooked. If this is a feature you would like to have we can discuss adding it (or a PR would be even better).

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

No branches or pull requests

2 participants