I want to find the communities that holds my seed nodes with at most 8 of its closest interactions.
I've tried the following lines:
genes <- read.table("~/Desktop/connected.txt", header=FALSE, sep="\t")
g=as.matrix(genes)
y <- graph.edgelist(g, directed=FALSE)
seeds <- read.table("~/Desktop/combined.txt", header=TRUE, sep="\t")
seeds <- as.data.frame(sedds)
seeds <- seeds$seednodes
x <- which(farthest.nodes(g) %in% communities(sg) <= 9)
subg <- induced.subgraph(graph=y,vids=unlist(neighborhood(graph=y,order=9,nodes=seednodes)))
Both of these give me 3 communities and only one contains one of my seed nodes, but when I look at the communities using communities(sg), I see more than that.
Any help would be greatly appreciated.
Beni H