cytoscape 输入数据

  1. my_modules <- c("red")
  2. i = paste(my_modules, collapse = "_")
  3. # paste(c("red", "black", "green"), collapse = "_")
  4. # #> [1] "red_black_green"
  5. m_wgcna_result <- wgcna_result %>% filter(module %in% my_modules)
  6. m_datExpr <- datExpr[, m_wgcna_result$gene_id]
  7. # 计算该模块的 TOM 矩阵
  8. m_TOM <- TOMsimilarityFromExpr(
  9. m_datExpr,
  10. power = sft$powerEstimate,
  11. networkType = "unsigned",
  12. TOMType = "unsigned")
  13. dimnames(m_TOM) <- list(colnames(m_datExpr), colnames(m_datExpr))
  14. edge <- paste("CytoscapeInput-network.", i, ".txt", sep = "")
  15. node <- paste("CytoscapeInput-node.", i, ".txt", sep = "")
  16. # 导出 Cytoscape 输入文件
  17. cyt <- exportNetworkToCytoscape(
  18. m_TOM,
  19. edgeFile = edge,
  20. nodeFile = node,
  21. weighted = TRUE,
  22. threshold = 0.1)