WAD.rocco

WAD.rocco.chrom_solution_to_bed(chromosome: str, intervals, solution, ID: str) str

Convert Rocco-generated vector of decision variables into a BED file

Parameters:
  • chromosome (str) – Chromosome name.

  • intervals (list) – List of interval.

  • solution (list or array) – Solution vector with values in [0, 1], where >0.5 indicates inclusion.

  • ID (str) – Output file name.

Returns:

Path to the generated BED file.

Return type:

str

WAD.rocco.merge_bed_files(bed_files: list, temp_dir: str)

Combine multiple BED files into one merged BED file.

Parameters:
  • bed_files (list of str) – List of paths to the multiple BED files.

  • temp_dir (str) – Path to write the merged BED output.

Returns:

The function writes the merged BED file to temp_dir.

Return type:

None

WAD.rocco.merge_intervals_for_chromosome(intervals)

Merge overlapping intervals for one chromosome.

Parameters:

intervals (list of tuple) – List of (start, end) intervals.

Returns:

List of merged non-overlapping (start, end) intervals.

Return type:

list of tuple

WAD.rocco.rocco_one_chrom(bigwig_file: str, chrom: str, chrom_sizes_file: str, temp_dir: str, step: int = 50, budget: float = 0.03, gamma: float = 1.0, c_1: float = 1.0, c_2: float = -1.0, c_3: float = 1.0)

Run Rocco for a single (cell-type specific BigWig file, chrom) pair.

Parameters:
  • bigwig_file (str) – Path to the cell-type specific bigWig file.

  • chrom (str) – Chromosome name.

  • chrom_sizes_file (str) – Path to chromosome sizes file.

  • temp_dir (str) – Directory to write BED output.

  • step (int, optional) – Window size for bigWig signal extraction (default is 50).

  • budget (float, optional) – Sparsity budget for Rocco (default is 0.03).

  • gamma (float, optional) – Weight parameter for Rocco optimization (default is 1.0).

  • c_1 (float, optional) – Linear term weight for central tendency (default is 1.0).

  • c_2 (float, optional) – Linear term weight for dispersion (default is -1.0).

  • c_3 (float, optional) – Linear term weight for boundary (default is 1.0).

Returns:

Path to the generated BED file.

Return type:

str