smftools.preprocessing.append_base_context

smftools.preprocessing.append_base_context#

smftools.preprocessing.append_base_context(adata, ref_column='Reference_strand', use_consensus=False, native=False, mod_target_bases=['GpC', 'CpG'], bypass=False, force_redo=False, uns_flag='append_base_context_performed')#

Append base context annotations to adata.

Parameters:
  • adata (AnnData) -- AnnData object.

  • ref_column (str (default: 'Reference_strand')) -- Obs column used to stratify references.

  • use_consensus (bool (default: False)) -- Whether to use consensus sequences rather than FASTA references.

  • native (bool (default: False)) -- If True, use native SMF assumptions; otherwise use conversion assumptions.

  • mod_target_bases (list[str] (default: ['GpC', 'CpG'])) -- Base contexts that may be modified.

  • bypass (bool (default: False)) -- Whether to skip processing.

  • force_redo (bool (default: False)) -- Whether to rerun even if uns_flag is set.

  • uns_flag (str (default: 'append_base_context_performed')) -- Flag in adata.uns indicating prior completion.

Return type:

None