Skip to content

Builds and caches the document-level link table, document-term table, sparse document-term matrix, and summary metadata used by Module 3 topic modeling.

Usage

module3_construct_docs(
  filtered_dir,
  output_dir,
  tf_cluster_map = NULL,
  check_repeated_values = FALSE,
  condition_document_unit = c("condition_tf", "condition"),
  condition_gene_token_fraction = 0.6,
  condition_document_token_budget = 1000000L,
  condition_specificity_temperature = 0.5,
  condition_specificity_floor = 0.1,
  ...
)

Arguments

filtered_dir

Directory containing Module 3 filtered differential-link CSV files.

output_dir

Directory where topic input caches are written.

tf_cluster_map

Named vector mapping TF names to motif clusters.

check_repeated_values

Warn about repeated inconsistent term values. The high-throughput default is `FALSE`; set to `TRUE` for diagnostic audits.

condition_document_unit

Condition-mode document unit. The standard `"condition_tf"` value builds one document per condition and TF. Experimental `"condition"` builds one document per condition from unique Gene and coordinate Peak terms.

condition_gene_token_fraction

Exact fraction of model tokens allocated to Gene terms in each condition document.

condition_document_token_budget

Exact total model tokens allocated to each condition document.

condition_specificity_temperature

Positive temperature controlling condition-specific feature weighting for condition documents.

condition_specificity_floor

Uniform baseline retained during condition-specific feature weighting.

...

Additional topic-document construction arguments passed to the internal Module 3 document builder.

Value

A list with cache paths and input summary counts.