itpseq.Replicate.logo#
- Replicate.logo(logo_kwargs=None, ax=None, fMet=False, type='information', **kwargs)[source]#
Generates a sequence logo based on the aligned inverse-toeprints, using the logomaker library.
- Parameters:
logo_kwargs (dict, optional) – Additional keyword arguments passed to logomaker.Logo for customizing the sequence logo. Defaults to {‘color_scheme’: ‘NajafabadiEtAl2017’}.
ax (matplotlib.axes.Axes, optional) – Pre-existing matplotlib Axes to draw the logo on. A new Axes is created if not provided.
fMet (bool, optional) – If False, removes m (formyl-methionine / start codon) from the alignment when building the logo. Defaults to False.
type (str, optional) – The transformation type applied to the counts matrix. Possible values include: - ‘information’ for information content. - ‘probability’ for probabilities. Defaults to ‘information’.
**kwargs (dict) – Additional keyword arguments passed to filter the input data (e.g., pos, min_peptide, max_peptide…).
- Returns:
A logomaker.Logo object representing the sequence logo.
- Return type:
logomaker.Logo
Notes
Sequence alignment data is first converted to a counts matrix via the logomaker.alignment_to_matrix method.
The ribosomal site corresponding to each position is annotated on the x-axis.
Transformation of the counts matrix (e.g., counts to information) is performed using logomaker.transform_matrix.
Examples
- Simple logo plot with default settings
>>> logo = obj.logo()
- Logo plot with min_peptide filtering
>>> logo = obj.logo(min_peptide=3)
- Logo plot with custom transformation type and filtering
>>> logo = obj.logo(type='probability', min_peptides=2, fMet=True)