Dear all,
I have this error when I try to use the hLICORN from CoRegNet.
As example:
library(CoRegNet)
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
GRN=hLICORN(gexp,TFlist = letters)
Error in validObject(.Object) :
invalid class “itemMatrix” object: item labels do not match number of columns
In addition: Warning message:
In hLICORN(gexp, TFlist = letters) :
Expression data should be in a matrix or data frame with genes in rows and samples in column.
sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] CoRegNet_1.5.0 arules_1.1-9 Matrix_1.2-2 shiny_0.12.2 igraph_1.0.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.0 ComplexHeatmap_1.3.3 RColorBrewer_1.1-2 futile.logger_1.4.1 GenomeInfoDb_1.5.13
[6] XVector_0.9.3 GenomicFeatures_1.21.18 bitops_1.0-6 futile.options_1.0.0 tools_3.2.2
[11] zlibbioc_1.15.0 dendextend_1.1.0 biomaRt_2.25.1 digest_0.6.8 lattice_0.20-33
[16] RSQLite_1.0.0 DBI_0.3.1 parallel_3.2.2 rtracklayer_1.29.21 Biostrings_2.37.8
[21] GlobalOptions_0.0.8 S4Vectors_0.7.14 IRanges_2.3.18 stats4_3.2.2 grid_3.2.2
[26] Biobase_2.29.1 R6_2.1.1 GetoptLong_0.1.0 AnnotationDbi_1.31.17 XML_3.98-1.3
[31] BiocParallel_1.3.51 lambda.r_1.1.7 magrittr_1.5 whisker_0.3-2 htmltools_0.2.6
[36] Rsamtools_1.21.16 BiocGenerics_0.15.6 GenomicRanges_1.21.20 GenomicAlignments_1.5.12 SummarizedExperiment_0.3.3
[41] xtable_1.7-4 mime_0.3 shape_1.4.2 circlize_0.3.1 colorspace_1.2-6
[46] httpuv_1.3.3 RCurl_1.95-4.7 rjson_0.2.15
Dear Remy,
Thank you for your answer. However, tt doesn't seem to work:
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
gexp=data.frame(gexp)
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
GRN=hLICORN(gexp,TFlist = letters)
Error in validObject(.Object) :
invalid class “itemMatrix” object: item labels do not match number of columns
session_info()
Session info --------------------------------------------------------------------------------
setting value
version R version 3.2.2 (2015-08-14)
system x86_64, darwin13.4.0
ui RStudio (0.99.441)
language (EN)
collate fr_FR.UTF-8
tz Europe/Paris
date 2015-08-31
Packages ------------------------------------------------------------------------------------
package * version date source
ade4 * 1.7-2 2015-04-14 CRAN (R 3.2.0)
AnnotationDbi 1.31.17 2015-06-18 Bioconductor
arules * 1.1-9 2015-07-14 CRAN (R 3.2.0)
assertthat 0.1 2013-12-06 CRAN (R 3.2.0)
Biobase * 2.29.1 2015-05-03 Bioconductor
BiocGenerics * 0.15.6 2015-08-08 Bioconductor
BiocParallel 1.3.51 2015-08-22 Bioconductor
BiocStyle * 1.7.6 2015-07-31 Bioconductor
biomaRt 2.25.1 2015-04-21 Bioconductor
Biostrings * 2.37.8 2015-08-22 Bioconductor
bit * 1.1-12 2014-04-09 CRAN (R 3.2.0)
bitops 1.0-6 2013-08-17 CRAN (R 3.2.0)
BSgenome * 1.37.4 2015-07-26 Bioconductor
car * 2.0-26 2015-08-06 CRAN (R 3.2.0)
CGHbase * 1.29.0 2015-04-17 Bioconductor
circlize 0.3.1 2015-08-19 CRAN (R 3.2.2)
cluster * 2.0.3 2015-07-21 CRAN (R 3.2.2)
codetools 0.2-14 2015-07-15 CRAN (R 3.2.2)
colorspace 1.2-6 2015-03-11 CRAN (R 3.2.0)
ComplexHeatmap 1.3.3 2015-08-25 Bioconductor (R 3.2.2)
CoRegNet * 1.5.0 2015-04-17 Bioconductor
corrplot * 0.73 2013-10-15 CRAN (R 3.2.0)
DBI 0.3.1 2014-09-24 CRAN (R 3.2.0)
dendextend 1.1.0 2015-07-31 CRAN (R 3.2.1)
devtools * 1.9.0 2015-08-15 Github (hadley/devtools@2881db5)
digest 0.6.8 2014-12-31 CRAN (R 3.2.0)
doParallel 1.0.8 2014-02-28 CRAN (R 3.2.0)
dplyr 0.4.2 2015-06-16 CRAN (R 3.2.0)
evaluate 0.7.2 2015-08-13 CRAN (R 3.2.1)
fastmatch 1.0-4 2012-01-21 CRAN (R 3.2.0)
ff * 2.2-13 2014-04-09 CRAN (R 3.2.0)
ffbase * 0.12.1 2015-06-05 CRAN (R 3.2.0)
foreach 1.4.2 2014-04-11 CRAN (R 3.2.0)
formatR 1.2 2015-04-21 CRAN (R 3.2.0)
futile.logger 1.4.1 2015-04-20 CRAN (R 3.2.0)
futile.options 1.0.0 2010-04-06 CRAN (R 3.2.0)
gdata 2.17.0 2015-07-04 CRAN (R 3.2.0)
GenomeInfoDb * 1.5.13 2015-08-20 Bioconductor
GenomicAlignments 1.5.13 2015-08-29 Bioconductor
GenomicFeatures 1.21.18 2015-08-19 Bioconductor
GenomicRanges * 1.21.20 2015-08-26 Bioconductor
GetoptLong 0.1.0 2015-03-09 CRAN (R 3.2.0)
ggfortify * 0.0.3 2015-08-16 Github (sinhrks/ggfortify@2555d3a)
ggplot2 * 1.0.1 2015-03-17 CRAN (R 3.2.0)
GlobalOptions 0.0.8 2015-08-18 CRAN (R 3.2.2)
gmodels 2.16.2 2015-07-22 CRAN (R 3.2.0)
gridBase 0.4-7 2014-02-24 CRAN (R 3.2.0)
gridExtra * 2.0.0 2015-07-14 CRAN (R 3.2.0)
gtable 0.1.2 2012-12-05 CRAN (R 3.2.0)
gtools 3.5.0 2015-05-29 CRAN (R 3.2.0)
highr 0.5 2015-04-21 CRAN (R 3.2.0)
htmltools 0.2.6 2014-09-08 CRAN (R 3.2.0)
httpuv 1.3.3 2015-08-04 CRAN (R 3.2.0)
igraph * 1.0.1 2015-06-26 CRAN (R 3.2.0)
IRanges * 2.3.18 2015-08-08 Bioconductor
iterators 1.0.7 2014-04-11 CRAN (R 3.2.0)
knitr * 1.11 2015-08-14 CRAN (R 3.2.1)
labeling 0.3 2014-08-23 CRAN (R 3.2.0)
lambda.r 1.1.7 2015-03-20 CRAN (R 3.2.0)
lattice * 0.20-33 2015-07-14 CRAN (R 3.2.2)
latticeExtra * 0.6-26 2013-08-15 CRAN (R 3.2.0)
lazyeval 0.1.10 2015-01-02 CRAN (R 3.2.0)
limma * 3.25.15 2015-08-06 Bioconductor
lme4 1.1-9 2015-08-20 CRAN (R 3.2.0)
magrittr 1.5 2014-11-22 CRAN (R 3.2.0)
marray * 1.47.1 2015-08-19 Bioconductor
MASS 7.3-43 2015-07-16 CRAN (R 3.2.2)
Matrix * 1.2-2 2015-07-08 CRAN (R 3.2.2)
MatrixModels 0.4-1 2015-08-22 CRAN (R 3.2.2)
memoise 0.2.1 2014-04-22 CRAN (R 3.2.0)
mgcv 1.8-7 2015-07-23 CRAN (R 3.2.2)
mime 0.3 2015-03-29 CRAN (R 3.2.0)
minqa 1.2.4 2014-10-09 CRAN (R 3.2.0)
mnormt 1.5-3 2015-05-25 CRAN (R 3.2.0)
munsell 0.4.2 2013-07-11 CRAN (R 3.2.0)
nlme 3.1-122 2015-08-19 CRAN (R 3.2.0)
nloptr 1.0.4 2014-08-04 CRAN (R 3.2.0)
NMF * 0.20.6 2015-05-26 CRAN (R 3.2.0)
nnet 7.3-10 2015-06-29 CRAN (R 3.2.2)
pander * 0.5.2 2015-05-18 CRAN (R 3.2.0)
papeR * 0.6-1 2015-06-09 CRAN (R 3.2.0)
pbkrtest 0.4-2 2014-11-13 CRAN (R 3.2.0)
phenotypicForest * 0.3 2015-08-08 Github (chrislad/phenotypicForest@ddebfe5)
pkgmaker * 0.25.9 2015-07-18 Github (renozao/pkgmaker@751511b)
plyr * 1.8.3 2015-06-12 CRAN (R 3.2.0)
proto * 0.3-10 2012-12-22 CRAN (R 3.2.0)
psych * 1.5.6 2015-07-08 CRAN (R 3.2.0)
quantreg 5.18 2015-08-16 CRAN (R 3.2.0)
R6 2.1.1 2015-08-19 CRAN (R 3.2.2)
RColorBrewer * 1.1-2 2014-12-07 CRAN (R 3.2.0)
Rcpp 0.12.0 2015-07-25 CRAN (R 3.2.1)
RCurl 1.95-4.7 2015-06-30 CRAN (R 3.2.0)
registry * 0.3 2015-07-08 CRAN (R 3.2.0)
reshape * 0.8.5 2014-04-23 CRAN (R 3.2.0)
reshape2 1.4.1 2014-12-06 CRAN (R 3.2.0)
rjson 0.2.15 2014-11-03 CRAN (R 3.2.0)
rmarkdown * 0.7.3 2015-08-23 Github (rstudio/rmarkdown@ee2f13c)
rngtools * 1.2.4 2014-03-06 CRAN (R 3.2.0)
Rsamtools 1.21.16 2015-08-28 Bioconductor
RSQLite 1.0.0 2014-10-25 CRAN (R 3.2.0)
rtracklayer * 1.29.21 2015-08-27 Bioconductor
S4Vectors * 0.7.14 2015-08-28 Bioconductor
scales * 0.3.0 2015-08-25 CRAN (R 3.2.0)
shape 1.4.2 2014-11-05 CRAN (R 3.2.0)
shiny * 0.12.2 2015-08-05 CRAN (R 3.2.0)
SparseM 1.7 2015-08-15 CRAN (R 3.2.0)
stringi 0.5-5 2015-06-29 CRAN (R 3.2.0)
stringr 1.0.0 2015-04-30 CRAN (R 3.2.0)
SummarizedExperiment 0.3.3 2015-08-08 Bioconductor
survival * 2.38-3 2015-07-02 CRAN (R 3.2.2)
tabplot * 1.1 2014-02-24 CRAN (R 3.2.0)
tidyr 0.2.0 2014-12-05 CRAN (R 3.2.0)
whisker 0.3-2 2013-04-28 CRAN (R 3.2.0)
XML 3.98-1.3 2015-06-30 CRAN (R 3.2.0)
xtable * 1.7-4 2014-09-12 CRAN (R 3.2.0)
XVector * 0.9.3 2015-08-22 Bioconductor
yaml 2.1.13 2014-06-12 CRAN (R 3.2.0)
zlibbioc 1.15.0 2015-04-17 Bioconductor
Try loading the parallel package beforehand (library(parallel)) and run hLICORN with the verbose parameter to TRUE :
library(parallel)
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
gexp=data.frame(gexp)
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
GRN=hLICORN(gexp,TFlist = letters,verbose=T)
Here's the output:
library(parallel)
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
gexp=data.frame(gexp)
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
GRN=hLICORN(gexp,TFlist = letters,verbose = T)
Pre-process.
Error in validObject(.Object) :
invalid class “itemMatrix” object: item labels do not match number of columns
Well, something is going wrong with your version of arules or of Matrix.
I'm soory to make you try so many things but I'd really like to track down your error.
Would you mind trying this ?
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
gexp=data.frame(gexp)
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
discreteExpression=CoRegNet::discretizeExpressionData(gexp)
discreteExpression[1:10,1:10]
posSamples = 1:ncol(discreteExpression)
negSamples= (ncol(discreteExpression) +1):(ncol(discreteExpression) *2)
regBitData =cbind(discreteExpression==+1 , discreteExpression== -1)
regBitData[c(1:5,48:52),c(1:5,95:105,195:200)]
transRegBitData= as(t(regBitData),"transactions")
print(transRegBitData)
gexp=matrix(rnorm(2600,sd=3),ncol=100)
gexp=rbind(gexp,do.call(rbind,lapply(1:26,function(i){
tf = sample(1:26,4)
return((gexp[tf[1],]+gexp[tf[2],] -gexp[tf[3],]-gexp[tf[4],] +rnorm(100,sd=3))/2)})))
gexp=data.frame(gexp)
dimnames(gexp)=list(c(letters,LETTERS),paste("s",1:100,sep=""))
discreteExpression=CoRegNet::discretizeExpressionData(gexp)
discreteExpression[1:10,1:10]
# s1 s2 s3 s4 s5 s6 s7 s8 s9 s10
#a 0 0 0 -1 -1 0 0 0 0 0
#b 1 0 0 -1 -1 0 0 0 0 0
#c 0 -1 1 0 -1 0 0 1 0 0
#d 0 -1 0 0 0 0 0 0 1 0
#e 0 0 0 0 1 1 0 0 1 0
#f 0 1 0 0 0 0 0 0 0 1
#g 0 0 0 0 1 1 0 0 0 1
#h 0 0 0 0 -1 0 0 0 0 1
#i 0 -1 0 0 0 0 0 0 0 0
#j -1 0 -1 0 0 0 0 0 -1 0
posSamples = 1:ncol(discreteExpression)
negSamples= (ncol(discreteExpression) +1):(ncol(discreteExpression) *2)
regBitData =cbind(discreteExpression==+1 , discreteExpression== -1)
regBitData[c(1:5,48:52),c(1:5,95:105,195:200)]
# s1 s2 s3 s4 s5 s95 s96 s97 s98 s99 s100 s1 s2 s3 s4 s5 s95 s96 s97 s98 s99 #s100
#a FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE #TRUE FALSE FALSE TRUE FALSE FALSE FALSE
#b TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE #TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#c FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE #TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#d FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE #FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#e FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE #FALSE TRUE TRUE FALSE TRUE FALSE FALSE
#V FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE #FALSE FALSE TRUE FALSE FALSE FALSE FALSE
#W FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE #FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#X FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #FALSE FALSE FALSE FALSE FALSE TRUE FALSE
#Y FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE #FALSE FALSE FALSE FALSE FALSE TRUE FALSE
#Z FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE #FALSE FALSE FALSE FALSE FALSE FALSE FALSE
transRegBitData= as(t(regBitData),"transactions")
Error in validObject(.Object) :
invalid class “itemMatrix” object: item labels do not match number of columns
print(transRegBitData)
Error in print(transRegBitData) : object 'transRegBitData' not found
sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MVpower_2.0 class_7.3-13 kernlab_0.9-22 pamr_1.55 survival_2.38-3 cluster_2.0.3 randomForest_4.6-10
loaded via a namespace (and not attached):
[1] Rcpp_0.12.0 ComplexHeatmap_1.3.3 RColorBrewer_1.1-2 futile.logger_1.4.1 GenomeInfoDb_1.5.13
[6] XVector_0.9.3 GenomicFeatures_1.21.18 bitops_1.0-6 futile.options_1.0.0 tools_3.2.2
[11] zlibbioc_1.15.0 digest_0.6.8 dendextend_1.1.0 biomaRt_2.25.1 lattice_0.20-33
[16] RSQLite_1.0.0 igraph_1.0.1 Matrix_1.2-2 shiny_0.12.2 DBI_0.3.1
[21] parallel_3.2.2 rtracklayer_1.29.21 arules_1.1-9 Biostrings_2.37.8 GlobalOptions_0.0.8
[26] S4Vectors_0.7.14 IRanges_2.3.18 stats4_3.2.2 grid_3.2.2 Biobase_2.29.1
[31] R6_2.1.1 GetoptLong_0.1.0 AnnotationDbi_1.31.17 XML_3.98-1.3 BiocParallel_1.3.51
[36] lambda.r_1.1.7 magrittr_1.5 whisker_0.3-2 htmltools_0.2.6 Rsamtools_1.21.16
[41] BiocGenerics_0.15.6 GenomicRanges_1.21.20 GenomicAlignments_1.5.13 splines_3.2.2 CoRegNet_1.5.0
[46] SummarizedExperiment_0.3.3 xtable_1.7-4 mime_0.3 shape_1.4.2 circlize_0.3.1
[51] colorspace_1.2-6 httpuv_1.3.3 RCurl_1.95-4.7 rjson_0.2.15
OK. The problem clearly comes from the arules package.
I'll let you try something I directly got out of the package help :
library(arules)
a_matrix <- matrix(
c(1,1,1,0,0,
1,1,0,0,0,
1,1,0,1,0,
0,0,1,0,1,
1,1,0,1,1), ncol = 5)
## set dim names
dimnames(a_matrix) <- list(
c("a","b","c","d","e"),
paste("Tr",c(1:5), sep = ""))
a_matrix
## coerce
trans2 <- as(a_matrix, "transactions")
trans2
inspect(trans2)
ibrary(arules)
a_matrix <- matrix(
c(1,1,1,0,0,
1,1,0,0,0,
1,1,0,1,0,
0,0,1,0,1,
1,1,0,1,1), ncol = 5)
## set dim names
dimnames(a_matrix) <- list(
c("a","b","c","d","e"),
paste("Tr",c(1:5), sep = ""))
a_matrix
## coerce
trans2 <- as(a_matrix, "transactions")
Error in validObject(.Object) :
invalid class “itemMatrix” object: item labels do not match number of columns
trans2
Error: object 'trans2' not found
inspect(trans2)
Error in inspect(trans2) :
error in evaluating the argument 'x' in selecting a method for function 'inspect': Error: object 'trans2' not found
This is crazy, your version of arules doesn't work.
Now, aside from reinstalling it, I do not see what else you could do.
install.packages("arules")
and try again the last bit, (including the library(arules) )
Well actually, I have already reinstalled arules package even before to start this post in bioconductor forum... with the same results ;(
Did you do this in a new R session, with no other packages attached? Maybe arules is expecting to use symbols or methods from one package, but is getting them from another.
Yes, that's exactly what I was going to suggest until I realised my reputation is so bad around here that I couldn't do anything anymore and certainly not try to help you using my own package.
Anyway, the next possible fix is to try again (try all the tests I proposed here in reverse chronological order, starting with arules testing) but using a fresh new R session.
Dear Martin and Remy,
Using a new "clean" R session it works!