This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter out genes less than 10 count from DESeq2 does not work

Hi All,

The following code chunks, that is used to filter out genes less than 10 counts did not work at all because genes with less than 10 is still in the count matrix after running those commands. Anyone has any suggestion or could spot what was wrong there

> ## Create DESeq2 object ============================================
> 
> dds <- DESeqDataSetFromMatrix(countData = Raw.Count,
>                                   colData = Phenotype,
>                                   design = ~ Group)
> 
> 
> ## Estimate size factor ===========
> 
> dds <- estimateSizeFactors(dds)
> 
> ## Prefiltering: not necessary for DESeq, but good to reduce memory size and incrase speed of transformation =========
> 
> keep <- rowSums(counts(dds)) >= 10
> 
> dds <- dds[keep,]
> 
> ## print size factor ===========
> 
> sizeFactors(dds)
> 
> ## Normalized count 
> 
> normalized_counts <- counts(dds, normalized=TRUE)
> 
> dim(normalized_counts)
> 
> ## Write the csv file ==================
> 
> write.csv(normalized_counts, file="normalized_count.csv")

Thanks,

Synat

deseq2

1 answer

try:

keep <- rowSums(counts(dds) >= 10)

instead of

keep <- rowSums(counts(dds)) >= 10

HI jcn, thank for your help. However, it does not work.

No one can help you more if all you're going to say is "it does not work".

Sorry Admin if my response was inappropriate. please accept my apology... I guessed the count matrix i got after running those commands from DESeq2 vignette were normalized counts, not a raw count that was why I still saw lot of value less than 10 in there.

Regards,

synat

Log in to answer this question.