## Not run:
#
# ##########identify dysregulated pathways by using the function PAGI.Main###########
# #example 1
# #get example data
# dataset<-getdataset()
# class.labels<-getclass.labels()
#
# #identify dysregulated pathways
# result<-PAGI.Main(dataset,class.labels,nperm = 100,p.val.threshold = -1,FDR.threshold = 0.01,
# gs.size.threshold.min = 25, gs.size.threshold.max = 500 )
#
# #print the summary results of pathways to screen
# result[[1]][1:10,]
#
# #The result is a dataframe. The rows of the dataframe are ranked by the values of False
# #discovery rate (FDR). Each row of the result (dataframe) is a pathway. It columns include
# #"Pathway Name", "SIZE", "PathwayID", "Pathway Score", "NOM p-val", "FDR q-val", "Tag
# #percentage", "Gene percentage", "Signal strength". They correspond to pathway names,
# #the number of genes which were mapped to the pathway from gene expression profiles, pathway ID,
# #the scores of pathway, the nominal p-values of the pathways, the FDR values, the percent of
# #gene set before running enrichment peak, the percent of gene list before running enrichment peak,
# #enrichment signal strength.
#
# #print the detail results of pathways to screen
# result[[2]][1:5]
#
# #The result is a list. Each element of the list is a dataframe whcih present the detail results of
# #genes in the pathway with FDR.threshold< 0.01. Each rows of the dataframe represents a gene.
# #Its columns include "Gene number in the (sorted) pathway", "gene symbol from the gene express data",
# #"location of the gene in the sorted gene list", "the T-score of gene between two biological states",
# #"global influence impactor", "if the gene contribute to the score of pathway".
#
# #write the summary results of pathways to tab delimited file.
# write.table(result[[1]], file = "SUMMARY RESULTS.txt", quote=F, row.names=F, sep = "\t")
#
# #write the detail results of genes for each pathway with FDR.threshold< 0.01 to tab delimited file.
# for(i in 1:length(result[[2]])){
# gene.report<-result[[2]][[i]]
# filename <- paste(names(result[[2]][i]),".txt", sep="", collapse="")
# write.table(gene.report, file = filename, quote=F, row.names=F, sep = "\t")
# }
#
# #example 2
# #get example data
# dataset<-read.table(paste(system.file(package="PAGI"),"/localdata/dataset.txt",sep=""),
# header=T,sep="\t","\"")
# class.labels<-as.character(read.table(paste(system.file(package="PAGI"),
# "/localdata/class.labels.txt",sep=""),quote="\"", stringsAsFactors=FALSE)[1,])
#
# #identify dysregulated pathways
# result<-PAGI.Main(dataset,class.labels,nperm = 100,p.val.threshold = -1,FDR.threshold = 0.01,
# gs.size.threshold.min = 25, gs.size.threshold.max = 500 )
#
# #print the summary results of pathways to screen
# result[[1]][1:10,]
#
# #The result is a dataframe. The rows of the dataframe are ranked by the values of False
# #discovery rate (FDR). Each row of the result (dataframe) is a pathway. It columns include
# #"Pathway Name", "SIZE", "PathwayID", "Pathway Score", "NOM p-val", "FDR q-val", "Tag
# #percentage", "Gene percentage", "Signal strength". They correspond to pathway names,
# #the number of genes which were mapped to the pathway from gene expression profiles, pathway ID,
# #the scores of pathway, the nominal p-values of the pathways, the FDR values, the percent of
# #gene set before running enrichment peak, the percent of gene list before running enrichment peak,
# #enrichment signal strength.
#
# #print the detail results of pathways to screen
# result[[2]][1:5]
#
# #The result is a list. Each element of the list is a dataframe whcih present the detail results of
# #genes in the pathway with FDR.threshold< 0.01. Each rows of the dataframe represents a gene.
# #Its columns include "Gene number in the (sorted) pathway", "gene symbol from the gene express data",
# #"location of the gene in the sorted gene list", "the T-score of gene between two biological states",
# #"global influence impactor", "if the gene contribute to the score of pathway".
#
# #write the summary results of pathways to tab delimited file.
# write.table(result[[1]], file = "SUMMARY RESULTS.txt", quote=F, row.names=F, sep = "\t")
#
# #write the detail results of genes for each pathway with FDR.threshold< 0.01 to tab delimited file.
# for(i in 1:length(result[[2]])){
# gene.report<-result[[2]][[i]]
# filename <- paste(names(result[[2]][i]),".txt", sep="", collapse="")
# write.table(gene.report, file = filename, quote=F, row.names=F, sep = "\t")
# }
#
# ## End(Not run)
Run the code above in your browser using DataLab