zhangyuqing / ComBat-seq

Batch effect adjustment based on negative binomial regression for RNA sequencing count data
154 stars 39 forks source link

Error in order(y) : unimplemented type 'list' in 'orderVector1' #32

Open dea-jenaer opened 2 years ago

dea-jenaer commented 2 years ago

Hi @zhangyuqing ,

I am trying to run batch correction with Combat-seq package but keep running into an error. The data set has 14 variables (the first 10 belong to the same batch of sequencing, the other 4 are from a different batch of sequencing). The data is read into R "as is" and i try to run batch correction. I get an error.

uncorrected = read_xlsx ( "genes_file.xlsx" , sheet = "genes" ) sample_info = read_xlsx ( "info_file.xlsx" , sheet = "sample_info" )

batches = sapply (as.character (sample_info$library), switch, "My_data" = 1, "lab2_et_al_2020" = 2, USE.NAMES = F) corrected = ComBat_seq (counts = as.matrix (uncorrected [,sample_info$file]) , batch = batches)

When I run the line of code to compute correction, then R returns "Error in order(y) : unimplemented type 'list' in 'orderVector1'" as the error message.

The same thing happens when I try to create a group vector using the following:

samples = c (0,0,0,0,0,0,0,0,0,0,1,1,1,1)

corrected = ComBat_seq (counts = as.matrix(uncorrected[,sample_info$file]), batch = batches, group = samples)

The same error message "Error in order(y) : unimplemented type 'list' in 'orderVector1' is what R returns.

I have uninstalled R (was on v 4.1.2) and reinstalled to the latest version and also install dev version of your sva package. The error still comes up unfortunately.

Do you have any idea what could be causing this?

Thanks a lot!