PyPI PyPIDownloads Docs

CoSpar - dynamic inference by integrating state and lineage information

CoSpar is a toolkit for dynamic inference from lineage-traced single cells.
The methods are based on Wang et al. Nat. Biotech. (2022).

Dynamic inference based on single-cell state measurement alone requires serious simplifications. On the other hand, direct dynamic measurement via lineage tracing only captures partial information and its interpretation is challenging. CoSpar integrates both state and lineage information to infer a finite-time transition map of a development/differentiation system. It gains superior robustness and accuracy by exploiting both the local coherence and sparsity of differentiation transitions, i.e., neighboring initial states share similar yet sparse fate outcomes. Building around the AnnData object, CoSpar provides an integrated analysis framework for datasets with both state and lineage information. When only state information is available, CoSpar also improves upon existing dynamic inference methods by imposing sparsity and coherence. It offers essential toolkits for analyzing lineage data, state information, or their integration.

CoSpar’s key applications

  • infer transition maps from lineage data, state measurements, or their integration.

  • predict the fate bias of progenitor cells.

  • order cells along a differentiation trajectory leading to a given cell fate.

  • predict gene expression dynamics along a trajectory.

  • predict genes whose expression correlates with future fate outcome.

  • generate a putative fate hierarchy, ordering fates by their lineage distances.

Package development relocation

Effective on April 1st 2023, Shou-Wen Wang is leaving the Klein lab to start his own group at Westlake University, and he will no longer maintain this repository. Further development of CoSpar will continue in his own lab under this respository Please reach out there for any issues related to CoSpar.

Recorded Talks


Feel free to submit an issue or send us an email. Your help to improve CoSpar is highly appreciated.


Shou-Wen Wang wants to acknowledge Xiaojie Qiu for inspiring him to make this website. He also wants to acknowledge the community that maintains scanpy and scvelo, where he learned about proper code documentation. He thanks Tal Debrobrah Scully, Qiu Wu and other lab members for testing the package. Shou-Wen wants to thank especially Allon Klein for his mentorship. Finally, he wants to acknowledge the generous support of the Damon Runyon Foundation through the Quantitative Biology Fellowship.