diff options
author | Alexander Kabui | 2021-10-13 14:50:03 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-01-22 09:23:14 +0300 |
commit | 541af4ab39c911102fb89beedaa430e282bdb529 (patch) | |
tree | 33decb2afd010734d4043fdee31ea0d7f44951f3 /scripts | |
parent | 8981ef0585dd6b74b6719faa886d0c9880f18698 (diff) | |
download | genenetwork3-541af4ab39c911102fb89beedaa430e282bdb529.tar.gz |
export json data
Diffstat (limited to 'scripts')
-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 |