I have a matrix with 2300 samples, and about 34 batches. I am trying to use ComBat_Seq on this matrix. The matrix is arranged by genes in the rows, and samples in the columns. I have a vector to be used a batches that has same length as the number of columns in the count matrix. But I keep getting the following error:
> length(use_batch)
[1] 2312
> ncol(ori_matrix)
[1] 2312
> corrected_mat <- ComBat_seq(ori_matrix, batch = use_batch)
Found 34 batches
Using null model in ComBat-seq.
Error in cbind(batchmod, mod) :
number of rows of matrices must match (see arg 2)
Am I missing something? What is the way around this. The ori_matrix of the original count values is a matrix.
I have a matrix with 2300 samples, and about 34 batches. I am trying to use
ComBat_Seq
on this matrix. The matrix is arranged by genes in the rows, and samples in the columns. I have a vector to be used a batches that has same length as the number of columns in the count matrix. But I keep getting the following error:Am I missing something? What is the way around this. The
ori_matrix
of the original count values is amatrix
.