igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Find communities of a list of seed nodes and next 8 interac


From: Gábor Csárdi
Subject: Re: [igraph] Find communities of a list of seed nodes and next 8 interactions in the community
Date: Wed, 11 Feb 2015 11:26:19 -0500

I am not sure what you are trying to do here. Can you give a small example with the output you expect? Please also see http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Gabor

On Fri, Feb 6, 2015 at 9:55 AM, Benika H <address@hidden> wrote:
Hi everyone,

I have a list of seed nodes in a file like such :  
hsa-let-7f-2
hsa-let-7f-2
hsa-let-7f-2
hsa-let-7f-2
hsa-mir-106b
hsa-mir-1180
hsa-mir-1228
hsa-mir-1248
hsa-mir-1248

and I have my edgelist that looks like this:
MCCC1 MCCC2
MCCC2 AUH
MCEE MUT
MCEE PCCA
MCF2 CAP1
hsa-mir-1228
COG8
MCF2 COPA
MCF2 COPB2
MCF2 DOCK2
MCF2 GNA13
MCF2 GNG2
 
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

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]