Skip to contents

This function is used to conver the list generated by get_net2target_list() to a matrix of mutual information signed by Spearman correlation coefficient, sources by targets. This is an internal function for cal_Activity(), getActivity_individual(), getActivity_inBatch().

Usage

get_target_list2matrix(target_list = NULL, activity_method = "mean")

Arguments

target_list

a list of source genes returned by get_net2target_list(), for each source gene, the value if a data frame with "target", "MI" and "spearman" as the columns,

activity_method

Character, method used to calculate the activity: "mean" (the default), "weightedmean", "absmean" or "maxmean".

Value

If "weightedmean" is given, it returns a matrix of signed (by Spearman correlation coefficient) mutual information, the sign of which will be used for activity calculation. For all the other methods ("mean", "absmean" or "maxmean"), it returns a matrix of 1.

Examples

net_data <-  read.table(system.file("extdata/demo_pbmc14k/SJARACNe/B/TF/bt100_pc001/consensus_network_ncol_.txt", package = "scMINER"),
                        header = TRUE, sep = "\t", stringsAsFactors = FALSE, quote = "",
                        colClasses = c("character", "character", "character", "character", "numeric", "numeric", "numeric", "numeric", "numeric"))
target_list <- get_net2target_list(net_data)

weight_matrix <- get_target_list2matrix(target_list)