
Sft = pickSoftThreshold(datExpr, powerVector=powers, verbose =5, networkType="signed") #call network topology analysis function Powers = c(c(1:10), seq(from =10, to=30, by=1)) #choosing a set of soft-thresholding powers # Choose a soft threshold power- USE A SUPERCOMPUTER IRL. This is provided in the attached R script. It is suggested that you cluster samples by expression to identify any outliers before this step. These are easy to do and are well documented in the online tutorials. Save(datExpr, datTraits, file="SamplesAndTraits.RData")Īt this point you will need to identify sample outliers and choose a soft threshold power. # Expression data is in datExpr, corresponding traits are datTraits # You have finished uploading and formatting expression and trait data Table(rownames(datTraits)=rownames(datExpr)) #should return TRUE if datasets align correctly, otherwise your names are out of order #form a data frame analogous to expression data that will hold the clinical traits. #Create an object called "datTraits" that contains your trait dataĭatTraits = read.csv("Traits_23May2015.csv") # printFlush(paste("Removing samples:", paste(rownames(datExpr), collapse=", "))) # printFlush(paste("Removing genes:", paste(names(datExpr), collapse= ", "))) If not, we remove the offending genes and samples from the data with the following: #If the last statement returns TRUE, all genes have passed the cuts. Gsg = goodSamplesGenes(datExpr, verbose = 3) # Run this to check if there are gene outliers # Manipulate file so it matches the format WGCNA needsĭatExpr = as.ame(t(datExpr)) # now samples are rows and genes are columnsĭim(datExpr) # 48 samples and 1000 genes (you will have many more genes in reality) Head(datExpr) # You see that genes are listed in a column named "X" and samples are in columns # This creates an object called "datExpr" that contains the normalized counts file output from DESeq2ĭatExpr = read.csv("SampleTimeSeriesRLD.csv") # Uploading data into R and formatting it for WGCNA # Load WGCNA and flashClust libraries every time you open R
#WGCNA EXPORT TO CYTOSCAPE INSTALL#
# Only run the following commands once to install flashClust if needed
