From 541af4ab39c911102fb89beedaa430e282bdb529 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 13 Oct 2021 14:50:03 +0300 Subject: export json data --- scripts/ctl_analysis.R | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3