YosefLab / Cassiopeia

A Package for Cas9-Enabled Single Cell Lineage Tracing Tree Reconstruction
https://cassiopeia-lineage.readthedocs.io/en/latest/
MIT License
75 stars 24 forks source link

ecDNA simulator #240

Closed mattjones315 closed 4 months ago

mattjones315 commented 5 months ago

This PR implements a special simulator described in Hung, Jones, Wong, Curtis et al.

It extends the basic BirthDeathFitnessSimulator implemented Cassiopeia to simulate copy-numbers of extrachromosomal DNA (ecDNA) on top of the phylogeny. An arbitrary number of particles can be simulated according to various selection and co-segregation parameters.

It also makes a few changes to the BirthDeathFitnessSimulator to support passing in an intermediate tree. This is especially relevant when users would like to simulate experiments with different phases - for example, drug-on and drug-off cases.

Another miscellaneous change is the support for passing specific lineage_profiles for tree plotting.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 79.18782% with 41 lines in your changes are missing coverage. Please review.

Project coverage is 79.77%. Comparing base (41dbff8) to head (8bbcd10).

:exclamation: Current head 8bbcd10 differs from pull request most recent head fca94b2. Consider uploading reports for the commit fca94b2 to get more accurate results

Files Patch % Lines
cassiopeia/simulator/ecDNABirthDeathSimulator.py 77.14% 32 Missing :warning:
cassiopeia/simulator/BirthDeathFitnessSimulator.py 83.33% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #240 +/- ## ========================================== - Coverage 79.84% 79.77% -0.08% ========================================== Files 90 91 +1 Lines 8173 8347 +174 ========================================== + Hits 6526 6659 +133 - Misses 1647 1688 +41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mattjones315 commented 5 months ago

Hey @colganwi --

I know that this PR is very much outside of the normal scope of Cassiopeia, but there are a few items here that are relevant to the BirthDeathSimulator. Requesting your review here just in case you want to see if any of my suggested changes would be non-optimal with how you are using Cassiopeia.

mattjones315 commented 4 months ago

Thanks so much for the review, @colganwi -- I believe I've addressed your comments and it looks like this is ready to be merged in!