Mercurial > repos > proteore > proteore_prot_features
annotate protein_features.R @ 8:2e53ba3b1697 draft
planemo upload commit cb952d34dce3fd5cd7baa6f69fdaae3a1174d12e-dirty
| author | proteore |
|---|---|
| date | Fri, 23 Mar 2018 10:37:36 -0400 |
| parents | af7089d1c7c0 |
| children |
| rev | line source |
|---|---|
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
1 # Read file and return file content as data.frame |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
2 readfile = function(filename, header) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
3 if (header == "true") { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
4 # Read only first line of the file as header: |
|
6
fc0118aa432a
planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
proteore
parents:
5
diff
changeset
|
5 headers <- read.table(filename, nrows = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "") |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
6 #Read the data of the files (skipping the first row) |
|
6
fc0118aa432a
planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
proteore
parents:
5
diff
changeset
|
7 file <- read.table(filename, skip = 1, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "") |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
8 # Remove empty rows |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
9 file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
10 #And assign the header to the data |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
11 names(file) <- headers |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
12 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
13 else { |
|
6
fc0118aa432a
planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
proteore
parents:
5
diff
changeset
|
14 file <- read.table(filename, header = FALSE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings=c("", "NA"), blank.lines.skip = TRUE, quote = "") |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
15 # Remove empty rows |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
16 file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
17 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
18 return(file) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
19 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
20 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
21 protein_features = function() { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
22 args <- commandArgs(TRUE) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
23 if(length(args)<1) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
24 args <- c("--help") |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
25 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
26 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
27 # Help section |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
28 if("--help" %in% args) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
29 cat("Selection and Annotation HPA |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
30 Arguments: |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
31 --inputtype: type of input (list of id or filename) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
32 --input: input |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
33 --nextprot: path to nextprot information file |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
34 --column: the column number which you would like to apply... |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
35 --header: true/false if your file contains a header |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
36 --type: the type of input IDs (UniProt/EntrezID) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
37 --argsP1: IsoPoint,SeqLength,MW |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
38 --argsP2: Chr,SubcellLocations |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
39 --argsP3: Diseases |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
40 --output: text output filename \n") |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
41 q(save="no") |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
42 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
43 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
44 # Parse arguments |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
45 parseArgs <- function(x) strsplit(sub("^--", "", x), "=") |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
46 argsDF <- as.data.frame(do.call("rbind", parseArgs(args))) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
47 args <- as.list(as.character(argsDF$V2)) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
48 names(args) <- argsDF$V1 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
49 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
50 inputtype = args$inputtype |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
51 if (inputtype == "copypaste") { |
|
6
fc0118aa432a
planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
proteore
parents:
5
diff
changeset
|
52 input = strsplit(args$input, "[ \t\n]+")[[1]] |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
53 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
54 else if (inputtype == "tabfile") { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
55 filename = args$input |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
56 ncol = args$column |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
57 # Check ncol |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
58 if (! as.numeric(gsub("c", "", ncol)) %% 1 == 0) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
59 stop("Please enter an integer for level") |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
60 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
61 else { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
62 ncol = as.numeric(gsub("c", "", ncol)) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
63 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
64 header = args$header |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
65 # Get file content |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
66 file = readfile(filename, header) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
67 # Extract Protein IDs list |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
68 input = c() |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
69 for (row in as.character(file[,ncol])) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
70 input = c(input, strsplit(row, ";")[[1]][1]) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
71 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
72 } |
|
5
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
73 |
|
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
74 # Read reference file |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
75 nextprot_file = args$nextprot |
|
5
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
76 nextprot = read.table(nextprot_file, header = TRUE, sep = "\t", stringsAsFactors = FALSE, fill = TRUE, na.strings = "", quote = "") |
|
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
77 |
|
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
78 # Parse arguments |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
79 typeid = args$type |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
80 P1_args = strsplit(args$argsP1, ",")[[1]] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
81 P2_args = strsplit(args$argsP2, ",")[[1]] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
82 P3_args = strsplit(args$argsP3, ",")[[1]] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
83 output = args$output |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
84 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
85 # Change the sample ids if they are uniprot ids to be able to match them with |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
86 # Nextprot data |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
87 if (typeid=="uniprot"){ |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
88 input = gsub("^","NX_",input) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
89 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
90 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
91 # Select user input protein ids in nextprot |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
92 if ((length(input[input %in% nextprot[,1]]))==0){ |
|
6
fc0118aa432a
planemo upload commit 5221e042cb207f593b144ed857106235b8f5fbde-dirty
proteore
parents:
5
diff
changeset
|
93 write.table("None of the input ids are can be found in Nextprot",file=output,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE) |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
94 } else { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
95 names = c() |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
96 res = matrix(nrow=length(input), ncol=0) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
97 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
98 # Get information from neXtProt |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
99 if (length(P1_args)>0) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
100 for (arg in P1_args) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
101 names = c(names, arg) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
102 info = nextprot[match(input, nextprot["NextprotID"][,]),][arg][,] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
103 res = cbind(res, info) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
104 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
105 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
106 if (length(P2_args)>0) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
107 for (arg in P2_args) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
108 names = c(names, arg) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
109 info = nextprot[match(input, nextprot["NextprotID"][,]),][arg][,] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
110 res = cbind(res, info) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
111 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
112 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
113 if (length(P3_args)>0) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
114 for (arg in P3_args) { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
115 names = c(names, arg) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
116 info = nextprot[match(input, nextprot["NextprotID"][,]),][arg][,] |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
117 res = cbind(res, info) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
118 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
119 } |
|
7
af7089d1c7c0
planemo upload commit 9022c185a27542381b163c6079bb2d9328e103b0-dirty
proteore
parents:
6
diff
changeset
|
120 |
|
1
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
121 # Write output |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
122 if (inputtype == "copypaste") { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
123 res = cbind(as.matrix(input), res) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
124 names = c(typeid, names) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
125 colnames(res) = names |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
126 write.table(res, output, row.names = FALSE, sep = "\t", quote = FALSE) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
127 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
128 else if (inputtype == "tabfile") { |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
129 names = c(names(file), names) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
130 output_content = cbind(file, res) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
131 colnames(output_content) = names |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
132 write.table(output_content, output, row.names = FALSE, sep = "\t", quote = FALSE) |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
133 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
134 } |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
135 |
|
bfc679370c64
planemo upload commit 5774fd6a5a746f36f6bf4671a51a39ea2b978300-dirty
proteore
parents:
diff
changeset
|
136 } |
|
5
867d47ff782c
planemo upload commit 08f1831e097df5d74bf60ff5955e7e9c8e524cc8-dirty
proteore
parents:
1
diff
changeset
|
137 protein_features() |
