metaloci.tools package

Subset of modules that run the METALoci pipeline.

Submodules

metaloci.tools.figure module

This script generates METALoci plots from METALoci objects. The object needs to have a Kamakawa-Kawai layout and a Local Moran’s I already calculated. It will generate the following plots:

  • HiC matrix

  • Signal plot

  • Kamada-Kawai layout

  • Local Moran’s I scatterplot

  • Gaudí plot for signal

  • Gaudí plot for LMI quadrant

and a composite image with all of the above.

metaloci.tools.figure.get_figures(row: Series, args: Series, progress=None, counter: int = None, silent: bool = True)

Function to generate the figures for a given region, given that there is a .mlo file associated with it.

Parameters:
  • row (pd.Series) – Row from the DataFrame containing the regions of interest.

  • args (pd.Series) – Arguments parsed from the user input.

  • progress (mp.Manager().dict) – Dictionary to keep track of the progress in multiprocessing.

  • counter (int) – Counter for the region being processed.

  • silent (bool) – Flag to enable or disable the print statements. Useful for multiprocessing.

metaloci.tools.figure.run(opts: list)

Function to run this section of METALoci with the needed arguments

Parameters:

opts (list) – List of arguments

metaloci.tools.layout module

Given a Hi-C and a region, this script creates a Kamada-Kawai layout for said region.

metaloci.tools.layout.get_region_layout(row: Series, args: Series, progress=None, counter: int = None, silent: bool = True)

Function to get the Kamada-Kawai layout for a given region

Parameters:
  • row (pd.Series) – Data of the region

  • args (pd.Series) – pd.Series with all the needed argument info to run the function

  • progress (optional) – Information about if this region has been completed, by default None

  • counter (int, optional) – Counter used for when multiprocessing is not active, by default None

  • silent (bool, optional) – Flag to enable or disable the print statements. Useful for multiprocessing.

metaloci.tools.layout.run(opts: list)

Funtion to run this section of METALoci with the needed arguments.

Parameters:

opts (list) – List of arguments.

metaloci.tools.ml module

Adds signal data to a Kamada-Kawai layout and calculates Local Moran’s I for every bin in the layout.

metaloci.tools.ml.get_lmi(row: Series, args: Series, progress=None, counter: int = None, silent: bool = True)

This function get the Local Moran’s I given the arguments.

Parameters:
  • row (pd.Series) – Data of the region.

  • args (pd.Series) – pd.Series with all the needed argument info to run the function.

  • progress (optional) – Information about if this region has been completed, by default None.

  • counter (int, optional) – Counter used for when multiprocessing is not active, by default None.

  • silent (bool, optional) – Flag to enable or disable the print statements. Useful for multiprocessing.

Raises:

Exception – Exception to handle if the user puts “extra” signals.

metaloci.tools.ml.run(opts)

Funtion to run this section of METALoci with the needed arguments.

Parameters:

opts (list) – List of arguments.

metaloci.tools.prep module

Processes signal .bed files or .bedGraph files, binnarizing them at a given resolution, merging all signals in the same dataframe and subsetting by chromosomes.

metaloci.tools.prep.run(opts: list)

Funtion to run this section of METALoci with the needed arguments.

Parameters:

opts (list) – List of arguments.