rotifer.interval.utils.architecture#
- rotifer.interval.utils.architecture(df, reference=['query'], collapse='hit', start='qstart', end='qend', maximum_overlap=0.4, criteria={'probability': False, 'region_length': False, 'score': False, 'sum_probs': False})[source]#
This function builds a compact representation of all non-overlapping regions for a given reference column.
It is often used to produce a compact protein domain architecture table
The input Pandas DataFrame must contain columns corresponding to unidimensional interval coordinates (start and end columns) and at least one reference column (e.g. pid or sequence).
- Parameters:
- dfPandas dataframe
The dataframe must have at least a reference column and coordinates
- reference(list of) strings, default [‘query’]
Name of the column storing sequence identifiers
- collapse(list of) strings, default ‘hits’
Name of the column storing region identifiers
- startstring, default estart
Name of the column with the first coordinate of each interval
- endstring, default eend
Name of the column with the last coordinate of each interval
- maximum_overlapinteger, default 0.1 (10% of the shortest)
Maximum number of overlapping residues to ignore. If maximum_overlap < 1, the parameter is treated as a percentage
- criteriaordered dictionary
Criteria for best interval selection.
Keys in this dictionary must match column names in the input Pandas DataFrame. Values should be booleans (True or False).
‘region_length’ is an exception: this column is automatically calculated from the start and end coordinates of each region.
A True value for a given column will give precedence for rows with the smallest value in that column. A False value will select rows with the largest values.
Examples
HH-suite results based on the largest probability and/or region length:
>>> from rotifer.interval.utils import architecture >>> df = pd.read_csv("results.hhsuite2table.tsv", sep=" ") >>> dfc = architecture(df, start='qstart', end='qend', criteria=c)