Extracting differentially expressed genes in R
2
2
Entering edit mode
7.2 years ago
zizigolu ★ 4.3k

Hi,

I know it is too naive but when I tried to extract genes with fold-change >2.0 or <0.5 alterations I faced error.

I tried so

results <- t[which(abs(t$logFC) > 1 & t$adj.P.Val < 0.05),]

This gives me only fold-change >2.0 , then how I add fold-change < 0.5 to this code please??

Thank you

R software error rna-seq gene • 7.9k views
ADD COMMENT
3
Entering edit mode

Try if following works:

> subset(t, adj.P.Val<0.05 & abs(logFC)>2.0| abs(logFC)<0.5)

I am not sure if it is good to filter the genes by statistical significance and fc at the same time.

ADD REPLY
0
Entering edit mode

Sorry, do you mean I should first filter for statistical significance and then FC or vice versa instead of performing both at the same time????

ADD REPLY
1
Entering edit mode
7.2 years ago

IMO, first filter by statistical significance and then by fc. Double filtering (using both p-value and fc at the same time) in microarray analysis is contested multiple times and infact Limma toptable function (for microarray analysis) suggests not to filter by fc and p-value at the same time (https://www.rdocumentation.org/packages/limma/versions/3.28.14/topics/toptable). Double filtering (filtering by fc and p-value from statistical test simultaneous) issue is discussed clearly, way back (PMID:19995439 PMCID:PMC2801685). Here is a long discussion on this on researchgate: https://www.researchgate.net/post/FDR_or_log_fold_change_which_one_is_the_priority_for_selecting_the_DEGs. Here (https://support.bioconductor.org/p/62286/) and here (https://support.bioconductor.org/p/64787/), Gordon Smyth (from EdgeR) discourages filtering by FC and P-value simultaneously (unless I misunderstood the post) for RNAseq data and microarray data. One should be filtering (by fc) within some statistical limits (frame)

In addition, In most of the RNAseq, Exon arrays and Microarray data analysis (recently), I have seen filtering/sorting by p-values first, followed by fc. Please note that this doesn't mean that what you are doing is incorrect and should not do what you are doing. But there is enough literature to support filter the results by (adj)p-values first.

ADD COMMENT

Login before adding your answer.

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