SPARC.predict

Contents

SPARC.predict#

missionbio.demultiplex.phylogeny.sparc.SPARC.predict

SPARC.predict(dna: Assay, cnv: Optional[Assay] = None, variants: Optional[List[str]] = None, cnamps: Optional[List[str]] = None, apply_correlation_filter: bool = False, variant_params: Optional[Dict[str, VariantParams]] = None, select: str = '', immune: Optional[List[str]] = None, invalid: Optional[List[str]] = None) SPARCResult#

Predict the phylogenetic tree structure from a DNA assay and a list of variants.

This method initializes clone genotypes, filters valid clones, assigns cell labels, computes distances, and iteratively trims clones to maximize assignment and tree quality. It updates the object’s attributes with the resulting tree, labels, and genotype matrices.

Parameters:
  • dna – The DNA assay containing the data.

  • cnv – The CNV assay corresponding to the cells in the dna assay. If given and cnamps is also given then copy gain clones are looked for. It can also affect the LoH variant groups that are found.

  • variants – List of variants to use for prediction.

  • cnamps – The amplicons used for finding CNVs. If provided, LoH variants will be computed and used in addition to the somatic variants.

  • apply_correlation_filter – Whether to only use variants which are correlated with CNV. If True, not all the variants will be used for creating the phylogent. The variants which are used can be accessed using result.profile.somatic_variants.

  • variant_params – The parameters to use for the provided variants. If not provided, the parameters are estimated from the data.

  • select – If provided, selects the tree with this hash and returns it.

  • immune – List of clone names to protect from removal.

  • invalid – List of clone names to drop from the final tree.

Returns:

None