Mercurial > repos > proteore > proteore_goprofiles
diff goprofiles.R @ 11:3ddc1f78773d draft
planemo upload commit 4ba1ebe7b3f5e3fabf78b5fed7ed0b92e2cbf9e5-dirty
author | proteore |
---|---|
date | Fri, 28 Jun 2019 05:11:15 -0400 |
parents | 2138e0035e57 |
children | 601027649251 |
line wrap: on
line diff
--- a/goprofiles.R Mon Mar 04 08:20:52 2019 -0500 +++ b/goprofiles.R Fri Jun 28 05:11:15 2019 -0400 @@ -65,20 +65,13 @@ # Extract Gene Entrez ID if (id_type == "Entrez") { id = select(package, ids, "ENTREZID", multiVals = "first") - genes_ids = id$ENTREZID[which( ! is.na(id$ENTREZID))] } else { - genes_ids = c() id = select(package, ids, "ENTREZID", "UNIPROT", multiVals = "first") - if (duplicate == "TRUE") { - id = unique(id) - } - print(id[[1]]) - genes_ids = id$ENTREZID[which( ! is.na(id$ENTREZID))] - # IDs that have NA ENTREZID - NAs = id$UNIPROT[which(is.na(id$ENTREZID))] - #print("IDs unable to convert to ENTREZID: ") - #print(NAs) } + if (duplicate) { id = unique(id) } + genes_ids = id$ENTREZID[which( ! is.na(id$ENTREZID))] + NAs = id$UNIPROT[which(is.na(id$ENTREZID))] # IDs that have NA ENTREZID + # 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) @@ -163,7 +156,7 @@ id_type = args$id_type input_type = args$input_type if (input_type == "text") { - input = strsplit(args$input, "[ \t\n]+")[[1]] + input = unlist(strsplit(strsplit(args$input, "[ \t\n]+")[[1]],";")) } else if (input_type == "file") { filename = args$input ncol = args$ncol @@ -178,8 +171,8 @@ file = read_file(filename, header) # Extract Protein IDs list input = unlist(strsplit(as.character(file[,ncol]),";")) - input = input [which(!is.na(input))] } + input = input [which(!is.na(gsub("NA",NA,input)))] if (! any(check_ids(input,id_type))){ stop(paste(id_type,"not found in your ids list, please check your IDs in input or the selected column of your input file")) @@ -191,7 +184,7 @@ level = args$level per = as.logical(args$per) title = args$title - duplicate = args$duplicate + duplicate = str2bool(args$duplicate) text_output = args$text_output species=args$species