Mercurial > repos > proteore > proteore_prot_features
comparison add_protein_features.R @ 11:8df559ad14a7 draft
planemo upload commit 27f7b6a4a0139ca47ae874fe2fe6de4bd40ffbcf-dirty
| author | proteore |
|---|---|
| date | Fri, 18 Jan 2019 04:13:47 -0500 |
| parents | 0b46a7aead62 |
| children | 1a4cfa7a3a27 |
comparison
equal
deleted
inserted
replaced
| 10:4de4f6359820 | 11:8df559ad14a7 |
|---|---|
| 134 | 134 |
| 135 protein_features = function() { | 135 protein_features = function() { |
| 136 | 136 |
| 137 args <- get_args() | 137 args <- get_args() |
| 138 | 138 |
| 139 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/add_human_protein_features/args.rda") | 139 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/add_protein_features/args.rda") |
| 140 #load("/home/dchristiany/proteore_project/ProteoRE/tools/add_human_protein_features/args.rda") | 140 #load("/home/dchristiany/proteore_project/ProteoRE/tools/add_protein_features/args.rda") |
| 141 | 141 |
| 142 #setting variables | 142 #setting variables |
| 143 inputtype = args$inputtype | 143 inputtype = args$inputtype |
| 144 if (inputtype == "copy_paste") { | 144 if (inputtype == "copy_paste") { |
| 145 input = get_list_from_cp(args$input) | 145 input = get_list_from_cp(args$input) |
| 192 } else { | 192 } else { |
| 193 res <- get_nextprot_info(nextprot,NextprotID,pc_features,localization,diseases_info) | 193 res <- get_nextprot_info(nextprot,NextprotID,pc_features,localization,diseases_info) |
| 194 res = res[!duplicated(res$NextprotID),] | 194 res = res[!duplicated(res$NextprotID),] |
| 195 output_content = merge(file, res,by.x=ncol,by.y="NextprotID",incomparables = NA,all.x=T) | 195 output_content = merge(file, res,by.x=ncol,by.y="NextprotID",incomparables = NA,all.x=T) |
| 196 output_content = order_columns(output_content,ncol,id_type,file) | 196 output_content = order_columns(output_content,ncol,id_type,file) |
| 197 output_content = output_content[,-which(colnames(output_content)=="NextprotID")] #remove nextprotID column | |
| 197 output_content <- as.data.frame(apply(output_content, c(1,2), function(x) gsub("^$|^ $", NA, x))) #convert "" et " " to NA | 198 output_content <- as.data.frame(apply(output_content, c(1,2), function(x) gsub("^$|^ $", NA, x))) #convert "" et " " to NA |
| 198 write.table(output_content, output, row.names = FALSE, sep = "\t", quote = FALSE) | 199 write.table(output_content, output, row.names = FALSE, sep = "\t", quote = FALSE) |
| 199 } | 200 } |
| 200 | 201 |
| 201 } | 202 } |
