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

Smoothing for Pseudotime kernel #514

Merged
merged 12 commits into from
Mar 13, 2021
Merged

Smoothing for Pseudotime kernel #514

merged 12 commits into from
Mar 13, 2021

Conversation

michalk8
Copy link
Collaborator

@michalk8 michalk8 commented Mar 6, 2021

IMPORTANT: Please search among the Pull request before creating one.

Title

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)

Description

Adds soft/hard/custom threhdolding for cells in PT's past for PseudotimeKernel.
@Marius1311 would be great if you could check this out and compare it with VIA's implementation here.
Briefly, I've kept all the constant the same, except for nu (now is 0.5, orig. was 1 for the gen. logistic regression) + I do 95% winsorization, instead of 90% on the KNN weights.
You can set the thresholding as threshold_scheme={'soft','hard'} or pass a function which has the following signature:
(cell_pseudotime: float, neigh_pseudotime: np.ndarray, neigh_dist: np.ndarray, **kwargs: Any) -> np.ndarray
(not sure about the naming, neigh_dist are the KNN weights, should be renamed).

How has this been tested?

No tests yet.

Closes

closes #504

TODO:

  • tests
  • determine which parameters to expose
  • update docs (@Marius1311 I leave this up to you)
  • asses the robustness of parameters (not really robust to perc. clipping [expected imho], not sure about others).

@michalk8 michalk8 changed the title General pt kernel General Pseudotime kernel Mar 6, 2021
@michalk8 michalk8 changed the title General Pseudotime kernel Smoothing for Pseudotime kernel Mar 6, 2021
@michalk8 michalk8 requested a review from Marius1311 March 7, 2021 10:58
@codecov
Copy link

codecov bot commented Mar 7, 2021

Codecov Report

Merging #514 (7ff9953) into master (c500c8e) will increase coverage by 0.04%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
+ Coverage   88.40%   88.44%   +0.04%     
==========================================
  Files          53       54       +1     
  Lines        7410     7471      +61     
==========================================
+ Hits         6551     6608      +57     
- Misses        859      863       +4     
Flag Coverage Δ
unittests 88.44% <95.65%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cellrank/tl/_utils.py 83.95% <ø> (-0.41%) ⬇️
cellrank/tl/kernels/_velocity_kernel.py 89.27% <ø> (-0.10%) ⬇️
cellrank/tl/kernels/_pseudotime_kernel.py 85.13% <92.59%> (ø)
cellrank/tl/kernels/_pseudotime_schemes.py 96.36% <96.36%> (ø)
cellrank/tl/_constants.py 96.55% <100.00%> (+0.12%) ⬆️
cellrank/tl/kernels/__init__.py 100.00% <100.00%> (ø)
cellrank/tl/kernels/_utils.py 65.71% <100.00%> (+0.49%) ⬆️
cellrank/ul/_docs.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0be4948...7ff9953. Read the comment docs.

Copy link
Collaborator

@Marius1311 Marius1311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very elegant solution @michalk8. I suggest

  • removing the clipping
  • removing the nu parameter (fixing it to 1)
  • making sure weights are in [0, 1]
    I detail this in my comments. Once this is done, I will take care of the docstrings and test this on some data.

cell_pseudotime: float,
neigh_pseudotime: np.ndarray,
neigh_dist: np.ndarray,
b: float = 20.0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a bit confused here because they consider both 1 and 20 for b - are you sure 20 is the right value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just looking into this in some simulations and will get back to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b=1 is for "using the pseudotime calculated from lazy-jumping walk"
b=20 is for " using the refined MCMC Psuedotimes before calculating lineage likelihood paths"

