Skip to content

Commit f649531

Browse files
committed
2021/09/17-14:45:43 (Linux ws6890.zit.bam.de x86_64)
1 parent d2b66e7 commit f649531

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scoresLr_expand.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ var _log OperationUnary = OperationUnary{
5959

6060
var _square OperationUnary = OperationUnary{
6161
Func : func(a float64) float64 { return a*a },
62-
Name : func(a string ) string { return fmt.Sprintf("(a^2)", a) },
62+
Name : func(a string ) string { return fmt.Sprintf("(%s^2)", a) },
6363
Final: true }
6464

6565
var _sqrt OperationUnary = OperationUnary{
6666
Func : func(a float64) float64 { return math.Sqrt(a) },
67-
Name : func(a string ) string { return fmt.Sprintf("sqrt(a)", a) },
67+
Name : func(a string ) string { return fmt.Sprintf("sqrt(%s)", a) },
6868
Final: true }
6969

7070
var _add OperationBinary = OperationBinary{
@@ -167,7 +167,7 @@ func expand_export(config Config, scores_columns [][]float64, scores_lengths []i
167167
if j == 0 {
168168
fmt.Fprintf(w, "%s", name)
169169
} else {
170-
fmt.Fprintf(w, " %s", name)
170+
fmt.Fprintf(w, ",%s", name)
171171
}
172172
}
173173
fmt.Fprintf(w, "\n")
@@ -178,7 +178,7 @@ func expand_export(config Config, scores_columns [][]float64, scores_lengths []i
178178
if j == 0 {
179179
fmt.Fprintf(w, "%e", scores_columns[j][i])
180180
} else {
181-
fmt.Fprintf(w, " %e", scores_columns[j][i])
181+
fmt.Fprintf(w, ",%e", scores_columns[j][i])
182182
}
183183
}
184184
}
@@ -228,6 +228,7 @@ func main_expand_scores(config Config, args []string) {
228228
options := getopt.New()
229229

230230
optDepth := options. IntLong("depth", 0 , 1, "recursion depth")
231+
optHeader := options.BoolLong("header", 0 , "input files contain a header with feature names")
231232
optHelp := options.BoolLong("help", 'h', "print help")
232233

233234
options.SetParameters("<SCORES1.table,SCORES2.table,...> <BASENAME_OUT>")
@@ -243,6 +244,7 @@ func main_expand_scores(config Config, args []string) {
243244
options.PrintUsage(os.Stdout)
244245
os.Exit(0)
245246
}
247+
config.Header = *optHeader
246248
// parse arguments
247249
//////////////////////////////////////////////////////////////////////////////
248250
if len(options.Args()) != 2 {

0 commit comments

Comments
 (0)