I am performing the network analysis with WGCNA and at the very last step I have to export the network file in VisANT readable format in order to visualize the gene network in external software VisANT.
But the problem is whenever, I am exporting gene network from R version 3.6.1 the gene ids are replaced with "NA", I dont have any clue what is problem with that. Also i am attaching the image of unexpectedoutput file .
I am following WGCNA tutorial by Steve Horvath, the commands are as follows with some modification according to my data:
Recalculate topological overlap
TOM = TOMsimilarityFromExpr(datExpr, power=8)
annot = read.csv(file = "GeneAnnotation.csv"); module = "darkolivegreen"
Select module probes
probes = names(datExpr) inModule = (moduleColors==module); modProbes = probes[inModule]; probes = names(datExpr) inModule = (moduleColors==module) modProbes = probes[inModule]
Select the corresponding Topological Overlap
modTOM = TOM[inModule, inModule]
Because the module is rather large,
we focus on the 20 top intramodular hub genes
nTopHubs = 20
intramodular connectivity
vis = exportNetworkToVisANT(modTOM, file = paste("VisANTInput11-", module, ".txt", sep=""), weighted = TRUE, threshold = 0)
kIN = softConnectivity(datExpr[, modProbes]) selectHubs = (rank (-kIN) <= nTopHubs)
vis = exportNetworkToVisANT(modTOM[selectHubs,selectHubs],
file=paste("VisANTInput12-", module, "-top20.txt", sep=""),
weighted=TRUE,threshold = 0, probeToGene=
data.frame(GeneAnnotation$GeneId, GeneAnnotation$Gene start (bp)
))
Does any one has a clue what i am doing wrong? or is it some installation problem with R.
All suggestions are welcome.
Thank you in advance.