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

Preparing v0.8 #218

Open
wants to merge 75 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
6f00abb
pin sparse to 0.9.1
Zethson May 31, 2021
b8c6ae0
Merge pull request #200 from theislab/fix/pin_sparse
davidsebfischer May 31, 2021
b2ebeb0
Change to allow grouping order to be preserved
adkinsrs Jul 26, 2021
0464d2a
Removing comment
adkinsrs Nov 24, 2021
12f1286
Merge pull request #210 from adkinsrs/master
davidsebfischer Nov 24, 2021
0164a94
[WIP] First Pass
ilan-gold Apr 25, 2022
2b1162d
[WIP] Use estimator + model
ilan-gold Apr 25, 2022
b30fb97
[WIP] Use ll
ilan-gold Apr 25, 2022
151bc1d
[WIP] Fix test_partition
ilan-gold Apr 26, 2022
d5955f6
[WIP] batchglm now imports
ilan-gold Apr 26, 2022
c695437
[WIP] update for dask?
ilan-gold Apr 26, 2022
6bc9a31
[WIP] making progress on tests.
ilan-gold Apr 28, 2022
6e8970c
[WIP] fix constraint system call.
ilan-gold Apr 28, 2022
92404f6
[WIP] Fix API issues. Now Dask issues.
ilan-gold May 2, 2022
54d2ab1
[WIP] More API issues fixed.
ilan-gold May 3, 2022
13f952a
[WIP] Test fails for p-value problem.
ilan-gold May 12, 2022
679de64
[WIP] test_partition completely works now.
ilan-gold May 13, 2022
b585c3f
[WIP] Fix test_backends.
ilan-gold May 23, 2022
9dce3a0
[WIP] Fixed test_constrained up to not being able to fit multiple sca…
ilan-gold May 27, 2022
5d7ef16
[WIP] Continue to resolve as_categorical issues.
ilan-gold Jun 1, 2022
f2eb495
[WIP] Fix test_vsrest.py
ilan-gold Jun 1, 2022
41eba72
[WIP] Fix test_twosample.py
ilan-gold Jun 1, 2022
3c561b0
[WIP] Fix test_fit.py
ilan-gold Jun 1, 2022
9517859
[WIP] Fix test_enrich.py
ilan-gold Jun 7, 2022
9926449
[WIP] Fix test_pairwise_null.py (up to normal and more than one scale)
ilan-gold Jun 7, 2022
872646a
[WIP] Fix test_single_null.py (up to normal model)
ilan-gold Jun 7, 2022
96fbbc8
[WIP] Fix code of test_single_de.py - false positives.
ilan-gold Jun 7, 2022
7fe10ea
[WIP] Fix test_single_fullrank.py
ilan-gold Jun 7, 2022
5df91f8
[WIP] Fix test_single_sf_null.py
ilan-gold Jun 9, 2022
a44661c
[WIP] Fix test_numeric_covar.py
ilan-gold Jun 9, 2022
dfee9b7
[WIP] Fix test_extreme_values.py
ilan-gold Jun 9, 2022
fb59ec1
[WIP] Fix test_continuous_de.py up to errors.
ilan-gold Jun 9, 2022
6775327
[WIP] Fix test_continuous_null.py
ilan-gold Jun 9, 2022
62da7ce
[WIP] Fix test_single_external_libs.py. t-test failing.
ilan-gold Jun 9, 2022
78f6a2e
[WIP] Fixed test_data_types.py up to https://github.com/dask/dask/iss…
ilan-gold Jun 9, 2022
1052d35
[WIP] ADd norm back into test_backends.py
ilan-gold Jun 9, 2022
85509ab
[WIP] Fix test_single_de.py for normal. Tests still failing
ilan-gold Jun 9, 2022
52117cd
[WIP] Fix test_continuous_de.py. Tests still failing.
ilan-gold Jun 9, 2022
bb171bb
[WIP] Fix test_single_fullrank.py
ilan-gold Jun 9, 2022
1c233d0
[WIP] Fix test_fit.py
ilan-gold Jun 9, 2022
cc64e8a
[WIP] Fix test_single_null.py
ilan-gold Jun 12, 2022
7cf952a
[WIP] Fix test_pairwise_null.py
ilan-gold Jun 12, 2022
d5cb0f3
[WIP] Fix test_single_sf_null.py excpet for dask chunks issue.
ilan-gold Jun 12, 2022
ffe5052
[WIP] Fixed some of the tests in test_xxxx_de.py
ilan-gold Jun 16, 2022
6adc365
[WIP] Add note.
ilan-gold Jun 16, 2022
143d298
[WIP] Gotta import the right model!
ilan-gold Jun 19, 2022
049ab47
Small tweaks.
ilan-gold Jun 26, 2022
529db55
Fix coefficient setters.
ilan-gold Jun 26, 2022
068da68
uncomment
ilan-gold Jun 26, 2022
1aef26e
Use a larger non-zero value to fix test_single_external_libs.py
ilan-gold Jul 1, 2022
9eb76e1
Compute before mean because of https://github.com/dask/dask/issues/7169
ilan-gold Jul 4, 2022
ab18c53
Add comment.
ilan-gold Jul 4, 2022
325de84
Try different tolerance.
ilan-gold Jul 4, 2022
827029a
Fix "real data" test (not sure about scale).
ilan-gold Jul 5, 2022
2861451
Fix variable usage.
ilan-gold Jul 7, 2022
08482df
Fix plotting.
ilan-gold Jul 8, 2022
a775b72
Use good rand parameters for nb model in wald test_vsrest.py
ilan-gold Jul 8, 2022
5c41b3b
Use good rand parameters for nb model in wald test_vsrest.py
ilan-gold Jul 8, 2022
68bc5e7
Use good rand parameters for nb model in wald test_vsrest.py
ilan-gold Jul 8, 2022
e9bdc9d
Use correct typing.
ilan-gold Jul 13, 2022
eb73dcb
Correct use of estimator/model container
ilan-gold Jul 13, 2022
7a02f6b
Remove tf1 backend
ilan-gold Jul 13, 2022
4611432
Set default backend to numpy.
ilan-gold Jul 13, 2022
8bda25d
remove unecessary batch_size arg
ilan-gold Jul 13, 2022
b5a42c4
Fix `TestConstrained`
ilan-gold Jul 14, 2022
761fd8d
Fix pairwise.
ilan-gold Aug 5, 2022
4ca9d7b
fix.
ilan-gold Aug 5, 2022
002aa28
Make intehritence from base.
ilan-gold Aug 8, 2022
5d9595e
For poisson.
ilan-gold Aug 9, 2022
5da2dba
Merge branch 'dev' into ig/batchglm_api_update
ilan-gold Aug 9, 2022
5e89222
(fix): test_single_de straggler?
ilan-gold Oct 7, 2022
0d95526
(fix): add poisson.
ilan-gold Oct 7, 2022
9a5b224
(bug): Don't pass in `noise_model` args to rank/t-test
ilan-gold Oct 7, 2022
e5975d8
(fix): small fixes to get more working
ilan-gold Oct 10, 2022
ceb79aa
(fix): `test_pairs` cond. on element, not index
ilan-gold Oct 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion diffxpy/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from diffxpy.testing.utils import constraint_matrix_from_string, constraint_matrix_from_dict, \
from diffxpy.testing.utils import constraint_matrix_from_string, constraint_system_from_dict, \
constraint_system_from_star
from diffxpy.testing.utils import design_matrix
from diffxpy.testing.utils import view_coef_names, preview_coef_names
23 changes: 13 additions & 10 deletions diffxpy/fit/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pandas as pd
import patsy
import scipy.sparse
import dask
from typing import Union, List, Dict, Callable, Tuple

