Question: Construct gene coexpression network
0
gravatar for shuklapriyanka287
12 months ago by
shuklapriyanka2870 wrote:

How can I construct a gene co-expression network in R from the expression value I have in Excel sheet?

Please tell me what packages are the helpful or share any tutorial for the construction of the co-expression network in R.

Thank you

R gene • 1.6k views
ADD COMMENTlink modified 12 months ago by zx87547.1k • written 12 months ago by shuklapriyanka2870
1

Please show some effort of trying. Post input data, and expected output? At the least post some links to published papers. As it stands this post is too broad and unclear.

ADD REPLYlink written 12 months ago by zx87547.1k
3
gravatar for F
12 months ago by
F3.4k
Iran
F3.4k wrote:

Reading your normalized gene expression data in r which has been saved as .txt and genes are in rows and samples are in columns

    mycounts <- read.table("data.txt", header = T, sep = "\t",row.names = 1)
    # watching the head of uploaded file
    head(mycounts[,1:4])
    # watching the dimension of matrix
    dim(mycounts)

Using this R package for instance, you must put your working directory in where gene3.R and your expression files are. You must also install these packages in R that all help you to illustrate your network in Cytoscape. Download geneie3.R source from this link clicking on R/randomForest part

library(GENIE3)
        library(igraph)
        library(RCy3)
        library(Rgraphviz)
        weight.matrix <- GENIE3(mycounts)
        link.list <- linkList(weight.matrix, report.max=1000)
        edge_listsi <- link.list[!duplicated(link.list),]

        Gsi <- graph.data.frame(edge_listsi,directed = F)

        Asi <- get.adjacency(Gsi,sparse = F,attr = "weight",type = "both")

        g_arasi <- graph.adjacency(Asi,mode = "undirected",weighted = T)

        g.cyto <- igraph.to.graphNEL(g_arasi)

        cw = createNetworkFromGraph("net", graph=g.cyto)

        displayGraph (cw)
ADD COMMENTlink modified 11 weeks ago • written 12 months ago by F3.4k

Hi F I used your commands for my data but after "weight.matrix <- GENIE3(mycounts)" I got error:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘GENIE3’ for signature ‘"data.frame"

my data are log2 of FPKM and I have -INF in some rows, could you help? Thanks

ADD REPLYlink modified 10 weeks ago • written 10 weeks ago by Sam100

Sorry, Perhaps you should add up 1 to your data before taking log2 to avoid INF. Hereafter, you please read your find as matrix

as.matrix(read.table("data.txt", header = T, sep = "\t",row.names = 1))

Genes are in rows and columns are your samples

ADD REPLYlink written 10 weeks ago by F3.4k

yes, genes are in rows and samples are in columns. you think is it wise to replace -inf with 0?

Mamnun :)

ADD REPLYlink written 10 weeks ago by Sam100

Sorry no idea but you can try that and compare your resulted network with when you are taking log2 after adding up 1

:)

ADD REPLYlink written 10 weeks ago by F3.4k

I have about 40K genes and 12 samples, should remove low expressed ones?

ADD REPLYlink written 10 weeks ago by Sam100
1

Of course because all of these genes are not informative even Cytoscape would get in trouble for loading such a big interactiobs. have you done any differential expression to reduce your genes ?

ADD REPLYlink written 10 weeks ago by F3.4k

yes, I have the DE genes, but I think we should not include just DE genes and we need to filter the low expressed ones just according the normalized expression.right?

ADD REPLYlink written 10 weeks ago by Sam100

If you have raw read counts, before normalization the first step would be removing some genes with totally 0 read counts or another threshold. I guess I am not sure

ADD REPLYlink written 10 weeks ago by F3.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 695 users visited in the last hour