Mercurial > repos > proteore > proteore_clusterprofiler
changeset 2:1c98865a8508 draft
planemo upload commit 01102a33a5c3fc56de61cd12784691b49334054b-dirty
| author | proteore |
|---|---|
| date | Wed, 05 Sep 2018 03:50:36 -0400 |
| parents | 91b9b48d07b3 |
| children | 67a796154e2a |
| files | GO-enrich.R cluster_profiler.xml |
| diffstat | 2 files changed, 32 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/GO-enrich.R Tue Aug 28 09:09:10 2018 -0400 +++ b/GO-enrich.R Wed Sep 05 03:50:36 2018 -0400 @@ -1,8 +1,6 @@ -suppressMessages(library(clusterProfiler)) +suppressMessages(library(clusterProfiler,quietly = TRUE)) -#library(org.Sc.sgd.db) -suppressMessages(library(org.Hs.eg.db)) -suppressMessages(library(org.Mm.eg.db)) +#library(org.Sc.sgd.db,quietly = TRUE) # Read file and return file content as data.frame readfile = function(filename, header) { @@ -43,24 +41,29 @@ ego<-enrichGO(gene=geneid, universe=universe, OrgDb=orgdb, - keytype="ENTREZID", ont=ontology, pAdjustMethod="BH", pvalueCutoff=pval_cutoff, qvalueCutoff=qval_cutoff, readable=TRUE) + # Plot bar & dot plots - bar_name <- paste("EGO.", ontology, ".bar.png", sep = "") - png(bar_name) - p <- barplot(ego) - print(p) - dev.off() - dot_name <- paste("EGO.", ontology, ".dot.png", sep = "") - png(dot_name) - p <- dotplot(ego, showCategory=10) - print(p) - dev.off() - return(ego) + #if there are enriched GopTerms + if (length(ego$ID)>0){ + bar_name <- paste("EGO.", ontology, ".bar.png", sep = "") + png(bar_name) + p <- barplot(ego) + print(p) + dev.off() + dot_name <- paste("EGO.", ontology, ".dot.png", sep = "") + png(dot_name) + p <- dotplot(ego, showCategory=10) + print(p) + dev.off() + return(ego) + } else { + warning(paste("No Go terms enriched (EGO) found for ",ontology,"ontology"),immediate. = TRUE,noBreaks. = TRUE,call. = FALSE) + } } check_ids <- function(vector,type) { @@ -109,15 +112,17 @@ names(args) <- argsDF$V1 #print(args) - #save(args,file="args.Rda") + #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda") #load("/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda") + suppressMessages(library(args$species, character.only = TRUE, quietly = TRUE)) + # Extract OrgDb - if (args$species=="human") { + if (args$species=="org.Hs.eg.db") { orgdb<-org.Hs.eg.db - } else if (args$species=="mouse") { + } else if (args$species=="org.Mm.eg.db") { orgdb<-org.Mm.eg.db - } else if (args$species=="rat") { + } else if (args$species=="org.Sc.eg.db") { orgdb<-org.Rn.eg.db } @@ -149,7 +154,7 @@ any(check_ids(input,"uniprot")) idFrom<-"UNIPROT" idTo<-"ENTREZID" - gene<-bitr(input, fromType=idFrom, toType=idTo, OrgDb=orgdb) + suppressMessages(gene<-bitr(input, fromType=idFrom, toType=idTo, OrgDb=orgdb)) gene<-unique(gene$ENTREZID) } else if (id_type=="Entrez" & any(check_ids(input,"entrez"))) { gene<-unique(input) @@ -193,7 +198,7 @@ if (universe_id_type=="Uniprot" & any(check_ids(universe,"uniprot"))) { idFrom<-"UNIPROT" idTo<-"ENTREZID" - universe_gene<-bitr(universe, fromType=idFrom, toType=idTo, OrgDb=orgdb) + suppressMessages(universe_gene<-bitr(universe, fromType=idFrom, toType=idTo, OrgDb=orgdb)) universe_gene<-unique(universe_gene$ENTREZID) } else if (universe_id_type=="Entrez" & any(check_ids(universe,"entrez"))) { universe_gene<-unique(universe)
--- a/cluster_profiler.xml Tue Aug 28 09:09:10 2018 -0400 +++ b/cluster_profiler.xml Wed Sep 05 03:50:36 2018 -0400 @@ -1,4 +1,4 @@ -<tool id="cluter_profiler" name="clusterProfiler" version="2018.08.28"> +<tool id="cluter_profiler" name="clusterProfiler" version="2018.09.04"> <description> GO terms classification and enrichment analysis </description> @@ -7,7 +7,7 @@ <requirement type="package" version="3.5.0">bioconductor-org.hs.eg.db</requirement> <requirement type="package" version="3.5.0">bioconductor-org.mm.eg.db</requirement> <requirement type="package" version="3.2.0">bioconductor-dose</requirement> - <requirement type="package" version="3.4.4">bioconductor-clusterprofiler</requirement> + <requirement type="package" version="3.6.0">bioconductor-clusterprofiler</requirement> </requirements> <command detect_errors="exit_code"><