"""
past_ixs = np.where(neigh_pseudotime < cell_pseudotime)[0]
if not len(past_ixs):
return neigh_dist * 0.5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we do that? Why would we multiply all connectivities by 0.5 in case there are no cells in the past?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I get this. It does not matter because normalization removes this factor anyways and it's nice in the context of the generalized logistic function. It shouldn't make any difference in practice I suppose.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go for the change I suggest below, we have to multiply by 1.0 (i.e. not multiply at all. )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does matter: sigmoid(0) = 0.5 i.e. when the current point is the same (or very close) w.r.t. to PT.

Comment on lines 153 to 157
neigh_dist[past_ixs] = np.clip(
neigh_dist[past_ixs],
np.percentile(neigh_dist[past_ixs], 100 - perc),
np.percentile(neigh_dist[past_ixs], perc),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this clipping necessary? I don't understand why this is done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this clipping altogether.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can send you some figures I have where I did a grid search so you can see for yourself if it's necessary.
I would say keep it (i.e. cells which are further from each other should have greater KNN distance between them, this
dampens these "outliers" if weights are not sufficiently small).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think this is something we need to figure out in practice - I would make the clipping a method parameter that we can test on some example cases. We will compile a "training set" of 4-5 datasets where we have ground truth (or some proxy) and do a grid search to optimise these free method parameters.

return biased_dist


class SoftThresholdScheme(PseudotimeScheme):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I think your solution to do this via a Scheme class is very elegant here!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it's the same principle as in the VelocityKernel.

neigh_pseudotime: np.ndarray,
neigh_dist: np.ndarray,
b: float = 20.0,
nu: float = 0.5,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use nu=1, potentially even remove this parameter entirely. Will message you in mattermost about this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but if I were you, I'd plot the values and decide based on that (e.g. gen_sigmoid(<some_dist>), where <some_dist> is e.g. 0.1, 0.25, 0.5, 0.75). With 0.5, the weight decreases more rapidly (not sure if you want that) with the distance.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Mike, please check your mattermost, I send you exactly these plots yesterday already and made the suggestion based on that.

weights = np.full_like(neigh_dist, fill_value=0.5)

dt = cell_pseudotime - neigh_pseudotime[past_ixs]
weights[past_ixs] = 1.0 / ((1.0 + np.exp(b * dt)) ** (1.0 / nu))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would multiply by 2 and get rid of the nu parameter, i.e.
weights[past_ixs] = 2.0 / (1.0 + np.exp(b * dt))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They also seem to be using nu=1 in their implementation.

np.percentile(neigh_dist[past_ixs], perc),
)

weights = np.full_like(neigh_dist, fill_value=0.5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go for the change I suggest below, need to change to fill_value=1.0

@Marius1311
Copy link
Collaborator

What's the status here, only tests missing?

@michalk8
Copy link
Collaborator Author

What's the status here, only tests missing?

From my side, it's the tests, from your side, it would be to polish the docstrings of PseudotimeKernel + of the schemes (I've alreay included the VIA citation)

@Marius1311
Copy link
Collaborator

Nice, will tend to this after my PR today!

@Marius1311
Copy link
Collaborator

Estimators don't like the pseudotime kernel yet, running

from cellrank.tl.kernels import PseudotimeKernel
from cellrank.tl.estimators import GPCCA

kernel = PseudotimeKernel(adata, time_key='gcs_pseudotime', check_connectivity=True)
kernel.compute_transition_matrix(threshold_scheme='hard', k=3)

g_fwd = GPCCA(kernel)

raises

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-38-a0174fcf3fc7> in <module>
----> 1 g_fwd = GPCCA(kernel)
      2 print(g_fwd)

~/Projects/cellrank/cellrank/tl/estimators/_base_estimator.py in __init__(self, obj, inplace, read_from_adata, obsp_key, g2m_key, s_key, write_to_adata, key)
    103         from anndata import AnnData
    104 
--> 105         super().__init__(obj, obsp_key=obsp_key, key=key, write_to_adata=write_to_adata)
    106 
    107         if isinstance(obj, (KernelExpression, AnnData)) and not inplace:

~/Projects/cellrank/cellrank/tl/estimators/_property.py in __init__(self, *args, **kwargs)
    864 
    865     def __init__(self, *args, **kwargs):
--> 866         super().__init__(*args, **kwargs)
    867 
    868         self._is_irreducible = None  # no need to refactor these

~/Projects/cellrank/cellrank/tl/estimators/_property.py in __init__(self, obj, key, obsp_key, write_to_adata)
    213             self._kernel = PrecomputedKernel(obj.obsp[obsp_key], adata=obj)
    214         else:
--> 215             raise TypeError(
    216                 f"Expected an object of type `KernelExpression`, `numpy.ndarray`, `scipy.sparse.spmatrix` "
    217                 f"or `anndata.AnnData`, got `{type(obj).__name__!r}`."

TypeError: Expected an object of type `KernelExpression`, `numpy.ndarray`, `scipy.sparse.spmatrix` or `anndata.AnnData`, got `'PseudotimeKernel'`.

@michalk8
Copy link
Collaborator Author

Estimators don't like the pseudotime kernel yet, running

This is an issue with jupyter + autoreload (can't reproduce this).

@Marius1311
Copy link
Collaborator

Okay sorry, my mistake then!

@Marius1311
Copy link
Collaborator

Okay, you're right, restarting my kernel solved this, really sorry!

@Marius1311
Copy link
Collaborator

The docstrings should be done @michalk8 - let me know if I missed anyting!

@michalk8 michalk8 changed the base branch from master to dev March 13, 2021 18:11
@michalk8 michalk8 merged commit a823f76 into dev Mar 13, 2021
@michalk8 michalk8 deleted the general_pt_kernel branch March 13, 2021 18:11
@Marius1311
Copy link
Collaborator

Thanks for adding the tests!

michalk8 added a commit that referenced this pull request Mar 28, 2021
* Smoothing for Pseudotime kernel (#514)

* Rename PalantirKernel -> PseudotimeKernel

* Add initial abstraction

* Add Palantir scheme

* Add soft PT

* Remove old test

* Fix wrong condition

* Update docs and defaults

* Fix Pseudotime kernel docstring

* Fix more docstrings

* Update docs

* Add tests, pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add compute_projection (#520)

* Add compute_projection

* Swap order of args

* Add tests

* Fix params, add plotting test

* [ci skip] Update docstring

* Pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix bugs, QoL improvements (#535)

* Fix bugs, QoL improvements

* Add QoL changes v2

* Enable CI

* Cytotrace kernel (#527)

* Add CytoTRACE kernel

* Add new kernel to docs

* Fix literal

* Work on the docstring

* Rename variables

* Rename the gcs variable

* Update the docstring

* Add docstring to kernel class

* Move the workflow example

* [ci skip] Enable CI

* Move to CytoTRACEKernel

* Improve logging, remove arbitrary restriction

* Do not use short kernel names

* Add CytoTRACE test skeletons

* Set use_raw=False, add tests

* Improve tests

* Fix raw and normal adata with different n_vars

* Add cytotrace score to adata_200

* Add regression test for ct_score

* Add regression test for gene_corr

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add external model (#522)

* Add external module, port statOT

* Add docs

* Add typing_extensions

* Add some sanity check

* Move external to separate page

* Add tests

* Temp. pin down numba

* Add explicit POT mention in docs, add to external

* Use raise from

* Fix init subclass

* Add rest error mixins

* Add tox

* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst

* Fix sections

* Update CONTRIBUTING.rst

* Update test requirements

* [ci skip] Start addressing comments

* [ci skip] Update CONTRIBUTING.rst

* Add tutorials to CONTRIBUTING.rst

* Different import, enable CI on dev

* Update GA issues/discussions

* Update OTKernel to reflect new changes

* Fix wrong import

* [ci skip] Update dev install, docs

* [ci skip] Fix link

* Remove edit_on_github (#538)

* Random walk simulation (#537)

* Add random walk class

* Parallelize

* Random walk plotting

* Add docstrings

* [ci skip] Fix some imports

* [ci skip] Add error messages

* Add random walks test skeleton

* [ci skip] Add plotting test skeletons

* Add RW tests

* Add plotting tests

* Add legend loc for start/stop indices, update docs

* Work on docstrings

* Add first/last cell description

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix dist -> conn, update docstrings, remove copy (#536)

* Fix dist -> conn, update docstrings, remove copy

* Change default

* Work on the docstring

* Exchange k for fract_to_keep

* Make fract_to_keep a float

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix plot lin drivers (#543)

* Fix lineage drivers plotting

* Add tests

* Add forgotten GT images

* Fix nan in emb when projection tmat (#546)

* [ci skip] Add Zebrafish dataset (#547)

* [ci skip] Remove fig.show()

* Fix some logging messages

* Release notes 1.3 (#539)

* Fix docs, move latest additions

* Change latest to stable

* Add most of the release notes

* [ci skip] Update release notes - new dataset

* Go over release notes

* Update release notes: move Zebrafish, add pygpcca

* Correct tutorial names

* Regenerate some figures to accomodate mpl==1.4.0

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Release 1.3 (#548)

* Fix typos, update _static

* Add forgotten docstring to abstract method

* Fix tutorial links in docs

Co-authored-by: Marius Lange <marius.lange@t-online.de>
michalk8 added a commit that referenced this pull request Apr 9, 2021
* Smoothing for Pseudotime kernel (#514)

* Rename PalantirKernel -> PseudotimeKernel

* Add initial abstraction

* Add Palantir scheme

* Add soft PT

* Remove old test

* Fix wrong condition

* Update docs and defaults

* Fix Pseudotime kernel docstring

* Fix more docstrings

* Update docs

* Add tests, pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add compute_projection (#520)

* Add compute_projection

* Swap order of args

* Add tests

* Fix params, add plotting test

* [ci skip] Update docstring

* Pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix bugs, QoL improvements (#535)

* Fix bugs, QoL improvements

* Add QoL changes v2

* Enable CI

* Cytotrace kernel (#527)

* Add CytoTRACE kernel

* Add new kernel to docs

* Fix literal

* Work on the docstring

* Rename variables

* Rename the gcs variable

* Update the docstring

* Add docstring to kernel class

* Move the workflow example

* [ci skip] Enable CI

* Move to CytoTRACEKernel

* Improve logging, remove arbitrary restriction

* Do not use short kernel names

* Add CytoTRACE test skeletons

* Set use_raw=False, add tests

* Improve tests

* Fix raw and normal adata with different n_vars

* Add cytotrace score to adata_200

* Add regression test for ct_score

* Add regression test for gene_corr

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add external model (#522)

* Add external module, port statOT

* Add docs

* Add typing_extensions

* Add some sanity check

* Move external to separate page

* Add tests

* Temp. pin down numba

* Add explicit POT mention in docs, add to external

* Use raise from

* Fix init subclass

* Add rest error mixins

* Add tox

* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst

* Fix sections

* Update CONTRIBUTING.rst

* Update test requirements

* [ci skip] Start addressing comments

* [ci skip] Update CONTRIBUTING.rst

* Add tutorials to CONTRIBUTING.rst

* Different import, enable CI on dev

* Update GA issues/discussions

* Update OTKernel to reflect new changes

* Fix wrong import

* [ci skip] Update dev install, docs

* [ci skip] Fix link

* Remove edit_on_github (#538)

* Random walk simulation (#537)

* Add random walk class

* Parallelize

* Random walk plotting

* Add docstrings

* [ci skip] Fix some imports

* [ci skip] Add error messages

* Add random walks test skeleton

* [ci skip] Add plotting test skeletons

* Add RW tests

* Add plotting tests

* Add legend loc for start/stop indices, update docs

* Work on docstrings

* Add first/last cell description

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix dist -> conn, update docstrings, remove copy (#536)

* Fix dist -> conn, update docstrings, remove copy

* Change default

* Work on the docstring

* Exchange k for fract_to_keep

* Make fract_to_keep a float

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix plot lin drivers (#543)

* Fix lineage drivers plotting

* Add tests

* Add forgotten GT images

* Fix nan in emb when projection tmat (#546)

* [ci skip] Add Zebrafish dataset (#547)

* [ci skip] Remove fig.show()

* Fix some logging messages

* Release notes 1.3 (#539)

* Fix docs, move latest additions

* Change latest to stable

* Add most of the release notes

* [ci skip] Update release notes - new dataset

* Go over release notes

* Update release notes: move Zebrafish, add pygpcca

* Correct tutorial names

* Regenerate some figures to accomodate mpl==1.4.0

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Release 1.3 (#548)

* Fix typos, update _static

* Add forgotten docstring to abstract method

* Fix tutorial links in docs

* Update the index

* Make it a bit shorter

* Add links and contributions seciton

* Fix spelling

* Fix same plot (#556)

* Fix reading from adata

* Regenerate figure

* Add warning

* Compute Schur only for num. states, not +1

* Add test

* Update README.rst

* Minor update

* Remove solver heuristics (#558)

* Remove solver/PETSc heuristic

* Change tol to 1e-6

* Change test tol, regen image

Co-authored-by: Marius Lange <marius.lange@t-online.de>
michalk8 added a commit that referenced this pull request Jun 30, 2021
* Smoothing for Pseudotime kernel (#514)

* Rename PalantirKernel -> PseudotimeKernel

* Add initial abstraction

* Add Palantir scheme

* Add soft PT

* Remove old test

* Fix wrong condition

* Update docs and defaults

* Fix Pseudotime kernel docstring

* Fix more docstrings

* Update docs

* Add tests, pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add compute_projection (#520)

* Add compute_projection

* Swap order of args

* Add tests

* Fix params, add plotting test

* [ci skip] Update docstring

* Pin down numba

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix bugs, QoL improvements (#535)

* Fix bugs, QoL improvements

* Add QoL changes v2

* Enable CI

* Cytotrace kernel (#527)

* Add CytoTRACE kernel

* Add new kernel to docs

* Fix literal

* Work on the docstring

* Rename variables

* Rename the gcs variable

* Update the docstring

* Add docstring to kernel class

* Move the workflow example

* [ci skip] Enable CI

* Move to CytoTRACEKernel

* Improve logging, remove arbitrary restriction

* Do not use short kernel names

* Add CytoTRACE test skeletons

* Set use_raw=False, add tests

* Improve tests

* Fix raw and normal adata with different n_vars

* Add cytotrace score to adata_200

* Add regression test for ct_score

* Add regression test for gene_corr

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Add external model (#522)

* Add external module, port statOT

* Add docs

* Add typing_extensions

* Add some sanity check

* Move external to separate page

* Add tests

* Temp. pin down numba

* Add explicit POT mention in docs, add to external

* Use raise from

* Fix init subclass

* Add rest error mixins

* Add tox

* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst

* Fix sections

* Update CONTRIBUTING.rst

* Update test requirements

* [ci skip] Start addressing comments

* [ci skip] Update CONTRIBUTING.rst

* Add tutorials to CONTRIBUTING.rst

* Different import, enable CI on dev

* Update GA issues/discussions

* Update OTKernel to reflect new changes

* Fix wrong import

* [ci skip] Update dev install, docs

* [ci skip] Fix link

* Remove edit_on_github (#538)

* Random walk simulation (#537)

* Add random walk class

* Parallelize

* Random walk plotting

* Add docstrings

* [ci skip] Fix some imports

* [ci skip] Add error messages

* Add random walks test skeleton

* [ci skip] Add plotting test skeletons

* Add RW tests

* Add plotting tests

* Add legend loc for start/stop indices, update docs

* Work on docstrings

* Add first/last cell description

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix dist -> conn, update docstrings, remove copy (#536)

* Fix dist -> conn, update docstrings, remove copy

* Change default

* Work on the docstring

* Exchange k for fract_to_keep

* Make fract_to_keep a float

* Fix tests

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Fix plot lin drivers (#543)

* Fix lineage drivers plotting

* Add tests

* Add forgotten GT images

* Fix nan in emb when projection tmat (#546)

* [ci skip] Add Zebrafish dataset (#547)

* [ci skip] Remove fig.show()

* Fix some logging messages

* Release notes 1.3 (#539)

* Fix docs, move latest additions

* Change latest to stable

* Add most of the release notes

* [ci skip] Update release notes - new dataset

* Go over release notes

* Update release notes: move Zebrafish, add pygpcca

* Correct tutorial names

* Regenerate some figures to accomodate mpl==1.4.0

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Release 1.3 (#548)

* Fix typos, update _static

* Add forgotten docstring to abstract method

* Fix tutorial links in docs

* Update the index

* Make it a bit shorter

* Add links and contributions seciton

* Fix spelling

* Fix same plot (#556)

* Fix reading from adata

* Regenerate figure

* Add warning

* Compute Schur only for num. states, not +1

* Add test

* Update README.rst

* Minor update

* Remove solver heuristics (#558)

* Remove solver/PETSc heuristic

* Change tol to 1e-6

* Change test tol, regen image

* Add check probs sum to 1 (#566)

* Add abs. probs check

* Add nicer message, add tests

* Increase tolerance to 1e-3

* Fix test

* [ci skip] Fix test names

* Fix not using percentile (#568)

* Fix wrong pyGPCCA attribute in logging

* First version of req. pruning (#571)

* Fix inconsistent state (#563)

* Fix inconsistent cat/cont macrostates/lineages

* Add tests, fix 1 minor bug

* Add force recompute tmat (#577)

* Add force tmat recomputation, fix typo bug

* Add test

* Change circ. projection TSP default heuristic

* Remove -1 in hard scheme, modify test (#582)

* [ci skip] Remove sphinx-paramlinks (#584)

* Pt kernel changes (#583)

* Change PT kernel defaults, remove perc/dnorm

* Remove density normalize from tests

* Fix docs

* [ci skip] Remove sphinx-paramlinks

* Fix test

* Remove dens correction from docstring

* Dont force sparse tmat if already dense (#586)

* Do not force tmat to be sparse

* Add test

* Fix tests expecting sparse matrix

* Parallelize pt kernel (#587)

* Parallelize PT kernel

* [ci skip] Add forgotten kwargs in docs

* Fix custom connectivities key (#590)

* Fix plot_coarse_T annotation

* Exp time kernel (#595)

* Resurrect exp. time kernel

* Add WOT skeleton class

* Add WOT

* Add tests, add wot to external requirements

* Skip WOT tests on CI, update WOT installation

* Better import error message, save tmats, last 1s

* Clear order info message, fix test skip

* Expose more args

* Save estimated growth rates to adata

* [ci skip] Add compute_initial_growth_rates

* Add to the docstrings

* Add HVGs subset, fix docs, rename StatOT kernel

* Change debug to info, add uniform

* Add example workflow

* [ci skip] Polish docs

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Wot kernel graph (#600)

* Don't require connectivities for external kernels

* Fix commented skip

* Enable bibtex (#601)

* Use bibtex for references

* Polish docs

* Fix dois

* Update CytoTRACE workflow

* Update WOT example workflow

* Remove old examples, add new skeleton ones (#602)

* Remove old examples, add new skeleton ones

* Move old release notes

* Add 2 new examples - projection and RW

* Update latest additions

* Update RW docstring

* Update docstring to manually set terminal states (#607)

* Update docstring to manually set terminal states

* Fix bug with doc insertion

* Add option to set term states from clusters

Co-authored-by: Michal Klein <michal.klein@protonmail.com>

* Add option to use connectivities for WOT (#609)

* Fix tqdm/ipywidgets (#616)

* Vein plot (#615)

* Start vein plot

* Specialize plot_flow for exp. time kernel

* Add first working impl.

* Update plotting

* Add plotting options

* Add flow threshold

* Rename argument

* Fix cyclic import

* Fix plot_flow in ExpTimeKernel

* Add tmat kernel

* Subset clusters, fix bwd

* Allow cluster subset and ordering

* Add time point filtering

* [ci skip] Fix bugs, start abstraction

* [ci skip] Clean code

* [ci skip] Remove dicts

* [ci skip] Fix indexing error

* Remove plot_flow specification for TMatKernel

* [ci skip] Control ticks

* [ci skip] Order legend

* Polish docs

* Polish docs

* Add option to remove empty clusters

* Fix linting

* [ci skip] Fix logging and docs

* Add skeleton tests, fix typo, name to single flow

* Add first batch of tests

* Add plotting tests

* [ci skip] Fix doi

* [ci skip] Fix exp. time kernel copy (#623)

* Fix lineage drivers to allow for combinations (#624)

* Fix parallelize too many jobs (#633)

* Cluster lin clusters (#634)

* [ci skip] Add cluster key to cluster_lineage

* Fix limits

* Use more xticks

* Add multiple covariates, expose ratio and cmap

* Add tests

* Add WOT dataset infra (#631)

* Add WOT dataset infra

* Add figshare link

* Fix indentation in docs, missing dot.

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Increate timeout

* Prolif apop markers (#630)

* Add marker fetching class

* Add prolif/apop infra

* Remove rat

* Add human markers

* Add mouse markers

* Add references

* Add test

* Minor dosctring changes

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Speed up calculation of absorption probabilities (#638)

* Refactor `compute_absorption_probabilities`

Refactors the calculation of absorption probabilities to first define
a single artificial cell in the macro state by summing all cells
identifying the macro state. This is equivalent to solving the linear
system for each individual cell and then summing the absorption
probabilities.

* Update test_cflare.py

Updates `TestCFLARE.test_abs_probs_negative` to work correctly with the
refactored version of `BaseEstimator.compute_absorption_probabilities`.

Co-authored-by: michalk8 <46717574+michalk8@users.noreply.github.com>

* Stacked histogram (#641)

* Add plot macrostate composition

* Set margins

* Fix cyclic import

* Add test skeletons

* Add tests

* Remove return ax test

* Set yticks

* Regenerate figures

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Log odds (#642)

* Initialize log_odds

* Move Marius' function

* Implement log odds

* Add docs, fix TODOs

* Add test skeletons

* Add colorbar

* Add legend_loc

* Fix categorical bug, jitter, seed, add tests

* Remove testing artifact

* Fix copy

* Change threshold

* Add show

* Add key-specific threshold

* Add fontsize

* Add xticks step size

* Add tests, fix tick step size None

* Change verbosity to debug

* Add plot gene corr (#640)

* Add plot gene corr

* Add test skeletons

* Add tests, fix raw bug

* Fix adjustText

* Change defaults, ERROR logging

* Fix using wrong params

Co-authored-by: Marius Lange <marius.lange@t-online.de>

* Update precommit (#645)

* Update precommit

* Update reqs, setup.py, pyproject.toml

* Install Cython for 3.9

* Install Cython v2

* POT v3

* Try latest numba version

* Disable 3.9 CI

* Try installing umap-learn on CI/tox

* Fix macOS, docs umap-learn version

* Fix docs build

* Add some references

* Update release notes (#647)

* Update release notes

* Pin numba in reqs again

* Update test reqs., CI Python hash

* Purge CI cache

* Remove 3.9 CI

* Add links to index.rst

* Finalize release notes

* Fix reference, add missing doi, download notebook

Co-authored-by: Marius Lange <marius.lange@t-online.de>

Co-authored-by: Marius Lange <marius.lange@t-online.de>
Co-authored-by: Marius Lange <marius.lange@tum.de>
Co-authored-by: Philipp Weiler <philipp.weiler@tum.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pseudotime-based kernel tutorial
2 participants