diff peca.R @ 11:19bb06146c2e draft

planemo upload for repository https://github.com/caleb-easterly/galaxytools/peca
author caleb-easterly
date Thu, 08 Mar 2018 18:27:44 -0500
parents e16cd77cf9f7
children
line wrap: on
line diff
--- a/peca.R	Mon Mar 05 18:11:34 2018 -0500
+++ b/peca.R	Thu Mar 08 18:27:44 2018 -0500
@@ -14,7 +14,8 @@
     # read first argument, which is quant file (proteins in rows, samples in columns)
     quant_file <- read.delim(args[1],
                            na.strings = c("0", "NA"),
-                           sep = '\t')
+                           sep = '\t',
+                           stringsAsFactors=FALSE)
 
     # read 2nd and 3rd argument, which are path to files with group 1 and 2 column indices 
     group1_ind_file <- as.vector(as.matrix(read.csv(args[2], header = FALSE)[1, ]))
@@ -22,20 +23,25 @@
 
     # test type
     ttype <- args[4]
-
-    # read 4th argument, which is output file name
-    out_file <- args[5]
+    
+    # paired or not 
+    pair <- args[5] == "true"
+    
+    # output file name
+    out_file <- args[6]
 
     # get vectors of column names
     df_names <- colnames(quant_file)
     group1_names <- df_names[group1_ind_file]
     group2_names <- df_names[group2_ind_file]
- 
+
     # run PECA_df
     # id column is first column (hard-coded)
-    results <- PECA_df(quant_file,
-                group1_names,
-                group2_names,
+    results <- PECA_df(df = quant_file,
+                samplenames1 = group1_names,
+                samplenames2 = group2_names,
+                test = ttype,
+                paired = pair,
                 id = df_names[1])
 
     # put add protein names column