|
From: | Chris Watson |
Subject: | Re: [igraph] Enforcing directions of edges |
Date: | Wed, 4 Feb 2015 18:01:37 -0500 |
Also, just got an errorError in which(c1$csize) : argument to 'which' is not logicalCalls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> whichExecution haltedOn Wed, Feb 4, 2015 at 5:45 PM, Benika H <address@hidden> wrote:Oh ok. I'm new to this. I will send data.hgnc_mapped2.txt is the 1st edgelist (y in my code)newdata.txt is the 2nd edgelist (z in my code)I got an error saying Warning in layout[, 1] + label.dist * cos(-label.degree) * (vertex.size +## : longer object length is not a multiple of shorter object lengthI'm not getting any errors now, but I'm still getting all communities except thrones I requested.On Wed, Feb 4, 2015 at 5:33 PM, Chris Watson <address@hidden> wrote:We can't reproduce your code because we don't have your data. You also don't show any error messages you receive, or how the output/result is different than what you expect to see.On Wed, Feb 4, 2015 at 5:30 PM, Benika H <address@hidden> wrote:_______________________________________________Hi Tamas, Could you help me with my question.I have an edgelist (1st file) which I created the graph object. I want to use walktrap community detection on that network. After getting the communities, I need to plot only the communities with at most 8 vertices and at least 2 vertices (no isolates). Using those communities, I want to join the edgelist from the 2nd file to the matching vertices in a column. Here, I think I can use graph.union. However, I can't seem to get the communities with a sizes 2-8..My data are in files:hgnc_mapped looks likeABCB7 MARS 0.054839ABCB7 MAX 0.0638109ABCB7 MRPS34 0.112394ABCB7 NDUFA8 0.123633ABCB7 NUP133 0.0810968combined looks likehsa-mir-1180 MAPK7hsa-mir-1228 NACAhsa-mir-1248 IRF9hsa-mir-1248 PSME2hsa-mir-1254 KIAA1279hsa-mir-125b-1PCDHGB3My code so far is:edgeList <- read.table("hgnc_mapped.txt", header=TRUE, sep="\t")eQTLList <- read.table("combined.txt", header=TRUE, sep="\t")t <- as.data.frame(edgeList)u <- as.data.frame(eQTLList)y <- graph.data.frame(t, directed=FALSE, vertices=NULL)V(y)z <- graph.data.frame(u, directed=TRUE)# new_g <- delete.vertices(y,which(degree(y) < 1) - 1)# V(new_g)``````{r cache=TRUE, dependson='network-data'}#Run the community detection algorithmwc <- walktrap.community(y, weights = edgeList$Weight, steps=6, merges =TRUE, modularity = TRUE, membership = TRUE)```c1 <- clusters(y)c1$membership# small.clusters <- which(c1$size > 7)# vertices.to.delete <- which((c1$membership)==small.clusters)-1# g <- delete.vertices(y, vertices.to.delete)layout <- layout.fruchterman.reingold(y)x <- (which(c1$csize) < 8 & (c1$csize) > 1)vertices <- which(c1$membership==x)g1 <- induced.subgraph(y, vertices)plot(g1,layout=layout[vertices,])Thanks in advance.....
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |