rstoolbox.components.DesignFrame.get_label

DesignFrame.get_label(label, seqID=None)

Return the content(s) of the labels of interest as a Selection for a given sequece.

If only one seqID is available, it will automatically pick labels for that, even if other data is present; otherwise, seqID must be provided. This takes into account availability of sequence, structure and psipred data.

Parameters:
  • label (str) – Label identifier. Will be uppercased.
  • seqID (str) – Identifier of the sequence of interest.
Returns:

Selection

Raises:
TypeError:if the data container is not DataFrame or Series.
KeyError:If seqID is not specified and more than one seqID is possible.
KeyError:If the column lbl_<label> cannot be found.

Example

In [1]: from rstoolbox.io import parse_rosetta_file
   ...: 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_2seq.minisilent.gz",
   ...:                         {'labels': ['MOTIF', 'CONTACT', 'CONTEXT'],
   ...:                          'sequence': 'A'})
   ...: df.get_label('CONTACT', 'A')
   ...: df.get_label('CONTACT', 'B')
   ...: 
Out[1]: 
0    (9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 35, 37, 38, 39, 40, 67, 68, 70, 71, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116)
1    (9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 29, 31, 32, 35, 37, 38, 39, 40, 67, 68, 70, 89, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)                 
2    (6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 35, 37, 38, 39, 40, 67, 68, 70, 89, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)          
3    (6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 29, 31, 32, 35, 37, 39, 40, 67, 68, 70, 89, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)                  
4    (9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 29, 31, 32, 35, 37, 38, 39, 40, 67, 68, 89, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)                             
5    (9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 29, 31, 32, 35, 37, 39, 40, 67, 68, 70, 89, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)                         
Name: lbl_CONTACT, dtype: object