Question: how to set threshold of fdr and p values
0
gravatar for flavia
2.0 years ago by
flavia0
flavia0 wrote:

i want to identify and retrieve all DEGs from the data and set the p value<0.05 and fdr<0.01 how can i set the values for p and fdr value using R on linux suse platform? i am using the code given below but it is not showing FDR value coloumn in result and i dnt knw how to set the threshold of fdr which i want to set 0.01 .

> gse <- gse[[1]]
> fData(gse) <- fData(gse)[,c(1,2,10:12)]
> grp <- factor(sapply(strsplit(as.character(pData(gse)[,1]), " "), "[", 1))
> grp
 [1] A_set  A_set  AS_set AS_set AS_set F_set  F_set  S_set  S_set  S_set
Levels: A_set AS_set F_set S_set
> design <- model.matrix(~grp)
> fit <- lmFit(gse, design)
> fit2 <- eBayes(fit)
**> tt<- topTable(fit2, coef = 2, adjust = "fdr",n = 50)**
> UP <- subset(tt, tt$logFC > 0)
> DOWN <- subset(tt, tt$logFC < 0)
> head(DOWN)
                       ID   GB_ACC
210004_at       210004_at AF035776
236646_at       236646_at BE301029
1560477_a_at 1560477_a_at AK054643
                                                            Gene.Title
210004_at    oxidized low density lipoprotein (lectin-like) receptor 1
236646_at                                    transmembrane protein 52B
1560477_a_at                  sterile alpha motif domain containing 11
             Gene.Symbol ENTREZ_GENE_ID     logFC  AveExpr         t
210004_at           OLR1           4973 -2.495755 3.516644 -14.90119
236646_at        TMEM52B         120939 -1.991936 3.200324 -12.37906
1560477_a_at      SAMD11         148398 -1.385055 5.790050 -11.81502
                  P.Value  adj.P.Val        B
210004_at    3.134046e-07 0.01713540 3.500307
236646_at    1.353597e-06 0.03551374 3.055998
1560477_a_at 1.948628e-06 0.03551374 2.926959
deg limma • 2.1k views
ADD COMMENTlink modified 2.0 years ago by Benn6.6k • written 2.0 years ago by flavia0
1

You don't need FDR if you use adj.P.val (P-value adjusted for multiple testing). It's not the same as FDR, but it has the same purpose. It's quite equivalent in usage.

ADD REPLYlink written 2.0 years ago by WouterDeCoster38k

I changed format for clarity.

ADD REPLYlink written 2.0 years ago by Jean-Karim Heriche18k

It's simple just use order function of subset the data from of top table with for less than 0.01 and then select degs based on direction. Your selection of degs should be first on for threshold followed by logFC.

ADD REPLYlink written 2.0 years ago by ivivek_ngs4.8k
1
gravatar for Benn
2.0 years ago by
Benn6.6k
Netherlands
Benn6.6k wrote:

In limma, you make use of adjusted p-values. By default it is using FDR's (Benjamini Hochberg's) method for adjustment. This is not the same as FDR itself. Please read what Gordon Smyth says about it here:

https://support.bioconductor.org/p/49864/

ADD COMMENTlink written 2.0 years ago by Benn6.6k

but if we are using LIMMA so how can we know that what is the value of FDR which is used by LIMMA

ADD REPLYlink written 2.0 years ago by flavia0

You'll have to calculate it yourself.

ADD REPLYlink written 2.0 years ago by Benn6.6k

I reckon OP wants to use the adjust.p filters. If you want to use the real FDR method then b.nota is correct. You will have to intact select genes from tt object you have based on logFC and avgexp and then recalculate the FDR of those genes against the background. Then you will be able to have a new column with FDR values

ADD REPLYlink written 2.0 years ago by ivivek_ngs4.8k
0
gravatar for theobroma22
2.0 years ago by
theobroma221.1k
theobroma221.1k wrote:

This helped me http://stackoverflow.com/questions/4935479/how-to-combine-multiple-conditions-to-subset-a-data-frame-using-or

ADD COMMENTlink written 2.0 years ago by theobroma221.1k

no it's not working.

ADD REPLYlink written 2.0 years ago by flavia0

If you're only interested in the AS_set result the adjusted P-value is also known as the Q-value.

ADD REPLYlink written 2.0 years ago by theobroma221.1k

My concerned is to set fdr score if you know how to set the cutoff value of fdr so kindly tell me that for eg: fdr<0.01 how can i set this value using R code.

ADD REPLYlink written 2.0 years ago by flavia0
degs.fdr<- subset(tt, tt$adj.P.Val < 0.05)

This is how you set, here adjust.P.Val is what you need. Now if you want to regenerate again new FDR values then its different

ADD REPLYlink written 2.0 years ago by ivivek_ngs4.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 908 users visited in the last hour