Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 32 additions & 24 deletions diffxpy/fit/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ def model(
:param constraints_loc: Constraints for location model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -113,9 +114,10 @@ def model(
:param constraints_scale: Constraints for scale model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -289,9 +291,10 @@ def residuals(
:param constraints_loc: Constraints for location model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -322,9 +325,10 @@ def residuals(
:param constraints_scale: Constraints for scale model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -548,9 +552,10 @@ def model(
:param constraints_loc: Constraints for location model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -581,9 +586,10 @@ def model(
:param constraints_scale: Constraints for scale model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -705,9 +711,10 @@ def residuals(
:param constraints_loc: Constraints for location model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -738,9 +745,10 @@ def residuals(
:param constraints_scale: Constraints for scale model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down
42 changes: 24 additions & 18 deletions diffxpy/testing/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ def _fit(
:param design_loc: Design matrix of location model.
:param design_loc: Design matrix of scale model.
:param constraints_loc: : Constraints for location model.
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
of that constraint (which may be dependent at an earlier constraint)
are indicated by a 1.
:param constraints_scale: : Constraints for scale model.
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -519,9 +521,10 @@ def wald(
:param constraints_loc: Constraints for location model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -552,9 +555,10 @@ def wald(
:param constraints_scale: Constraints for scale model. Can be one of the following:

- np.ndarray:
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down Expand Up @@ -1896,19 +1900,21 @@ def wald(
This makes sense for number of genes, time, pseudotime or space
for example.
:param constraints_loc: : Constraints for location model.
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
of that constraint (which may be dependent at an earlier constraint)
are indicated by a 1. It is highly recommended to only use this option
together with prebuilt design matrix for the location model, dmat_loc.
:param constraints_scale: : Constraints for scale model.
Array with constraints in rows and model parameters in columns.
Each constraint contains non-zero entries for the a of parameters that
has to sum to zero. This constraint is enforced by binding one parameter
Array with constraints in columns and model parameters in rows.
Each constraint contains non-zero entries for the constrained parameters that
have to sum to zero. For a non-constrained parameter the revelant constraint column
contains 1 in the parameter row. This constraint is enforced by binding one parameter
to the negative sum of the other parameters, effectively representing that
parameter as a function of the other parameters. This dependent
parameter is indicated by a -1 in this array, the independent parameters
Expand Down
4 changes: 1 addition & 3 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ Diffxpy allows you to define a data set partition and to conduct test on each ge
Multiple tests per gene
~~~~~~~~~~~~~~~~~~~~~~~

How to perform `pairwise <https://nbviewer.jupyter.org/github/theislab/diffxpy_tutorials/tree/master/diffxpy_tutorials/test/multiple_tests_per_gene.ipynb>`__ tests.

How to perform group tests versus all other groups (versus `rest <https://nbviewer.jupyter.org/github/theislab/diffxpy_tutorials/tree/master/diffxpy_tutorials/test/multiversus_rest.ipynb>`__).
How to perform `pairwise tests, group versus rest tests and tests within each parition <https://nbviewer.jupyter.org/github/theislab/diffxpy_tutorials/tree/master/diffxpy_tutorials/test/multiple_tests_per_gene.ipynb>`__ tests.


Gene set enrichment: enrich
Expand Down