This function runs the GRaNIE pipeline to generate gene regulatory network analyses from peak, RNA, and metadata files.

runGRaNIE(
  dir_output = "output_GRaNIE",
  datasetName = "undescribed",
  file_peaks,
  file_rna,
  file_metadata,
  TFBS_source = "custom",
  HOCOMOCO_version = "v12/H12INVIVO",
  TFBS_folder = NULL,
  TFBS_JASPAR_useSpecificTaxGroup = NULL,
  genomeAssembly = "hg38",
  normalization_peaks = "none",
  idColumn_peaks = "peakID",
  normalization_rna = "none",
  idColumn_RNA = "ENSEMBL",
  includeSexChr = FALSE,
  minCV = 0,
  minNormalizedMean_peaks = NULL,
  minNormalizedMean_RNA = NULL,
  minSizePeaks = 5,
  corMethod = "spearman",
  promoterRange = 250000,
  useGCCorrection = FALSE,
  GC_percBackground_size = 75,
  GC_percBackground_resample = TRUE,
  TF_peak.fdr.threshold = 0.2,
  peak_gene.fdr.threshold = 0.1,
  runTFClassification = FALSE,
  runNetworkAnalyses = FALSE,
  nCores = 4,
  forceRerun = TRUE
)

Arguments

dir_output

Character string specifying the directory where the output files will be saved. Default is `"output_GRaNIE"`.

datasetName

Character string specifying the name of the dataset. Default is `"undescribed"`. This is only used for populating the metadata in the GRaNIE object and has no functional consequence.

file_peaks

Character string specifying the path to the file containing peak data (i.e., one of the output files from `prepareSeuratData_GRaNIE`)

file_rna

Character string specifying the path to the file containing RNA data (i.e., one of the output files from `prepareSeuratData_GRaNIE`)

file_metadata

Character string specifying the path to the file containing metadata (i.e., one of the output files from `prepareSeuratData_GRaNIE`)

TFBS_source

Corresponds to the argument `source` from the method `addTFBS`. For more details, see the GRaNIE package description.

HOCOMOCO_version

Character string specifying the version of the HOCOMOCO database to use. Default is `"v12/H12INVIVO"`.

TFBS_folder

Corresponds to the argument `motifFolder` from the method `addTFBS`. For more details, see the GRaNIE package description.

TFBS_JASPAR_useSpecificTaxGroup

Corresponds to the argument `JASPAR_useSpecificTaxGroup` from the method `addTFBS`. For more details, see the GRaNIE package description.

genomeAssembly

Corresponds to the same-named argument from the method `initializeGRN`. For more details, see the GRaNIE package description.

normalization_peaks

Corresponds to the same-named argument from the method `addData`. For more details, see the GRaNIE package description.

idColumn_peaks

Corresponds to the same-named argument from the method `addData`. For more details, see the GRaNIE package description.

normalization_rna

Corresponds to the same-named argument from the method `addData`. For more details, see the GRaNIE package description.

idColumn_RNA

Corresponds to the same-named argument from the method `addData`. For more details, see the GRaNIE package description.

includeSexChr

Logical value indicating whether to include sex chromosomes in the analysis. Default is `FALSE`.

minCV

Corresponds to arguments `minCV_peaks` and `minCV_genes` from the method `filterData`. Currently, only one value for both modalities can be set. For more details, see the GRaNIE package description.

minNormalizedMean_peaks

Corresponds to the same-named argument from the method `filterData`. For more details, see the GRaNIE package description.

minNormalizedMean_RNA

Corresponds to the same-named argument from the method `filterData`. For more details, see the GRaNIE package description.

minSizePeaks

Corresponds to the same-named argument from the method `filterData`. For more details, see the GRaNIE package description.

corMethod

Character string specifying the correlation method to use (used in multiple functions within the GRaNIE workflow). Options are `"pearson"`, `"spearman"`, etc. Default is `"spearman"`.

promoterRange

Corresponds to the same-named argument from the method `addConnections_peak_geneInteger`. For more details, see the GRaNIE package description.

useGCCorrection

Corresponds to argument `useGCCorrection` from the method `addConnections_TF_peak`. For more details, see the GRaNIE package description.

GC_percBackground_size

Corresponds to argument `percBackground_size` from the method `addConnections_TF_peak`. For more details, see the GRaNIE package description.

GC_percBackground_resample

Corresponds to argument `percBackground_resample` from the method `addConnections_TF_peak`. For more details, see the GRaNIE package description.

TF_peak.fdr.threshold

Corresponds to the same-named argument from the method `filterGRNAndConnectGenes`. For more details, see the GRaNIE package description.

peak_gene.fdr.threshold

Corresponds to the same-named argument from the method `filterGRNAndConnectGenes`. For more details, see the GRaNIE package description.

runTFClassification

Logical value indicating whether to run transcription factor classification (function `AR_classification_wrapper`) in GRaNIE. Default is `FALSE`.

runNetworkAnalyses

Logical value indicating whether to run network analyses from GRaNIE (function `performAllNetworkAnalyses`). Default is `FALSE`.

nCores

Integer value specifying the number of cores to use for parallel processing that is used in multiple functions within the GRaNIE workflow. Default is `4`.

forceRerun

A logical value indicating whether to force rerun the function and re-generate the output even if the output files already exist on disk or in the object. Default is FALSE.

Value

The function processes the dataset and saves the results in the specified output directory.

Examples

if (FALSE) {
# Example usage:
runGRaNIE(
  dir_output = "results/",
  datasetName = "example_dataset",
  file_peaks = "data/peaks.tsv",
  file_rna = "data/rna.tsv",
  file_metadata = "data/metadata.tsv",
  TFBS_source = "JASPAR2024",
  nCores = 8
)
}