# HG changeset patch # User proteore # Date 1537536218 14400 # Node ID 6afe8166a9a403837b7de073ec38c02d17955870 # Parent 781072a656008f7cf23c635b8d925fdf1a5aa7f0 planemo upload commit 4e898239997b7ef266b1d0ce0a4c7cdec31b4ecd-dirty diff -r 781072a65600 -r 6afe8166a9a4 goprofiles.R --- a/goprofiles.R Wed Sep 19 05:49:06 2018 -0400 +++ b/goprofiles.R Fri Sep 21 09:23:38 2018 -0400 @@ -1,5 +1,7 @@ +options(warn=-1) #TURN OFF WARNINGS !!!!!! + # Load necessary libraries -library(goProfiles,quietly = TRUE) +suppressMessages(library(goProfiles,quietly = TRUE)) # Read file and return file content as data.frame readfile = function(filename, header) { @@ -23,7 +25,7 @@ check_ids <- function(vector,type) { uniprot_pattern = "^([OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2})$" - entrez_id = "^'[0-9]+|[A-Z]{1,2}_[0-9]+|[A-Z]{1,2}_[A-Z]{1,4}[0-9]+)$" + entrez_id = "^([0-9]+|[A-Z]{1,2}_[0-9]+|[A-Z]{1,2}_[A-Z]{1,4}[0-9]+)$" if (type == "Entrez"){ return(grepl(entrez_id,vector)) } else if (type == "UniProt") { @@ -214,10 +216,8 @@ # Get file content file = readfile(filename, header) # Extract Protein IDs list - input = c() - for (row in as.character(file[,ncol])) { - input = c(input, strsplit(row, ";")[[1]][1]) - } + input = unlist(strsplit(file[,ncol],";")) + input = input [which(!is.na(input))] } if (! any(check_ids(input,id_type))){ diff -r 781072a65600 -r 6afe8166a9a4 goprofiles.xml --- a/goprofiles.xml Wed Sep 19 05:49:06 2018 -0400 +++ b/goprofiles.xml Fri Sep 21 09:23:38 2018 -0400 @@ -1,4 +1,4 @@ - + Statistical analysis of functional profiles R