tjhwangxiong / TCGAplot

A number of functions were generated to perform pan-cancer DEG analysis, correlation analysis between gene expression and TMB, MSI, TIME, and promoter methylation. Methods for visualization were provided in order to easily perform integrative pan-cancer multi-omics analysis.
Other
79 stars 16 forks source link

DEG is not filtered. #2

Closed chadili closed 10 months ago

chadili commented 10 months ago

logFC_t = logFC_cutoff pvalue_t = pvalue_cutoff The above two lines of code did not work. DEG is not filtered.

tjhwangxiong commented 10 months ago

Which function did you refer to?


该邮件从移动设备发送

--------------原始邮件-------------- 发件人:"nitu @.>; 发送时间:2023年12月19日(星期二) 晚上11:05 收件人:"tjhwangxiong/TCGAplot" @.>; 抄送:"Subscribed @.***>; 主题:[tjhwangxiong/TCGAplot] DEG is not filtered. (Issue #2)

logFC_t = logFC_cutoff pvalue_t = pvalue_cutoff The above two lines of code did not work. DEG is not filtered.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

chadili commented 10 months ago

gene_gsea_go gene_gsea_kegg

tjhwangxiong commented 10 months ago

`gene_gsea_go=function(cancer,gene,logFC_cutoff=2,pvalue_cutoff = 0.05){

exp=subset(tpm,Group=="Tumor" & Cancer==cancer) exp=exp[,-c(1:2)] exp=as.matrix(t(exp))

Group = factor(ifelse(exp[gene,]> median(exp[gene,]),'high','low'),levels=c("low","high")) logFC_t = logFC_cutoff pvalue_t = pvalue_cutoff

DEG

dat=normalizeBetweenArrays(exp) design=model.matrix(~Group) fit=lmFit(dat,design) fit=eBayes(fit) options(digits = 4) DEG=topTable(fit,coef=2,adjust='BH',n=Inf) DEG = na.omit(DEG) DEG$symbol=rownames(DEG)

GSEA

s2e <- clusterProfiler::bitr(DEG$symbol, fromType = "SYMBOL", toType = "ENTREZID", OrgDb = org.Hs.eg.db)

DEG <- dplyr::inner_join(DEG,s2e,by=c("symbol"="SYMBOL"))

geneList=DEG$logFC names(geneList)=DEG$ENTREZID geneList=sort(geneList,decreasing = T)

GSEA-GO

Go_gseresult <- clusterProfiler::gseGO(geneList, 'org.Hs.eg.db', keyType = "ENTREZID", ont="BP", pvalueCutoff=1)

transform ENTREZID to gene symbol

Go_gseresult = setReadable(Go_gseresult, OrgDb = "org.Hs.eg.db", keyType = "ENTREZID")

export the GSEA-GO result

write.csv(Go_gseresult@result,file="GSEA_GO.csv",row.names = F)

plot

enrichplot::gseaplot2(Go_gseresult, 1:5, title = cancer)

} ` logFC_t = logFC_cutoff pvalue_t = pvalue_cutoff

We are sorry that "logFC_t" and "pvalue_t" are useless, we will remove them in future. As for GESA-GO and GSEA-KEGG, all genes ranked by logFC have been used as input.