rotifer.interval.utils.complement#
- rotifer.interval.utils.complement(df, include=True, exclude=False, add=False, reference='ID', start='start', end='end')[source]#
Given a DataFrame describing regions in one-dimensional reference systems, return a similar DataFrame describing the set of regions required to fully cover all the length of the references.
The input table is expected to include one or more columns describing the reference object and a pair of integer columns corresponding to the start and end positions of each region.
If a column with the length of each interval is supplied, the last interval and the length of each fragment will be included in the returned dataframe.
- Parameters:
- dfPandas dataframe
The dataframe must have at least a reference column and coordinates
- include: list
- exclude: list
- add: dict
- reference(list of) strings, default [‘sequence’]
Name of the column(s) storing sequence identifiers
- startstring, default ‘start’
Name of the column with the first coordinate of each interval
- endstring, default ‘end’
Name of the column with the last coordinate of each interval