Entering edit mode
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
|
|
|
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
:thank you,
it told
>
sorry the question is this how i can convert both of my matrices as your matrices to be pass by validate function???
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 ofany(mycounts1 == 1)
.thank you
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
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).
thank you for your help