Question: error in minet package
0
3.9 years ago by
Angel40
Berlin
Angel40 wrote:

hi,

i am trying to get fscore by minet package i get error always

do know what this error means?

mycounts <- minet( mycounts, method="clr", estimator="spearman"  )
> dim(mycounts)
[1] 3123 3123
AT1G01060   AT1G01170    AT1G01180  AT1G01260
AT1G01060 0.000000000 0.005806158 0.0183583025 0.00000000
AT1G01170 0.005806158 0.000000000 0.0000000000 0.00000000
AT1G01180 0.018358303 0.000000000 0.0000000000 0.00000000
AT1G01260 0.000000000 0.000000000 0.0000000000 0.00000000
AT1G01380 0.044597717 0.000000000 0.0303780633 0.00000000
AT1G01490 0.083655940 0.023658725 0.0002822091 0.03640982
> dim(mycounts)
[1] 3123 3123
> mycounts <- as.matrix(mycounts)
> # viewing mycounts class
> class(mycounts)
[1] "matrix"

# reading my true network derived from my gold standard gene list

> mycounts1 <- as.matrix(mycounts1)
> # viewing mycounts class
> class(mycounts1)
[1] "matrix"
> # watching the head of  file
AT1G01060 AT1G01170 AT1G01180 AT1G01260
AT1G01060         0         0         0         0
AT1G01170         0         0         0         0
AT1G01180         0         0         0         0
AT1G01260         0         0         0         0
AT1G01380         0         0         0         0
AT1G01490         0         0         0         0
> index<-colnames(mycounts1) %in% colnames(mycounts)
> selected<-mycount1[,index]
> selected<-mycounts1[,index]
> dim(selected)
[1] 3123 3123
> index<-rownames(selected) %in% rownames(mycounts)
> mycounts1<-selected[index,] # Select rows
AT1G01060 AT1G01170 AT1G01180 AT1G01260
AT1G01060         0         0         0         0
AT1G01170         0         0         0         0
AT1G01180         0         0         0         0
AT1G01260         0         0         0         0
AT1G01380         0         0         0         0
AT1G01490         0         0         0         0
> # watching the dimension of matrix
> dim(mycounts1)
[1] 3123 3123
> mycounts1 <- as.matrix(mycounts1)
> # viewing mycounts class
> class(mycounts1)
[1] "matrix"
> # watching the head of  file
AT1G01060 AT1G01170 AT1G01180 AT1G01260
AT1G01060         0         0         0         0
AT1G01170         0         0         0         0
AT1G01180         0         0         0         0
AT1G01260         0         0         0         0
AT1G01380         0         0         0         0
AT1G01490         0         0         0         0
> clr.tbl<- validate(mycounts,mycounts1)
Error in validate(mycounts, mycounts1) :
argument 'tnet' must contain values 0 or 1


 >
minet software error • 545 views
written 3.9 years ago by Angel40

Does your true network contain only values 0 or 1 as mentioned in the error message? What do you get with table(mycounts1)?

This simple code works for me with the release version of minet:

set.seed(123)
m1 <- matrix(sample(c(0,1), 4, replace = TRUE), ncol = 2)
m2 <- matrix(sample(c(0,1), 4, replace = TRUE), ncol = 2)

> m1
[,1] [,2]
[1,]    0    0
[2,]    1    1
> m2
[,1] [,2]
[1,]    1    1
[2,]    0    1

library(minet)
validate(m1, m2)
thrsh tp fp fn tn
1     1  1  0  2  1
2     1  1  0  2  1
3     0  1  1  2  0
4     0  2  1  1  0
5     0  3  1  0  0


thank you,

it told

> table(mycounts1)
Error in table(mycounts1) : attempt to make a table with >= 2^31 elements


 > sorry the question is this how i can convert both of my matrices as your matrices to be pass by validate function???
1

But they are (class(mycounts1) returns 'matrix' in your example code). The error you showed says nothing about a problem with being matrices. It suggests instead your true network is all zeros. Since table() fails with your matrix, please check the output of any(mycounts1 == 1).

thank you

> any(mycounts1 == 1)
[1] TRUE

sorry i checked my true network, that is not all zeros.

i have a gold standard in Arabidopsis thaliana( genes and transcription factors) like below

TFLocus    TargetLocus    InteractionType
AT5G10140    AT1G65480    -1
AT5G11260    AT1G27480    -1
AT5G11260    AT5G53370    -1
AT5G11260    AT1G03630    -1
AT5G11260    AT1G13600    -1
AT5G11260    AT2G41670    -1
AT5G11260    AT2G05160    -1
AT5G11260    AT2G40170    -1
AT5G11260    AT1G62780    -1

by a matlab code i produced the true net Adjacency matrix and used to validate the inferred network but never i could run validate function

1

Mmm, OK. My only suggestion then is that you try to work first with a subset of your matrices to see if you can reproduce the minimal example. Make sure to check also the help for validate (for example, it mentions about row and col names having to be identical- that may be related).