LikelihoodMethod#
missionbio.demultiplex.dna.likelihood.LikelihoodMethod
- class LikelihoodMethod(truth: ~pandas.core.frame.DataFrame, model: ~typing.Union[~typing.Type[~missionbio.demultiplex.dna.model.AFModel], ~typing.Type[~missionbio.demultiplex.dna.model.ADModel]] = <class 'missionbio.demultiplex.dna.model.AFModel'>, het_mismatch_penalty: float = 0.75, nocall_mismatch_penalty: float = 0.15, variant_params: ~typing.Union[bool, ~typing.Dict[str, ~missionbio.demultiplex.dna.model.VariantParams]] = False, **kwargs: ~typing.Any)#
A likelihood-based demultiplexing method for DNA data.
This method assigns a label to every cell. The label is the sample that is most likely to have generated the observed DNA data. The likelihoods are calculated using the allele frequencies and depths of the variants in the DNA data and the allele frequencies in the truth data.
Functions#
label_cells([dna, af, dp, clone_weights, ...])Run the demultiplexing
- param truth:
The truth used to label the cells. It must be filtered to all the relevant variants and contain the signature for doublets as well. The only check that is performed is the overlap with the DNA variants when label_cells is called.
- param model:
The model to use for calculating the likelihoods.
- param het_mismatch_penalty:
The penalty for a mismatch in a HET call. The lower the value the more lineant is the filter towards HET calls being called as WT / HOM due to ADO.
- param nocall_mismatch_penalty:
The penalty for a mismatch in a missing call. The lower the value the more lineant is the filter towards cells with missing data. Increasing this value will reduce the miscalling in incomplete cells.
- param variant_params:
A dict of VariantParams objects that contain the parameters for each variant. If True, the parameters will be computed during assignment. These parameters do not change for a given set of cells, so passing them can speed up algorithms where assignment is called multiple times. If False, the default ADO and error rate parameters are used for all variants.
- param **kwargs:
Passed to GTModel. Model parameters can be changed using these arguments.