Mercurial > repos > anmoljh > rcaret_classification_model
annotate modelBuilding.py @ 0:2cb81da69c73 draft
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
author | anmoljh |
---|---|
date | Thu, 31 May 2018 11:58:59 -0400 |
parents | |
children |
rev | line source |
---|---|
0
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
1 def __inputArguments(): |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
2 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
3 import argparse |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
4 parser = argparse.ArgumentParser() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
5 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
6 parser.add_argument("--method", nargs='?',default ='pls',help="Name of the method on which model will build; \ |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
7 Available Methods are:- pls, glm , glmboost ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
8 parser.add_argument("rdata",help="Descriptor file for model building") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
9 parser.add_argument("--getdatainfoeval",nargs='?',default='TRUE',help="Validation of the data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
10 parser.add_argument("--getdatainfoecho",nargs='?',default='FALSE',help="print on consol about Validity of the data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
11 parser.add_argument("--getdatainforesult",nargs='?',default='hide',help="print in output file about Validity of the data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
12 parser.add_argument("--missingfiltereval",nargs='?',default='FALSE',help="Processing step :: removal of missing value ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
13 parser.add_argument("--missingfilterecho",nargs='?',default='FALSE',help="print Processing step :: removal of missing value ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
14 parser.add_argument("--missingfilterresult",nargs='?',default='hide',help="print in output file about Processing step :: removal of missing value ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
15 parser.add_argument("--missingfilterthreshc",nargs='?',default=0.20,type=float,help="info about highly missing column data") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
16 parser.add_argument("--missingfilterthreshr",nargs='?',default=0.20,type=float,help="info about highly missing row number") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
17 parser.add_argument("--pcaeval",nargs='?',default='FALSE',help="PCA of data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
18 parser.add_argument("--pcaecho",nargs='?',default='FALSE',help="PCA of data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
19 parser.add_argument("--pcaresult",nargs='?',default='hide',help="print in file about PCA of data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
20 parser.add_argument("--pcacomp",nargs='?',default=3,type=int,help="Number of PCA componant will be plotted ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
21 parser.add_argument("--pcaploteval",nargs='?',default='FALSE',help="PCA plot of data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
22 parser.add_argument("--pcaplotecho",nargs='?',default='FALSE',help="print PCA plot of data ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
23 parser.add_argument("--pcaplotresult",nargs='?',default='hide',help="write in output file about PCA plot of data") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
24 parser.add_argument("--pcaplotfig",nargs='?',default='TRUE',help="make figure file for integration in output file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
25 parser.add_argument("--initialdataspliteval",nargs='?',default='TRUE',help="data splitting in test and train set ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
26 parser.add_argument("--initialdatasplitecho",nargs='?',default='FALSE',help="print about data splitting in test and train set") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
27 parser.add_argument("--initialdatasplitresult",nargs='?',default='hide',help="write in outputfile about data splitting in test and train set") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
28 parser.add_argument("--saampling",nargs='?',default="garBage",help="Perform sampling from data") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
29 parser.add_argument("--percent",nargs='?',default=0.8,type=float,help="percent value at which data splitting is done") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
30 parser.add_argument("--nzveval",nargs='?',default='FALSE',help="remove near zero values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
31 parser.add_argument("--nzvresult",nargs='?',default='hide',help="write in outputfile about removing near zero values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
32 parser.add_argument("--nzvecho",nargs='?',default='FALSE',help="print about removing near zero values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
33 parser.add_argument("--corrfiltereval",nargs='?',default='FALSE',help="remove higly correlated values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
34 parser.add_argument("--corrfilterresult",nargs='?',default='hide',help="write in outputfile about removing highly correlated values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
35 parser.add_argument("--corrfilterecho",nargs='?',default='FALSE',help="print about removing correlated values") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
36 parser.add_argument("--threshholdcor",nargs='?',default=0.75,type=float,help="percent value at which correlated values ommitted ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
37 parser.add_argument("--preproceval",nargs='?',default='FALSE',help="pre proccesing") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
38 parser.add_argument("--preprocecho",nargs='?',default='FALSE',help="print about pre proccesing") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
39 parser.add_argument("--preprocresult",nargs='?',default='hide',help="write in output file about pre proccesing") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
40 parser.add_argument("--setupworkersecho",nargs='?',default='FALSE',help="print about number of processors") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
41 parser.add_argument("--setupworkersresult",nargs='?',default='tex',help="write about number of processors in output file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
42 parser.add_argument("--numworkers",nargs='?',default=1,type=int,help="defines used processors") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
43 parser.add_argument("--setupresamplingecho",nargs='?',default='FALSE',help="print resampling rules") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
44 parser.add_argument("--setupresamplingresult",nargs='?',default='hide',help="write resampling rules in output file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
45 parser.add_argument("--resampname",nargs='?',default='boot632',help="choose type of resampling") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
46 parser.add_argument("--resamplenumber",nargs='?',default=10,type=int,help="set number of resampling") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
47 parser.add_argument("--numrepeat",nargs='?',default=3,type=int,help="set times of repeat") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
48 parser.add_argument("--resamplenumberpercent",nargs='?',default=0.75,type=float,help="set PERCENT resampling") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
49 parser.add_argument("--setupgridresult",nargs='?',default='hide',help="write about number of grids in output file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
50 parser.add_argument("--setupgridecho",nargs='?',default='FALSE',help="print about number of grids") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
51 parser.add_argument("--setupgridsize",nargs='?',default=3,type=int,help="set number of grids") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
52 parser.add_argument("--fitmodelresult",nargs='?',default='hide',help="write about model") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
53 parser.add_argument("--fitmodelecho",nargs='?',default='FALSE',help="print about model") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
54 parser.add_argument("--fitmodeleval",nargs='?',default='TRUE',help="start model building") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
55 parser.add_argument("--modeldescrecho",nargs='?',default='FALSE',help="print model description") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
56 parser.add_argument("--modeldescrresult",nargs='?',default='hide',help="write model description in outout file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
57 parser.add_argument("--resamptableecho",nargs='?',default='FALSE',help="print resample table") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
58 parser.add_argument("--resamptableresult",nargs='?',default='tex',help="write resample table in output file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
59 parser.add_argument("--profileplotecho",nargs='?',default='FALSE',help="print about profile plots") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
60 parser.add_argument("--profileplotfig",nargs='?',default='TRUE',help=" profile plots") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
61 parser.add_argument("--stopworkersecho",nargs='?',default='FALSE',help="stop workers ie processors") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
62 parser.add_argument("--stopworkersresult",nargs='?',default='hide',help="write about workers ie processors used") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
63 parser.add_argument("--testpredresult",nargs='?',default='tex',help="write about statistical measure") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
64 parser.add_argument("--testpredecho",nargs='?',default='FALSE',help="print about statistical measure") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
65 parser.add_argument("--classprobstexresult",nargs='?',default='tex',help="paste various figure of statistical measure in outputfile") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
66 parser.add_argument("--classprobstexecho",nargs='?',default='FALSE',help="print various figure of statistical measure") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
67 parser.add_argument("--classprobstexresult1",nargs='?',default='hide',help="create roc curve in outputfile") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
68 parser.add_argument("--classprobstexecho1",nargs='?',default='FALSE',help="print figure of statistical measure") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
69 parser.add_argument("--savedataecho",nargs='?',default='FALSE',help="information about completion of model building ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
70 parser.add_argument("--savedataresult",nargs='?',default='hide',help="write information about completion of model building in outputfile ") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
71 parser.add_argument("--datasets", help="name of the generated datasets") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
72 parser.add_argument("--outputmodel", help="give name for the generated model") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
73 parser.add_argument("--outputresultpdf", help="give name for the output pdf file") |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
74 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
75 args = parser.parse_args() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
76 return args |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
77 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
78 def generateRnwScript(): |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
79 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
80 import templateLibrary |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
81 t = templateLibrary.__template4Rnw() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
82 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
83 from string import Template |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
84 s = Template(t) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
85 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
86 args = __inputArguments() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
87 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
88 templt = s.safe_substitute(METHOD=args.method, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
89 RDATA=args.rdata, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
90 GETDATAINFOEVAL=args.getdatainfoeval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
91 GETDATAINFOECHO=args.getdatainfoecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
92 GETDATAINFORESULT=args.getdatainforesult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
93 MISSINGFILTEREVAL=args.missingfiltereval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
94 MISSINGFILTERECHO=args.missingfilterecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
95 MISSINGFILTERRESULT=args.missingfilterresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
96 MISSINGFILTERTHRESHC=args.missingfilterthreshc, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
97 MISSINGFILTERTHRESHR=args.missingfilterthreshr, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
98 PCAEVAL=args.pcaeval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
99 PCAECHO=args.pcaecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
100 PCARESULT=args.pcaresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
101 PCACOMP=args.pcacomp, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
102 PCAPLOTEVAL=args.pcaploteval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
103 PCAPLOTECHO=args.pcaplotecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
104 PCAPLOTRESULT=args.pcaplotresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
105 PCAPLOTFIG=args.pcaplotfig, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
106 INITIALDATASPLITEVAL=args.initialdataspliteval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
107 INITIALDATASPLITECHO=args.initialdatasplitecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
108 INITIALDATASPLITRESULT=args.initialdatasplitresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
109 SAAMPLING=args.saampling, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
110 PERCENT=args.percent, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
111 NZVEVAL=args.nzveval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
112 NZVRESULT=args.nzvresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
113 NZVECHO=args.nzvecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
114 CORRFILTEREVAL=args.corrfiltereval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
115 CORRFILTERRESULT=args.corrfilterresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
116 CORRFILTERECHO=args.corrfilterecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
117 THRESHHOLDCOR=args.threshholdcor, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
118 PREPROCEVAL=args.preproceval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
119 PREPROCECHO=args.preprocecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
120 PREPROCRESULT=args.preprocresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
121 SETUPWORKERSECHO=args.setupworkersecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
122 SETUPWORKERSRESULT=args.setupworkersresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
123 NUMWORKERS=args.numworkers, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
124 SETUPRESAMPLINGECHO=args.setupresamplingecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
125 SETUPRESAMPLINGRESULT=args.setupresamplingresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
126 RESAMPNAME=args.resampname, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
127 RESAMPLENUMBER=args.resamplenumber, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
128 NUMREPEAT=args.numrepeat, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
129 RESAMPLENUMBERPERCENT=args.resamplenumberpercent, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
130 SETUPGRIDRESULT=args.setupgridresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
131 SETUPGRIDECHO=args.setupgridecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
132 SETUPGRIDSIZE=args.setupgridsize, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
133 FITMODELRESULT=args.fitmodelresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
134 FITMODELECHO=args.fitmodelecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
135 FITMODELEVAL=args.fitmodeleval, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
136 MODELDESCRECHO=args.modeldescrecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
137 MODELDESCRRESULT=args.modeldescrresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
138 RESAMPTABLEECHO=args.resamptableecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
139 RESAMPTABLERESULT=args.resamptableresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
140 PROFILEPLOTECHO=args.profileplotecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
141 PROFILEPLOTFIG=args.profileplotfig, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
142 STOPWORKERSECHO=args.stopworkersecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
143 STOPWORKERSRESULT=args.stopworkersresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
144 TESTPREDRESULT=args.testpredresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
145 TESTPREDECHO=args.testpredecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
146 CLASSPROBSTEXRESULT=args.classprobstexresult, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
147 CLASSPROBSTEXECHO=args.classprobstexecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
148 CLASSPROBSTEXRESULT1=args.classprobstexresult1, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
149 CLASSPROBSTEXECHO1=args.classprobstexecho1, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
150 SAVEDATAECHO=args.savedataecho, |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
151 SAVEDATARESULT=args.savedataresult ) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
152 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
153 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
154 f = open('result-doc.Rnw','w') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
155 f.write(templt) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
156 f.close() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
157 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
158 def modelBuilding(): |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
159 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
160 import os |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
161 os.system('R CMD Sweave result-doc.Rnw > cmd.log.1 2>&1') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
162 os.system('R CMD pdflatex result-doc.tex > cmd.log.2 2>&1') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
163 os.system('R CMD pdflatex result-doc.tex > cmd.log.2 2>&1') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
164 args = __inputArguments() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
165 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
166 from string import Template |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
167 s1 = Template('cp $METHOD-Fit.RData $OUTPUTMODEL') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
168 s2 = Template('cp result-doc.pdf $OUTPUTRESULTPDF') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
169 s3 = Template('cp datasets.RData $DATASETS') |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
170 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
171 cmd1 = s1.safe_substitute(METHOD=args.method, OUTPUTMODEL=args.outputmodel) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
172 cmd2 = s2.safe_substitute(OUTPUTRESULTPDF=args.outputresultpdf) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
173 cmd3 = s3.safe_substitute(DATASETS=args.datasets) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
174 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
175 os.system(cmd1) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
176 os.system(cmd2) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
177 os.system(cmd3) |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
178 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
179 if __name__ == "__main__" : |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
180 |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
181 generateRnwScript() |
2cb81da69c73
planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272
anmoljh
parents:
diff
changeset
|
182 modelBuilding() |