Closed chadili closed 10 months ago
Which function did you refer to?
该邮件从移动设备发送
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: @.***>
gene_gsea_go gene_gsea_kegg
`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
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)
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)
Go_gseresult <- clusterProfiler::gseGO(geneList, 'org.Hs.eg.db', keyType = "ENTREZID", ont="BP", pvalueCutoff=1)
Go_gseresult = setReadable(Go_gseresult, OrgDb = "org.Hs.eg.db", keyType = "ENTREZID")
write.csv(Go_gseresult@result,file="GSEA_GO.csv",row.names = F)
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.
logFC_t = logFC_cutoff pvalue_t = pvalue_cutoff The above two lines of code did not work. DEG is not filtered.