2012-10-29 6 views
3

나는이R WGCNA Cytoscape 허브 유전자

WGCNA 다음과 같은 문제 - http://labs.genetics.ucla.edu/horvath/htdocs/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/

는 1.6 절에서 작업, 외부 소프트웨어로 네트워크의 수출 (Cytoscape) 나는 현재 수행하기 위해 노력하고있어

WGCNA를 일련의 유전자에 적용하면 각 모듈의 최상위 x 허브 유전자를 확보하는 데 어려움을 겪고 있습니다. Cytoscape에 네트워크를 내보내려고하고 있는데 Visant로 내보내기 위해 요약 된대로 상위 x 허브 유전자를 얻는 데 같은 방법을 사용했습니다.

# 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() 함수 공장.

+2

아마도이 질문을 할 수 있습니다 : http://www.biostars.org/ – PhiS

답변

-1

modules = "brown";

probes = rownames (datExpr_human) ======> 행의 데이터 유전자와 열의 샘플.

inModule = is.finite (매치 (modules_human 모듈))

modTOM = dissTOM_Human [inModule, inModule];

modProbes = probes [inModule];

dimnames (modTOM) = 목록 (modProbes, modProbes)

NTOP = 30;

datExpr = t (datExpr_human)

IMConn = softConnectivity (datExpr [modProbes]);

가기 = (랭크 (-IMConn) < = NTOP)

CYT = exportNetworkToCytoscape (modTOM [위쪽, 위쪽, edgeFile = 페이스트 ("CytoscapeInput-edges-"페이스트 (모듈 붕괴 = " ",".txt ", sep =" "), nodeFile = paste ("CytoscapeInput-nodes- ", paste (모듈, 축소 ="- "),".txt ", sep =" "), weighted = TRUE)