The information is currently stored in GRN@connections$TF_genes.filtered. Note that raw p-values are not adjusted.

  corMethod = "pearson",
  nCores = 1,
  forceRerun = FALSE



Object of class GRN


Character. One of pearson, spearman or bicor. Default pearson. Method for calculating the correlation coefficient. For pearson and spearman , see cor for details. bicor denotes the *biweight midcorrelation*, a correlation measure based on medians as calculated by WGCNA::bicorAndPvalue. Both spearman and bicor are considered more robust measures that are less prone to be affected by outliers.


Integer >0. Default 1. Number of cores to use. A value >1 requires the BiocParallel package (as it is listed under Suggests, it may not be installed yet).


TRUE or FALSE. Default FALSE. Force execution, even if the GRN object already contains the result. Overwrites the old results.


An updated GRN object, with additional information added from this function.


# See the Workflow vignette on the GRaNIE website for examples
GRN = loadExampleObject()
#> Downloading GRaNIE example object from
#> INFO [2023-12-10 14:45:26] Storing GRN@data$RNA$counts matrix as sparse matrix because fraction of 0s is > 0.1 (0.44)
#> Finished successfully. You may explore the example object. Start by typing the object name to the console to see a summaty. Happy GRaNIE'ing!
GRN = add_TF_gene_correlation(GRN, forceRerun = FALSE)
#> INFO [2023-12-10 14:45:26] Calculate correlations for TF and genes from the filtered set of connections
#> INFO [2023-12-10 14:45:26]  Real data
#> INFO [2023-12-10 14:45:27]   Iterate through 582 TF-gene combinations and (if possible) calculate correlations using 1 cores. This may take a few minutes.
#> INFO [2023-12-10 14:45:28]  Finished execution using 1 cores. TOTAL RUNNING TIME: 0.5 secs
#> INFO [2023-12-10 14:45:28]   Done. Construct the final table, this may result in an increased number of TF-gene pairs due to different TF names linked to the same Ensembl ID.
#> INFO [2023-12-10 14:45:28]  Permuted data
#> INFO [2023-12-10 14:45:28]  Nothing to do, skip.
#> INFO [2023-12-10 14:45:28] Finished successfully. Execution time: 1.7 secs