from .external import _fit
Expand All @@ -17,7 +18,7 @@


def model(
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.typing.InputDataBase],
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.utils.input.InputDataGLM],
formula_loc: Union[None, str] = None,
formula_scale: Union[None, str] = "~1",
as_numeric: Union[List[str], Tuple[str], str] = (),
Expand Down Expand Up @@ -192,23 +193,23 @@ def model(
)

design_loc, design_loc_names, constraints_loc, term_names_loc = constraint_system_from_star(
constraints=constraints_loc,
dmat=dmat_loc,
sample_description=sample_description,
formula=formula_loc,
as_numeric=as_numeric,
constraints=constraints_loc,
return_type="patsy"
)
design_scale, design_scale_names, constraints_scale, term_names_scale = constraint_system_from_star(
constraints=constraints_scale,
dmat=dmat_scale,
sample_description=sample_description,
formula=formula_scale,
as_numeric=as_numeric,
constraints=constraints_scale,
return_type="patsy"
)

model = _fit(
estim = _fit(
noise_model=noise_model,
data=data,
design_loc=design_loc,
Expand All @@ -226,11 +227,11 @@ def model(
quick_scale=quick_scale,
dtype=dtype
)
return model
return estim


def residuals(
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.typing.InputDataBase],
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.utils.input.InputDataGLM],
formula_loc: Union[None, str] = None,
formula_scale: Union[None, str] = "~1",
as_numeric: Union[List[str], Tuple[str], str] = (),
Expand Down Expand Up @@ -401,12 +402,12 @@ def residuals(
dtype=dtype,
** kwargs
)
residuals = estim.x - estim.model.location
residuals = estim.model_container.x - estim.model_container.location
return residuals


def partition(
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.typing.InputDataBase],
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.utils.input.InputDataGLM],
parts: Union[str, np.ndarray, list],
gene_names: Union[np.ndarray, list] = None,
sample_description: pd.DataFrame = None,
Expand Down Expand Up @@ -460,7 +461,7 @@ class _Partition:

def __init__(
self,
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.typing.InputDataBase],
data: Union[anndata.AnnData, Raw, np.ndarray, scipy.sparse.csr_matrix, glm.utils.input.InputDataGLM],
parts: Union[str, np.ndarray, list],
gene_names: Union[np.ndarray, list] = None,
sample_description: pd.DataFrame = None,
Expand All @@ -487,12 +488,14 @@ def __init__(
same order as in data or string-type column identifier of size-factor containing
column in sample description.
"""
if isinstance(data, glm.typing.InputDataBase):
if isinstance(data, glm.utils.input.InputDataGLM):
self.x = data.x
elif isinstance(data, anndata.AnnData) or isinstance(data, Raw):
self.x = data.X
elif isinstance(data, np.ndarray):
self.x = data
elif isinstance(data, dask.array.core.Array):
self.x = data.compute() # ?
else:
raise ValueError("data type %s not recognized" % type(data))
self.gene_names = parse_gene_names(data, gene_names)
Expand Down
2 changes: 1 addition & 1 deletion diffxpy/pkg_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
BATCHGLM_PROVIDE_FIM = True
BATCHGLM_PROVIDE_HESSIAN = False

BATCHGLM_BACKEND = "tf1"
BATCHGLM_BACKEND = "numpy"
BATCHGLM_FEATUREWISE = True
BATCHGLM_AUTOGRAD = True
Loading