Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Palantir v1.2 #106

Merged
merged 32 commits into from
Jun 21, 2023
Merged

Palantir v1.2 #106

merged 32 commits into from
Jun 21, 2023

Conversation

katosh
Copy link
Collaborator

@katosh katosh commented Jun 21, 2023

This covers multiple changes @ManuSetty and I wrote up in preparation of our cell-state density manuscript.

Version 1.2.0

New Features

  • Enable an AnnData-centric workflow for improved usability and interoperability with other single-cell analysis tools.
  • Introduced new utility functions
    • palantir.utils.early_cell To automate fining an early cell based on cell type and diffusion components.
    • palantir.utils.find_terminal_states To automate finding terminal cell states based on cell type and diffusion components.
    • palantir.presults.select_branch_cells To find cells associated to each branch based on fate probability.
    • palantir.plot.plot_branch_selection To inspect the cell to branch association.
    • palantir.utils.run_local_variability To compute local gene expression variability.
    • palantir.utils.run_density A wrapper for mellon.DensityEstimator.
    • palantir.utils.run_low_density_variability. To aggregate local gene expression variability in low density.
  • Added input validation for better error handling and improved user experience.
  • Expanded documentation within docstrings, providing additional clarity for users and developers.

Enhancements

  • Updated tutorial notebook to reflect the new workflow, guiding users through the updated processes.
  • Implemented gene trend computation using Mellon, providing more robust and efficient gene trend analysis.

Changes

  • Replaced PhenoGraph dependency with scanpy.tl.leiden for gene trend clustering.
  • Deprecated the run_tsne, determine_cell_clusters, and plot_cell_clusters functions. Use corresponding implementations from Scanpy, widely used single-cell analysis library and direct dependecy of Palantir.

Fixes

  • Addressed the issue of variability when reproducing results (issue#64), enhancing the reproducibility and reliability of Palantir.

katosh and others added 30 commits June 12, 2023 13:09
fallback to pseudo inverse of fundamental matrix
This is for consideration as there already is a function
`_terminal_states_from_markov_chain`. The advantage of the
new funcion beeing that specific cell types can be defined
for which a terminal state ought to be found.
This commit introduces comprehensive compatibility with the AnnData object.
The following major functions are updated to accept AnnData as an input,
perform computations, and write results back to the AnnData object:

- core.run_palantir
- utils.run_pca
- utils.run_diffusion_maps
- run_magic_imputation
- utils.determine_multiscale_space
- utils.run_tsne
- utils.determine_cell_clusters

Key enhancements and modifications include:

- All key input and output references within the AnnData structure are now customizable, providing flexibility for users to align with their existing data structures.
- Detailed docstrings have been updated to provide clear and comprehensive explanations for all new functionalities.
- Backwards compatibility has been ensured, and the modified functions have been tested with the [tutorial notebook](https://github.com/dpeerlab/Palantir/blob/master/notebooks/Palantir_sample_notebook.ipynb) to ensure the integrity and reliability of the updates.

These changes aim to increase user-friendliness and perpare the implementation of furher features.
PhenoGraph fails to cluster with current package versions:
 - Python==3.10.10
 - scipy==1.10.1
 - numpy==1.24.3
 - pandas==1.5.3
 - PhenoGraph==git+https://github.com/JonathanShor/PhenoGraph@f63b02c7f5e6f2300156d7e4201818fa238bf0a4

The error is `TypeError: Expected list, got numpy.ndarray` happending in
`scipy/sparse/_lil.py:473` when calling
`_csparsetools.lol_flatten_to_array(self.rows, indices)`.
 - bugfix: use pca_key
 - parallel MAGIC on optionally sparse input
 - remove `palantir.utils.run_tsne`
This commit enables tthe comparison while using the new implementation
that uses mellon for gene trends and saves all results in the procided
Anntata.

To finilize the new workflow of passing on AnnData I udpated all
functuions used in the tutorial and updated the tutorial itself
with the new workflow.

Since we decided to remove unused functions such as run_tsne I also
removed the following functions that are covered by scanpy:
 - palantir.utils.determine_cell_clusters
 - palantir.plot.plot_cell_clusters
Enhancements for Tutorial Notebooks and Comprehensive Support for AnnData
@ManuSetty ManuSetty merged commit d61eff7 into dpeerlab:master Jun 21, 2023
christopheragnus pushed a commit to christopheragnus/Palantir that referenced this pull request Oct 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants