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

Add a way to create a DeseqDataSet object from normalized count matrix / preprocessed adata object #205

Open
VictorCurean opened this issue Nov 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@VictorCurean
Copy link

Currently, the only way to initialize a DeseqDataSet object is to have a non-negative integers in adata.X. The AnnData object might have been normalized/preprocessed before-hand, so this limits the integration with other tools.

Describe the solution you'd like

  1. Solution:
    Instead of throwing an Exception, a Warning might be better in the test_valid_counts function.

  2. Solution

Add a constructor flag that ignores the test.

I am not sure which solution might work better, I can't think of a case where a Warning wouldn't do the job, but I can take care of this one if there is one preferred fix for it.

@BorisMuzellec BorisMuzellec added the enhancement New feature or request label Nov 24, 2023
@vcabeli
Copy link
Contributor

vcabeli commented Nov 27, 2023

Hello @VictorCurean !

Just to make sure I understand the solution you are suggesting, you would like PyDESeq2 to throw a warning and perform a conversion of adata.X to integer ? (integers are necessary for the DESeq2 method)

The current way to use PyDESeq2+Anndata is to make sure adata.X contains the raw counts and adata.obs the metadata. If your adata object is normalized/preprocessed before pydeseq2, make sure you keep the raw counts somewhere (e.g. adata.layers['raw_counts'], or copy the raw object if you subset samples / genes during processing adata_raw = adata.copy()) and then set adata.X = adata.layers['raw_counts'] before calling PyDESeq2.

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

No branches or pull requests

3 participants