Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor: organize filters, features, fitnesses, extenders

  • Loading branch information...
commit 60f1c2500eed24f89d76dcccde29ce670ce0cc66 1 parent 154417a
egon authored
View
16 src/spexs/extenders/all.go
@@ -0,0 +1,16 @@
+package extenders
+
+var All = [...]Desc{
+ {"simple",
+ "extends using the alphabet",
+ wrap(SimpleExtender)},
+ {"group",
+ "extends using the alphabet and group symbols",
+ wrap(GroupExtender)},
+ {"star",
+ "extends using the alphabet and star extension",
+ wrap(StarExtender)},
+ {"regexp",
+ "extends using the alphabet, group symbols and stars",
+ wrap(GroupStarExtender)},
+}
View
31 src/spexs/extenders/desc.go
@@ -0,0 +1,31 @@
+package extenders
+
+import (
+ . "spexs"
+)
+
+type Func func(p *Pattern, ref *Reference) Patterns
+
+type Conf map[string]interface{}
+type CreateFunc func(conf Conf) (Func, error)
+
+type Desc struct {
+ Name string
+ Desc string
+ Create CreateFunc
+}
+
+func Get(name string) (*Desc, bool) {
+ for _, e := range All {
+ if e.Name == name {
+ return &e, true
+ }
+ }
+ return nil, false
+}
+
+func wrap(f Func) CreateFunc {
+ return func(conf Conf) (Func, error) {
+ return f, nil
+ }
+}
View
3  src/spexs/extenders.go → src/spexs/extenders/extenders.go
@@ -1,6 +1,7 @@
-package spexs
+package extenders
import (
+ . "spexs"
"utils"
)
View
62 src/spxs/features.go → src/spexs/features/all.go
@@ -1,66 +1,53 @@
-package main
+package features
import (
. "spexs"
"utils"
)
-type Feature struct {
- Desc string
- Func FeatureFunc
-}
-
-type StrFeature struct {
- Desc string
- Func StrFeatureFunc
-}
-
-type FeatureFunc func(*Pattern, *Reference) float64
-type StrFeatureFunc func(*Pattern, *Reference) string
-
-var Features = map[string]Feature{
- "query-seqs": {
+var All = [...]Desc{
+ {"query-seqs",
"total number of query sequences",
func(p *Pattern, ref *Reference) float64 {
return float64(ref.Groupings[0])
}},
- "back-seqs": {
+ {"back-seqs",
"total number of background sequences",
func(p *Pattern, ref *Reference) float64 {
return float64(ref.Groupings[1])
}},
- "query-match-seqs": {
+ {"query-match-seqs",
"number of matching query sequences",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Count(ref, 0))
}},
- "back-match-seqs": {
+ {"back-match-seqs",
"number of matching background sequences",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Count(ref, 1))
}},
- "query-match-occs": {
+ {"query-match-occs",
"number of occurences in query",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Occs(ref, 0))
}},
- "back-match-occs": {
+ {"back-match-occs",
"number of occurences in background",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Occs(ref, 1))
}},
- "query-match-seqs-prop": {
+ {"query-match-seqs-prop",
"percentage of matching sequences in query",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Count(ref, 0)) / float64(ref.Groupings[0])
}},
- "back-match-seqs-prop": {
+ {"back-match-seqs-prop",
"percentage of matching sequences in background",
func(p *Pattern, ref *Reference) float64 {
return float64(p.Count(ref, 1)) / float64(ref.Groupings[1])
}},
- "match-hyper-up-pvalue": {
+ {"match-hyper-up-pvalue",
"hypergeometric split p-value",
func(p *Pattern, ref *Reference) float64 {
query := p.Count(ref, 0)
@@ -68,7 +55,7 @@ var Features = map[string]Feature{
pvalue := utils.HypergeometricSplit(query, back, ref.Groupings[0], ref.Groupings[1])
return pvalue
}},
- "match-hyper-up-pvalue-approx": {
+ {"match-hyper-up-pvalue-approx",
"hypergeometric split p-value (approximate)",
func(p *Pattern, ref *Reference) float64 {
query := p.Count(ref, 0)
@@ -76,7 +63,7 @@ var Features = map[string]Feature{
pvalue := utils.HypergeometricSplitApprox(query, back, ref.Groupings[0], ref.Groupings[1])
return pvalue
}},
- "match-hyper-down-pvalue": {
+ {"match-hyper-down-pvalue",
"hypergeometric split p-value down",
func(p *Pattern, ref *Reference) float64 {
query := p.Count(ref, 0)
@@ -84,7 +71,7 @@ var Features = map[string]Feature{
pvalue := utils.HypergeometricSplitDown(query, back, ref.Groupings[0], ref.Groupings[1])
return pvalue
}},
- "match-ratio": {
+ {"match-ratio",
"ratio of (matches in query + 1) / (matches in background + 1)",
func(p *Pattern, ref *Reference) float64 {
query := p.Count(ref, 0)
@@ -92,7 +79,7 @@ var Features = map[string]Feature{
return float64(query+1) / float64(back+1)
}},
- "pat-length": {
+ {"pat-length",
"length of the pattern",
func(p *Pattern, ref *Reference) float64 {
t := -1 // because first "" is also a char
@@ -105,7 +92,7 @@ var Features = map[string]Feature{
}
return float64(t)
}},
- "pat-chars": {
+ {"pat-chars",
"count of characters in pattern",
func(p *Pattern, ref *Reference) float64 {
t := -1 // because first "" is also a char
@@ -117,7 +104,7 @@ var Features = map[string]Feature{
}
return float64(t)
}},
- "pat-groups": {
+ {"pat-groups",
"count of groups in pattern",
func(p *Pattern, ref *Reference) float64 {
t := 0
@@ -129,7 +116,7 @@ var Features = map[string]Feature{
}
return float64(t)
}},
- "pat-stars": {
+ {"pat-stars",
"count of stars in pattern",
func(p *Pattern, ref *Reference) float64 {
t := 0
@@ -143,15 +130,4 @@ var Features = map[string]Feature{
}},
}
-var StrFeatures = map[string]StrFeature{
- "pat": {
- "representation of the pattern",
- func(p *Pattern, ref *Reference) string {
- return p.String()
- }},
- "pat-regexp": {
- "representation of the pattern with group symbols replaced",
- func(p *Pattern, ref *Reference) string {
- return ref.ReplaceGroups(p.String())
- }},
-}
+
View
39 src/spexs/features/desc.go
@@ -0,0 +1,39 @@
+package features
+
+import (
+ . "spexs"
+)
+
+type Func func(*Pattern, *Reference) float64
+
+type Desc struct {
+ Name string
+ Desc string
+ Func Func
+}
+
+func Get(name string) (*Desc, bool) {
+ for _, e := range All {
+ if e.Name == name {
+ return &e, true
+ }
+ }
+ return nil, false
+}
+
+type StrFunc func(*Pattern, *Reference) string
+
+type StrDesc struct {
+ Name string
+ Desc string
+ Func StrFunc
+}
+
+func GetStr(name string) (*StrDesc, bool) {
+ for _, e := range Str {
+ if e.Name == name {
+ return &e, true
+ }
+ }
+ return nil, false
+}
View
18 src/spexs/features/str.go
@@ -0,0 +1,18 @@
+package features
+
+import (
+ . "spexs"
+)
+
+var Str = [...]StrDesc{
+ {"pat",
+ "representation of the pattern",
+ func(p *Pattern, ref *Reference) string {
+ return p.String()
+ }},
+ {"pat-regexp",
+ "representation of the pattern with group symbols replaced",
+ func(p *Pattern, ref *Reference) string {
+ return ref.ReplaceGroups(p.String())
+ }},
+}
View
30 src/spexs/filters/all.go
@@ -0,0 +1,30 @@
+package filters
+
+import (
+ . "spexs"
+)
+
+var All = [...]Desc{
+ {"no-starting-group",
+ "does not allow pattern to start with group",
+ func(conf Conf) (Func, error) {
+ return func(p *Pattern, ref *Reference) bool {
+ for p != nil {
+ if (p.IsGroup || p.IsStar) &&
+ (p.Parent != nil) &&
+ (p.Parent.Parent == nil) {
+ return false
+ }
+ p = p.Parent
+ }
+ return true
+ }, nil
+ }},
+ {"no-ending-group",
+ "does not allow pattern to end with group",
+ func(conf Conf) (Func, error) {
+ return func(p *Pattern, ref *Reference) bool {
+ return !p.IsGroup
+ }, nil
+ }},
+}
View
44 src/spexs/filters/composite.go
@@ -0,0 +1,44 @@
+package filters
+
+import (
+ . "spexs"
+ "errors"
+)
+
+func trueFilter(p *Pattern, ref *Reference) bool {
+ return true
+}
+
+func Compose(conf map[string]Conf) (Func, error) {
+ filters := make([]Func, 0)
+
+ for name, args := range conf {
+ filter, valid := Get(name)
+ if !valid {
+ return nil, errors.New("No filter named: " + name)
+ }
+
+ f, err := filter.Create(args)
+ if err != nil {
+ return nil, err
+ }
+
+ filters = append(filters, f)
+ }
+
+ if len(filters) == 0 {
+ return trueFilter, nil
+ } else if len(filters) == 1 {
+ return filters[0], nil
+ }
+
+ // create a composite filter
+ return func(p *Pattern, ref *Reference) bool {
+ for _, f := range filters {
+ if !f(p, ref) {
+ return false
+ }
+ }
+ return true
+ }, nil
+}
View
27 src/spexs/filters/desc.go
@@ -0,0 +1,27 @@
+package filters
+
+import (
+ . "spexs"
+)
+
+type Func func(p *Pattern, ref *Reference) bool
+
+type Conf map[string]interface{}
+type CreateFunc func(Conf) (Func, error)
+
+type Desc struct {
+ Name string
+ Desc string
+ Create CreateFunc
+}
+
+func Get(name string) (*Desc, bool) {
+ for _, e := range All {
+ if e.Name == name {
+ return &e, true
+ }
+ }
+
+ f, valid := getFeatureFilter(name)
+ return f, valid
+}
View
58 src/spexs/filters/feature.go
@@ -0,0 +1,58 @@
+package filters
+
+import (
+ . "spexs"
+ "spexs/features"
+ "math"
+ "utils"
+ "errors"
+)
+
+type floatConf struct{ Min, Max float64 }
+
+func makeFilter(feature features.Func, config interface{}) (f Func, err error) {
+ err = nil
+ var conf floatConf
+ conf.Min = math.NaN()
+ conf.Max = math.NaN()
+
+ utils.ApplyObject(&config, &conf)
+
+ min, max := conf.Min, conf.Max
+ low, high := !math.IsNaN(conf.Min), !math.IsNaN(conf.Max)
+
+ f = nil
+ if low && high {
+ f = func(p *Pattern, ref *Reference) bool {
+ return (feature(p, ref) <= max) && (feature(p, ref) >= min)
+ }
+ } else if low {
+ f = func(p *Pattern, ref *Reference) bool {
+ return feature(p, ref) >= min
+ }
+ } else if high {
+ f = func(p *Pattern, ref *Reference) bool {
+ return feature(p, ref) <= max
+ }
+ }
+
+ if f == nil {
+ return trueFilter, errors.New("Neither min or max was defined for filter.")
+ }
+
+ return f, nil
+}
+
+func wrap(f features.Func) CreateFunc {
+ return func(conf Conf) (Func, error) {
+ return makeFilter(f, conf)
+ }
+}
+
+func getFeatureFilter(name string) (*Desc, bool) {
+ f, valid := features.Get(name)
+ if !valid {
+ return nil, false
+ }
+ return &Desc{f.Name, f.Desc, wrap(f.Func)}, true
+}
View
8 src/spexs/fitnesses/all.go
@@ -0,0 +1,8 @@
+package fitnesses
+
+import (
+ //. "spexs"
+)
+
+var All = [...]Desc{
+}
View
26 src/spexs/fitnesses/desc.go
@@ -0,0 +1,26 @@
+package fitnesses
+
+import (
+ . "spexs"
+)
+
+type Func func(p *Pattern, ref *Reference) float64
+
+type Conf map[string]interface{}
+type CreateFunc func(Conf) (Func, error)
+
+type Desc struct {
+ Name string
+ Desc string
+ Create CreateFunc
+}
+
+func Get(name string) (*Desc, bool) {
+ for _, e := range All {
+ if e.Name == name {
+ return &e, true
+ }
+ }
+
+ return getFeatureFitness(name)
+}
View
19 src/spexs/fitnesses/feature.go
@@ -0,0 +1,19 @@
+package fitnesses
+
+import (
+ "spexs/features"
+)
+
+func wrap(f features.Func) CreateFunc {
+ return func(conf Conf) (Func, error) {
+ return Func(f), nil
+ }
+}
+
+func getFeatureFitness(name string) (*Desc, bool) {
+ f, valid := features.Get(name)
+ if !valid {
+ return nil, false
+ }
+ return &Desc{f.Name, f.Desc, wrap(f.Func)}, true
+}
View
9 src/spxs/conf.go
@@ -9,6 +9,9 @@ import (
"regexp"
"strconv"
"strings"
+
+ "spexs/filters"
+ "spexs/extenders"
)
const baseConfiguration = `{
@@ -52,14 +55,14 @@ type Conf struct {
}
Extension struct {
Method string
- Args map[string]map[string]interface{}
- Filter map[string]map[string]interface{}
+ Args map[string]extenders.Conf
+ Filter map[string]filters.Conf
}
Output struct {
Order string
Sort string
Args map[string]map[string]interface{}
- Filter map[string]map[string]interface{}
+ Filter map[string]filters.Conf
Count int
Header string
Format string
View
60 src/spxs/extenders.go
@@ -1,60 +0,0 @@
-package main
-
-import (
- "log"
- . "spexs"
-)
-
-type extenderConf map[string]interface{}
-type extenderCreator func(conf extenderConf, setup AppSetup) ExtenderFunc
-
-type extenderDesc struct {
- name string
- desc string
- fun extenderCreator
-}
-
-var Extenders = [...]extenderDesc{
- {"simple",
- "extends using the alphabet",
- simpleExtender(SimpleExtender)},
- {"group",
- "extends using the alphabet and group symbols",
- simpleExtender(GroupExtender)},
- {"star",
- "extends using the alphabet and star extension",
- simpleExtender(StarExtender)},
- {"regexp",
- "extends using the alphabet, group symbols and stars",
- simpleExtender(GroupStarExtender)},
-}
-
-func getExtender(name string) (extenderCreator, bool) {
- for _, e := range Extenders {
- if e.name == name {
- return e.fun, true
- }
- }
- return nil, false
-}
-
-func simpleExtender(f ExtenderFunc) extenderCreator {
- return func(conf extenderConf, setup AppSetup) ExtenderFunc {
- return f
- }
-}
-
-func CreateExtender(conf Conf, setup AppSetup) ExtenderFunc {
- if conf.Extension.Method == "" {
- log.Fatal("Extender not defined!")
- }
-
- create, valid := getExtender(conf.Extension.Method)
- if !valid {
- log.Fatal("No extender named: ", conf.Extension.Method)
- }
-
- args := conf.Extension.Args[conf.Extension.Method]
-
- return create(args, setup)
-}
View
104 src/spxs/filters.go
@@ -1,104 +0,0 @@
-package main
-
-import (
- "log"
- "math"
- . "spexs"
- "utils"
-)
-
-type filterConf map[string]interface{}
-type filterCreator func(filterConf) FilterFunc
-
-type floatFilterConf struct{ Min, Max float64 }
-
-func trueFilter(p *Pattern, ref *Reference) bool {
- return true
-}
-
-var Filters = map[string]filterCreator{
- "no-starting-group": func(conf filterConf) FilterFunc {
- return func(p *Pattern, ref *Reference) bool {
- for p != nil {
- if (p.IsGroup || p.IsStar) && (p.Parent != nil) && (p.Parent.Parent == nil) {
- return false
- }
- p = p.Parent
- }
- return true
- }
- },
- "no-ending-group": func(conf filterConf) FilterFunc {
- return func(p *Pattern, ref *Reference) bool {
- return !p.IsGroup
- }
- },
-}
-
-func CreateFilter(conf map[string]map[string]interface{}, setup AppSetup) FilterFunc {
- filters := make([]FilterFunc, 0)
-
- for name, args := range conf {
- if _, valid := Filters[name]; !valid {
- log.Fatal("No filter named: ", name)
- }
- f := Filters[name](args)
- filters = append(filters, f)
- }
-
- if len(filters) == 0 {
- return trueFilter
- } else if len(filters) == 1 {
- return filters[0]
- }
-
- // create a composite filter
- return func(p *Pattern, ref *Reference) bool {
- for _, f := range filters {
- if !f(p, ref) {
- return false
- }
- }
- return true
- }
-}
-
-func makeFloatFilter(feature FeatureFunc, config interface{}) FilterFunc {
- var conf floatFilterConf
- conf.Min = math.NaN()
- conf.Max = math.NaN()
-
- utils.ApplyObject(&config, &conf)
-
- min, max := conf.Min, conf.Max
- low, high := !math.IsNaN(conf.Min), !math.IsNaN(conf.Max)
-
- if low && high {
- return func(p *Pattern, ref *Reference) bool {
- return (feature(p, ref) <= max) && (feature(p, ref) >= min)
- }
- } else if low {
- return func(p *Pattern, ref *Reference) bool {
- return feature(p, ref) >= min
- }
- } else if high {
- return func(p *Pattern, ref *Reference) bool {
- return feature(p, ref) <= max
- }
- }
-
- log.Fatal("Neither min or max was defined for filter.")
- return trueFilter
-}
-
-func makeFilter(f FeatureFunc) filterCreator {
- return func(conf filterConf) FilterFunc {
- return makeFloatFilter(f, conf)
- }
-}
-
-func initFilters() {
- for name, f := range Features {
- Filters[name] = makeFilter(f.Func)
- }
-}
View
45 src/spxs/fitnesses.go
@@ -1,45 +0,0 @@
-package main
-
-import (
- "log"
- . "spexs"
-)
-
-type fitnessConf map[string]interface{}
-type fitnessCreator func(fitnessConf, AppSetup) FitnessFunc
-
-func simpleFitness(f FitnessFunc) fitnessCreator {
- return func(conf fitnessConf, setup AppSetup) FitnessFunc {
- return f
- }
-}
-
-var Fitnesses = map[string]fitnessCreator{}
-
-func CreateFitness(conf Conf, setup AppSetup) FitnessFunc {
- if conf.Output.Order == "" {
- log.Fatal("Output ordering not defined!")
- }
-
- fitnessCreate, valid := Fitnesses[conf.Output.Order]
- if !valid {
- log.Fatal("No ordering/fitness named: ", conf.Output.Order)
- }
- args := conf.Output.Args[conf.Output.Order]
-
- return fitnessCreate(args, setup)
-}
-
-func makeFloatFitness(f FeatureFunc) fitnessCreator {
- return func(conf fitnessConf, setup AppSetup) FitnessFunc {
- return func(p *Pattern) float64 {
- return f(p, setup.Ref)
- }
- }
-}
-
-func initFitnesses() {
- for name, f := range Features {
- Fitnesses[name] = makeFloatFitness(f.Func)
- }
-}
View
47 src/spxs/help.go
@@ -5,6 +5,11 @@ import (
"log"
"os"
"sort"
+
+ "spexs/filters"
+ "spexs/extenders"
+ "spexs/features"
+ "spexs/fitnesses"
)
var lgh = log.New(os.Stderr, "", 0)
@@ -71,46 +76,40 @@ func PrintAliases(conf Conf) {
}
func PrintStrFeatures() {
- info := make(map[string]string)
- for name, data := range StrFeatures {
- info[name] = data.Desc
+ printCaption("Features")
+ for _, e := range features.Str {
+ printItem(e.Name, e.Desc)
}
-
- printSection("String Features", info)
}
func PrintFeatures() {
- info := make(map[string]string)
- for name, data := range Features {
- info[name] = data.Desc
+ printCaption("Features")
+ for _, e := range features.All {
+ printItem(e.Name, e.Desc)
}
-
- printSection("Features", info)
}
func PrintFitnesses() {
- info := make(map[string]string)
- for name, _ := range Fitnesses {
- info[name] = ""
- }
- info["+[FEATURES]"] = ""
+ printCaption("Fitnesses")
+ printItem("+[FEATURES]", "")
- printSection("Fitnesses", info)
+ for _, e := range fitnesses.All {
+ printItem(e.Name, e.Desc)
+ }
}
func PrintFilters() {
- info := make(map[string]string)
- for name, _ := range Filters {
- info[name] = ""
- }
- info["+[FEATURES]"] = ""
+ printCaption("Filters")
+ printItem("+[FEATURES]", "")
- printSection("Filters", info)
+ for _, e := range filters.All {
+ printItem(e.Name, e.Desc)
+ }
}
func PrintExtenders() {
printCaption("Extenders")
- for _, e := range Extenders {
- printItem(e.name, e.desc)
+ for _, e := range extenders.All {
+ printItem(e.Name, e.Desc)
}
}
View
27 src/spxs/printer.go
@@ -8,6 +8,8 @@ import (
"regexp"
. "spexs"
"text/template"
+
+ "spexs/features"
)
func CreatePrinter(conf Conf, setup AppSetup) PrinterFunc {
@@ -23,16 +25,29 @@ func CreatePrinter(conf Conf, setup AppSetup) PrinterFunc {
regFixName, _ := regexp.Compile(`-`)
fixedNames := make(map[string]string)
+
+ feats := make(map[string]features.Func)
+ strFeats := make(map[string]features.StrFunc)
formatStrs := regExtract.FindAllStringSubmatch(format, -1)
for _, tokens := range formatStrs {
name := tokens[1]
- _, valid := Features[name]
- _, validStr := StrFeatures[name]
+
+ f, valid := features.Get(name)
+ fs, validStr := features.GetStr(name)
+
if !(valid || validStr) {
log.Fatal(errors.New("No valid format parameter: " + name))
}
+ if valid {
+ feats[name] = f.Func
+ }
+
+ if validStr {
+ strFeats[name] = fs.Func
+ }
+
fixedNames[name] = regFixName.ReplaceAllString(name, "")
}
@@ -54,13 +69,13 @@ func CreatePrinter(conf Conf, setup AppSetup) PrinterFunc {
values := make(map[string]interface{})
for name, fixName := range fixedNames {
- f, valid := Features[name]
+ f, valid := feats[name]
if valid {
- values[fixName] = f.Func(pat, ref)
+ values[fixName] = f(pat, ref)
}
- fstr, valid := StrFeatures[name]
+ fstr, valid := strFeats[name]
if valid {
- values[fixName] = fstr.Func(pat, ref)
+ values[fixName] = fstr(pat, ref)
}
}
View
55 src/spxs/setup.go
@@ -3,7 +3,12 @@ package main
import (
"io"
. "spexs"
- pool "spexs/pool"
+ "log"
+
+ "spexs/pool"
+ "spexs/extenders"
+ "spexs/filters"
+ "spexs/fitnesses"
)
const MAX_POOL_SIZE = 1024 * 1024 * 1024
@@ -67,7 +72,49 @@ func CreateSetup(conf Conf) AppSetup {
return s
}
-func initSetup() {
- initFitnesses()
- initFilters()
+func CreateExtender(conf Conf, setup AppSetup) ExtenderFunc {
+ if conf.Extension.Method == "" {
+ log.Fatal("Extender not defined!")
+ }
+
+ extender, valid := extenders.Get(conf.Extension.Method)
+ if !valid {
+ log.Fatal("No extender named: ", conf.Extension.Method)
+ }
+
+ args := conf.Extension.Args[conf.Extension.Method]
+
+ ext, err := extender.Create(args)
+ if err != nil {
+ log.Fatal(err)
+ }
+ return ExtenderFunc(ext)
+}
+
+func CreateFilter(conf map[string]filters.Conf, setup AppSetup) FilterFunc {
+ f, err := filters.Compose(conf)
+ if err != nil {
+ log.Fatal(err)
+ }
+ return FilterFunc(f)
+}
+
+func CreateFitness(conf Conf, setup AppSetup) FitnessFunc {
+ if conf.Output.Order == "" {
+ log.Fatal("Output ordering not defined!")
+ }
+
+ fitness, valid := fitnesses.Get(conf.Output.Order)
+ if !valid {
+ log.Fatal("No ordering/fitness named: ", conf.Output.Order)
+ }
+ args := conf.Output.Args[conf.Output.Order]
+ fit, err := fitness.Create(args)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ return func(p *Pattern) float64{
+ return fit(p, setup.Ref)
+ }
}
View
3  src/spxs/spxs.go
@@ -56,7 +56,6 @@ func main() {
info("reading input")
- initSetup()
setup := CreateSetup(conf)
// defined in runtime.go
@@ -86,7 +85,7 @@ func main() {
}
endStats()
-
+
if conf.Output.Queue != "lifo" {
info("sorting results")
Please sign in to comment.
Something went wrong with that request. Please try again.