У меня следующая проблема с
WGCNA - http://labs.genetics.ucla.edu/horvath/htdocs/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/
Работа над Разделом 1.6, Экспорт сетей во внешнее программное обеспечение (Cytoscape)
В настоящее время я пытаюсь выполнить WGCNA для набора генов, и у меня возникают проблемы с получением генов верхнего х-хаба для каждого модуля. Я пытаюсь экспортировать сеть в Cytoscape и использовал тот же метод для получения генов верхнего х-хаба, как описано для экспорта в VisANT.
# Select modules (only interested in one for now)
modules = c("greenyellow")
# Select module probes
probes = names(datExpr)
inModule = is.finite(match(bwModuleColors, modules))
modProbes = probes[inModule]
modGenes = annot$gene_symbols[match(modProbes, annot$geneID)]
# Select the corresponding Topological Overlap
modTOM = TOM[inModule, inModule]
dimnames(modTOM) = list(modProbes, modProbes)
# Restrict the network to the top 30 genes
nTop = 30
IMConn = softConnectivity(datExpr[, modProbes]
top = (order(-IMConn) <= nTop)
# Export the network into a fomat that Cytoscape can read
cyt = exportNetworkToCytoscape(modTOM[top, top],
edgeFile = paste("CytoscapeInput-edges-", paste(modules, collapse="-"), ".txt", sep = ""),
nodeFile = paste("CytoscapeInput-nodes-", paste(modules, collapse="-"), ".txt", sep = ""),
weight = TRUE,
threshold = 0.02,
nodeNames = modProbes,
altNodeNames = modGenes,
nodeAttr = bwModuleColors[inModule])
Я написал короткий цикл для подсчета количества связей с каждым геном, и он работает, как ожидалось, но x-й ген постоянно имеет нулевые связи. Предположим, что x равно 30. Если я увеличу отсечение до 31 гена-концентратора, 30-й ген теперь показывает связи с другими в сети, но 31-й ген ничего не показывает. Кроме того, это изменение увеличивает И уменьшает количество соединений с другими генами в сети. Это меня действительно беспокоит, потому что связи следует только добавлять, поскольку сеть увеличивается на один ген, и изменения должны объясняться 30-м геном, но это не относится к выходным данным.
# Split the cytoscape file into two parts: edge and node
node <- cyt$nodeData
edge <- cyt$edgeData
# The limit covers all of the connections in the edge file by determining the length of the column ‘fromNode’
limit <- length(edge$fromNode)
# Create an empty list to store the counts for each gene
counts = list()
# Loop for the genes going from 1 to the number of genes specified for the network, ‘nTop’
for (i in 1:nTop) {
# Reset the count for each new gene and specify the names of the gene of interest and the matching genes
name = node$nodeName[[i]]
count = 0
# Nested loop that searches for matches to the gene in question in both the ‘fromNode’ and ‘toNode’columns, and adds one to the count for each match.
for (j in 1:limit) {
matchName1 = edge$fromNode[[j]]
matchName2 = edge$toNode[[j]]
if (name == matchName1 || name == matchName2)
{count = count + 1}
}
# Create a string for the attribute in the correct format
attribute <- paste(name, "=", count)
# Adds the count to the list
counts <- c(counts, attribute)
}
# End of loop
Кажется, что цикл работает должным образом, поэтому я думаю, что проблема в построении сети. В настоящее время я возвращаюсь к тому, что знаю о линейной алгебре, матрицах и топологии, чтобы попытаться понять, заключается ли проблема в способе их сортировки или в чем-то подобном, но это может быть просто способ, которым функция exportNetworkToCytoscape () работает.