zhangyuqing / ComBat-seq

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

Error in .compressOffsets(y, lib.size = lib.size, offset = offset) : offsets must be finite values #17

Open maximinio opened 3 years ago

maximinio commented 3 years ago

Hi there,

I previously used the sva::ComBat function and it worked perfectly:

adjusted <- sva::ComBat(dat=raw_counts,
                        batch=metadata$source,
                        mod=cbind(metadata$tissue_coded))

But since I would love to use DESeq2 for downstream analysis I was now trying the new function:

adjusted <- sva::ComBat_seq(counts=raw_counts,
                            group=NULL,
                            batch=metadata$source)

Unfortunatly, as you can see, I got this error:

Error in .compressOffsets(y, lib.size = lib.size, offset = offset) : 
  offsets must be finite values
In addition: Warning message:
In DGEList(counts = counts) : library size of zero detected

What am I doing wrong? Thank you in advance! Luca

zhangyuqing commented 3 years ago

Hi Luca, thank you for providing such detailed error information. It looks like there are samples with only 0 in your data (library size of zero means all gene counts in some sample add up to 0). Would you check if that is the case? Thanks. -Yuqing