scglue.genomics.window_graph

scglue.genomics.window_graph(left, right, window_size, left_sorted=False, right_sorted=False, attr_fn=None)[源代码]

Construct a window graph between two sets of genomic features, where features pairs within a window size are connected.

参数:
  • left (typing.Union[scglue.genomics.Bed, str]) – First feature set, either a Bed object or path to a bed file

  • right (typing.Union[scglue.genomics.Bed, str]) – Second feature set, either a Bed object or path to a bed file

  • window_size (int) – Window size (in bp)

  • left_sorted (bool) – Whether left is already sorted

  • right_sorted (bool) – Whether right is already sorted

  • attr_fn (typing.Optional[typing.Callable[[pybedtools.cbedtools.Interval, pybedtools.cbedtools.Interval, float], typing.Mapping[str, typing.Any]]]) –

    Function to compute edge attributes for connected features, should accept the following three positional arguments:

    • l: left interval

    • r: right interval

    • d: signed distance between the intervals

    By default no edge attribute is created.

返回类型:

MultiDiGraph

返回:

graph – Window graph