arcfish.tl.LoopTestAbstract#

class arcfish.tl.LoopTestAbstract(adata: AnnData)#

Abstract class for each test alternative. Every testing object passed to LoopCaller must implement the methods in this class.

Parameters:

adata (AnnData) – adata of a single chromosome, created by arcfish.pp.FOF_CT_Loader.create_adata().

abstract __init__(adata: AnnData)#

Methods

__init__(adata)

append_pval(result, cut_lo, cut_up, outer_cut)

Performing tests and append the test results to the dictionary passed in.

append_summit(result)

How to define loop summit from each loop cluster.

ij_background(i, j, d1d, outer_cut)

Define the local background for the (i,j) entry.

abstract static ij_background(i: int, j: int, d1d: ndarray, outer_cut: int) ndarray#

Define the local background for the (i,j) entry.

Parameters:
  • i (int) – Index of the first locus.

  • j (int) – Index of the second locus.

  • d1d ((p,) np.ndarray) – Array of 1D genomic locations of imaging loci.

  • outer_cut (int) – Loci with 1D genomic distance within outer_cut from the target locus is included in the local background.

Returns:

A boolean matrix with background entries equal to True.

Return type:

(p, p) np.ndarray

abstract append_pval(result: dict, cut_lo: int, cut_up: int, outer_cut: int)#

Performing tests and append the test results to the dictionary passed in. Must add stat and pval as keys to result, with the values being (p,p) matrix. Can also add other key-value pairs.

Parameters:
  • result (dict) – The result dictionary to add testing results.

  • cut_lo (float) – Minimum loop size.

  • cut_up (float) – Maximum loop size.

  • outer_cut (int) – Loci with 1D genomic distance within outer_cut from the target locus is included in the local background.

abstract append_summit(result: dict)#

How to define loop summit from each loop cluster.

Loop candidates within the same cluster will have the same number in result[“label”]. Add a boolean (p,p) matrix to result[“summit”], where entries equal to True are the selected loop summit for each cluster.

Parameters:

result (dict) – The result dictionary to add summit.