in GOplot binary matrix chord_dat gives error
1
1
Entering edit mode
4.9 years ago
manibalanbt ▴ 10

i have all necessary files as per toy examples, i made circle with my data but when comes to chord_data it shows error. the error i have got is
Error in [<-(*tmp*, g, p, value = ifelse(M[g] %in% sub2$genes, 1, : subscript out of bounds

as per my search(web), in the above lines it should be sub2$genes, 1,0, but zero is missing in this error. i am new to R and i could not understand the source they given bellow is, if(is.vector(genes)){ M <- genes[genes%in%unique(subData$genes)] mat <- matrix(0, ncol = length(process), nrow = length(M)) rownames(mat) <- M colnames(mat) <- process for (p in 1:length(process)){ sub2 <- subset(subData, BPprocess == process[p]) for (g in 1:length(M)) mat[g, p] <- ifelse(M[g]%in%sub2$genes, 1, 0) } }else{ genes <- subset(genes, genes %in% unique(subData$genes)) N <- length(process) + 1 M <- genes[,1] mat <- matrix(0, ncol = N, nrow = length(M)) rownames(mat) <- M colnames(mat) <- c(process, 'logFC') mat[,N] <- genes[,2] for (p in 1:(N-1)){ sub2 <- subset(subData, BPprocess == process[p]) for (g in 1:length(M)) mat[g, p] <- ifelse(M[g]%in%sub2$genes, 1, 0)

can anyone understand the codes, kindly help me to solve this, thanks in advance

R genome software error • 3.1k views
ADD COMMENT
0
Entering edit mode
4.6 years ago
Aspie96 • 0

The function takes three arguments: data, genes and process. The error you mentioned can happen if there are no data lines with an appropriate process. This can happen, for instance, if the process parameter is null. Try to check the value of the parameters and maybe post your own code.

ADD COMMENT

Login before adding your answer.

Traffic: 2049 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