detect_blocks

visualife.utils.detect_blocks(secondary_str)

Detects secondary structure blocks (segments)

This function takes a string representing a secondary structure and returns three lists, that contain helices, strands and loops respectively (H, E and C elements). The blocks are detected with consecutive_find() function

For example:

detect_blocks("CEEEEEECCCCCCEEEEEECCHHHHHHHHHHHHHHHCCCCCEEEEECCCCEEEEEC")

should return:

{'H': [[21, 35]], 'E': [[1, 6], [13, 18], [41, 45], [50, 54]], 'C': [[7, 12], [19, 20], [36, 40], [46, 49]]}
Parameters:secondary_str – (string) secondary structure as a string (by default in the HEC code)
Returns:three list of SSEs: for H, E and C, respectively. Each list of SSEs comprises (from, to) two-tuple of integer indexes to define an SSE location in the given secondary structure string