Filtering the readcounts
1
0
Entering edit mode
frimz.r • 0
@frimzr-13631
Last seen 6.2 years ago

Hey 

I am trying to filter out my countdata file based on a minimum basemean  of 20 and expressed in all of my samples.

I was going through one of your previously answered question and accordingly i am using the script

ddsTC <- DESeqDataSetFromMatrix(countDatanew, colData=phenotype_data, ~ strain + minute + strain:minute) 

ddsTC$strain <- relevel(ddsTC$strain, ref="control")

ddsTC$minute <- relevel(ddsTC$minute, ref="pre")

ddsTC <- DESeq(ddsTC, test="LRT", reduced = ~ strain + minute)

rld <- rlog(ddsTC)

test <- phenotype_data[order(phenotype_data$strain),]

test2 <- test[order(test$minute),]

rld_ordered <- rld[,rownames(test2)]

resTC<-results(ddsTC, alpha = 0.05,independentFiltering=FALSE )

filterGenes <- rowSums(counts(ddsTC, normalized=TRUE) > 20 ) ==57

write.table(filterGenes,"filter")

but the result file i am getting is in form of true and false with no LFC, pvalue, or  padj.

Any help will be highly appreciated.

Cheers

Farha

 

 

 

deseq2 multiple factor design • 1.3k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 6 hours ago
United States

hi,

Check out this R guide:

http://www.statmethods.net/management/subset.html

You want to subset the results table using a logical vector ;filterGenes'. But instead of subsetting, you've just written out the logical vector. You want to use square brackets [ ], with the filtering vector in the first place of the square brackets. Read over the R guide which will help understand how subsetting works in R.

Also, I think your filter is too strict: requiring a normalized count of 20 in 57 samples. You could potentially lose true differentially expressed genes with such a strict filter. You don't need to filter in DESeq2, but if you want to, I'd recommend requiring at least 10 counts in some small number of samples, much less than 57.

ADD COMMENT

Login before adding your answer.

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