Mercurial > repos > vmarcon > h_clust
diff h_clust_galaxy.R @ 0:dc678d2c1976 draft default tip
planemo upload commit a2411926bebc2ca3bb31215899a9f18a67e59556
author | vmarcon |
---|---|
date | Thu, 18 Jan 2018 07:56:33 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/h_clust_galaxy.R Thu Jan 18 07:56:33 2018 -0500 @@ -0,0 +1,79 @@ +#!/usr/local/bioinfo/bin/Rscript --vanilla --slave --no-site-file + +# R Script producing a hierarchical clustering +# Input : a file containing a table with numeric values +# except for the first column containing sample names +# and the first line containing variable names +# separator expected is <TAB> +# +# Clustering method : +# euclidean, correlation, ... +# +# Ouptut : a file containing the image of the clustering +#----------------------------------------------------------------- +# Authors : sophie.lamarre(at)insa-toulouse.fr +# ignacio.gonzalez(at)toulouse.inra.fr +# luc.jouneau(at)inra.fr +# valentin.marcon(at)inra.fr +# Version : 0.9 +# Date : 06/09/2017 + +##------------------------------ +## Options +##------------------------------ +strAsFacL <- options()$stringsAsFactors +options(stringsAsFactors = FALSE) + +##------------------------------ +## Libraries laoding +##------------------------------ +# For parseCommandArgs function +library(batch) + +# R script call +source_local <- function(fname) +{ + argv <- commandArgs(trailingOnly = FALSE) + base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) + source(paste(base_dir, fname, sep="/")) +} + +#Import the different functions used for the hierarchical clustering +source_local("h_clust.R") + +##------------------------------ +## Lecture parametres +##------------------------------ +argLs <- parseCommandArgs(evaluate=FALSE) + +group_member_file=argLs[["group_member_file"]] +if (group_member_file=="NO"){ + group_member_file<-NULL +} +select=argLs[["select"]] +if (select=="NULL"){ + select<-NULL +} +column_clustering=argLs[["column_clustering"]] +if (column_clustering=="TRUE"){ + column_clustering<-TRUE +} else { + column_clustering<-FALSE +} + +h_clust(input_file=argLs[["input_file"]], + group_member_file=group_member_file, + output_file=argLs[["output_file"]], + log_file=argLs[["log_file"]], + format_image_out=argLs[["format_image_out"]], + distance_method=argLs[["distance_method"]], + agglomeration_method=argLs[["agglomeration_method"]], + column_clustering=column_clustering, + select=select, + plot_title=argLs[["plot_title"]], + xlab=argLs[["xlab"]], + ylab=argLs[["ylab"]], + width=argLs[["width"]], + height=argLs[["height"]], + ppi=argLs[["ppi"]], + na_encoding=argLs[["NA_code"]])