WubingZhang / MAGeCKFlute

Integrative analysis pipeline for pooled CRISPR functional genetic screens
https://github.com/WubingZhang/MAGeCKFlute
24 stars 10 forks source link

[BatchRemove] Error in names(x) <- value: ‘names’ attribute 【2】must be the same length as the vector[1] #21

Open Canjingzhang opened 1 year ago

Canjingzhang commented 1 year ago

Hi, I try to use the BatchRemove funtion of MAGeCKFlute 1.14.0 in R 4.1 in Linux server with the example data downloaded from http://[cistrome.org/MAGeCKFlute/demo/Batch_effect_removal/](http://cistrome.org/MAGeCKFlute/demo/Batch_effect_removal/), as described in the paper (https://doi.org/10.1038/s41596-018-0113-7). The command I use is the same as in paper: $R

library(MAGeCKFlute) BatchRemove(mat = "rawcount.txt", batchMat = "BatchMatrix.txt", prefix = "BatchCorrect", -pca = T, -cluster = T, -outdir =".")

but it shows: Unexpected '=' in "BatchRemove(mat = "rawcount.txt", batchMat = "BatchMatrix.txt", prefix = "BatchCorrect", -pca ="

so I remove the extra conditions and just type:

BatchRemove(mat = "rawcount.txt", batchMat = "BatchMatrix.txt")

Then the error showes: Error in names(x) <- value: ‘names’ attribute 【2】must be the same length as the vector[1]

I also try the example in ">help(BatchRemove)" and this one works:

edata = matrix(c(rnorm(2000, 5), rnorm(2000, 8)), 1000) colnames(edata) = paste0("s", 1:4) batchMat = data.frame(sample = colnames(edata), batch = rep(1:2, each = 2)) edata1 = BatchRemove(edata, batchMat) print(edata1$p)

Could you please help with the issue that the former example doesn't work? Thank you!