# HG changeset patch # User proteore # Date 1551696528 18000 # Node ID 948fecb6a40bfe4d0b59b0e29af2550606317409 # Parent 386145573c194bb37be5d1e4f36faaef30a174c6 planemo upload commit 973d782455fd6a7df7ba9bce0a7878de53bc1e68-dirty diff -r 386145573c19 -r 948fecb6a40b goprofiles.R --- a/goprofiles.R Tue Dec 18 09:54:57 2018 -0500 +++ b/goprofiles.R Mon Mar 04 05:48:48 2019 -0500 @@ -79,30 +79,42 @@ #print("IDs unable to convert to ENTREZID: ") #print(NAs) } - # Create basic profiles profile.CC = basicProfile(genes_ids, onto='CC', level=level, orgPackage=species, empty.cats=F, ord=T, na.rm=T) profile.BP = basicProfile(genes_ids, onto='BP', level=level, orgPackage=species, empty.cats=F, ord=T, na.rm=T) profile.MF = basicProfile(genes_ids, onto='MF', level=level, orgPackage=species, empty.cats=F, ord=T, na.rm=T) profile.ALL = basicProfile(genes_ids, onto='ANY', level=level, orgPackage=species, empty.cats=F, ord=T, na.rm=T) - # Print profile # printProfiles(profile) return(c(profile.CC, profile.MF, profile.BP, profile.ALL)) } +#return height and width of plot in inches from profile +plot_size_from_nb_onto <- function(profile){ + width=10 + range = seq(50, 2000, by=25) + names(range) = seq(8,242, by=3) + nb_onto = round(nrow(profile[[1]])/25)*25 + height= as.integer(names(which(range==nb_onto))) + return (c(width,height)) +} + make_plot <- function(profile,percent,title,onto,plot_opt){ + tmp <- plot_size_from_nb_onto (profile) + width <- tmp[1] + height <- tmp[2] + if (plot_opt == "PDF") { file_name=paste("profile_",onto,".pdf",collapse="",sep="") - pdf(file_name) + pdf(file_name, width=width, heigh=height) } else if (plot_opt == "JPEG"){ file_name=paste("profile_",onto,".jpeg",collapse="",sep="") - jpeg(file_name) + jpeg(file_name,width=width, height=height, units = "in", res=100) } else if (plot_opt == "PNG"){ file_name=paste("profile_",onto,".png",collapse="",sep="") - png(file_name) + png(file_name,width=width, height=height, units = "in", res=100) } plotProfiles(profile, percentage=percent, multiplePlots=FALSE, aTitle=title) dev.off() @@ -179,7 +191,7 @@ species=args$species profiles = getprofile(input, id_type, level, duplicate,species) - + for (index in onto_pos) { onto = names(profiles[index]) profile=profiles[index] diff -r 386145573c19 -r 948fecb6a40b goprofiles.xml --- a/goprofiles.xml Tue Dec 18 09:54:57 2018 -0500 +++ b/goprofiles.xml Mon Mar 04 05:48:48 2019 -0500 @@ -1,4 +1,4 @@ - + (Human, Mouse) [goProfiles] R @@ -8,6 +8,7 @@ bioconductor-annotationdbi bioconductor-biobase goprofiles + @@ -59,7 +60,9 @@ - + + [c]{0,1}[0-9]+ + @@ -82,13 +85,26 @@ + + + - + + + + + + + + + + + - + - + @@ -148,13 +164,13 @@ "Select GO terms category": you can choose one or more GO categories which are Biological Process (BP), Cellular Component (CC) and Molecular Function (MF) -"Ontology level (the higher this number, the deeper the GO level)": correspond to the level of GO hierarchy (from 1 to 3). In general the higher the level, the more semantically specific the term is. +"Ontology level (the higher this number, the deeper the GO level)": correspond to the level of GO hierarchy (from 1 to 6). In general the higher the level, the more semantically specific the term is. ----- **Ouput** -Diagram output: graphical output in the form of bar-plot or dot-plot (png, jpeg or pdf format), one figure for each GO category. +Diagram output: graphical output in the form of bar-plot or dot-plot (png (default format), jpeg or pdf format), one figure for each GO category. text output: with the following information GO category description (e.g.BP.Description), GO term identifier (e.g. BP.GOID) and GO term frequency (e.g. BP.Frequency)