Entering edit mode
Hello list
I'm trying to build graph objects showing the relationship between
miRNA and genes. Is there a quick way to do this from a dataframe (see
toy code below)?
When building my graph object I can't think my way through getting the
'edges' list name into my list of edges (see below)!
> testData
symbol mirbase_id
6 2'-PDE hsa-let-7b
86 A2BP1 hsa-let-7b
331 AAK1 hsa-let-7b
1003 ABCB9 hsa-let-7b
1071 ABCC10 hsa-let-7b
1195 ABCC5 hsa-let-7b
3520 ACSL6 hsa-let-7b
3583 ACTA1 hsa-let-7b
4102 ACTR2 hsa-let-7b
4480 ACVR1B hsa-let-7b
t2<-as.list(testData[,2],)
names(t2)<-testData[,1]
nodes<-testData[,1]
for (i in 1:length(t2)) t2[[i]] <- c(names(t2[i]), t2[[i]])
> t2
$`2'-PDE`
[1] "2'-PDE" "hsa-let-7b"
...
But what I need is...
> t2
$`2'-PDE`
$`2'-PDE`$edges
[1] "2'-PDE" "hsa-let-7b"
...
Thanks for any help.
Iain
> sessionInfo()
R version 2.10.1 (2009-12-14)
x86_64-pc-linux-gnu
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets
methods
[8] base
other attached packages:
[1] RColorBrewer_1.0-2 Rgraphviz_1.24.0 graph_1.24.1
loaded via a namespace (and not attached):
[1] tools_2.10.1