rstoolbox.plot.
multiple_distributions
(df, fig, grid, igrid=None, values='*', titles=None, labels=None, refdata=None, ref_equivalences=None, violins=True, legends=False, **kwargs)¶Automatically plot boxplot distributions for multiple score types of the decoy population.
A part from the fixed options, the function accepst any option of
boxplot()
, except for y
, data
and ax
, which
are used internally by this function.
Parameters: |
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
|
||||||||||
Raises: |
|
Example 1: Raw design population data.
In [1]: from rstoolbox.io import parse_rosetta_file
...: from rstoolbox.plot import multiple_distributions
...: import matplotlib.pyplot as plt
...: df = parse_rosetta_file("../rstoolbox/tests/data/input_2seq.minisilent.gz")
...: values = ["score", "hbond_sr_bb", "B_ni_rmsd", "hbond_bb_sc",
...: "cav_vol", "design_score", "packstat", "rmsd_drift"]
...: fig = plt.figure(figsize=(25, 10))
...: axs = multiple_distributions(df, fig, (2, 4), values=values)
...: plt.tight_layout()
...:
In [2]: plt.show()
In [3]: plt.close()
Example 2: Design population data vs. DB reference.
In [4]: from rstoolbox.io import parse_rosetta_file
...: from rstoolbox.plot import multiple_distributions
...: from rstoolbox.utils import load_refdata
...: import matplotlib.pyplot as plt
...: df = parse_rosetta_file("../rstoolbox/tests/data/input_2seq.minisilent.gz",
...: {'sequence': 'A'})
...: slength = len(df.iloc[0]['sequence_A'])
...: refdf = load_refdata('scop2')
...: refdf = refdf[(refdf['length'] >= slength - 5) &
...: (refdf['length'] <= slength + 5)]
...: values = ["score", "hbond_sr_bb", "B_ni_rmsd", "hbond_bb_sc",
...: "cav_vol", "design_score", "packstat", "rmsd_drift"]
...: fig = plt.figure(figsize=(25, 10))
...: axs = multiple_distributions(df, fig, (2, 4), values=values, refdata=refdf)
...: plt.tight_layout()
...:
In [5]: plt.show()
In [6]: plt.close()