Learn R Programming

ProCoNA (version 1.10.0)

moduleMemberCorrelations: moduleMemberCorrelations

Description

Computes the relation between peptides and eigenvector summaries and also peptides and phenotypes.

Usage

moduleMemberCorrelations(pnet, pepdat, phenotypes)

Arguments

pnet
The peptide net object
pepdat
The peptide data matrix
phenotypes
The matrix of traits

Value

Examples

Run this code
data(ProCoNA_Data)
#net1 <- buildProconaNetwork("peptide network", peptideData)
n <- length(samples(net1))
phenotypes <- matrix(rnorm(10*n), nrow=60)
pepcor <- moduleMemberCorrelations(net1, peptideData, phenotypes)

# To plot the heatmap: 
# moduleCors <- correlationWithPhenotypesHeatMap(net1, phenotypes, modules = 1:5, 
#    plot = NULL, title = "Module-trait relationships", textSize = 0.5)

#########################################################################
# quick function to write out the tables for specific modules.
#moduleData <- function(pepnet, pepcors, module, pepinfo, fileprefix) {
#  moduleX <- pepnet@peptides[which(pepnet@mergedColors==module)]
#  moduleInfo <- pepinfo[which(pepinfo$Mass_Tag_ID %in% moduleX),]
#  moduleCors <- pepcors[which(pepcors$Module==module),]
#  corname <- paste(fileprefix, "_correlations.csv", sep="")
#  write.table(moduleCors, file=corname, sep=",", row.names=F)
#  infoname <- paste(fileprefix, "_peptide_info.csv", sep="")
#  write.table(moduleInfo, file=infoname, sep=",", row.names=F)
#}
########################################################################

# WRITE OUT A TABLE WITH THE BELOW FUNCTION CALL  :)#
# moduleData(peptideNetwork, pepcor, 1, masstagdb, "Module_1")

Run the code above in your browser using DataLab