setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) source("./PAGER.R") # pathFun is a function connected to PAGER api to perform hypergeometric test and retrieve enriched PAGs associated to a list of genes # The input parameters are: # 1.dir: the directory of output file. # 2.filename: the name of the output file. # 3.markers: a list of gene symbols. # 4.type: a list of PAG types consisting of 'P', 'A' or 'G' # 5.minSize: the allowed minimum size of PAG genes # 6.maxSize: the allowed maximum size of PAG genes # 7.similarity: the similarity score cutoff # 8.overlap: the allowed minimum overlap genes # 9.nCoCo: the minimum nCoCo score # 10.pValue: p-value cutoff # 11.FDR: false discovery rate # 12.source: a list of sources refered to 'http://discovery.informatics.uab.edu/PAGER/index.php/pages/help' genes = c("BRCA1","BRCA2","RAD51","PGR") PAG_result = pathFun(dir = "./", fileName = 'test.txt', genes, type = "All", minSize = 2, maxSize = 5000, similarity = 0.05, overlap = 1, nCoCo = 0, pValue = 0.05, FDR = 0.05, Species = 'All', source = c('KEGG',"WikiPathway","BioCarta","MSigDB","NCI-Nature Curated","Reactome","Protein Lounge","Spike") ) colnames(PAG_result) head(PAG_result) table(PAG_result$SOURCE) # pathMember is a function connected to PAGER api to retrieve the membership of PAGs using a list of PAG IDs # example: PAG_member = pathMember(dir = "./",PAG_result$GS_ID) head(PAG_member$data) # pathInt is a function connected to PAGER api to retrieve the m-type relationships of PAGs using a list of PAG IDs # example: PAGint = pathInt(dir = './',PAG_result$GS_ID) head(PAGint$data) # pathReg is a function connected to PAGER api to retrieve the r-type relationships of PAGs using a list of PAG IDs # example: PAGreg=pathReg(dir = './',PAG_result$GS_ID) head(PAGreg$data) # pagRankedGene is a function connected to PAGER api to retrieve RP-ranked genes with RP-score of the given PAG_IDs # example: PAGRankedGenes=pagRankedGene(dir = './',PAG_result$GS_ID[1]) head(PAGRankedGenes$data) # pagGeneInt is a function connected to PAGER api to retrieve gene interaction network # example: pagGeneInts=pagGeneInt(dir = './',PAG_result$GS_ID[1]) head(pagGeneInts$data) # pagGeneReg is a function connected to PAGER api to retrieve gene regulatory network # example: pagGeneRegs=pagGeneReg(dir = './',PAG_result$GS_ID[1]) head(pagGeneRegs$data) # path_NGSEA is a function connected to PAGER api to generate the network-based GSEA result # example: gene_df = data.frame(symbol = c("BRCA1","BRCA2","RAD51","PGR"), log2FoldChange = c(0.6,0.3,0.1,0.1)) pagInNetworkWGSEA=path_NGSEA(dir = './',gene_df,PAG_member) head(pagInNetworkWGSEA$data) # Cell Annotation CellInference=CellAnnotation(dir = './', fileName = 'test_cell.txt', c('KLRB1','KLRC1','KLRD1','KLRF1'), minSize = 1, maxSize = 5000, similarity = 0, overlap = 1, pValue = 0.05, FDR = 1, Species = 'All') head(CellInference)