[BioC] graph object question

Seth Falcon sfalcon at fhcrc.org
Sat Feb 13 00:01:02 CET 2010


Hi Iain,

On 2/12/10 2:17 PM, Iain Gallagher wrote:
> 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)!

I think maybe you are looking for graph::ftM2graphNEL.  Here's an example:

library("graph")
s <- "symbol mirbase_id
2'-PDE hsa-let-7b
A2BP1 hsa-let-7b
AAK1 hsa-let-7b
ABCB9 hsa-let-7b
ABCC10 hsa-let-7b
ABCC5 hsa-let-7b
ACSL6 hsa-let-7b
ACTA1 hsa-let-7b
ACTR2 hsa-let-7b
ACVR1B hsa-let-7b
"

con <- textConnection(s)
df <- read.table(con, sep = " ", quote = "", header = TRUE)
ft <- as.matrix(df)
close(con)
g <- ftM2graphNEL(ft)
## or perhaps you want an undirected graph?
gu <- ftM2graphNEL(ft, edgemode = "undirected")

+ seth

-- 
Seth Falcon
Bioconductor Core Team | FHCRC



More information about the Bioconductor mailing list