Sample.sparc#
missionbio.mosaic.sample.Sample.sparc
- Sample.sparc(variants: List[str], cnamps: Optional[List[str]] = None, ado_score: float = 0.9, adjusted_mixing: float = 0.2, branch_size: int = 10, min_snv_clone_size: float = 0.001, min_snv_clone_count: int = 6, min_loh_clone_size: float = 0.001, min_loh_clone_count: int = 25, min_loh_group_size: int = 2, min_cnv_depth: int = 8, min_cnv_completeness: float = 0.6, min_copy_gain_cells: int = 150) SPARCResult#
Runs SPARC to predict clonal phylogeny.
Snippets#
>>> import missionbio.mosaic as ms >>> sample = ms.load("/path/to/file.h5") >>> result = sample.sparc(variants=['var1', 'var2', 'var3']) >>> sample.dna.set_labels(result.labels.values) # Adds the clones to the assay >>> result.draw() # Draws the phylogenetic tree
- Parameters:
- variants:
Variant ids to use as somatic mutations for the phylogeny construction.
- cnamps:
List of CNV amplicon ids to use for phylogeny construction. If None, only SNVs are used. If the CNV assay has the amplicon_model info then copy gain clones are also looked for, otherwise only LoH clones are searched. Use
missionbio.mosaic.cnv.Cnv.model_amplicons()on the diploid assay to get the amplicon parameters and store it in the assay.- The following parameters are passed directly to SPARC.
- ado_score: float
Minimum ADO score to consider a clone valid.
- adjusted_mixing: float
The maximum adjusted mixing rate to consider when looking for doublets.
- branch_size: int
Controls the number of clones dropped in a given cycle. The run time is proportional to (branch_size ^ 3)
- min_snv_clone_size: float
Minimum clone size as a fraction of the total for SNV clones to be considered. For rare variants, this limit might be ignored. It does not guarantee that all SNV clones will be larger than this value.
- min_snv_clone_count: int
Minimum number of cells in a clone for the SNV clone to be considered. For rare variants, this limit might be ignored. It does not guarantee that all SNV clones will be larger than this value.
- min_loh_clone_size: float
Minimum clone size as a fraction of the total for LoHFinder. It does not guarantee that all LoH clones will be larger than this value.
- min_loh_clone_count: int
Minimum number of cells in a clone for LoHFinder. It does not guarantee that all LoH clones will be larger than this value.
- min_loh_group_size: int
Minimum number of variants in a LoH variant group for it to be considered. Passed directly to LoHFinder.
- min_cnv_depth: int
Minimum reads in each cell-amplicon for the completeness check
- min_cnv_completeness: float
Minimum fraction of amplicons in a given cell with sufficient depth to be considered for amplicon modeling and copy gain prediction.
- min_copy_gain_cells: int
The minimum number complete cells in a clone to consider it for copy gain clone identification