This function generates BED files for each topic based on the provided topic annotations. Each BED file is saved into its own folder, and a list of output folder paths is returned.

get_annot_beds(topics_res, output_dir, fuzzy = FALSE, cutoff = 0.9)

Arguments

topics_res

A list containing the factor matrices Fmat and Lmat, differential expression results de_res, and p-values matrix p_jk.

  • Fmat: A matrix containing factor loadings (peaks x topics).

  • Pmat: A matrix of p-values or probabilities (peaks x topics). Rows correspond to peaks with names in the format "chr:start-end". Columns correspond to topics.

output_dir

A character string specifying the base output directory for the BED files.

fuzzy

Logical value indicating whether to create fuzzy annotations (default: FALSE).

cutoff

Numeric value specifying the cutoff for binary annotations when fuzzy = FALSE (default: 0.9).

Value

A list of output folder paths (bed_dir_list), one for each topic.