error in minet package
0
0
Entering edit mode
Angel ▴ 40
@angel-7981
Last seen 7.7 years ago
Berlin

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
> head(mycounts[,1:4])
            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
> # read as matrix
> mycounts <- as.matrix(mycounts)
> # viewing mycounts class
> class(mycounts)
[1] "matrix"
# reading my true network derived from my gold standard gene list 

     mycounts1 <- read.table("newMat", header=T, sep =",", row.names=1)

 

> mycounts1 <- as.matrix(mycounts1)
> # viewing mycounts class
> class(mycounts1)
[1] "matrix"
> # watching the head of  file
> head(mycounts1[,1:4])
          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
> # loading the libraries
> index<-colnames(mycounts1) %in% colnames(mycounts)
> selected<-mycount1[,index]
Error: object 'mycount1' not found
> selected<-mycounts1[,index]
> dim(selected)
[1] 3123 3123
> index<-rownames(selected) %in% rownames(mycounts)
> mycounts1<-selected[index,] # Select rows
> head(mycounts1[,1:4])
          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
> # read as matrix
> mycounts1 <- as.matrix(mycounts1)
> # viewing mycounts class
> class(mycounts1)
[1] "matrix"
> # watching the head of  file
> head(mycounts1[,1:4])
          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 • 1.7k views
ADD COMMENT
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

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???

ADD REPLY
1
Entering edit mode

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).

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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).

ADD REPLY
0
Entering edit mode

thank you for your help

ADD REPLY

Login before adding your answer.

Traffic: 622 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6