7 # Isaak Y Tecle (iyt2@cornell.edu)
15 library(phenoAnalysis
)
18 allArgs
<- commandArgs()
20 outputFiles
<- scan(grep("output_files", allArgs
, value
= TRUE),
23 inputFiles
<- scan(grep("input_files", allArgs
, value
= TRUE),
26 phenoDataFile
<- grep("phenotype_data", inputFiles
, value
= TRUE)
27 message('pheno file: ', phenoDataFile
)
28 traitsFile
<- grep("traits", inputFiles
, value
= TRUE)
29 message('traits file: ', traitsFile
)
31 #phenoDataFile <- '/export/prod/tmp/localhost/GBSApeKIgenotypingv4/solgs/cache/phenotype_data_139.txt';
32 #phenoDataFile <- '/mnt/hgfs/cxgn/phenotype_data_RCBD_1596.txt';
34 phenoData
<- fread(phenoDataFile
,
35 na
.strings
=c("NA", "-", " ", ".", ".."))
37 phenoData
<- data
.frame(phenoData
)
39 traits
<- scan(traitsFile
,
42 traits
<- strsplit(traits
, "\t")
44 #needs more work for multi traits anova
45 for (trait
in traits
) {
46 anovaFiles
<- grep("anova_table",
50 message('anova file: ', anovaFiles
)
51 anovaHtmlFile
<- grep("html",
55 message('anova html file: ', anovaHtmlFile
)
56 anovaTxtFile
<- grep("txt",
60 message('anova txt file: ', anovaTxtFile
)
61 modelSummFile
<- grep("anova_model",
65 message('model file: ', modelSummFile
)
66 adjMeansFile
<- grep("adj_means",
70 message('means file: ', adjMeansFile
)
72 anovaOut
<- runAnova(phenoData
, trait
)
74 anovaTable
<- getAnovaTable(anovaOut
,
79 anovaTable
<- getAnovaTable(anovaOut
,
84 adjMeans
<- getAdjMeans(phenoData
, trait
)
99 q(save
= "no", runLast
= FALSE)