Skip to contents

Get Consensus Membership of Genes in Metagene Communities

Usage

get_gene_community_membership(
  consensus_comms,
  network_membership_list,
  min_studies = 2,
  include_nonmembers = FALSE,
  compress = TRUE,
  rank_based = TRUE
)

Arguments

consensus_comms

communities output from MCL::mcl(), a list containing elements Cluster with a vector of the cluster associated with each index.

network_membership_list

a list containing community membership scores for each network. Where rownames contain unique gene ids and column names are community names

min_studies

the minimum threshold of studies/datasets indicating a gene belongs to a community. In a given dataset, a gene "belongs" to a community if the gene's highest loading corresponds to that community.

include_nonmembers

include_nonmembers which do not appear in a community.

compress

indicates whether to drop duplicate community metagenes. Assumes first one is the one to keep (largest or best). Currently only TRUE is supported

rank_based

flag indicating whether to use rank when determing max metagene. Currently only TRUE is supported

Value

data.frame containing gene ids and their associated most likely cluster(s) in $cluster and $n_studies, representing the number of studies or datasets indicating a gene belongs to the most associated community. In a given dataset, a gene "belongs" to a community if the gene's highest loading corresponds to that community.

Examples

if (FALSE) {
memb_list <- list(
  GSE39582 = GSE39582_icwgcna$community_membership,
  READ = read_icwgcna$community_membership,
  COAD = coad_icwgcna$community_membership
)
ma <- construct_rbh_correlation_based(
  memb_list,
  upper_quant = .99,
  lower_quant = .05,
  max_rank = 2
)
consensus_comms <- detect_consensus_communities(ma)
consensus_genes <- get_gene_community_membership(consensus_comms, memb_list, 2)
}