Mercurial > repos > caleb-easterly > peca
changeset 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 | f0de83932f9e |
children | 5c3b60c36c66 |
files | peca.R peca.xml |
diffstat | 2 files changed, 18 insertions(+), 10 deletions(-) [+] |
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
--- a/peca.xml Mon Mar 05 18:11:34 2018 -0500 +++ b/peca.xml Thu Mar 08 18:27:44 2018 -0500 @@ -9,17 +9,18 @@ ## write groups to file echo '$group1' > group1.txt && echo '$group2' > group2.txt && - Rscript --vanilla '$__tool_directory__/peca.R' '$input' group1.txt group2.txt '$test_type' '$output' + Rscript --vanilla '$__tool_directory__/peca.R' '$input' group1.txt group2.txt '$test_type' '$paired' '$output' ]]></command> <inputs> <param name="input" type="data" format="tabular"/> <param name="group1" type="data_column" data_ref="input" multiple="true"/> <param name="group2" type="data_column" data_ref="input" multiple="true"/> - <param name="test_type" type="select"> + <param name="test_type" type="select" label="Type of test"> <option value="t" selected="true">Standard t-test</option> <option value="modt">Modified t-test</option> <option value="rots">Reproducibility-optimized test statistic</option> </param> + <param name="paired" type="boolean" label="Perform paired t-test" checked="false"/> </inputs> <outputs> <data format="tabular" name="output"/> @@ -30,6 +31,7 @@ <param name="group1" value="2,3,4"/> <param name="group2" value="5,6,7"/> <param name="test_type" value="t"/> + <param name="paired" value="false"/> <output name="output" file="out.tab" ftype="tabular"/> </test> </tests>