@@ -113,51 +113,10 @@ load.config <- function(file) {
113
113
114
114
# Parse & validate distance expression
115
115
config $ dist <- parse.distance(settings $ distances )
116
-
117
- # Parse Kernel Settings
118
- if (is.list(settings $ distances )) {
119
- if (is.element(' kernel.dist' , names(settings $ distances ))) {
120
- kernel.settings <- settings $ distances [[' kernel.dist' ]]
121
- config $ decay.factor <- kernel.settings $ decay.factor
122
- config $ rbf.variance <- kernel.settings $ rbf.variance
123
- config $ sst.control <- kernel.settings $ sst.control
124
- config $ rescale.mode <- kernel.settings $ rescale.mode
125
- config $ labelPattern <- kernel.settings $ labelPattern
126
- config $ labelReplacement <- kernel.settings $ labelReplacement
127
- config $ gamma <- kernel.settings $ gamma
128
- }
129
- } else if (is.character(settings $ distances )) {
130
- # parse kernel settings from string
131
- dist.list <- strsplit(settings $ distances , " +" , fixed = TRUE )[[1 ]]
132
- for (dist in dist.list ) {
133
- if (grepl(" kernel.dist" , dist )) {
134
- match <- regexpr(" \\ (.+\\ )" , dist , perl = TRUE )
135
- args <- regmatches(dist , match )
136
- args <- gsub(" [( )]" , " " , args )
137
- kernel.settings <- strsplit(args , " ," , fixed = TRUE )[[1 ]]
138
- names <- c()
139
- values <- c()
140
- for (parm in kernel.settings ) {
141
- split <- strsplit(parm , " =" , fixed = TRUE )[[1 ]]
142
- name <- split [1 ]
143
- value <- split [2 ]
144
- names <- c(names , name )
145
- values <- c(values , value )
146
- }
147
- names(values ) <- names
148
- config $ decay.factor <- as.numeric(values [" decay.factor" ])
149
- config $ rbf.variance <- as.numeric(values [" rbf.variance" ])
150
- config $ sst.control <- as.numeric(values [" sst.control" ])
151
- config $ rescale.mode <- values [" rescale.mode" ]
152
- config $ labelPattern <- values [" labelPattern" ]
153
- config $ labelReplacement <- values [" labelReplacement" ]
154
- config $ gamma <- as.numeric(values [" gamma" ])
155
- }
156
- }
157
- }
158
116
return (config )
159
117
}
160
118
119
+
161
120
parse.distance <- function (distance ) {
162
121
# generate matrix of accepted tree statistic functions from 'metrics' list which can be added to over time without altering the rest of the function
163
122
# if value of 1, only one variable required in distance function call (ie. sackin(x) - sackin(y))
0 commit comments