arcfish.tl.loop_overlap#

arcfish.tl.loop_overlap(test_df: DataFrame | str, true_df: DataFrame | str, offset: float = 0) DataFrame#

For each locus pair (row) in test_df, return 3 if the locus air also presents in true_df (pair presents -> both loci overlapped); return 1 if one of the two loci presents in true_df; and return 2 if both loci present but they never present in the same row of true_df. If offset is not 0, overlap is defined as within offset away from each other.

Parameters:
  • test_df (pd.DataFrame | str) – If a DataFrame, must has “c1”, “s1”, “e1”, “c2”, “s2”, “e2” as column names. If a str, will read from the file named test_df. The file is delimited by tab and either has the column names listed above or has no column names.

  • true_df (pd.DataFrame | str) – Same format as test_df.

  • offset (float, optional) – How to define overlapped intervals, by default 0.

Returns:

Same format and length as test_df, with an additional overlapped column.

Return type:

pd.DataFrame