rstoolbox.plot.
distribution_quality
(df, refdata, values, ascending, names, fig)¶Locate the quantile position of each putative DesingSerie
in a list of score distributions.
Parameters: |
|
||||||||
---|---|---|---|---|---|---|---|---|---|
Returns: | |||||||||
Raises: |
|
Example:
In [1]: from rstoolbox.plot import distribution_quality
...: from rstoolbox.utils import load_refdata
...: import matplotlib.pyplot as plt
...: df = load_refdata('scop')
...: qr = pd.DataFrame([['2F4V', 'C'], ['3BFU', 'B'], ['2APJ', 'C'],
...: ['2C37', 'V'], ['2I6E', 'H']],
...: columns=['pdb', 'chain'])
...: qr = qr.merge(df, on=['pdb', 'chain'])
...: refs = []
...: for i, t in qr.iterrows():
...: refs.append(df[(df['length'] >= (t['length'] - 5)) &
...: (df['length'] <= (t['length'] + 5))])
...: fig = plt.figure(figsize=(25, 6))
...: ax = distribution_quality(df=qr, refdata=refs,
...: values=['score', 'pack', 'avdegree',
...: 'cavity', 'psipred'],
...: ascending=[True, False, True, True, False],
...: names=['pdb', 'chain'], fig=fig)
...: plt.tight_layout()
...:
In [2]: plt.show()
In [3]: plt.close()