GRN object.add_TF_gene_correlation.RdThe information is currently stored in GRN@connections$TF_genes.filtered. Note that raw p-values are not adjusted.
add_TF_gene_correlation(
GRN,
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 https://git.embl.de/grp-zaugg/GRaNIE/-/raw/master/data/GRN.rds
#> INFO [2023-08-16 17:27:16] 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-08-16 17:27:17] Calculate correlations for TF and genes from the filtered set of connections
#> INFO [2023-08-16 17:27:17] Real data
#> INFO [2023-08-16 17:27:17] Iterate through 582 TF-gene combinations and (if possible) calculate correlations using 1 cores. This may take a few minutes.
#> INFO [2023-08-16 17:27:18] Finished execution using 1 cores. TOTAL RUNNING TIME: 0.3 secs
#>
#> INFO [2023-08-16 17:27:18] 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-08-16 17:27:18] Permuted data
#> INFO [2023-08-16 17:27:18] Nothing to do, skip.
#> INFO [2023-08-16 17:27:18] Finished successfully. Execution time: 1.3 secs