pybedtools.bedtool.BedTool.random_jaccard

BedTool.random_jaccard(other, genome_fn=None, iterations=None, processes=1, _orig_pool=None, shuffle_kwargs=None, jaccard_kwargs=None)[source]

Computes the naive Jaccard statistic (intersection divided by union).

Note

If you don’t need the randomization functionality of this method, you can use the simpler BedTool.jaccard method instead.

See Favorov et al. (2012) PLoS Comput Biol 8(5): e1002529 for more info on the Jaccard statistic for intersections.

If iterations is None, then do not perform random shufflings.

If iterations is an integer, perform iterations random shufflings, each time computing the Jaccard statistic to build an empirical distribution. genome_fn will also be needed; optional processes will split the iteations across multiple CPUs.

Returns a tuple of the observed Jaccard statistic and a list of the randomized statistics (which will be an empty list if iterations was None).