rstoolbox.analysis.secondary_structure_percentage

rstoolbox.analysis.secondary_structure_percentage(df, seqID, key_residues=None)

Calculate the percentage of the different secondary structure types.

Requires secondary structure data.

Adds 3 new columns to the data container:

New Column Data Content
structure_<seqID>_H Percentage of alpha helices in the structure.
structure_<seqID>_E Percentage of beta sheets in the structure.
structure_<seqID>_L Percentage of loops in the structure.
Parameters:
Returns:

Union[DesignFrame, DesignSeries]

Raises:
NotImplementedError:
 if the data passed is not in Union[DesignFrame, DesignSeries].
KeyError:if there is no structure information for chain seqID of the decoys.

Example

In [1]: from rstoolbox.io import parse_rosetta_file
   ...: from rstoolbox.analysis import secondary_structure_percentage
   ...: import pandas as pd
   ...: pd.set_option('display.width', 1000)
   ...: pd.set_option('display.max_columns', 500)
   ...: df = parse_rosetta_file("../rstoolbox/tests/data/input_ssebig.minisilent.gz",
   ...:                         {'scores': ['score'], 'structure': 'C'})
   ...: df = secondary_structure_percentage(df, 'C')
   ...: df.head()
   ...: 
Out[1]: 
    score                                                 structure_C  structure_C_H  structure_C_E  structure_C_L
0 -64.070  LEEEEEEELLLEEEEEEELLLLHHHHHHHHHHHHLLLLLLLLLLLEEEELLLEEEELL  0.206897       0.379310       0.413793     
1 -70.981  LEEEEEEELLEEEEEEEELLLLHHHHHHHHHHHLLLLLLLLLLLEEEELLLLLEEEEL  0.189655       0.396552       0.413793     
2 -43.863  LEEEEEEELLEEEEEEEELLLLHHHHHHHHHHHHLLLLLLLLLLEEEEELLLEEEEEL  0.206897       0.431034       0.362069     
3 -75.847  LLLEEEEELLEEEEEELLLLLLHHHHHHHHHHHHLLLLLLLLLLEEEEELLLEEEEEL  0.206897       0.362069       0.431034     
4 -55.347  LEEEEEEELLLEEEEEEELLLLHHHHHHHHHHHHLLLLLLLLLLLEEEELLLEEEELL  0.206897       0.379310       0.413793