ComBat-seq problem
0
0
Entering edit mode
13 months ago
SKY ▴ 60

I need some help.

I have raw counts matrix from feature counts and want to perform batch effect correction using ComBat-seq

I am confused about batch <- c(rep(1, 4), rep(2, 4))?

What does 1,4 and 2,4 mean? are they columns/samples belonging to the different batches? How do I specify to ComBat to consider my column 7,8,9 as one batch and 10,11 as another?

Code Taken from https://github.com/zhangyuqing/ComBat-seq

count_matrix <- matrix(rnbinom(400, size=10, prob=0.1), nrow=50, ncol=8)
batch <- c(rep(1, 4), rep(2, 4))
adjusted <- ComBat_seq(count_matrix, batch=batch, group=NULL)

Thanks in advance

ComBat-seq RNA-Seq batch-effect • 741 views
ADD COMMENT
1
Entering edit mode

You can bring up the help documentation for the rep function with either help(rep) or ?rep. If you look at the documentation you'll see rep(1, 4) means to repeat the number 1 four times, so c(rep(1, 4), rep(2, 4)) means repeat the number 1 four times, and the number 2 four times. For the purpose of ComBat_seq it's a way to specify that the first four samples are one batch, and the last four samples are another batch. For your data make a similar vector specifying which batch each of your samples is in.

ADD REPLY
0
Entering edit mode

Adding to rpolicastro's comment, you cannot use a set of columns to specify the batch vector, you need it at least as a single data.frame column which in effect is a vector.

ADD REPLY

Login before adding your answer.

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