dandelion.external.immcantation.polars.shazam.quantify_mutations

dandelion.external.immcantation.polars.shazam.quantify_mutations(data, split_locus=False, sequence_column=None, germline_column=None, region_definition=None, mutation_definition=None, frequency=False, combine=True, existing_columns='overwrite', existing_column_suffix='_new', **kwargs)[source]

Run basic mutation load analysis.

Implemented in shazam https://shazam.readthedocs.io/en/stable/vignettes/Mutation-Vignette.

Parameters:
  • data (Dandelion | str) – Dandelion object, file path to AIRR file.

  • split_locus (bool, optional) – whether to return the results for heavy chain and light chain separately.

  • sequence_column (str | None, optional) – passed to shazam’s observedMutations. https://shazam.readthedocs.io/en/stable/topics/observedMutations

  • germline_column (str | None, optional) – passed to shazam’s observedMutations. https://shazam.readthedocs.io/en/stable/topics/observedMutations

  • region_definition (str | None, optional) – passed to shazam’s observedMutations. https://shazam.readthedocs.io/en/stable/topics/IMGT_SCHEMES/

  • mutation_definition (str | None, optional) – passed to shazam’s observedMutations. https://shazam.readthedocs.io/en/stable/topics/MUTATION_SCHEMES/

  • frequency (bool, optional) – whether to return the results a frequency or counts.

  • combine (bool, optional) – whether to return the results for replacement and silent mutations separately.

  • existing_columns (Literal[“overwrite”, “suffix”], optional) – how to handle mutation output columns that already exist in input data. - “overwrite”: replace existing columns with freshly computed values. - “suffix”: preserve existing columns and append new values with

    existing_column_suffix.

  • existing_column_suffix (str, optional) – suffix used when existing_columns='suffix'.

  • **kwargs – passed to shazam::observedMutations.

Returns:

pandas DataFrame holding mutation information.

Return type:

DataFrame | None