rstoolbox.plot.
sequence_frequency_plot
(df, seqID, ax, aminosY=True, clean_unused=-1, refseq=True, key_residues=None, border_color='green', border_width=2, labelsize=None, xrotation=0, yrotation=0, **kwargs)¶Makes a heatmap subplot into the provided axis showing the sequence distribution of each residue type for each position.
A part from the function arguments, any argument that can be provided to the
seaborn.heatmap()
function can also be provided here.
By default, the heatmap generated will have the residue types as y-axis and the sequence positions as x-axis.
Some tips:
cbar_kws={"orientation": "vertical"}
cbar_ax=[second_axis]
cbar=False
Parameters: |
|
---|
Note
Attribute clean_unused
, if applied deletes the full column/row assigned to an
unrepresented residue type, this means that if that residue type is part of the
refseq
, it will not be labeled.
Raises: |
|
---|
Example
In [1]: from rstoolbox.io import parse_rosetta_file
...: from rstoolbox.plot import sequence_frequency_plot
...: import matplotlib.pyplot as plt
...: df = parse_rosetta_file("../rstoolbox/tests/data/input_2seq.minisilent.gz",
...: {"sequence": "B"})
...: fig = plt.figure(figsize=(25, 10))
...: ax = plt.subplot2grid((1, 1), (0, 0))
...: sequence_frequency_plot(df, "B", ax, refseq=False, cbar=False, xrotation=90)
...:
In [2]: plt.show()
In [3]: plt.close()