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

[BUG] Raise Erro when the max number of counts table more than int32 #159

Open
byemaxx opened this issue Jul 25, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@byemaxx
Copy link

byemaxx commented Jul 25, 2023

If my count table include number more than int32 (2147483647), it will raise Erro as follows:

in DeseqDataSet.__init__(self, adata, counts, clinical, design_factors, ref_level, min_mu, min_disp, max_disp, refit_cooks, min_replicates, beta_tol, n_cpus, batch_size, joblib_verbosity)
    193     self.__dict__.update(adata.__dict__)
    194 elif counts is not None and clinical is not None:
    195     # Test counts before going further
--> 196     test_valid_counts(counts)
    197     super().__init__(X=counts.astype(int), obs=clinical)
    198 else:
...
    135     raise ValueError("The count matrix should only contain integers.")
    136 if (counts < 0).any().any():
--> 137     raise ValueError("The count matrix should only contain non-negative values.")

ValueError: The count matrix should only contain non-negative values.

Expected behavior
A temporary solution is to zoom in data before creating dds, as follows:

if counts_df.max().max() > 2147483647:
    times = counts_df.max().max() / 2147483647
    divide = int(times) + 1
    counts_df = counts_df / divide
@byemaxx byemaxx added the bug Something isn't working label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant