diff options
Diffstat (limited to 'scripts/ctl_analysis.R')
-rw-r--r-- | scripts/ctl_analysis.R | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/ctl_analysis.R b/scripts/ctl_analysis.R index 6c3b22f..24a86a8 100644 --- a/scripts/ctl_analysis.R +++ b/scripts/ctl_analysis.R @@ -2,10 +2,22 @@ library(ctl) # The genotypes.csv file containing the genotype matrix is stored individuals (rows) x genetic marker (columns): +args = commandArgs(trailingOnly=TRUE) -genotypes <- read.csv("genotypes.csv",row.names=1, header=FALSE, sep="\t") +if (length(args)==0) { + stop("Argument for the geno and pheno file location is required", call.=FALSE) +} else { + # default output file + geno_file = args[1] + pheno_file = args[2] +} + + + + +genotypes <- read.csv(geno_file,row.names=1, header=FALSE, sep="\t") # The phenotypes.csv file containing individuals (rows) x traits (columns) measurements: -traits <- read.csv("phenotypes.csv",row.names=1, header=FALSE, sep="\t") +traits <- read.csv(pheno_file,row.names=1, header=FALSE, sep="\t") ctls <- CTLscan(geno,traits,strategy=input$strategy, @@ -17,3 +29,9 @@ ctls <- CTLscan(geno,traits,strategy=input$strategy, #output matrix significant CTL interactions with 4 columns: trait, marker, trait, lod sign <- CTLsignificant(ctls,significance = input$significance) +# add plots + + +json_data <- list(significance=signs, + images=lists("image_1":"image_location"), + network_figure_location="/location")
\ No newline at end of file |