rstoolbox.plot.positional_sequence_similarity_plot

rstoolbox.plot.positional_sequence_similarity_plot(df, ax, identity_color='green', similarity_color='orange')

Generates a plot covering the amount of identities and positives matches from a population of designs to a reference sequence according to a substitution matrix.

Input data can/should be generated with positional_sequence_similarity().

Parameters:
  • df (DataFrame) – Input data, where rows are positions and columns are identity_perc and positive_perc
  • ax (Axes) – matplotlib axis to which we will plot.
  • identity_color (str) – Color assigned to identity matches.
  • similarity_color (str) – Color assigned to similarity matches.
Raises:
ValueError:If the data container is not DataFrame.

Example

In [1]: from rstoolbox.io import get_sequence_and_structure, parse_rosetta_file
   ...: from rstoolbox.analysis import positional_sequence_similarity
   ...: from rstoolbox.plot import positional_sequence_similarity_plot
   ...: import matplotlib.pyplot as plt
   ...: baseline = get_sequence_and_structure('../rstoolbox/tests/data/2pw9C.pdb')
   ...: df = parse_rosetta_file('../rstoolbox/tests/data/input_ssebig.minisilent.gz',
   ...:                         {'sequence': 'C'})
   ...: df.add_reference_sequence('C', baseline.get_sequence('C'))
   ...: df.add_reference_shift('C', 32)
   ...: seqsim = positional_sequence_similarity(df, 'C')
   ...: fig = plt.figure(figsize=(30, 10))
   ...: ax = plt.subplot2grid((1, 1), (0, 0))
   ...: positional_sequence_similarity_plot(seqsim, ax)
   ...: 

In [2]: plt.show()

In [3]: plt.close()
../_images/positional_sequence_similarity_plot_docs.png