Hi I am using WGCNA for network construction but I am using tutorial script for automatic network construction
and i get this error i dont understand what this mean
1.> # Choose a set of soft-thresholding powers
> powers = c(c(1:10), seq(from = 12, to=20, by=2))
> # Call the network topology analysis function
> sft = pickSoftThreshold(datExpr, powerVector = powers, verbose = 5)
pickSoftThreshold: will use block size 720.
pickSoftThreshold: calculating connectivity for given powers...
..working on genes 1 through 720 of 62103
Error in { : task 1 failed - "'x' has a zero dimension."
In addition: Warning message:
executing %dopar% sequentially: no parallel backend registered
> # Plot the results:
> sizeGrWindow(9, 5)
What is the dimension of your datExpr? Could you post the output of
dim(datExpr)? Maybe there aren't any samples left after the quality control of goodSamplesGenes.
Thanks I used dataExpr0 it has the data instead of Expr so it worked but when going to calculate TOM
it gives me this error
I am running this scrip in C directory and it has 60 Gb free space so why it still gives this error
> coexpression<-adjacency(data)
Error: cannot allocate vector of size 28.7 Gb
In addition: Warning messages:
1: In cor(datExpr, use = "p") :
Reached total allocation of 3810Mb: see help(memory.size)
2: In cor(datExpr, use = "p
but I have spc
Sorry I don't understand what do you mean when you say "I used dataExpr0 it has the data instead of Expr " could you post a piece of your data? If you already calculated the TOM why are you later calculating the adjacency?
What do you mean by "I have spc"?
I mean i used tutrioal object Expr but it has no data and i chekced bu str(Expr0) object Expr0 has the data so i used Expr0 object further in the script and data look like
> str(Expr)
Error in str(Expr) : object 'Expr' not found
> str(datExpr0)
'data.frame': 18 obs. of 62103 variables:
$ : num 9.19 9.57 9.39 9.54 9.11 ...
$ : num 10.97 11.3 10.13 8.69 10.3 ...
$ : num 8
and I have not calculated the TOM i am going to calculate Adjacency matrix then i will calculat the TOM ?
some body sugessted me that the above error mentioned in the question is not hard disk space error but its less RAM error is it right ?
Dear Muhammad,
there is no object Expr, you need to use datExpr. It seems that you are new to R and possibly to larger-scale computation and you may benefit from learning more about R and finding someone local who can guide you through some of the pitfalls. You seem to be using an R installation which can only use 4GB of memory. Please read the WGCNA tutorial I, section 2c (analysis of large data) carefully since your computer RAM is too small to handle the large data set (plus, WGCNA currently cannot handle more than about 46300 variables in one block). You may also want to look at WGCNA FAQ at https://labs.genetics.ucla.edu/horvath/CoexpressionNetwork/Rpackages/WGCNA/faq.html regarding gene filtering. There is also a short article on analysis of large data in WGCNA at http://www.peterlangfelder.com/blockwise-network-analysis-of-large-data/ .
Dear Peter
Thanks for advice yes you are right actually I am learning how to work in r. I used short code
like
data<-t(data)
coexpression<-adjacency(data)
using remote server now i want to convert save this file into .csv convert into cytoscape or visant file network file
yes you are right i read through these links before and again but i did not found any solution because I want to see lnc RNA and mRNA correlation network and one file contains more then 60 k probes i used block wise approach as suggested by WGCNA for 2000 but it did not work so what should i do guide me any solution
What do you mean by "it did not work", which error/problem did you have?
I mean blockwise=2000 argument did not work , I used a server with 64 GB ram and have made network file but when I want to export the file I have to calculate The TOM according to WGCNA tutrioal but it TOM for data object gives no error but after some time it just do not go forward like
> TOM=TOMsimilarityFromExpr(datExpr0, power =6);
TOM calculation: adjacency..
adjacency: replaceMissing: 0
..will use 23 parallel threads.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication
whats the problem
can i make export file from network.Radat file directly
It is normal to spend some time in that step. of "...matrix multiplication". Be patient
how much time because yesterday I tried 4 times and after one hour at this step connection to server was disconnected, can I ask is this step is necessary to get export file or we can skip this
The time spend depends on the server. You can use nohup to keep the process going even if you disconnect from the server (I am assuming a Unix server). You can use blockwiseModules to do it automatically, see tutorial 1) 2.c
yes you right and thanks for input and advice, I already used block wise module approach for for network.Rdata file but for TOM=TOMsimilarityFromExpr(datExpr0, power =6); can i use bolck wise argument again
?
or is there some other way to use network.Rdata file form blockwise module detection to cytoscape or vis net file
There is a function in WGCNA to export the network too cytoscape and visant, look in the manual. You only need the adjacency matrix.
yes that is final step names as Exporting network data to network visualization software """ Exporting to VisANT The package provides a convenient function for exporting the network to VisANT [1]. We illustrate a simple export of the full weighted network of a single module. # Recalculate topological overlap TOM = TOMsimilarityFromExpr(datExpr, power = 6);"""""
so here I am stuck my question is when WGCNA has calculate adjcency for modue detection in block wise approach also TOMs
bwnet = blockwiseModules(datExpr, maxBlockSize = 2000, power = 6, TOMType = "unsigned", minModuleSize = 30, reassignThreshold = 0, mergeCutHeight = 0.25, numericLabels = TRUE, saveTOMs = TRUE, saveTOMFileBase = "femaleMouseTOM-blockwise", verbose = 3)
after this step is it nessary to calcaulte TOM again like TOM=TOMsimilarityFromExpr(datExpr0, power =6);
I think you should use datExpr instead of datExpr0. But check with your advisor.
Thanks A lot for help Lluis but my Supervisor is not bioinformatic so I have no help any I have move forward I used ssh 32 bit server to connect the linux based sever so I got TOM after 3.5 hours but i have two errors
dim(TOM) 62103 62103
1. i wanted to save this data object but was not able to save i dont know why may be matrix is two large it gives error
error in writable connection
2. when i wanted to save TOM as VisANT networl file
vis=exportNetworkToVisANT(modTOM, file=paste( "VisANTInput-", module, ".txt", Warning messages:TRUE, threshold=0)
1: In max(abs(adjMat - t(adjMat)), na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
2: In min(adjMat, na.rm = TRUE) :
no non-missing arguments to min; returning Inf
3: In max(adjMat, na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
4: In matrix(c(1:nRow), nRow, nRow, byrow = TRUE) :
data length exceeds size of matrix
5: In matrix(c(1:nRow), nRow, nRow) : data length exceeds size of matrix
>
what is the solution
I am sorry to hear your problems:
1) the error seems to indicate you, or the process, got disconnected from the server. Or that it is too big to be handled properly.
2) That are warnings, not errors so you have already the network in visant format or whatever
exportNetworkToVisANT
returns in thevis
variable.Please, next time try to find yourself the solutions and explain what you found, it is a good skill to know how to solve problems. Also, I won't be able to always solve your problems :D