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 order option in GPCCA.plot_coarse_T #804

Merged
merged 4 commits into from Feb 10, 2022
Merged

Conversation

michalk8
Copy link
Collaborator

@michalk8 michalk8 commented Feb 1, 2022

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

Description

Add order argument in :meth:cellrank.tl.estimators.GPCCA.plot_coarse_T.

How has this been tested?

TODO
@Marius1311 for incoming/outgoing, I exclude the diagonal from the computation (for outgoing, it seems to sum to 1 so it's not interesting - not sure if this is always the case, maybe you know).
Also, for these 2 options, since off-diag elements can be negative, shall we take absolute value?

Closes

discussed in #791

@michalk8 michalk8 added the enhancement New feature or request label Feb 1, 2022
@michalk8 michalk8 self-assigned this Feb 1, 2022
@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #804 (b969097) into dev (82d658c) will decrease coverage by 0.31%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #804      +/-   ##
==========================================
- Coverage   81.25%   80.93%   -0.32%     
==========================================
  Files          67       67              
  Lines        9143     9169      +26     
  Branches     1850     1857       +7     
==========================================
- Hits         7429     7421       -8     
- Misses       1146     1174      +28     
- Partials      568      574       +6     
Impacted Files Coverage Δ
cellrank/tl/estimators/terminal_states/_gpcca.py 80.48% <63.63%> (-1.17%) ⬇️
cellrank/external/kernels/_import_error_kernel.py 0.00% <0.00%> (-100.00%) ⬇️
cellrank/external/_error_mixin.py 0.00% <0.00%> (-87.50%) ⬇️
cellrank/external/kernels/_statot_kernel.py 78.78% <0.00%> (-9.10%) ⬇️
cellrank/external/kernels/_wot_kernel.py 86.62% <0.00%> (-2.55%) ⬇️
cellrank/tl/kernels/_base_kernel.py 79.89% <0.00%> (-0.18%) ⬇️

@Marius1311
Copy link
Collaborator

Hi @michalk8, in short...

  • Re excluding the diagonal: of course, that makes sense. You also include an option to sort by diagonal entries, don't you?
  • Re outgoing summing to one: that must hold for the matrix to represent the transition matrix of an embedded Markov chain
  • Re negative elements: that's a difficult question - for now, let's not take the absolute value, let's add them up including their sign.

@michalk8
Copy link
Collaborator Author

Re excluding the diagonal: of course, that makes sense. You also include an option to sort by diagonal entries, don't you?

Yes.

Re excluding the diagonal: of course, that makes sense. You also include an option to sort by diagonal entries, don't you?

Makes, sense, I've removed it since it's uninformative.

Re negative elements: that's a difficult question - for now, let's not take the absolute value, let's add them up including their sign.

Ok, I've kept them.

@michalk8
Copy link
Collaborator Author

michalk8 commented Feb 10, 2022

3.9 fails because the images are for some reason blurry (happens only for 3.8, not sure why).
3.8 PETSc fails because we need to update the installation.
Will be dealt with in #803

@michalk8 michalk8 merged commit 938c907 into dev Feb 10, 2022
@michalk8 michalk8 deleted the feature/plot-coarse-t-order branch February 10, 2022 15:42
michalk8 added a commit that referenced this pull request Mar 21, 2022
* Fix/wot pickle (#748)

* Fix WOTKernel saving OTModel

* [ci skip] Polish docs

* [auto][ci skip] Generate news fragment (#748)

* Fix term/macro states dtype mixture (#750)

* Fix states association having mixture dtypes

* Fix stat dist

* Install Cython in CI

* Add numpy to tox.ini 3.9

* Do not install WOT on 3.9

* Install Cython external

* Fix importorskip

* Don't install statOT on 3.9 CI

* [auto][ci skip] Generate news fragment (#750)

* Feature/update tmat kernel (#764)

* First TmatKernel update

* Add QoL changes to TransportMapKernel

* Refactor transport map kernel

* [auto][ci skip] Generate news fragment (#764)

* Update CytoTRACE calcultation (#761)

* Update CytoTRACE calcultation

* [ci skip] Remove NaN check

* Check whether top correlated genes have NaNs

* [ci skip] Update docstring

* [auto][ci skip] Generate news fragment (#761)

* CI cron on dev (#769)

* Add Edit on GitHub (#775)

* Add Edit on GitHub

* [ci skip] Fix README.rst GPCCA link

* Expose ascending when plotting gene correlations (#779)

* [auto][ci skip] Generate news fragment (#779)

* Fix exp. time kernel colors (#784)

* Fix exp. time kernel colors

* Update news workflow

* [auto][ci skip] Generate news fragment (#784)

* [auto][ci skip] Update dev release notes (#784)

* Fix pyGAM deprecation warnings (#798)

* [auto][ci skip] Generate news fragment (#798)

* [auto][ci skip] Update dev release notes (#798)

* Update PAGA message in cluster_fates (#799)

* Update PAGA message in cluster_fates

* Fix wrong import

* [auto][ci skip] Update dev release notes (#799)

* Fix bad pandas version

* Add order option in GPCCA.plot_coarse_T (#804)

* Add order option in GPCCA.plot_coarse_T

* Remove outgoing order for coarse T

* Add test

* [auto][ci skip] Update dev release notes (#804)

* Feature/refactor kernels (#791)

* Add tmap_as_tmat ctx manager

* Add Edit on GitHub

* [ci skip] Fix README.rst GPCCA link

* Decouple CTPT from __init__

* Add negative corr to CytoTRACE

* Alpha version of kernel refactorings

* Add ConnectivityKernel

* Start refactoring VelocityKernel

* Fix typos

* Finish DisplacementKernel

* Switch to new impl.

* Dont copy expression when combining them

* Remove old impl.

* Fix typo in deterministic model

* Fix VK backward case

* Refactor RW plotting

* Refactor compute_projection -> plot_projection

* Start clean-up

* Fix transport kernel TODOs

* Fix pseudotime kernel TODOs

* Refactor precomputed kernel

* Add _copy_ignore

* Update external kernels

* Update str/repr

* Fix combining

* Change cache handler

* Fix getitem, update tmat setter

* Update precomputed kernel, add tmat decorator

* Fix superfluous dedent

* First round of test fixes

* Second round of test fixing

* Fix projection tests

* Fix VelocityKernel tests

* Fix TransportMapKernel

* Fix minor tests

* Update PrecomputedKernel, fix more tests

* Fix a few more tests

* Fix WOT + thresholding again

* Fix GPCCA tests

* Fix absorption probabilities when array is dense

* Clean the function a bit

* Fix tools tests

* Fix estimator precomputed kernel

* Fix RandomWalk tests

* Fix rest of the tests

* Update manuscript links, bump pyGPCCA>=1.0.3

* Update bibtex

* [auto][ci skip] Generate v1.5.1 release notes

* [auto][ci skip] Release v1.5.1

* Change verbosity level

* Remove neg. correlated genes in CytoTRACE

* [ci skip] Add unnormalized transition matrix in VK

* [ci skip] Update PrecomputedKernel docs

* [ci skip] Finish updating docstrings

* [ci skip] Fix transport maps not being set

* [ci skip] Add missing docstrings, fix a few typos

* Fix PrecomputedKernel and add tests

* Fix external, add more tests

* Add copy_ignore test

* Fix PrecomputedKernel behavior, update estim docs

* [ci skip] Fix typo

* Fix docs

* Fix n_cells in fit, examples and update docstring

* Fix typo in kernel tests

* Regenerate figures

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

* [auto][ci skip] Generate news fragment (#791)

* [auto][ci skip] Update dev release notes (#791)

* Fix/correlation qval nan (#835)

* Fix qvalue calculation resulting in all NaN values

* Add test, set to NaN if any corr not in [-1, 1]

* [auto][ci skip] Generate news fragment (#835)

* [auto][ci skip] Update dev release notes (#835)

* Fix None subset in VelocityKernel

* Change order to ascending when plotting macros (#839)

* Change order to ascending when plotting macros

* Add outgoing order of plotting coarse T

* [auto][ci skip] Update dev release notes (#839)

* Feature/tmap kernel connectivities (#828)

* Add initial diag conn implementation

* Expose conn_weight

* Update docs, fix minor issues

* Fix typo in import, add test, update docs

* Fix type

* Threshold before added diagonal connectivities

* Fix minor dtype bug and typo, fix tests

* [auto][ci skip] Generate news fragment (#828)

* [auto][ci skip] Update dev release notes (#828)

* Do not save Enums in AnnData (#842)

* [auto][ci skip] Generate news fragment (#842)

* [auto][ci skip] Update dev release notes (#842)

* Misc/nested anndata (#841)

* Don't save nested AnnData

* Fix reading from AnnData

* Misc/remove dev (#843)

* Remove references to dev

* Update pre-commit

* Fix badges

* Temporarily pin AnnData from above
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

Successfully merging this pull request may close these issues.

None yet

2 participants