From 360e74f3f16dec8375af7e922c717701be11763d Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 12:06:46 -0800 Subject: [PATCH 01/21] api init --- api/README.md | 3 + api/api/api.go | 288 ++++++ api/api/api_test.go | 131 +++ api/api/codon_tables/README.md | 7 + api/api/codon_tables/freqB.json | 379 ++++++++ api/api/codon_tables/pichia.json | 379 ++++++++ api/api/codon_tables/scerevisiae.json | 375 ++++++++ api/api/json/json.go | 181 ++++ api/api/json/json_test.go | 99 ++ api/api/lua.go | 235 +++++ api/api/lua_test.go | 126 +++ api/api/templates/attachment-icon.png | Bin 0 -> 289 bytes api/api/templates/chat.html | 32 + api/api/templates/styles.css | 120 +++ api/gen/dnadesign-server.gen.go | 1274 +++++++++++++++++++++++++ api/gen/dnadesign-types.gen.go | 154 +++ api/gen/gen.sh | 2 + api/gen/server.cfg.yaml | 6 + api/gen/types.cfg.yaml | 4 + api/main.go | 19 + api/spec.yaml | 450 +++++++++ go.mod | 16 +- go.sum | 41 + 23 files changed, 4319 insertions(+), 2 deletions(-) create mode 100644 api/README.md create mode 100644 api/api/api.go create mode 100644 api/api/api_test.go create mode 100644 api/api/codon_tables/README.md create mode 100644 api/api/codon_tables/freqB.json create mode 100644 api/api/codon_tables/pichia.json create mode 100644 api/api/codon_tables/scerevisiae.json create mode 100644 api/api/json/json.go create mode 100644 api/api/json/json_test.go create mode 100644 api/api/lua.go create mode 100644 api/api/lua_test.go create mode 100644 api/api/templates/attachment-icon.png create mode 100644 api/api/templates/chat.html create mode 100644 api/api/templates/styles.css create mode 100644 api/gen/dnadesign-server.gen.go create mode 100644 api/gen/dnadesign-types.gen.go create mode 100755 api/gen/gen.sh create mode 100644 api/gen/server.cfg.yaml create mode 100644 api/gen/types.cfg.yaml create mode 100644 api/main.go create mode 100644 api/spec.yaml diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000..f641f82 --- /dev/null +++ b/api/README.md @@ -0,0 +1,3 @@ +# DnaDesign API + +One thing that puts DnaDesign apart is an emphasis on API integration. More on this later! diff --git a/api/api/api.go b/api/api/api.go new file mode 100644 index 0000000..1ec1653 --- /dev/null +++ b/api/api/api.go @@ -0,0 +1,288 @@ +package api + +import ( + "context" + "embed" + _ "embed" + "encoding/json" + "fmt" + "html/template" + "io/fs" + "log" + "log/slog" + "net/http" + "strings" + "sync" + + "github.com/flowchartsman/swaggerui" + "github.com/koeng101/dnadesign/api/gen" + "github.com/koeng101/dnadesign/bio" + "github.com/koeng101/dnadesign/primers/pcr" + "github.com/koeng101/dnadesign/synthesis/codon" + "github.com/koeng101/dnadesign/synthesis/fix" + "github.com/koeng101/dnadesign/synthesis/fragment" +) + +//go:embed codon_tables/freqB.json +var ecoliCodonTable []byte + +var ( + // CodonTables is a list of default codon tables. + CodonTables = map[string]*codon.TranslationTable{ + "Escherichia coli": codon.ParseCodonJSON(ecoliCodonTable), + } +) + +//go:embed templates/* +var templatesFS embed.FS +var templates = template.Must(template.ParseFS(templatesFS, "templates/*")) + +// IndexHandler handles the basic HTML page for interacting with polyAPI. +func indexHandler(w http.ResponseWriter, r *http.Request) { + err := templates.ExecuteTemplate(w, "chat.html", nil) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +// App implements the dnadesign app +type App struct { + Router *http.ServeMux + Logger *slog.Logger +} + +func corsMiddleware(handler http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") // Set CORS header + handler.ServeHTTP(w, r) + }) +} + +// initializeApp starts here +func InitializeApp() App { + var app App + app.Router = http.NewServeMux() + + // Initiate logger + app.Logger = slog.Default() + appImpl := gen.NewStrictHandler(&app, nil) + + // Handle swagger docs. + swagger, err := gen.GetSwagger() + if err != nil { + log.Fatalf("Failed to get swagger: %s", err) + } + jsonSwagger, err := swagger.MarshalJSON() + if err != nil { + log.Fatalf("Failed to marshal swagger: %s", err) + } + + // Handle static files + subFS, err := fs.Sub(templatesFS, "templates") + if err != nil { + log.Fatal(err) + } + + // Handle "hello" for testing with wasm + app.Router.HandleFunc("/hello", func(res http.ResponseWriter, req *http.Request) { + params := make(map[string]string) + if err := json.NewDecoder(req.Body).Decode(¶ms); err != nil { + panic(err) + } + + res.Header().Add("Content-Type", "application/json") + if err := json.NewEncoder(res).Encode(map[string]string{ + "message": fmt.Sprintf("Hello there %s!", params["name"]), + }); err != nil { + panic(err) + } + }) + + // Handle routes. + app.Router.HandleFunc("/", indexHandler) + app.Router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(subFS)))) + app.Router.Handle("/swagger/", http.StripPrefix("/swagger", swaggerui.Handler(jsonSwagger))) + app.Router.HandleFunc("/docs", func(w http.ResponseWriter, r *http.Request) { w.Write(jsonSwagger) }) + + // Lua handlers. + app.Router.HandleFunc("/api/execute_lua", appImpl.PostExecuteLua) + + // IO handlers. + app.Router.HandleFunc("/api/io/fasta/parse", appImpl.PostIoFastaParse) + + // CDS design handlers. + app.Router.HandleFunc("/api/design/cds/fix", appImpl.PostDesignCdsFix) + app.Router.HandleFunc("/api/design/cds/optimize", appImpl.PostDesignCdsOptimize) + app.Router.HandleFunc("/api/design/cds/translate", appImpl.PostDesignCdsTranslate) + + // Simulate handlers. + app.Router.HandleFunc("/api/simulate/fragment", appImpl.PostSimulateFragment) + app.Router.HandleFunc("/api/simulate/complex_pcr", appImpl.PostSimulateComplexPcr) + app.Router.HandleFunc("/api/simulate/pcr", appImpl.PostSimulatePcr) + + return app +} + +/* +***************************************************************************** + +# Lua functions + +***************************************************************************** +*/ + +func (app *App) PostExecuteLua(ctx context.Context, request gen.PostExecuteLuaRequestObject) (gen.PostExecuteLuaResponseObject, error) { + script := request.Body.Script + attachments := *request.Body.Attachments + output, log, err := app.ExecuteLua(script, attachments) + if err != nil { + return gen.PostExecuteLua500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostExecuteLua200JSONResponse{Output: output, Log: log}, nil +} + +/* +***************************************************************************** + +# IO functions + +***************************************************************************** +*/ + +func (app *App) PostIoFastaParse(ctx context.Context, request gen.PostIoFastaParseRequestObject) (gen.PostIoFastaParseResponseObject, error) { + fastaString := *request.Body + parser, err := bio.NewFastaParser(strings.NewReader(fastaString + "\n")) + if err != nil { + return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + fastas, err := parser.Parse() + if err != nil { + return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data := make([]gen.FastaRecord, len(fastas)) + for i, fastaRecord := range fastas { + data[i] = gen.FastaRecord{Name: fastaRecord.Identifier, Sequence: fastaRecord.Sequence} + } + return gen.PostIoFastaParse200JSONResponse(data), nil +} + +/* +***************************************************************************** + +# CDS functions + +***************************************************************************** +*/ + +func fixFunctions(sequencesToRemove []string) []func(string, chan fix.DnaSuggestion, *sync.WaitGroup) { + var functions []func(string, chan fix.DnaSuggestion, *sync.WaitGroup) + functions = append(functions, fix.RemoveSequence([]string{"AAAAAAAA", "GGGGGGGG"}, "Homopolymers removed. Interferes with synthesis.")) + functions = append(functions, fix.RemoveRepeat(18)) + functions = append(functions, fix.GcContentFixer(0.80, 0.20)) + functions = append(functions, fix.RemoveSequence([]string{"GGTCTC", "GAAGAC", "CACCTGC"}, "Common TypeIIS restriction enzymes - BsaI, BbsI, PaqCI")) + return functions +} + +func (app *App) PostDesignCdsFix(ctx context.Context, request gen.PostDesignCdsFixRequestObject) (gen.PostDesignCdsFixResponseObject, error) { + var ct codon.Table + organism := string(request.Body.Organism) + ct, ok := CodonTables[organism] + if !ok { + return gen.PostDesignCdsFix400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil + } + sequence, fixChanges, err := fix.Cds(request.Body.Sequence, ct, fixFunctions(request.Body.RemoveSequences)) + if err != nil { + return gen.PostDesignCdsFix500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + changes := make([]gen.Change, len(fixChanges)) + for i, change := range fixChanges { + changes[i] = gen.Change{From: change.From, Position: change.Position, Reason: change.Reason, Step: change.Step, To: change.To} + } + return gen.PostDesignCdsFix200JSONResponse{Sequence: sequence, Changes: changes}, nil +} + +func (app *App) PostDesignCdsOptimize(ctx context.Context, request gen.PostDesignCdsOptimizeRequestObject) (gen.PostDesignCdsOptimizeResponseObject, error) { + var ct *codon.TranslationTable + organism := string(request.Body.Organism) + ct, ok := CodonTables[organism] + if !ok { + return gen.PostDesignCdsOptimize400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil + } + var seed int + if request.Body.Seed != nil { + seed = *request.Body.Seed + } + ct.UpdateWeights(ct.AminoAcids) + sequence, err := ct.Optimize(request.Body.Sequence, seed) + if err != nil { + return gen.PostDesignCdsOptimize500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostDesignCdsOptimize200JSONResponse(sequence), nil +} + +func (app *App) PostDesignCdsTranslate(ctx context.Context, request gen.PostDesignCdsTranslateRequestObject) (gen.PostDesignCdsTranslateResponseObject, error) { + translationTableInteger := request.Body.TranslationTable + ct := codon.NewTranslationTable(translationTableInteger) + if ct == nil { + return gen.PostDesignCdsTranslate500TextResponse(fmt.Sprintf("Translation table of %d not found.", translationTableInteger)), nil + } + sequence, err := ct.Translate(request.Body.Sequence) + if err != nil { + return gen.PostDesignCdsTranslate500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostDesignCdsTranslate200JSONResponse(sequence), nil +} + +/* +***************************************************************************** + +# Simulation begins here. + +***************************************************************************** +*/ + +func (app *App) PostSimulateFragment(ctx context.Context, request gen.PostSimulateFragmentRequestObject) (gen.PostSimulateFragmentResponseObject, error) { + var excludeOverhangs []string + overhangs := *request.Body.ExcludeOverhangs + if overhangs != nil { + excludeOverhangs = overhangs + } + fragments, efficiency, err := fragment.Fragment(request.Body.Sequence, request.Body.MinFragmentSize, request.Body.MaxFragmentSize, excludeOverhangs) + if err != nil { + return gen.PostSimulateFragment500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostSimulateFragment200JSONResponse{Fragments: fragments, Efficiency: float32(efficiency)}, nil +} +func (app *App) PostSimulateComplexPcr(ctx context.Context, request gen.PostSimulateComplexPcrRequestObject) (gen.PostSimulateComplexPcrResponseObject, error) { + var circular bool + circularPointer := request.Body.Circular + if circularPointer != nil { + circular = *circularPointer + } + amplicons, err := pcr.Simulate(request.Body.Templates, float64(request.Body.TargetTm), circular, request.Body.Primers) + if err != nil { + return gen.PostSimulateComplexPcr500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostSimulateComplexPcr200JSONResponse(amplicons), nil +} +func (app *App) PostSimulatePcr(ctx context.Context, request gen.PostSimulatePcrRequestObject) (gen.PostSimulatePcrResponseObject, error) { + var circular bool + circularPointer := request.Body.Circular + if circularPointer != nil { + circular = *circularPointer + } + amplicons := pcr.SimulateSimple([]string{request.Body.Template}, float64(request.Body.TargetTm), circular, []string{request.Body.ForwardPrimer, request.Body.ReversePrimer}) + if len(amplicons) == 0 { + return gen.PostSimulatePcr500TextResponse("Got no amplicons"), nil + } + return gen.PostSimulatePcr200JSONResponse(amplicons[0]), nil +} +func (app *App) PostSimulateGoldengate(ctx context.Context, request gen.PostSimulateGoldengateRequestObject) (gen.PostSimulateGoldengateResponseObject, error) { + return nil, nil +} +func (app *App) PostSimulateLigate(ctx context.Context, request gen.PostSimulateLigateRequestObject) (gen.PostSimulateLigateResponseObject, error) { + return nil, nil +} +func (app *App) PostSimulateRestrictionDigest(ctx context.Context, request gen.PostSimulateRestrictionDigestRequestObject) (gen.PostSimulateRestrictionDigestResponseObject, error) { + return nil, nil +} diff --git a/api/api/api_test.go b/api/api/api_test.go new file mode 100644 index 0000000..3eafeb5 --- /dev/null +++ b/api/api/api_test.go @@ -0,0 +1,131 @@ +package api + +import ( + "bytes" + "encoding/json" + "fmt" + "net/http/httptest" + "os" + "strings" + "testing" + + "github.com/koeng101/dnadesign/api/gen" +) + +var app App + +func TestMain(m *testing.M) { + app = InitializeApp() + code := m.Run() + os.Exit(code) +} + +func TestIoFastaParse(t *testing.T) { + baseFasta := `>gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus] +LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV +EWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLG +LLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVIL +GLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGX +IENY +` + req := httptest.NewRequest("POST", "/api/io/fasta/parse", strings.NewReader(baseFasta)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `[{"name":"gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]","sequence":"LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLVEWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLGLLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVILGLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGXIENY"}]` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} + +func TestFix(t *testing.T) { + req := httptest.NewRequest("POST", "/api/design/cds/fix", strings.NewReader(`{"organism":"Escherichia coli","sequence":"ATGGGTCTCTAA","removeSequences":["GGTCTC"]}`)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `{"changes":[{"From":"CTC","Position":2,"Reason":"Common TypeIIS restriction enzymes - BsaI, BbsI, PaqCI","Step":0,"To":"CTG"}],"sequence":"ATGGGTCTGTAA"}` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} + +func TestOptimize(t *testing.T) { + gfp := "MASKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTFSYGVQCFSRYPDHMKRHDFFKSAMPEGYVQERTISFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYITADKQKNGIKANFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK" + req := httptest.NewRequest("POST", "/api/design/cds/optimize", strings.NewReader(fmt.Sprintf(`{"organism":"Escherichia coli","sequence":"%s"}`, gfp))) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `"ATGGCATCCAAGGGCGAGGAGTTGTTCACCGGTGTTGTGCCGATCCTGGTGGAGCTGGACGGTGACGTGAACGGTCACAAATTTAGCGTGTCCGGTGAGGGTGAGGGTGATGCTACCTATGGCAAGCTGACCCTGAAATTCATTTGTACCACGGGTAAACTGCCGGTCCCGTGGCCGACGCTGGTGACCACCTTCAGCTATGGTGTGCAGTGTTTCAGCCGCTACCCGGACCACATGAAGCGCCACGACTTTTTCAAGAGCGCGATGCCGGAGGGTTATGTGCAAGAACGTACCATCAGCTTTAAAGATGATGGTAACTATAAGACCCGCGCGGAAGTCAAGTTTGAGGGTGACACGCTGGTGAATCGTATTGAGTTGAAGGGTATTGACTTTAAGGAGGATGGTAATATTTTGGGCCACAAACTGGAGTACAATTACAATAGCCACAATGTTTACATCACGGCAGATAAACAGAAGAACGGTATCAAGGCGAACTTCAAAATTCGTCACAACATTGAGGACGGTTCTGTTCAACTGGCGGACCATTACCAACAGAATACCCCGATCGGTGACGGCCCGGTTCTGCTGCCGGACAACCATTATTTGAGCACCCAGTCCGCCCTGAGCAAGGACCCGAATGAGAAGCGTGATCATATGGTTCTGCTGGAGTTTGTGACCGCGGCGGGCATCACCCACGGCATGGACGAGCTGTACAAG"` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} + +func TestTranslate(t *testing.T) { + gfp := "ATGGCATCCAAGGGCGAGGAGTTGTTCACCGGTGTTGTGCCGATCCTGGTGGAGCTGGACGGTGACGTGAACGGTCACAAATTTAGCGTGTCCGGTGAGGGTGAGGGTGATGCTACCTATGGCAAGCTGACCCTGAAATTCATTTGTACCACGGGTAAACTGCCGGTCCCGTGGCCGACGCTGGTGACCACCTTCAGCTATGGTGTGCAGTGTTTCAGCCGCTACCCGGACCACATGAAGCGCCACGACTTTTTCAAGAGCGCGATGCCGGAGGGTTATGTGCAAGAACGTACCATCAGCTTTAAAGATGATGGTAACTATAAGACCCGCGCGGAAGTCAAGTTTGAGGGTGACACGCTGGTGAATCGTATTGAGTTGAAGGGTATTGACTTTAAGGAGGATGGTAATATTTTGGGCCACAAACTGGAGTACAATTACAATAGCCACAATGTTTACATCACGGCAGATAAACAGAAGAACGGTATCAAGGCGAACTTCAAAATTCGTCACAACATTGAGGACGGTTCTGTTCAACTGGCGGACCATTACCAACAGAATACCCCGATCGGTGACGGCCCGGTTCTGCTGCCGGACAACCATTATTTGAGCACCCAGTCCGCCCTGAGCAAGGACCCGAATGAGAAGCGTGATCATATGGTTCTGCTGGAGTTTGTGACCGCGGCGGGCATCACCCACGGCATGGACGAGCTGTACAAG" + req := httptest.NewRequest("POST", "/api/design/cds/translate", strings.NewReader(fmt.Sprintf(`{"translation_table":11,"sequence":"%s"}`, gfp))) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `"MASKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTFSYGVQCFSRYPDHMKRHDFFKSAMPEGYVQERTISFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYITADKQKNGIKANFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK"` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} + +func TestFragment(t *testing.T) { + lacZ := "ATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAG" + type fragmentStruct struct { + Sequence string `json:"sequence"` + MinFragmentSize int `json:"min_fragment_size"` + MaxFragmentSize int `json:"max_fragment_size"` + ExcludeOverhangs []string `json:"exclude_overhangs"` + } + fragReq := &fragmentStruct{Sequence: lacZ, MinFragmentSize: 95, MaxFragmentSize: 105, ExcludeOverhangs: []string{"AAAA"}} + b, err := json.Marshal(fragReq) + if err != nil { + t.Errorf("Failed to marshal: %s", err) + } + req := httptest.NewRequest("POST", "/api/simulate/fragment", bytes.NewBuffer(b)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `{"efficiency":1,"fragments":["ATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGG","CTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAAC","CAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGC","GTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAG"]}` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } + +} + +func TestPCR(t *testing.T) { + gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa" + fwdPrimer := "TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG" + revPrimer := "TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC" + primers := []string{fwdPrimer, revPrimer} + circular := false + complexReq := &gen.PostSimulateComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: 55.0, Templates: []string{gene}} + b, err := json.Marshal(complexReq) + if err != nil { + t.Errorf("Failed to marshal: %s", err) + } + req := httptest.NewRequest("POST", "/api/simulate/complex_pcr", bytes.NewBuffer(b)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + r := `["TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA"]` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } + + simpleReq := &gen.PostSimulatePcrJSONBody{Circular: &circular, TargetTm: 55.0, Template: gene, ForwardPrimer: fwdPrimer, ReversePrimer: revPrimer} + b, err = json.Marshal(simpleReq) + if err != nil { + t.Errorf("Failed to marshal: %s", err) + } + req = httptest.NewRequest("POST", "/api/simulate/pcr", bytes.NewBuffer(b)) + resp = httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + r = `"TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA"` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} diff --git a/api/api/codon_tables/README.md b/api/api/codon_tables/README.md new file mode 100644 index 0000000..a5a1e2b --- /dev/null +++ b/api/api/codon_tables/README.md @@ -0,0 +1,7 @@ +# Default codon tables + +Here are a collection of decent default codon tables. I've included Pichia patoris, Saccharomyces cerevisiae, and Escherichia coli. + +The Escherichia coli table was derived from the FreqB table from the paper "[Design Parameters to Control Synthetic Gene Expression in Escherichia coli](https://doi.org/10.1371/journal.pone.0007002)". Pichia patoris and Saccharomyces cerevisiae were derived directly from their genome. + +This is a work-in-progress as we aim to cover more genomes. diff --git a/api/api/codon_tables/freqB.json b/api/api/codon_tables/freqB.json new file mode 100644 index 0000000..8206e14 --- /dev/null +++ b/api/api/codon_tables/freqB.json @@ -0,0 +1,379 @@ +{ + "start_codons": [ + "TTG", + "CTG", + "ATT", + "ATC", + "ATA", + "ATG", + "GTG" + ], + "stop_codons": [ + "TAA", + "TAG", + "TGA" + ], + "amino_acids": [ + { + "letter": "Y", + "codons": [ + { + "triplet": "TAT", + "weight": 42 + }, + { + "triplet": "TAC", + "weight": 58 + } + ] + }, + { + "letter": "C", + "codons": [ + { + "triplet": "TGT", + "weight": 42 + }, + { + "triplet": "TGC", + "weight": 58 + } + ] + }, + { + "letter": "I", + "codons": [ + { + "triplet": "ATT", + "weight": 49 + }, + { + "triplet": "ATC", + "weight": 51 + }, + { + "triplet": "ATA", + "weight": 0 + } + ] + }, + { + "letter": "V", + "codons": [ + { + "triplet": "GTT", + "weight": 35 + }, + { + "triplet": "GTC", + "weight": 28 + }, + { + "triplet": "GTA", + "weight": 3 + }, + { + "triplet": "GTG", + "weight": 34 + } + ] + }, + { + "letter": "G", + "codons": [ + { + "triplet": "GGT", + "weight": 60 + }, + { + "triplet": "GGC", + "weight": 39 + }, + { + "triplet": "GGA", + "weight": 0 + }, + { + "triplet": "GGG", + "weight": 0 + } + ] + }, + { + "letter": "L", + "codons": [ + { + "triplet": "TTA", + "weight": 3 + }, + { + "triplet": "TTG", + "weight": 14 + }, + { + "triplet": "CTT", + "weight": 2 + }, + { + "triplet": "CTC", + "weight": 3 + }, + { + "triplet": "CTA", + "weight": 0 + }, + { + "triplet": "CTG", + "weight": 78 + } + ] + }, + { + "letter": "W", + "codons": [ + { + "triplet": "TGG", + "weight": 1 + } + ] + }, + { + "letter": "K", + "codons": [ + { + "triplet": "AAA", + "weight": 51 + }, + { + "triplet": "AAG", + "weight": 49 + } + ] + }, + { + "letter": "S", + "codons": [ + { + "triplet": "TCT", + "weight": 10 + }, + { + "triplet": "TCC", + "weight": 13 + }, + { + "triplet": "TCA", + "weight": 2 + }, + { + "triplet": "TCG", + "weight": 5 + }, + { + "triplet": "AGT", + "weight": 0 + }, + { + "triplet": "AGC", + "weight": 68 + } + ] + }, + { + "letter": "*", + "codons": [ + { + "triplet": "TAA", + "weight": 2015 + }, + { + "triplet": "TAG", + "weight": 1667 + }, + { + "triplet": "TGA", + "weight": 1300 + } + ] + }, + { + "letter": "Q", + "codons": [ + { + "triplet": "CAA", + "weight": 45 + }, + { + "triplet": "CAG", + "weight": 55 + } + ] + }, + { + "letter": "R", + "codons": [ + { + "triplet": "CGT", + "weight": 62 + }, + { + "triplet": "CGC", + "weight": 35 + }, + { + "triplet": "CGA", + "weight": 0 + }, + { + "triplet": "CGG", + "weight": 0 + }, + { + "triplet": "AGA", + "weight": 3 + }, + { + "triplet": "AGG", + "weight": 0 + } + ] + }, + { + "letter": "A", + "codons": [ + { + "triplet": "GCT", + "weight": 12 + }, + { + "triplet": "GCC", + "weight": 19 + }, + { + "triplet": "GCA", + "weight": 24 + }, + { + "triplet": "GCG", + "weight": 44 + } + ] + }, + { + "letter": "E", + "codons": [ + { + "triplet": "GAA", + "weight": 43 + }, + { + "triplet": "GAG", + "weight": 57 + } + ] + }, + { + "letter": "F", + "codons": [ + { + "triplet": "TTT", + "weight": 45 + }, + { + "triplet": "TTC", + "weight": 55 + } + ] + }, + { + "letter": "P", + "codons": [ + { + "triplet": "CCT", + "weight": 9 + }, + { + "triplet": "CCC", + "weight": 0 + }, + { + "triplet": "CCA", + "weight": 10 + }, + { + "triplet": "CCG", + "weight": 81 + } + ] + }, + { + "letter": "H", + "codons": [ + { + "triplet": "CAT", + "weight": 38 + }, + { + "triplet": "CAC", + "weight": 62 + } + ] + }, + { + "letter": "M", + "codons": [ + { + "triplet": "ATG", + "weight": 1 + } + ] + }, + { + "letter": "T", + "codons": [ + { + "triplet": "ACT", + "weight": 10 + }, + { + "triplet": "ACC", + "weight": 57 + }, + { + "triplet": "ACA", + "weight": 0 + }, + { + "triplet": "ACG", + "weight": 33 + } + ] + }, + { + "letter": "N", + "codons": [ + { + "triplet": "AAT", + "weight": 47 + }, + { + "triplet": "AAC", + "weight": 53 + } + ] + }, + { + "letter": "D", + "codons": [ + { + "triplet": "GAT", + "weight": 46 + }, + { + "triplet": "GAC", + "weight": 54 + } + ] + } + ] +} diff --git a/api/api/codon_tables/pichia.json b/api/api/codon_tables/pichia.json new file mode 100644 index 0000000..70099ec --- /dev/null +++ b/api/api/codon_tables/pichia.json @@ -0,0 +1,379 @@ +{ + "start_codons": [ + "TTG", + "CTG", + "ATT", + "ATC", + "ATA", + "ATG", + "GTG" + ], + "stop_codons": [ + "TAA", + "TAG", + "TGA" + ], + "amino_acids": [ + { + "letter": "Y", + "codons": [ + { + "triplet": "TAT", + "weight": 40017 + }, + { + "triplet": "TAC", + "weight": 37740 + } + ] + }, + { + "letter": "C", + "codons": [ + { + "triplet": "TGT", + "weight": 17099 + }, + { + "triplet": "TGC", + "weight": 10242 + } + ] + }, + { + "letter": "I", + "codons": [ + { + "triplet": "ATT", + "weight": 68516 + }, + { + "triplet": "ATC", + "weight": 43651 + }, + { + "triplet": "ATA", + "weight": 35059 + } + ] + }, + { + "letter": "V", + "codons": [ + { + "triplet": "GTT", + "weight": 54750 + }, + { + "triplet": "GTC", + "weight": 30526 + }, + { + "triplet": "GTA", + "weight": 25054 + }, + { + "triplet": "GTG", + "weight": 30581 + } + ] + }, + { + "letter": "G", + "codons": [ + { + "triplet": "GGT", + "weight": 42959 + }, + { + "triplet": "GGC", + "weight": 18853 + }, + { + "triplet": "GGA", + "weight": 43541 + }, + { + "triplet": "GGG", + "weight": 14618 + } + ] + }, + { + "letter": "L", + "codons": [ + { + "triplet": "TTA", + "weight": 41481 + }, + { + "triplet": "TTG", + "weight": 68335 + }, + { + "triplet": "CTT", + "weight": 40288 + }, + { + "triplet": "CTC", + "weight": 20003 + }, + { + "triplet": "CTA", + "weight": 29034 + }, + { + "triplet": "CTG", + "weight": 35916 + } + ] + }, + { + "letter": "W", + "codons": [ + { + "triplet": "TGG", + "weight": 23941 + } + ] + }, + { + "letter": "K", + "codons": [ + { + "triplet": "AAA", + "weight": 83571 + }, + { + "triplet": "AAG", + "weight": 77197 + } + ] + }, + { + "letter": "S", + "codons": [ + { + "triplet": "TCT", + "weight": 53665 + }, + { + "triplet": "TCC", + "weight": 35643 + }, + { + "triplet": "TCA", + "weight": 43185 + }, + { + "triplet": "TCG", + "weight": 19746 + }, + { + "triplet": "AGT", + "weight": 32769 + }, + { + "triplet": "AGC", + "weight": 21832 + } + ] + }, + { + "letter": "*", + "codons": [ + { + "triplet": "TAA", + "weight": 2015 + }, + { + "triplet": "TAG", + "weight": 1667 + }, + { + "triplet": "TGA", + "weight": 1300 + } + ] + }, + { + "letter": "Q", + "codons": [ + { + "triplet": "CAA", + "weight": 58688 + }, + { + "triplet": "CAG", + "weight": 38500 + } + ] + }, + { + "letter": "R", + "codons": [ + { + "triplet": "CGT", + "weight": 14716 + }, + { + "triplet": "CGC", + "weight": 5515 + }, + { + "triplet": "CGA", + "weight": 12855 + }, + { + "triplet": "CGG", + "weight": 5643 + }, + { + "triplet": "AGA", + "weight": 47972 + }, + { + "triplet": "AGG", + "weight": 19381 + } + ] + }, + { + "letter": "A", + "codons": [ + { + "triplet": "GCT", + "weight": 51452 + }, + { + "triplet": "GCC", + "weight": 30978 + }, + { + "triplet": "GCA", + "weight": 35840 + }, + { + "triplet": "GCG", + "weight": 10148 + } + ] + }, + { + "letter": "E", + "codons": [ + { + "triplet": "GAA", + "weight": 93407 + }, + { + "triplet": "GAG", + "weight": 64293 + } + ] + }, + { + "letter": "F", + "codons": [ + { + "triplet": "TTT", + "weight": 60424 + }, + { + "triplet": "TTC", + "weight": 43704 + } + ] + }, + { + "letter": "P", + "codons": [ + { + "triplet": "CCT", + "weight": 35821 + }, + { + "triplet": "CCC", + "weight": 18924 + }, + { + "triplet": "CCA", + "weight": 39324 + }, + { + "triplet": "CCG", + "weight": 10585 + } + ] + }, + { + "letter": "H", + "codons": [ + { + "triplet": "CAT", + "weight": 30739 + }, + { + "triplet": "CAC", + "weight": 19034 + } + ] + }, + { + "letter": "M", + "codons": [ + { + "triplet": "ATG", + "weight": 42837 + } + ] + }, + { + "letter": "T", + "codons": [ + { + "triplet": "ACT", + "weight": 47886 + }, + { + "triplet": "ACC", + "weight": 31320 + }, + { + "triplet": "ACA", + "weight": 36947 + }, + { + "triplet": "ACG", + "weight": 16313 + } + ] + }, + { + "letter": "N", + "codons": [ + { + "triplet": "AAT", + "weight": 66744 + }, + { + "triplet": "AAC", + "weight": 57670 + } + ] + }, + { + "letter": "D", + "codons": [ + { + "triplet": "GAT", + "weight": 84985 + }, + { + "triplet": "GAC", + "weight": 52486 + } + ] + } + ] +} diff --git a/api/api/codon_tables/scerevisiae.json b/api/api/codon_tables/scerevisiae.json new file mode 100644 index 0000000..eb921a0 --- /dev/null +++ b/api/api/codon_tables/scerevisiae.json @@ -0,0 +1,375 @@ +{ + "start_codons": [ + "TTG", + "CTG", + "ATG" + ], + "stop_codons": [ + "TAA", + "TAG", + "TGA" + ], + "amino_acids": [ + { + "letter": "F", + "codons": [ + { + "triplet": "TTT", + "weight": 69255 + }, + { + "triplet": "TTC", + "weight": 47162 + } + ] + }, + { + "letter": "L", + "codons": [ + { + "triplet": "TTA", + "weight": 69592 + }, + { + "triplet": "TTG", + "weight": 69917 + }, + { + "triplet": "CTT", + "weight": 32571 + }, + { + "triplet": "CTC", + "weight": 14569 + }, + { + "triplet": "CTA", + "weight": 35726 + }, + { + "triplet": "CTG", + "weight": 27963 + } + ] + }, + { + "letter": "S", + "codons": [ + { + "triplet": "TCT", + "weight": 61396 + }, + { + "triplet": "TCC", + "weight": 36989 + }, + { + "triplet": "TCA", + "weight": 50416 + }, + { + "triplet": "TCG", + "weight": 23012 + }, + { + "triplet": "AGT", + "weight": 38486 + }, + { + "triplet": "AGC", + "weight": 26233 + } + ] + }, + { + "letter": "Y", + "codons": [ + { + "triplet": "TAT", + "weight": 50491 + }, + { + "triplet": "TAC", + "weight": 38471 + } + ] + }, + { + "letter": "K", + "codons": [ + { + "triplet": "AAA", + "weight": 113360 + }, + { + "triplet": "AAG", + "weight": 80638 + } + ] + }, + { + "letter": "W", + "codons": [ + { + "triplet": "TGG", + "weight": 27342 + } + ] + }, + { + "letter": "V", + "codons": [ + { + "triplet": "GTT", + "weight": 56557 + }, + { + "triplet": "GTC", + "weight": 29536 + }, + { + "triplet": "GTA", + "weight": 31958 + }, + { + "triplet": "GTG", + "weight": 28127 + } + ] + }, + { + "letter": "*", + "codons": [ + { + "triplet": "TAA", + "weight": 2561 + }, + { + "triplet": "TAG", + "weight": 1243 + }, + { + "triplet": "TGA", + "weight": 1614 + } + ] + }, + { + "letter": "C", + "codons": [ + { + "triplet": "TGT", + "weight": 20749 + }, + { + "triplet": "TGC", + "weight": 12623 + } + ] + }, + { + "letter": "P", + "codons": [ + { + "triplet": "CCT", + "weight": 35886 + }, + { + "triplet": "CCC", + "weight": 18238 + }, + { + "triplet": "CCA", + "weight": 47055 + }, + { + "triplet": "CCG", + "weight": 14424 + } + ] + }, + { + "letter": "Q", + "codons": [ + { + "triplet": "CAA", + "weight": 71668 + }, + { + "triplet": "CAG", + "weight": 32701 + } + ] + }, + { + "letter": "I", + "codons": [ + { + "triplet": "ATT", + "weight": 79418 + }, + { + "triplet": "ATC", + "weight": 44763 + }, + { + "triplet": "ATA", + "weight": 48474 + } + ] + }, + { + "letter": "M", + "codons": [ + { + "triplet": "ATG", + "weight": 54773 + } + ] + }, + { + "letter": "T", + "codons": [ + { + "triplet": "ACT", + "weight": 52985 + }, + { + "triplet": "ACC", + "weight": 32808 + }, + { + "triplet": "ACA", + "weight": 47831 + }, + { + "triplet": "ACG", + "weight": 21401 + } + ] + }, + { + "letter": "A", + "codons": [ + { + "triplet": "GCT", + "weight": 53513 + }, + { + "triplet": "GCC", + "weight": 31917 + }, + { + "triplet": "GCA", + "weight": 42870 + }, + { + "triplet": "GCG", + "weight": 16338 + } + ] + }, + { + "letter": "D", + "codons": [ + { + "triplet": "GAT", + "weight": 100401 + }, + { + "triplet": "GAC", + "weight": 53688 + } + ] + }, + { + "letter": "E", + "codons": [ + { + "triplet": "GAA", + "weight": 120741 + }, + { + "triplet": "GAG", + "weight": 51544 + } + ] + }, + { + "letter": "G", + "codons": [ + { + "triplet": "GGT", + "weight": 59816 + }, + { + "triplet": "GGC", + "weight": 25856 + }, + { + "triplet": "GGA", + "weight": 29566 + }, + { + "triplet": "GGG", + "weight": 16019 + } + ] + }, + { + "letter": "H", + "codons": [ + { + "triplet": "CAT", + "weight": 36801 + }, + { + "triplet": "CAC", + "weight": 20528 + } + ] + }, + { + "letter": "R", + "codons": [ + { + "triplet": "CGT", + "weight": 16654 + }, + { + "triplet": "CGC", + "weight": 7037 + }, + { + "triplet": "CGA", + "weight": 8246 + }, + { + "triplet": "CGG", + "weight": 4843 + }, + { + "triplet": "AGA", + "weight": 55776 + }, + { + "triplet": "AGG", + "weight": 25020 + } + ] + }, + { + "letter": "N", + "codons": [ + { + "triplet": "AAT", + "weight": 96750 + }, + { + "triplet": "AAC", + "weight": 65451 + } + ] + } + ] +} diff --git a/api/api/json/json.go b/api/api/json/json.go new file mode 100644 index 0000000..a1652ab --- /dev/null +++ b/api/api/json/json.go @@ -0,0 +1,181 @@ +package json + +import ( + "encoding/json" + "errors" + + lua "github.com/yuin/gopher-lua" +) + +// Preload adds json to the given Lua state's package.preload table. After it +// has been preloaded, it can be loaded using require: +// +// local json = require("json") +func Preload(L *lua.LState) { + L.PreloadModule("json", Loader) +} + +// Loader is the module loader function. +func Loader(L *lua.LState) int { + t := L.NewTable() + L.SetFuncs(t, api) + L.Push(t) + return 1 +} + +var api = map[string]lua.LGFunction{ + "decode": apiDecode, + "encode": apiEncode, +} + +func apiDecode(L *lua.LState) int { + str := L.CheckString(1) + + value, err := Decode(L, []byte(str)) + if err != nil { + L.Push(lua.LNil) + L.Push(lua.LString(err.Error())) + return 2 + } + L.Push(value) + return 1 +} + +func apiEncode(L *lua.LState) int { + value := L.CheckAny(1) + + data, err := Encode(value) + if err != nil { + L.Push(lua.LNil) + L.Push(lua.LString(err.Error())) + return 2 + } + L.Push(lua.LString(string(data))) + return 1 +} + +var ( + errNested = errors.New("cannot encode recursively nested tables to JSON") + errSparseArray = errors.New("cannot encode sparse array") + errInvalidKeys = errors.New("cannot encode mixed or invalid key types") +) + +type invalidTypeError lua.LValueType + +func (i invalidTypeError) Error() string { + return `cannot encode ` + lua.LValueType(i).String() + ` to JSON` +} + +// Encode returns the JSON encoding of value. +func Encode(value lua.LValue) ([]byte, error) { + return json.Marshal(jsonValue{ + LValue: value, + visited: make(map[*lua.LTable]bool), + }) +} + +type jsonValue struct { + lua.LValue + visited map[*lua.LTable]bool +} + +func (j jsonValue) MarshalJSON() (data []byte, err error) { + switch converted := j.LValue.(type) { + case lua.LBool: + data, err = json.Marshal(bool(converted)) + case lua.LNumber: + data, err = json.Marshal(float64(converted)) + case *lua.LNilType: + data = []byte(`null`) + case lua.LString: + data, err = json.Marshal(string(converted)) + case *lua.LTable: + if j.visited[converted] { + return nil, errNested + } + j.visited[converted] = true + + key, value := converted.Next(lua.LNil) + + switch key.Type() { + case lua.LTNil: // empty table + data = []byte(`[]`) + case lua.LTNumber: + arr := make([]jsonValue, 0, converted.Len()) + expectedKey := lua.LNumber(1) + for key != lua.LNil { + if key.Type() != lua.LTNumber { + err = errInvalidKeys + return + } + if expectedKey != key { + err = errSparseArray + return + } + arr = append(arr, jsonValue{value, j.visited}) + expectedKey++ + key, value = converted.Next(key) + } + data, err = json.Marshal(arr) + case lua.LTString: + obj := make(map[string]jsonValue) + for key != lua.LNil { + if key.Type() != lua.LTString { + err = errInvalidKeys + return + } + obj[key.String()] = jsonValue{value, j.visited} + key, value = converted.Next(key) + } + data, err = json.Marshal(obj) + default: + err = errInvalidKeys + } + default: + err = invalidTypeError(j.LValue.Type()) + } + return data, err +} + +// Decode converts the JSON encoded data to Lua values. +func Decode(L *lua.LState, data []byte) (lua.LValue, error) { + var value interface{} + err := json.Unmarshal(data, &value) + if err != nil { + return nil, err + } + return DecodeValue(L, value), nil +} + +// DecodeValue converts the value to a Lua value. +// +// This function only converts values that the encoding/json package decodes to. +// All other values will return lua.LNil. +func DecodeValue(L *lua.LState, value interface{}) lua.LValue { + switch converted := value.(type) { + case bool: + return lua.LBool(converted) + case float64: + return lua.LNumber(converted) + case string: + return lua.LString(converted) + case json.Number: + return lua.LString(converted) + case []interface{}: + arr := L.CreateTable(len(converted), 0) + for _, item := range converted { + arr.Append(DecodeValue(L, item)) + } + return arr + case map[string]interface{}: + tbl := L.CreateTable(0, len(converted)) + for key, item := range converted { + tbl.RawSetH(lua.LString(key), DecodeValue(L, item)) + } + return tbl + case nil: + return lua.LNil + } + + return lua.LNil +} diff --git a/api/api/json/json_test.go b/api/api/json/json_test.go new file mode 100644 index 0000000..4844e82 --- /dev/null +++ b/api/api/json/json_test.go @@ -0,0 +1,99 @@ +package json + +import ( + "encoding/json" + "testing" + + lua "github.com/yuin/gopher-lua" +) + +func TestSimple(t *testing.T) { + const str = ` + local json = require("json") + assert(type(json) == "table") + assert(type(json.decode) == "function") + assert(type(json.encode) == "function") + + assert(json.encode(true) == "true") + assert(json.encode(1) == "1") + assert(json.encode(-10) == "-10") + assert(json.encode(nil) == "null") + assert(json.encode({}) == "[]") + assert(json.encode({1, 2, 3}) == "[1,2,3]") + + local _, err = json.encode({1, 2, [10] = 3}) + assert(string.find(err, "sparse array")) + + local _, err = json.encode({1, 2, 3, name = "Tim"}) + assert(string.find(err, "mixed or invalid key types")) + + local _, err = json.encode({name = "Tim", [false] = 123}) + assert(string.find(err, "mixed or invalid key types")) + + local obj = {"a",1,"b",2,"c",3} + local jsonStr = json.encode(obj) + local jsonObj = json.decode(jsonStr) + for i = 1, #obj do + assert(obj[i] == jsonObj[i]) + end + + local obj = {name="Tim",number=12345} + local jsonStr = json.encode(obj) + local jsonObj = json.decode(jsonStr) + assert(obj.name == jsonObj.name) + assert(obj.number == jsonObj.number) + + assert(json.decode("null") == nil) + + assert(json.decode(json.encode({person={name = "tim",}})).person.name == "tim") + + local obj = { + abc = 123, + def = nil, + } + local obj2 = { + obj = obj, + } + obj.obj2 = obj2 + assert(json.encode(obj) == nil) + + local a = {} + for i=1, 5 do + a[i] = i + end + assert(json.encode(a) == "[1,2,3,4,5]") + ` + s := lua.NewState() + defer s.Close() + + Preload(s) + if err := s.DoString(str); err != nil { + t.Error(err) + } +} + +func TestCustomRequire(t *testing.T) { + const str = ` + local j = require("JSON") + assert(type(j) == "table") + assert(type(j.decode) == "function") + assert(type(j.encode) == "function") + ` + s := lua.NewState() + defer s.Close() + + s.PreloadModule("JSON", Loader) + if err := s.DoString(str); err != nil { + t.Error(err) + } +} + +func TestDecodeValue_jsonNumber(t *testing.T) { + s := lua.NewState() + defer s.Close() + + v := DecodeValue(s, json.Number("124.11")) + if v.Type() != lua.LTString || v.String() != "124.11" { + t.Fatalf("expecting LString, got %T", v) + } +} diff --git a/api/api/lua.go b/api/api/lua.go new file mode 100644 index 0000000..5fdfd66 --- /dev/null +++ b/api/api/lua.go @@ -0,0 +1,235 @@ +package api + +import ( + "encoding/json" + "fmt" + "net/http/httptest" + "strings" + + luajson "github.com/koeng101/dnadesign/api/api/json" + "github.com/koeng101/dnadesign/api/gen" + lua "github.com/yuin/gopher-lua" +) + +func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, string, error) { + L := lua.NewState() + defer L.Close() + + // Add attachments + luaAttachments := L.NewTable() + for _, attachment := range attachments { + luaAttachments.RawSetString(attachment.Name, lua.LString(attachment.Content)) + } + L.SetGlobal("attachments", luaAttachments) + + // Add IO functions + L.SetGlobal("fasta_parse", L.NewFunction(app.LuaIoFastaParse)) + + // Add CDS design functions + L.SetGlobal("fix", L.NewFunction(app.LuaDesignCdsFix)) + L.SetGlobal("optimize", L.NewFunction(app.LuaDesignCdsOptimize)) + L.SetGlobal("translate", L.NewFunction(app.LuaDesignCdsTranslate)) + + // Add simulate functions + L.SetGlobal("fragment", L.NewFunction(app.LuaSimulateFragment)) + L.SetGlobal("complex_pcr", L.NewFunction(app.LuaSimulateComplexPcr)) + L.SetGlobal("pcr", L.NewFunction(app.LuaSimulatePcr)) + + // Execute the Lua script + if err := L.DoString(data); err != nil { + return "", "", err + } + + // Extract log and output + var logBuffer, outputBuffer string + log := L.GetGlobal("log") + if str, ok := log.(lua.LString); ok { + logBuffer = string(str) + } + output := L.GetGlobal("output") + if str, ok := output.(lua.LString); ok { + outputBuffer = string(str) + } + + return logBuffer, outputBuffer, nil +} + +// luaResponse wraps the core of the lua data -> API calls -> lua data pipeline +func (app *App) luaResponse(L *lua.LState, url, dataString string) int { + req := httptest.NewRequest("POST", url, strings.NewReader(dataString)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + if resp.Code != 200 { + L.RaiseError("HTTP request failed: " + resp.Body.String()) + return 0 + } + + var data interface{} + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + L.RaiseError(err.Error()) + return 0 + } + luaData := luajson.DecodeValue(L, data) + L.Push(luaData) + return 1 +} + +// luaStringArrayToGoSlice converts a Lua table at the given index in the Lua stack to a Go slice of strings. +func luaStringArrayToGoSlice(L *lua.LState, index int) ([]string, error) { + var goStrings []string + lv := L.Get(index) + if lv.Type() != lua.LTTable { + if lv.Type() == lua.LTNil { + return []string{}, nil + } + return nil, fmt.Errorf("argument at index %d is not a table", index) + } + tbl := L.ToTable(index) + + tbl.ForEach(func(key lua.LValue, value lua.LValue) { + if str, ok := value.(lua.LString); ok { + goStrings = append(goStrings, string(str)) + } else { + // Handle non-string values if necessary + } + }) + + return goStrings, nil +} + +// LuaIoFastaParse implements fasta_parse in lua. +func (app *App) LuaIoFastaParse(L *lua.LState) int { + fastaData := L.ToString(1) + return app.luaResponse(L, "/api/io/fasta/parse", fastaData) +} + +// LuaDesignCdsFix implements fix in lua. +func (app *App) LuaDesignCdsFix(L *lua.LState) int { + sequence := L.ToString(1) + organism := L.ToString(2) + removeSequences, err := luaStringArrayToGoSlice(L, 3) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + + type fix struct { + Sequence string `json:"sequence"` + Organism string `json:"organism"` + RemoveSequences []string `json:"remove_sequences"` + } + req := &fix{Sequence: sequence, Organism: organism, RemoveSequences: removeSequences} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/design/cds/fix", string(b)) +} + +// LuaDesignCdsOptimize implements optimize in lua. +func (app *App) LuaDesignCdsOptimize(L *lua.LState) int { + sequence := L.ToString(1) + organism := L.ToString(2) + seed := L.ToInt(3) + + type optimize struct { + Sequence string `json:"sequence"` + Organism string `json:"organism"` + Seed int `json:"seed"` + } + req := &optimize{Sequence: sequence, Organism: organism, Seed: seed} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/design/cds/optimize", string(b)) +} + +// LuaDesignCdsTranslate implements translate in lua. +func (app *App) LuaDesignCdsTranslate(L *lua.LState) int { + sequence := L.ToString(1) + translationTable := L.ToInt(2) + + type translate struct { + Sequence string `json:"sequence"` + TranslationTable int `json:"translation_table"` + } + req := &translate{Sequence: sequence, TranslationTable: translationTable} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/design/cds/translate", string(b)) +} + +// LuaSimulateFragment implements fragment in lua. +func (app *App) LuaSimulateFragment(L *lua.LState) int { + sequence := L.ToString(1) + minFragmentSize := L.ToInt(2) + maxFragmentSize := L.ToInt(3) + excludeOverhangs, err := luaStringArrayToGoSlice(L, 4) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + + type fragmentStruct struct { + Sequence string `json:"sequence"` + MinFragmentSize int `json:"min_fragment_size"` + MaxFragmentSize int `json:"max_fragment_size"` + ExcludeOverhangs []string `json:"exclude_overhangs"` + } + req := &fragmentStruct{Sequence: sequence, MinFragmentSize: minFragmentSize, MaxFragmentSize: maxFragmentSize, ExcludeOverhangs: excludeOverhangs} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/simulate/fragment", string(b)) + +} + +// LuaSimulateComplexPcr implements complex pcr in lua. +func (app *App) LuaSimulateComplexPcr(L *lua.LState) int { + templates, err := luaStringArrayToGoSlice(L, 1) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + primers, err := luaStringArrayToGoSlice(L, 2) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + targetTm := L.ToNumber(3) + circular := L.ToBool(4) + + req := &gen.PostSimulateComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: float32(targetTm), Templates: templates} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/simulate/complex_pcr", string(b)) +} + +// LuaSimulatePcr implements pcr in lua +func (app *App) LuaSimulatePcr(L *lua.LState) int { + template := L.ToString(1) + forwardPrimer := L.ToString(2) + reversePrimer := L.ToString(3) + targetTm := L.ToNumber(4) + circular := L.ToBool(5) + + req := &gen.PostSimulatePcrJSONBody{Circular: &circular, Template: template, TargetTm: float32(targetTm), ForwardPrimer: forwardPrimer, ReversePrimer: reversePrimer} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/simulate/pcr", string(b)) +} diff --git a/api/api/lua_test.go b/api/api/lua_test.go new file mode 100644 index 0000000..58089c0 --- /dev/null +++ b/api/api/lua_test.go @@ -0,0 +1,126 @@ +package api + +import ( + "testing" + + "github.com/koeng101/dnadesign/api/gen" +) + +func TestApp_LuaIoFastaParse(t *testing.T) { + luaScript := ` +parsed_fasta = fasta_parse(attachments["input.fasta"]) + +output = parsed_fasta[1].name +` + inputFasta := `>AAD44166.1 +LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV +EWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLG +LLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVIL +GLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGX +IENY +` + + fastaAttachment := gen.Attachment{ + Name: "input.fasta", + Content: inputFasta, + } + + _, output, err := app.ExecuteLua(luaScript, []gen.Attachment{fastaAttachment}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "AAD44166.1" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } +} + +func TestApp_LuaDesignCdsFix(t *testing.T) { + luaScript := ` +fixed = fix("ATGGGTCTCTAA", "Escherichia coli", {"GGTCTC"}) + +output = fixed.sequence +` + _, output, err := app.ExecuteLua(luaScript, []gen.Attachment{}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "ATGGGTCTGTAA" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } +} + +func TestApp_LuaDesignCdsOptimizeTranslate(t *testing.T) { + luaScript := ` +optimized = optimize("MHELLQWQRLD", "Escherichia coli", 0) +translated = translate(optimized, 11) + +output = optimized +log = translated +` + log, output, err := app.ExecuteLua(luaScript, []gen.Attachment{}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "ATGCATGAGCTGTTGCAGTGGCAGCGCTTGGAC" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } + expectedLog := "MHELLQWQRLD" + if log != expectedLog { + t.Errorf("Unexpected response. Expected: " + expectedLog + "\nGot: " + log) + } +} + +func TestApp_LuaSimulateFragment(t *testing.T) { + luaScript := ` +lacZ = "ATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGCGTAATAGCGAAGAGGCCCGCACCGATCGCCCTTCCCAACAGTTGCGCAGCCTGAATGGCGAATGGCGCCTGATGCGGTATTTTCTCCTTACGCATCTGTGCGGTATTTCACACCGCATATGGTGCACTCTCAGTACAATCTGCTCTGATGCCGCATAG" +fragmentation = fragment(lacZ, 95, 105) + +output = fragmentation.fragments[1] +` + _, output, err := app.ExecuteLua(luaScript, []gen.Attachment{}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "ATGACCATGATTACGCCAAGCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGTCGTGACTGG" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } +} + +func TestApp_LuaSimulatePCR(t *testing.T) { + luaScript := ` +gene = "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa" +fwd_primer = "TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG" +rev_primer = "TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC" +amplicons = complex_pcr({gene},{fwd_primer, rev_primer}, 55.0) + +output = amplicons[1] +` + _, output, err := app.ExecuteLua(luaScript, []gen.Attachment{}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } + + luaScript = ` +gene = "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa" +fwd_primer = "TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG" +rev_primer = "TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC" +amplicon = pcr(gene, fwd_primer, rev_primer, 55.0) + +output = amplicon +` + _, output, err = app.ExecuteLua(luaScript, []gen.Attachment{}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } +} diff --git a/api/api/templates/attachment-icon.png b/api/api/templates/attachment-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..31b418a5ddb36a71d7678745e0c1fc94a496bd0a GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-#br+y z$B>FSZ>QRF9dZz8UAtya<9=U1g?kR`SHw9s^==ICU;M4<6z%v^XaYG*6IgU;si?GE8PH}gBJ z+VsTqAI?ncCJs|ORi@xsQ7&+SagH(`d)sAMek=j@ZVqxH@@zF{?oD} zq6Je9ZdhO!RQsN5#_5F6fbG?XOiEdKjLMys^hI~+f9~!*?2MQwk|&yAZa*)FlC k9dJB;_0g7~=li}eJiIV*cWaSmB+z>dp00i_>zopr01@|jSO5S3 literal 0 HcmV?d00001 diff --git a/api/api/templates/chat.html b/api/api/templates/chat.html new file mode 100644 index 0000000..109c1be --- /dev/null +++ b/api/api/templates/chat.html @@ -0,0 +1,32 @@ + + + + + + SynbioGPT + + + + +
+
SynbioGPT
+
+ +
+
+
+ + + + +
+
+
+ + + + diff --git a/api/api/templates/styles.css b/api/api/templates/styles.css new file mode 100644 index 0000000..3109406 --- /dev/null +++ b/api/api/templates/styles.css @@ -0,0 +1,120 @@ +/* Reset some basic elements */ +body, h1, h2, h3, h4, h5, h6, p, form, input, textarea, header { + margin: 0; + padding: 0; + border: 0; + outline: none; +} + +/* Apply a dark theme to the body */ +body { + background-color: #121212; + font-family: 'Arial', sans-serif; + color: white; + height: 100vh; + margin: 0; + display: flex; + justify-content: center; + align-items: center; + padding: 20px; /* Add padding to prevent content from touching the edges */ +} + +/* Style the chat container */ +.chat-container { + width: 100%; + max-width: 800px; /* Adjust based on your preference */ + height: 80vh; /* Adjust based on your preference */ + display: flex; + flex-direction: column; + border: 1px solid #333; + border-radius: 8px; + overflow: hidden; +} + +/* Style the header */ +header { + background: #333; + padding: 10px; + font-size: 1.2em; + text-align: left; + width: 100%; +} + +/* Style the chat history */ +.chat-history { + flex-grow: 1; + overflow-y: auto; + padding: 10px; + background: #1a1a1a; +} + +/* Style the chat box */ +.chat-box { + background: #121212; /* Match the background color */ + padding: 10px; +} + +/* Style the text input */ +.chat-box textarea { + width: calc(100% - 48px); /* Adjust width to leave space for the icon and button */ + height: 50px; /* Adjust height based on your preference */ + background: #121212; /* Match the background color */ + color: white; + padding: 10px; + resize: none; /* Disable resizing */ + border-radius: 4px; + margin-right: 10px; + line-height: 1.5; +} + +/* Style the file upload */ +.chat-box input[type="file"] { + display: none; +} + +/* Style the custom file upload label */ +.custom-file-upload { + display: inline-block; + padding: 6px 12px; + cursor: pointer; + margin-right: 10px; + background: #262626; + border-radius: 4px; +} + +.custom-file-upload img { + height: 20px; /* Adjust size as necessary */ + width: auto; + vertical-align: middle; +} + +/* Style the send button */ +.chat-box button { + padding: 10px 20px; + border: none; + border-radius: 4px; + background-color: #4CAF50; + color: white; + cursor: pointer; +} + +/* Add some space for the last message before the input box */ +.chat-history:after { + content: ""; + display: block; + height: 10px; +} + +/* Scrollbar styles */ +.chat-history::-webkit-scrollbar { + width: 10px; +} + +.chat-history::-webkit-scrollbar-track { + background: #2f2f2f; +} + +.chat-history::-webkit-scrollbar-thumb { + background: #555; +} + diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go new file mode 100644 index 0000000..81a4c8b --- /dev/null +++ b/api/gen/dnadesign-server.gen.go @@ -0,0 +1,1274 @@ +// Package gen provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version v1.16.2 DO NOT EDIT. +package gen + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/go-chi/chi/v5" + strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp" +) + +// ServerInterface represents all server handlers. +type ServerInterface interface { + // Fix CDS + // (POST /design/cds/fix) + PostDesignCdsFix(w http.ResponseWriter, r *http.Request) + // Optimize CDS. + // (POST /design/cds/optimize) + PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) + // Translate CDS + // (POST /design/cds/translate) + PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) + // Run a lua script + // (POST /execute_lua) + PostExecuteLua(w http.ResponseWriter, r *http.Request) + // Parse FASTA data + // (POST /io/fasta/parse) + PostIoFastaParse(w http.ResponseWriter, r *http.Request) + // Simulate PCR + // (POST /simulate/complex_pcr) + PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) + // Fragment CDS + // (POST /simulate/fragment) + PostSimulateFragment(w http.ResponseWriter, r *http.Request) + // Simulate Golden Gate assembly + // (POST /simulate/goldengate) + PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) + // Simulate ligation + // (POST /simulate/ligate) + PostSimulateLigate(w http.ResponseWriter, r *http.Request) + // Simulate a simple PCR + // (POST /simulate/pcr) + PostSimulatePcr(w http.ResponseWriter, r *http.Request) + // Simulate restriction digest + // (POST /simulate/restriction_digest) + PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) +} + +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Fix CDS +// (POST /design/cds/fix) +func (_ Unimplemented) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Optimize CDS. +// (POST /design/cds/optimize) +func (_ Unimplemented) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Translate CDS +// (POST /design/cds/translate) +func (_ Unimplemented) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Run a lua script +// (POST /execute_lua) +func (_ Unimplemented) PostExecuteLua(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Parse FASTA data +// (POST /io/fasta/parse) +func (_ Unimplemented) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate PCR +// (POST /simulate/complex_pcr) +func (_ Unimplemented) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Fragment CDS +// (POST /simulate/fragment) +func (_ Unimplemented) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate Golden Gate assembly +// (POST /simulate/goldengate) +func (_ Unimplemented) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate ligation +// (POST /simulate/ligate) +func (_ Unimplemented) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate a simple PCR +// (POST /simulate/pcr) +func (_ Unimplemented) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate restriction digest +// (POST /simulate/restriction_digest) +func (_ Unimplemented) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// ServerInterfaceWrapper converts contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface + HandlerMiddlewares []MiddlewareFunc + ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +type MiddlewareFunc func(http.Handler) http.Handler + +// PostDesignCdsFix operation middleware +func (siw *ServerInterfaceWrapper) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostDesignCdsFix(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostDesignCdsOptimize operation middleware +func (siw *ServerInterfaceWrapper) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostDesignCdsOptimize(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostDesignCdsTranslate operation middleware +func (siw *ServerInterfaceWrapper) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostDesignCdsTranslate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostExecuteLua operation middleware +func (siw *ServerInterfaceWrapper) PostExecuteLua(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostExecuteLua(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostIoFastaParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoFastaParse(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulateComplexPcr operation middleware +func (siw *ServerInterfaceWrapper) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulateComplexPcr(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulateFragment operation middleware +func (siw *ServerInterfaceWrapper) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulateFragment(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulateGoldengate operation middleware +func (siw *ServerInterfaceWrapper) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulateGoldengate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulateLigate operation middleware +func (siw *ServerInterfaceWrapper) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulateLigate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulatePcr operation middleware +func (siw *ServerInterfaceWrapper) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulatePcr(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSimulateRestrictionDigest operation middleware +func (siw *ServerInterfaceWrapper) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSimulateRestrictionDigest(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +type UnescapedCookieParamError struct { + ParamName string + Err error +} + +func (e *UnescapedCookieParamError) Error() string { + return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName) +} + +func (e *UnescapedCookieParamError) Unwrap() error { + return e.Err +} + +type UnmarshalingParamError struct { + ParamName string + Err error +} + +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +} + +func (e *UnmarshalingParamError) Unwrap() error { + return e.Err +} + +type RequiredParamError struct { + ParamName string +} + +func (e *RequiredParamError) Error() string { + return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName) +} + +type RequiredHeaderError struct { + ParamName string + Err error +} + +func (e *RequiredHeaderError) Error() string { + return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName) +} + +func (e *RequiredHeaderError) Unwrap() error { + return e.Err +} + +type InvalidParamFormatError struct { + ParamName string + Err error +} + +func (e *InvalidParamFormatError) Error() string { + return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error()) +} + +func (e *InvalidParamFormatError) Unwrap() error { + return e.Err +} + +type TooManyValuesForParamError struct { + ParamName string + Count int +} + +func (e *TooManyValuesForParamError) Error() string { + return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count) +} + +// Handler creates http.Handler with routing matching OpenAPI spec. +func Handler(si ServerInterface) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{}) +} + +type ChiServerOptions struct { + BaseURL string + BaseRouter chi.Router + Middlewares []MiddlewareFunc + ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux. +func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseRouter: r, + }) +} + +func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseURL: baseURL, + BaseRouter: r, + }) +} + +// HandlerWithOptions creates http.Handler with additional options +func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler { + r := options.BaseRouter + + if r == nil { + r = chi.NewRouter() + } + if options.ErrorHandlerFunc == nil { + options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusBadRequest) + } + } + wrapper := ServerInterfaceWrapper{ + Handler: si, + HandlerMiddlewares: options.Middlewares, + ErrorHandlerFunc: options.ErrorHandlerFunc, + } + + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/design/cds/fix", wrapper.PostDesignCdsFix) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/design/cds/optimize", wrapper.PostDesignCdsOptimize) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/design/cds/translate", wrapper.PostDesignCdsTranslate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/execute_lua", wrapper.PostExecuteLua) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fasta/parse", wrapper.PostIoFastaParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/complex_pcr", wrapper.PostSimulateComplexPcr) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/fragment", wrapper.PostSimulateFragment) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/goldengate", wrapper.PostSimulateGoldengate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/ligate", wrapper.PostSimulateLigate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/pcr", wrapper.PostSimulatePcr) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/simulate/restriction_digest", wrapper.PostSimulateRestrictionDigest) + }) + + return r +} + +type PostDesignCdsFixRequestObject struct { + Body *PostDesignCdsFixJSONRequestBody +} + +type PostDesignCdsFixResponseObject interface { + VisitPostDesignCdsFixResponse(w http.ResponseWriter) error +} + +type PostDesignCdsFix200JSONResponse struct { + Changes []Change `json:"changes"` + Sequence string `json:"sequence"` +} + +func (response PostDesignCdsFix200JSONResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostDesignCdsFix400TextResponse string + +func (response PostDesignCdsFix400TextResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(400) + + _, err := w.Write([]byte(response)) + return err +} + +type PostDesignCdsFix500TextResponse string + +func (response PostDesignCdsFix500TextResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostDesignCdsOptimizeRequestObject struct { + Body *PostDesignCdsOptimizeJSONRequestBody +} + +type PostDesignCdsOptimizeResponseObject interface { + VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error +} + +type PostDesignCdsOptimize200JSONResponse string + +func (response PostDesignCdsOptimize200JSONResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostDesignCdsOptimize400TextResponse string + +func (response PostDesignCdsOptimize400TextResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(400) + + _, err := w.Write([]byte(response)) + return err +} + +type PostDesignCdsOptimize500TextResponse string + +func (response PostDesignCdsOptimize500TextResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostDesignCdsTranslateRequestObject struct { + Body *PostDesignCdsTranslateJSONRequestBody +} + +type PostDesignCdsTranslateResponseObject interface { + VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error +} + +type PostDesignCdsTranslate200JSONResponse string + +func (response PostDesignCdsTranslate200JSONResponse) VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostDesignCdsTranslate500TextResponse string + +func (response PostDesignCdsTranslate500TextResponse) VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostExecuteLuaRequestObject struct { + Body *PostExecuteLuaJSONRequestBody +} + +type PostExecuteLuaResponseObject interface { + VisitPostExecuteLuaResponse(w http.ResponseWriter) error +} + +type PostExecuteLua200JSONResponse struct { + Log string `json:"log"` + Output string `json:"output"` +} + +func (response PostExecuteLua200JSONResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostExecuteLua500TextResponse string + +func (response PostExecuteLua500TextResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostIoFastaParseRequestObject struct { + Body *PostIoFastaParseTextRequestBody +} + +type PostIoFastaParseResponseObject interface { + VisitPostIoFastaParseResponse(w http.ResponseWriter) error +} + +type PostIoFastaParse200JSONResponse []FastaRecord + +func (response PostIoFastaParse200JSONResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoFastaParse500TextResponse string + +func (response PostIoFastaParse500TextResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostSimulateComplexPcrRequestObject struct { + Body *PostSimulateComplexPcrJSONRequestBody +} + +type PostSimulateComplexPcrResponseObject interface { + VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error +} + +type PostSimulateComplexPcr200JSONResponse []string + +func (response PostSimulateComplexPcr200JSONResponse) VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostSimulateComplexPcr500TextResponse string + +func (response PostSimulateComplexPcr500TextResponse) VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostSimulateFragmentRequestObject struct { + Body *PostSimulateFragmentJSONRequestBody +} + +type PostSimulateFragmentResponseObject interface { + VisitPostSimulateFragmentResponse(w http.ResponseWriter) error +} + +type PostSimulateFragment200JSONResponse struct { + Efficiency float32 `json:"efficiency"` + Fragments []string `json:"fragments"` +} + +func (response PostSimulateFragment200JSONResponse) VisitPostSimulateFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostSimulateFragment500TextResponse string + +func (response PostSimulateFragment500TextResponse) VisitPostSimulateFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostSimulateGoldengateRequestObject struct { + Body *PostSimulateGoldengateJSONRequestBody +} + +type PostSimulateGoldengateResponseObject interface { + VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error +} + +type PostSimulateGoldengate200Response struct { +} + +func (response PostSimulateGoldengate200Response) VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostSimulateGoldengate500TextResponse string + +func (response PostSimulateGoldengate500TextResponse) VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostSimulateLigateRequestObject struct { + Body *PostSimulateLigateJSONRequestBody +} + +type PostSimulateLigateResponseObject interface { + VisitPostSimulateLigateResponse(w http.ResponseWriter) error +} + +type PostSimulateLigate200Response struct { +} + +func (response PostSimulateLigate200Response) VisitPostSimulateLigateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostSimulatePcrRequestObject struct { + Body *PostSimulatePcrJSONRequestBody +} + +type PostSimulatePcrResponseObject interface { + VisitPostSimulatePcrResponse(w http.ResponseWriter) error +} + +type PostSimulatePcr200JSONResponse string + +func (response PostSimulatePcr200JSONResponse) VisitPostSimulatePcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostSimulatePcr500TextResponse string + +func (response PostSimulatePcr500TextResponse) VisitPostSimulatePcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostSimulateRestrictionDigestRequestObject struct { + Body *PostSimulateRestrictionDigestJSONRequestBody +} + +type PostSimulateRestrictionDigestResponseObject interface { + VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error +} + +type PostSimulateRestrictionDigest200Response struct { +} + +func (response PostSimulateRestrictionDigest200Response) VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostSimulateRestrictionDigest500TextResponse string + +func (response PostSimulateRestrictionDigest500TextResponse) VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + // Fix CDS + // (POST /design/cds/fix) + PostDesignCdsFix(ctx context.Context, request PostDesignCdsFixRequestObject) (PostDesignCdsFixResponseObject, error) + // Optimize CDS. + // (POST /design/cds/optimize) + PostDesignCdsOptimize(ctx context.Context, request PostDesignCdsOptimizeRequestObject) (PostDesignCdsOptimizeResponseObject, error) + // Translate CDS + // (POST /design/cds/translate) + PostDesignCdsTranslate(ctx context.Context, request PostDesignCdsTranslateRequestObject) (PostDesignCdsTranslateResponseObject, error) + // Run a lua script + // (POST /execute_lua) + PostExecuteLua(ctx context.Context, request PostExecuteLuaRequestObject) (PostExecuteLuaResponseObject, error) + // Parse FASTA data + // (POST /io/fasta/parse) + PostIoFastaParse(ctx context.Context, request PostIoFastaParseRequestObject) (PostIoFastaParseResponseObject, error) + // Simulate PCR + // (POST /simulate/complex_pcr) + PostSimulateComplexPcr(ctx context.Context, request PostSimulateComplexPcrRequestObject) (PostSimulateComplexPcrResponseObject, error) + // Fragment CDS + // (POST /simulate/fragment) + PostSimulateFragment(ctx context.Context, request PostSimulateFragmentRequestObject) (PostSimulateFragmentResponseObject, error) + // Simulate Golden Gate assembly + // (POST /simulate/goldengate) + PostSimulateGoldengate(ctx context.Context, request PostSimulateGoldengateRequestObject) (PostSimulateGoldengateResponseObject, error) + // Simulate ligation + // (POST /simulate/ligate) + PostSimulateLigate(ctx context.Context, request PostSimulateLigateRequestObject) (PostSimulateLigateResponseObject, error) + // Simulate a simple PCR + // (POST /simulate/pcr) + PostSimulatePcr(ctx context.Context, request PostSimulatePcrRequestObject) (PostSimulatePcrResponseObject, error) + // Simulate restriction digest + // (POST /simulate/restriction_digest) + PostSimulateRestrictionDigest(ctx context.Context, request PostSimulateRestrictionDigestRequestObject) (PostSimulateRestrictionDigestResponseObject, error) +} + +type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc +type StrictMiddlewareFunc = strictnethttp.StrictHttpMiddlewareFunc + +type StrictHTTPServerOptions struct { + RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) + ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares, options: StrictHTTPServerOptions{ + RequestErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusBadRequest) + }, + ResponseErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusInternalServerError) + }, + }} +} + +func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares, options: options} +} + +type strictHandler struct { + ssi StrictServerInterface + middlewares []StrictMiddlewareFunc + options StrictHTTPServerOptions +} + +// PostDesignCdsFix operation middleware +func (sh *strictHandler) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { + var request PostDesignCdsFixRequestObject + + var body PostDesignCdsFixJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostDesignCdsFix(ctx, request.(PostDesignCdsFixRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostDesignCdsFix") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostDesignCdsFixResponseObject); ok { + if err := validResponse.VisitPostDesignCdsFixResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostDesignCdsOptimize operation middleware +func (sh *strictHandler) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { + var request PostDesignCdsOptimizeRequestObject + + var body PostDesignCdsOptimizeJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostDesignCdsOptimize(ctx, request.(PostDesignCdsOptimizeRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostDesignCdsOptimize") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostDesignCdsOptimizeResponseObject); ok { + if err := validResponse.VisitPostDesignCdsOptimizeResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostDesignCdsTranslate operation middleware +func (sh *strictHandler) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { + var request PostDesignCdsTranslateRequestObject + + var body PostDesignCdsTranslateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostDesignCdsTranslate(ctx, request.(PostDesignCdsTranslateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostDesignCdsTranslate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostDesignCdsTranslateResponseObject); ok { + if err := validResponse.VisitPostDesignCdsTranslateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostExecuteLua operation middleware +func (sh *strictHandler) PostExecuteLua(w http.ResponseWriter, r *http.Request) { + var request PostExecuteLuaRequestObject + + var body PostExecuteLuaJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostExecuteLua(ctx, request.(PostExecuteLuaRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostExecuteLua") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostExecuteLuaResponseObject); ok { + if err := validResponse.VisitPostExecuteLuaResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastaParse operation middleware +func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { + var request PostIoFastaParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoFastaParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastaParse(ctx, request.(PostIoFastaParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastaParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastaParseResponseObject); ok { + if err := validResponse.VisitPostIoFastaParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulateComplexPcr operation middleware +func (sh *strictHandler) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { + var request PostSimulateComplexPcrRequestObject + + var body PostSimulateComplexPcrJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulateComplexPcr(ctx, request.(PostSimulateComplexPcrRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulateComplexPcr") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulateComplexPcrResponseObject); ok { + if err := validResponse.VisitPostSimulateComplexPcrResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulateFragment operation middleware +func (sh *strictHandler) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { + var request PostSimulateFragmentRequestObject + + var body PostSimulateFragmentJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulateFragment(ctx, request.(PostSimulateFragmentRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulateFragment") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulateFragmentResponseObject); ok { + if err := validResponse.VisitPostSimulateFragmentResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulateGoldengate operation middleware +func (sh *strictHandler) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { + var request PostSimulateGoldengateRequestObject + + var body PostSimulateGoldengateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulateGoldengate(ctx, request.(PostSimulateGoldengateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulateGoldengate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulateGoldengateResponseObject); ok { + if err := validResponse.VisitPostSimulateGoldengateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulateLigate operation middleware +func (sh *strictHandler) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { + var request PostSimulateLigateRequestObject + + var body PostSimulateLigateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulateLigate(ctx, request.(PostSimulateLigateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulateLigate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulateLigateResponseObject); ok { + if err := validResponse.VisitPostSimulateLigateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulatePcr operation middleware +func (sh *strictHandler) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { + var request PostSimulatePcrRequestObject + + var body PostSimulatePcrJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulatePcr(ctx, request.(PostSimulatePcrRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulatePcr") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulatePcrResponseObject); ok { + if err := validResponse.VisitPostSimulatePcrResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostSimulateRestrictionDigest operation middleware +func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { + var request PostSimulateRestrictionDigestRequestObject + + var body PostSimulateRestrictionDigestJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostSimulateRestrictionDigest(ctx, request.(PostSimulateRestrictionDigestRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostSimulateRestrictionDigest") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostSimulateRestrictionDigestResponseObject); ok { + if err := validResponse.VisitPostSimulateRestrictionDigestResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/9xZTW/bOBP+KwTf9yhYbru7aH1LnLoIULSBnT0tCoOmRjYLimRJKrVb5L8vSEqyHDGy", + "0jhJsSdX5XA488wzH2R+YioLJQUIa/DkJzZ0AwXx/zyzltBNAcK6L6WlAm0Z+DUqha0W7E4BnmBjNRNr", + "fJtgQQqILNwmWMO3kmnI8OSfIJU0ir4ktbxcfQVqnaLphog1dA+faVlET76ShlkmRWuRCQtr0G51DsQc", + "rO03Liyo+KZredyV5thKURIs9JubY2MOvhc/dgErEGXhVJ0bcokTfL4y7ueKfJv6T1OcX7Y07A2fEWPJ", + "HKjUWRenewKRYAPfShB0eJSaDTEvZpqs4yyZSf2d6OzzDWgXyqgtc7gBbaBXZjHY3kWfoZ/1mghmijbg", + "7x3hNaMbRhCVnDnUw5cixkrNTAR3dyoTeaAGs9ytXXw6QxkYthbo7MoFzbnluYjHo/HolTNAKhBEMTzB", + "b0bj0RgnWBG78VClYW9KM5PmbOuxlMZjmoGhmqlAbDxjWzCIyqKQAiktVxwKg5hA04uF/1UaFNHEiaNc", + "auQMMzthN2CYGWFvRVi+zPDEkdde+LOnmZmxLQ6AgrHnMtvdyXWiFGfUb06/VskUKkY3+LKF9v815HiC", + "/5fui01aVZq0iYoPZSFvoA6iV8MsFCbKiuo/iNZk9zBWN5LJ3sru4V0K3QZFRklhgnWvx+NHQER9gTt0", + "sw+qqiCeyvf6+JijSYR2meMYCnrRd2Y3iDNjkcxRrek2wX90ELGwtanihN3BIpJUh2f+bUAjJlRpEWgt", +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h4AAA==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go new file mode 100644 index 0000000..39f7d88 --- /dev/null +++ b/api/gen/dnadesign-types.gen.go @@ -0,0 +1,154 @@ +// Package gen provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version v1.16.2 DO NOT EDIT. +package gen + +// Defines values for Enzyme. +const ( + BbsI Enzyme = "BbsI" + BsaI Enzyme = "BsaI" + BsmBI Enzyme = "BsmBI" + PaqCI Enzyme = "PaqCI" +) + +// Defines values for Organism. +const ( + EscherichiaColi Organism = "Escherichia coli" + PichiaPastoris Organism = "Pichia pastoris" +) + +// Attachment defines model for Attachment. +type Attachment struct { + Content string `json:"content"` + Name string `json:"name"` +} + +// Change defines model for Change. +type Change struct { + From string `json:"From"` + Position int `json:"Position"` + Reason string `json:"Reason"` + Step int `json:"Step"` + To string `json:"To"` +} + +// Enzyme defines model for Enzyme. +type Enzyme string + +// FastaRecord defines model for FastaRecord. +type FastaRecord struct { + Name string `json:"name"` + Sequence string `json:"sequence"` +} + +// Fragment defines model for Fragment. +type Fragment struct { + ForwardOverhang *string `json:"ForwardOverhang,omitempty"` + ReverseOverhang *string `json:"ReverseOverhang,omitempty"` + Sequence string `json:"Sequence"` +} + +// Organism defines model for Organism. +type Organism string + +// PostDesignCdsFixJSONBody defines parameters for PostDesignCdsFix. +type PostDesignCdsFixJSONBody struct { + Organism Organism `json:"organism"` + RemoveSequences []string `json:"removeSequences"` + Sequence string `json:"sequence"` +} + +// PostDesignCdsOptimizeJSONBody defines parameters for PostDesignCdsOptimize. +type PostDesignCdsOptimizeJSONBody struct { + Organism Organism `json:"organism"` + Seed *int `json:"seed,omitempty"` + Sequence string `json:"sequence"` +} + +// PostDesignCdsTranslateJSONBody defines parameters for PostDesignCdsTranslate. +type PostDesignCdsTranslateJSONBody struct { + Sequence string `json:"sequence"` + TranslationTable int `json:"translation_table"` +} + +// PostExecuteLuaJSONBody defines parameters for PostExecuteLua. +type PostExecuteLuaJSONBody struct { + Attachments *[]Attachment `json:"attachments,omitempty"` + Script string `json:"script"` +} + +// PostIoFastaParseTextBody defines parameters for PostIoFastaParse. +type PostIoFastaParseTextBody = string + +// PostSimulateComplexPcrJSONBody defines parameters for PostSimulateComplexPcr. +type PostSimulateComplexPcrJSONBody struct { + Circular *bool `json:"circular,omitempty"` + Primers []string `json:"primers"` + TargetTm float32 `json:"target_tm"` + Templates []string `json:"templates"` +} + +// PostSimulateFragmentJSONBody defines parameters for PostSimulateFragment. +type PostSimulateFragmentJSONBody struct { + ExcludeOverhangs *[]string `json:"exclude_overhangs,omitempty"` + MaxFragmentSize int `json:"max_fragment_size"` + MinFragmentSize int `json:"min_fragment_size"` + Sequence string `json:"sequence"` +} + +// PostSimulateGoldengateJSONBody defines parameters for PostSimulateGoldengate. +type PostSimulateGoldengateJSONBody struct { + Enzyme *Enzyme `json:"enzyme,omitempty"` + Sequences *[]string `json:"sequences,omitempty"` +} + +// PostSimulateLigateJSONBody defines parameters for PostSimulateLigate. +type PostSimulateLigateJSONBody = []Fragment + +// PostSimulatePcrJSONBody defines parameters for PostSimulatePcr. +type PostSimulatePcrJSONBody struct { + Circular *bool `json:"circular,omitempty"` + ForwardPrimer string `json:"forward_primer"` + ReversePrimer string `json:"reverse_primer"` + TargetTm float32 `json:"target_tm"` + Template string `json:"template"` +} + +// PostSimulateRestrictionDigestJSONBody defines parameters for PostSimulateRestrictionDigest. +type PostSimulateRestrictionDigestJSONBody struct { + Enzyme *Enzyme `json:"enzyme,omitempty"` + Sequence *string `json:"sequence,omitempty"` +} + +// PostDesignCdsFixJSONRequestBody defines body for PostDesignCdsFix for application/json ContentType. +type PostDesignCdsFixJSONRequestBody PostDesignCdsFixJSONBody + +// PostDesignCdsOptimizeJSONRequestBody defines body for PostDesignCdsOptimize for application/json ContentType. +type PostDesignCdsOptimizeJSONRequestBody PostDesignCdsOptimizeJSONBody + +// PostDesignCdsTranslateJSONRequestBody defines body for PostDesignCdsTranslate for application/json ContentType. +type PostDesignCdsTranslateJSONRequestBody PostDesignCdsTranslateJSONBody + +// PostExecuteLuaJSONRequestBody defines body for PostExecuteLua for application/json ContentType. +type PostExecuteLuaJSONRequestBody PostExecuteLuaJSONBody + +// PostIoFastaParseTextRequestBody defines body for PostIoFastaParse for text/plain ContentType. +type PostIoFastaParseTextRequestBody = PostIoFastaParseTextBody + +// PostSimulateComplexPcrJSONRequestBody defines body for PostSimulateComplexPcr for application/json ContentType. +type PostSimulateComplexPcrJSONRequestBody PostSimulateComplexPcrJSONBody + +// PostSimulateFragmentJSONRequestBody defines body for PostSimulateFragment for application/json ContentType. +type PostSimulateFragmentJSONRequestBody PostSimulateFragmentJSONBody + +// PostSimulateGoldengateJSONRequestBody defines body for PostSimulateGoldengate for application/json ContentType. +type PostSimulateGoldengateJSONRequestBody PostSimulateGoldengateJSONBody + +// PostSimulateLigateJSONRequestBody defines body for PostSimulateLigate for application/json ContentType. +type PostSimulateLigateJSONRequestBody = PostSimulateLigateJSONBody + +// PostSimulatePcrJSONRequestBody defines body for PostSimulatePcr for application/json ContentType. +type PostSimulatePcrJSONRequestBody PostSimulatePcrJSONBody + +// PostSimulateRestrictionDigestJSONRequestBody defines body for PostSimulateRestrictionDigest for application/json ContentType. +type PostSimulateRestrictionDigestJSONRequestBody PostSimulateRestrictionDigestJSONBody diff --git a/api/gen/gen.sh b/api/gen/gen.sh new file mode 100755 index 0000000..64774e8 --- /dev/null +++ b/api/gen/gen.sh @@ -0,0 +1,2 @@ +oapi-codegen --config=./types.cfg.yaml ../spec.yaml +oapi-codegen --config=./server.cfg.yaml ../spec.yaml diff --git a/api/gen/server.cfg.yaml b/api/gen/server.cfg.yaml new file mode 100644 index 0000000..a864cc9 --- /dev/null +++ b/api/gen/server.cfg.yaml @@ -0,0 +1,6 @@ +package: gen +generate: + chi-server: true + strict-server: true + embedded-spec: true +output: dnadesign-server.gen.go diff --git a/api/gen/types.cfg.yaml b/api/gen/types.cfg.yaml new file mode 100644 index 0000000..349a4aa --- /dev/null +++ b/api/gen/types.cfg.yaml @@ -0,0 +1,4 @@ +package: gen +generate: + models: true +output: dnadesign-types.gen.go diff --git a/api/main.go b/api/main.go new file mode 100644 index 0000000..aff1fc6 --- /dev/null +++ b/api/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "log" + "net/http" + "os" + + "github.com/koeng101/dnadesign/api/api" +) + +func main() { + app := api.InitializeApp() + // Serve application + s := &http.Server{ + Addr: ":" + os.Getenv("PORT"), + Handler: app.Router, + } + log.Fatal(s.ListenAndServe()) +} diff --git a/api/spec.yaml b/api/spec.yaml new file mode 100644 index 0000000..88a6d13 --- /dev/null +++ b/api/spec.yaml @@ -0,0 +1,450 @@ +openapi: 3.0.0 +info: + title: DNA design API + version: 0.0.1 +servers: + - url: https://dnadesign.bio/api + - url: http://localhost:8080/api +components: + schemas: + Attachment: + type: object + properties: + name: + type: string + content: + type: string + required: + - name + - content + FastaRecord: + type: object + properties: + name: + type: string + sequence: + type: string + required: + - name + - sequence + Fragment: + type: object + properties: + Sequence: + type: string + ForwardOverhang: + type: string + ReverseOverhang: + type: string + required: + - Sequence + Organism: + type: string + enum: + - Escherichia coli + - Pichia pastoris + Enzyme: + type: string + enum: + - BsaI + - BbsI + - PaqCI + - BsmBI + Change: + type: object + properties: + Position: + type: integer + Step: + type: integer + From: + type: string + To: + type: string + Reason: + type: string + required: + - Position + - Step + - From + - To + - Reason +paths: + /execute_lua: + post: + tags: + - lua + summary: Run a lua script + requestBody: + content: + application/json: + schema: + type: object + properties: + script: + type: string + attachments: + type: array + items: + $ref: '#/components/schemas/Attachment' + required: + - script + responses: + '200': + description: Successful output + content: + application/json: + schema: + type: object + properties: + output: + type: string + log: + type: string + required: + - output + - log + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /io/fasta/parse: + post: + tags: + - io + summary: Parse FASTA data + requestBody: + content: + text/plain: + schema: + type: string + responses: + '200': + description: Parsed FASTA records + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FastaRecord' + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /design/cds/fix: + post: + tags: + - cds + summary: Fix CDS + description: Fixes common problems in CDSs in preparation for DNA synthesis. + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + organism: + $ref: '#/components/schemas/Organism' + removeSequences: + type: array + items: + type: string + required: + - sequence + - organism + - removeSequences + responses: + '200': + description: Fixed CDS string with list of changes + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + changes: + type: array + items: + $ref: '#/components/schemas/Change' + required: + - sequence + - changes + '400': + description: User input error + content: + text/plain: + schema: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /design/cds/optimize: + post: + tags: + - cds + summary: Optimize CDS. + description: RNG Seed defaults to 0 + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + organism: + $ref: '#/components/schemas/Organism' + seed: + type: integer + required: + - sequence + - organism + responses: + '200': + description: The optimized sequence + content: + application/json: + schema: + type: string + '400': + description: User input error + content: + text/plain: + schema: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /design/cds/translate: + post: + tags: + - cds + summary: Translate CDS + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + translation_table: + type: integer + default: 11 + required: [translation_table, sequence] + responses: + '200': + description: Translated sequence string + content: + application/json: + schema: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /simulate/fragment: + post: + tags: + - simulate + summary: Fragment CDS + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + min_fragment_size: + type: integer + default: 200 + max_fragment_size: + type: integer + default: 300 + exclude_overhangs: + type: array + items: + type: string + required: [sequence, min_fragment_size, max_fragment_size] + responses: + '200': + description: Array of fragments and a float + content: + application/json: + schema: + type: object + properties: + fragments: + type: array + items: + type: string + efficiency: + type: number + default: 0.99 + required: + - fragments + - efficiency + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /simulate/complex_pcr: + post: + tags: + - simulate + summary: Simulate PCR + requestBody: + content: + application/json: + schema: + type: object + properties: + templates: + type: array + items: + type: string + primers: + type: array + items: + type: string + target_tm: + type: number + default: 60.0 + circular: + type: boolean + required: [templates, primers, target_tm] + responses: + '200': + description: PCR product strings + content: + application/json: + schema: + type: array + items: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /simulate/pcr: + post: + tags: + - simulate + summary: Simulate a simple PCR + requestBody: + content: + application/json: + schema: + type: object + properties: + template: + type: string + forward_primer: + type: string + reverse_primer: + type: string + target_tm: + type: number + default: 60.0 + circular: + type: boolean + required: [template, forward_primer, reverse_primer, target_tm] + responses: + '200': + description: PCR product strings + content: + application/json: + schema: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /simulate/ligate: + post: + tags: + - simulate + summary: Simulate ligation + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Fragment' + responses: + '200': + description: Ligated product strings + /simulate/restriction_digest: + post: + tags: + - simulate + summary: Simulate restriction digest + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + enzyme: + $ref: '#/components/schemas/Enzyme' + responses: + '200': + description: Array of fragments + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /simulate/goldengate: + post: + tags: + - simulate + summary: Simulate Golden Gate assembly + requestBody: + content: + application/json: + schema: + type: object + properties: + sequences: + type: array + items: + type: string + enzyme: + $ref: '#/components/schemas/Enzyme' + responses: + '200': + description: Golden Gate assembly product strings + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + diff --git a/go.mod b/go.mod index 83658c5..0da305b 100644 --- a/go.mod +++ b/go.mod @@ -16,15 +16,27 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b // indirect + github.com/getkin/kin-openapi v0.122.0 // indirect + github.com/go-chi/chi/v5 v5.0.10 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 // indirect + github.com/invopop/yaml v0.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-sqlite3 v1.14.13 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oapi-codegen/runtime v1.1.0 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect golang.org/x/sync v0.3.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( github.com/klauspost/cpuid v1.3.1 // indirect - github.com/stretchr/testify v1.4.0 + github.com/stretchr/testify v1.8.4 gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 6962438..6337538 100644 --- a/go.sum +++ b/go.sum @@ -1,28 +1,54 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b h1:oy54yVy300Db264NfQCJubZHpJOl+SoT6udALQdFbSI= +github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b/go.mod h1:/RJwPD5L4xWgCbqQ1L5cB12ndgfKKT54n9cZFf+8pus= +github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10= +github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= +github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= +github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 h1:XboatR7lasl05yel5hNXF7kQBw2oFUGdMztcgisfhNU= github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6/go.mod h1:RmeVYf9XrPRbRc3XIx0gLYA8qOFvNoPOfaEZduRlEp4= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8 h1:oaPrvMY8VJEYfJ/r/VTKh2zshX/SxYHcImJRPZ++JPI= github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8/go.mod h1:/zIPMIRhcEjka8JxY3mo7jexMl4ncHLRUnv9RIiAS9E= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk= github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-sqlite3 v1.14.13 h1:1tj15ngiFfcZzii7yd82foL+ks+ouQcj8j/TPq3fk1I= github.com/mattn/go-sqlite3 v1.14.13/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mmcloughlin/avo v0.0.0-20200504053806-fa88270b07e4/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mroth/weightedrand v0.4.1 h1:rHcbUBopmi/3x4nnrvwGJBhX9d0vk+KgoLUZeDP6YyI= github.com/mroth/weightedrand v0.4.1/go.mod h1:3p2SIcC8al1YMzGhAIoXD+r9olo/g/cdJgAD905gyNE= +github.com/oapi-codegen/runtime v1.1.0 h1:rJpoNUawn5XTvekgfkvSZr0RqEnoYpFkyvrzfWeFKWM= +github.com/oapi-codegen/runtime v1.1.0/go.mod h1:BeSfBkWWWnAnGdyS+S/GnlbmHKzf8/hwkvelJZDeKA8= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -30,9 +56,19 @@ github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= golang.org/x/arch v0.0.0-20190909030613-46d78d1859ac/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -57,10 +93,15 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= lukechampine.com/blake3 v1.1.5 h1:hsACfxWvLdGmjYbWGrumQIphOvO+ZruZehWtgd2fxoM= lukechampine.com/blake3 v1.1.5/go.mod h1:hE8RpzdO8ttZ7446CXEwDP1eu2V4z7stv0Urj1El20g= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= From 1c71b6fc75811b0ac7b47e5efb10c25d83b172b5 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 12:08:28 -0800 Subject: [PATCH 02/21] update templates --- api/api/api.go | 18 +--- api/api/templates/attachment-icon.png | Bin 289 -> 0 bytes api/api/templates/chat.html | 32 ------- api/api/templates/index.html | 1 + api/api/templates/styles.css | 120 -------------------------- 5 files changed, 2 insertions(+), 169 deletions(-) delete mode 100644 api/api/templates/attachment-icon.png delete mode 100644 api/api/templates/chat.html create mode 100644 api/api/templates/index.html delete mode 100644 api/api/templates/styles.css diff --git a/api/api/api.go b/api/api/api.go index 1ec1653..f1ac90d 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -4,7 +4,6 @@ import ( "context" "embed" _ "embed" - "encoding/json" "fmt" "html/template" "io/fs" @@ -39,7 +38,7 @@ var templates = template.Must(template.ParseFS(templatesFS, "templates/*")) // IndexHandler handles the basic HTML page for interacting with polyAPI. func indexHandler(w http.ResponseWriter, r *http.Request) { - err := templates.ExecuteTemplate(w, "chat.html", nil) + err := templates.ExecuteTemplate(w, "index.html", nil) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } @@ -83,21 +82,6 @@ func InitializeApp() App { log.Fatal(err) } - // Handle "hello" for testing with wasm - app.Router.HandleFunc("/hello", func(res http.ResponseWriter, req *http.Request) { - params := make(map[string]string) - if err := json.NewDecoder(req.Body).Decode(¶ms); err != nil { - panic(err) - } - - res.Header().Add("Content-Type", "application/json") - if err := json.NewEncoder(res).Encode(map[string]string{ - "message": fmt.Sprintf("Hello there %s!", params["name"]), - }); err != nil { - panic(err) - } - }) - // Handle routes. app.Router.HandleFunc("/", indexHandler) app.Router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(subFS)))) diff --git a/api/api/templates/attachment-icon.png b/api/api/templates/attachment-icon.png deleted file mode 100644 index 31b418a5ddb36a71d7678745e0c1fc94a496bd0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-#br+y z$B>FSZ>QRF9dZz8UAtya<9=U1g?kR`SHw9s^==ICU;M4<6z%v^XaYG*6IgU;si?GE8PH}gBJ z+VsTqAI?ncCJs|ORi@xsQ7&+SagH(`d)sAMek=j@ZVqxH@@zF{?oD} zq6Je9ZdhO!RQsN5#_5F6fbG?XOiEdKjLMys^hI~+f9~!*?2MQwk|&yAZa*)FlC k9dJB;_0g7~=li}eJiIV*cWaSmB+z>dp00i_>zopr01@|jSO5S3 diff --git a/api/api/templates/chat.html b/api/api/templates/chat.html deleted file mode 100644 index 109c1be..0000000 --- a/api/api/templates/chat.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - SynbioGPT - - - - -
-
SynbioGPT
-
- -
-
-
- - - - -
-
-
- - - - diff --git a/api/api/templates/index.html b/api/api/templates/index.html new file mode 100644 index 0000000..bfab090 --- /dev/null +++ b/api/api/templates/index.html @@ -0,0 +1 @@ +

DnaDesign

diff --git a/api/api/templates/styles.css b/api/api/templates/styles.css deleted file mode 100644 index 3109406..0000000 --- a/api/api/templates/styles.css +++ /dev/null @@ -1,120 +0,0 @@ -/* Reset some basic elements */ -body, h1, h2, h3, h4, h5, h6, p, form, input, textarea, header { - margin: 0; - padding: 0; - border: 0; - outline: none; -} - -/* Apply a dark theme to the body */ -body { - background-color: #121212; - font-family: 'Arial', sans-serif; - color: white; - height: 100vh; - margin: 0; - display: flex; - justify-content: center; - align-items: center; - padding: 20px; /* Add padding to prevent content from touching the edges */ -} - -/* Style the chat container */ -.chat-container { - width: 100%; - max-width: 800px; /* Adjust based on your preference */ - height: 80vh; /* Adjust based on your preference */ - display: flex; - flex-direction: column; - border: 1px solid #333; - border-radius: 8px; - overflow: hidden; -} - -/* Style the header */ -header { - background: #333; - padding: 10px; - font-size: 1.2em; - text-align: left; - width: 100%; -} - -/* Style the chat history */ -.chat-history { - flex-grow: 1; - overflow-y: auto; - padding: 10px; - background: #1a1a1a; -} - -/* Style the chat box */ -.chat-box { - background: #121212; /* Match the background color */ - padding: 10px; -} - -/* Style the text input */ -.chat-box textarea { - width: calc(100% - 48px); /* Adjust width to leave space for the icon and button */ - height: 50px; /* Adjust height based on your preference */ - background: #121212; /* Match the background color */ - color: white; - padding: 10px; - resize: none; /* Disable resizing */ - border-radius: 4px; - margin-right: 10px; - line-height: 1.5; -} - -/* Style the file upload */ -.chat-box input[type="file"] { - display: none; -} - -/* Style the custom file upload label */ -.custom-file-upload { - display: inline-block; - padding: 6px 12px; - cursor: pointer; - margin-right: 10px; - background: #262626; - border-radius: 4px; -} - -.custom-file-upload img { - height: 20px; /* Adjust size as necessary */ - width: auto; - vertical-align: middle; -} - -/* Style the send button */ -.chat-box button { - padding: 10px 20px; - border: none; - border-radius: 4px; - background-color: #4CAF50; - color: white; - cursor: pointer; -} - -/* Add some space for the last message before the input box */ -.chat-history:after { - content: ""; - display: block; - height: 10px; -} - -/* Scrollbar styles */ -.chat-history::-webkit-scrollbar { - width: 10px; -} - -.chat-history::-webkit-scrollbar-track { - background: #2f2f2f; -} - -.chat-history::-webkit-scrollbar-thumb { - background: #555; -} - From 71800fbede113f97acad60ba5f54e7a4a16744ff Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 12:11:57 -0800 Subject: [PATCH 03/21] update go mod --- go.mod | 37 +++++++++++++++++-------------------- go.sum | 51 +++++++++++++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/go.mod b/go.mod index 0da305b..4ede24a 100644 --- a/go.mod +++ b/go.mod @@ -1,42 +1,39 @@ module github.com/koeng101/dnadesign -go 1.18 +go 1.21.3 require ( - github.com/google/go-cmp v0.5.8 + github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b + github.com/getkin/kin-openapi v0.122.0 + github.com/go-chi/chi/v5 v5.0.10 + github.com/google/go-cmp v0.6.0 + github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8 github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de github.com/mitchellh/go-wordwrap v1.0.1 - github.com/mroth/weightedrand v0.4.1 + github.com/mroth/weightedrand v1.0.0 + github.com/oapi-codegen/runtime v1.1.0 github.com/pmezard/go-difflib v1.0.0 - github.com/sergi/go-diff v1.2.0 + github.com/sergi/go-diff v1.3.1 github.com/spaolacci/murmur3 v1.1.0 - golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 - lukechampine.com/blake3 v1.1.5 + github.com/stretchr/testify v1.8.4 + github.com/yuin/gopher-lua v1.1.1 + golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/sync v0.5.0 + lukechampine.com/blake3 v1.2.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b // indirect - github.com/getkin/kin-openapi v0.122.0 // indirect - github.com/go-chi/chi/v5 v5.0.10 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/swag v0.22.4 // indirect github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-sqlite3 v1.14.13 // indirect + github.com/mattn/go-sqlite3 v1.14.18 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/oapi-codegen/runtime v1.1.0 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect - github.com/yuin/gopher-lua v1.1.1 // indirect - golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.13.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -require ( - github.com/klauspost/cpuid v1.3.1 // indirect - github.com/stretchr/testify v1.8.4 - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/go.sum b/go.sum index 6337538..e391a0d 100644 --- a/go.sum +++ b/go.sum @@ -13,77 +13,82 @@ github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaL github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 h1:XboatR7lasl05yel5hNXF7kQBw2oFUGdMztcgisfhNU= github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6/go.mod h1:RmeVYf9XrPRbRc3XIx0gLYA8qOFvNoPOfaEZduRlEp4= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= -github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8 h1:oaPrvMY8VJEYfJ/r/VTKh2zshX/SxYHcImJRPZ++JPI= github.com/koeng101/svb v0.0.0-20230815034912-d6737f9ed8b8/go.mod h1:/zIPMIRhcEjka8JxY3mo7jexMl4ncHLRUnv9RIiAS9E= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de h1:nyxwRdWHAVxpFcDThedEgQ07DbcRc5xgNObtbTp76fk= github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-sqlite3 v1.14.13 h1:1tj15ngiFfcZzii7yd82foL+ks+ouQcj8j/TPq3fk1I= -github.com/mattn/go-sqlite3 v1.14.13/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= +github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mmcloughlin/avo v0.0.0-20200504053806-fa88270b07e4/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/mroth/weightedrand v0.4.1 h1:rHcbUBopmi/3x4nnrvwGJBhX9d0vk+KgoLUZeDP6YyI= -github.com/mroth/weightedrand v0.4.1/go.mod h1:3p2SIcC8al1YMzGhAIoXD+r9olo/g/cdJgAD905gyNE= +github.com/mroth/weightedrand v1.0.0 h1:V8JeHChvl2MP1sAoXq4brElOcza+jxLkRuwvtQu8L3E= +github.com/mroth/weightedrand v1.0.0/go.mod h1:3p2SIcC8al1YMzGhAIoXD+r9olo/g/cdJgAD905gyNE= github.com/oapi-codegen/runtime v1.1.0 h1:rJpoNUawn5XTvekgfkvSZr0RqEnoYpFkyvrzfWeFKWM= github.com/oapi-codegen/runtime v1.1.0/go.mod h1:BeSfBkWWWnAnGdyS+S/GnlbmHKzf8/hwkvelJZDeKA8= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= golang.org/x/arch v0.0.0-20190909030613-46d78d1859ac/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 h1:LGJsf5LRplCck6jUCH3dBL2dmycNruWNF5xugkSlfXw= -golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= +golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -91,17 +96,15 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -lukechampine.com/blake3 v1.1.5 h1:hsACfxWvLdGmjYbWGrumQIphOvO+ZruZehWtgd2fxoM= -lukechampine.com/blake3 v1.1.5/go.mod h1:hE8RpzdO8ttZ7446CXEwDP1eu2V4z7stv0Urj1El20g= +lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= +lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= From e26c6b9676107b64d6c7f98ed05532c56a0ce16e Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 13:44:07 -0800 Subject: [PATCH 04/21] Updated with Genbank in spec.yaml --- api/api/api.go | 24 +- api/api/api_test.go | 57 +++- api/api/json/json.lua | 390 ++++++++++++++++++++++++++ api/api/lua.go | 14 + api/api/lua_test.go | 67 ++++- api/gen/dnadesign-server.gen.go | 144 ++++++++-- api/gen/dnadesign-types.gen.go | 88 +++++- api/spec.yaml | 221 ++++++++++++++- bio/fasta/fasta.go | 13 +- bio/genbank/genbank.go | 223 ++++++++------- bio/genbank/genbank_test.go | 37 +-- bio/gff/example_test.go | 170 ----------- bio/gff/gff.go | 332 ---------------------- bio/gff/gff_test.go | 146 ---------- data/parseLocationRegressionTest.json | 53 +++- synthesis/codon/codon.go | 2 +- 16 files changed, 1173 insertions(+), 808 deletions(-) create mode 100644 api/api/json/json.lua delete mode 100644 bio/gff/example_test.go delete mode 100644 bio/gff/gff.go delete mode 100644 bio/gff/gff_test.go diff --git a/api/api/api.go b/api/api/api.go index f1ac90d..4f31542 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -93,6 +93,7 @@ func InitializeApp() App { // IO handlers. app.Router.HandleFunc("/api/io/fasta/parse", appImpl.PostIoFastaParse) + app.Router.HandleFunc("/api/io/genbank/parse", appImpl.PostIoGenbankParse) // CDS design handlers. app.Router.HandleFunc("/api/design/cds/fix", appImpl.PostDesignCdsFix) @@ -145,11 +146,32 @@ func (app *App) PostIoFastaParse(ctx context.Context, request gen.PostIoFastaPar } data := make([]gen.FastaRecord, len(fastas)) for i, fastaRecord := range fastas { - data[i] = gen.FastaRecord{Name: fastaRecord.Identifier, Sequence: fastaRecord.Sequence} + data[i] = gen.FastaRecord(*fastaRecord) } return gen.PostIoFastaParse200JSONResponse(data), nil } +func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenbankParseRequestObject) (gen.PostIoGenbankParseResponseObject, error) { + genbankString := *request.Body + parser, err := bio.NewGenbankParser(strings.NewReader(genbankString + "\n")) + if err != nil { + return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + genbanks, err := parser.Parse() + if err != nil { + return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data := make([]gen.GenbankRecord, len(genbanks)) + for i, genbankRecord := range genbanks { + err := genbankRecord.StoreFeatureSequences() + if err != nil { + return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data[i] = gen.GenbankRecord(*genbankRecord) + } + return gen.PostIoGenbankParse200JSONResponse(data), nil +} + /* ***************************************************************************** diff --git a/api/api/api_test.go b/api/api/api_test.go index 3eafeb5..8af42c1 100644 --- a/api/api/api_test.go +++ b/api/api/api_test.go @@ -32,7 +32,62 @@ IENY resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) - r := `[{"name":"gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]","sequence":"LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLVEWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLGLLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVILGLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGXIENY"}]` + r := `[{"identifier":"gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]","sequence":"LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLVEWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLGLLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVILGLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGXIENY"}]` + if strings.TrimSpace(resp.Body.String()) != r { + t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) + } +} + +func TestIoGenbankParse(t *testing.T) { + baseGenbank := `LOCUS pUC19_lacZ 336 bp DNA linear UNA 12-SEP-2023 +DEFINITION natural linear DNA +ACCESSION . +VERSION . +KEYWORDS . +SOURCE natural DNA sequence + ORGANISM unspecified +REFERENCE 1 (bases 1 to 336) + AUTHORS Keoni Gandall + TITLE Direct Submission + JOURNAL Exported Sep 12, 2023 from SnapGene 6.2.2 + https://www.snapgene.com +FEATURES Location/Qualifiers + source 1..336 + /mol_type="genomic DNA" + /organism="unspecified" + primer_bind 1..17 + /label=M13 rev + /note="common sequencing primer, one of multiple similar + variants" + CDS 13..336 + /codon_start=1 + /gene="lacZ" + /product="LacZ-alpha fragment of beta-galactosidase" + /label=lacZ-alpha + /translation="MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNR + LAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICS + DAA" + misc_feature 30..86 + /label=MCS + /note="pUC19 multiple cloning site" + primer_bind complement(87..103) + /label=M13 fwd + /note="common sequencing primer, one of multiple similar + variants" +ORIGIN + 1 caggaaacag ctatgaccat gattacgcca agcttgcatg cctgcaggtc gactctagag + 61 gatccccggg taccgagctc gaattcactg gccgtcgttt tacaacgtcg tgactgggaa + 121 aaccctggcg ttacccaact taatcgcctt gcagcacatc cccctttcgc cagctggcgt + 181 aatagcgaag aggcccgcac cgatcgccct tcccaacagt tgcgcagcct gaatggcgaa + 241 tggcgcctga tgcggtattt tctccttacg catctgtgcg gtatttcaca ccgcatatgg + 301 tgcactctca gtacaatctg ctctgatgcc gcatag +// +` + req := httptest.NewRequest("POST", "/api/io/genbank/parse", strings.NewReader(baseGenbank)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + r := `[{"features":[{"attributes":{"mol_type":["genomic DNA"],"organism":["unspecified"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","sequenceHash":"","sequenceHashFunction":"","type":"source"},{"attributes":{"label":["M13 rev"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":false,"end":17,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgac","sequenceHash":"","sequenceHashFunction":"","type":"primer_bind"},{"attributes":{"codon_start":["1"],"gene":["lacZ"],"label":["lacZ-alpha"],"product":["LacZ-alpha fragment of beta-galactosidase"],"translation":["MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNRLAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICSDAA"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":12,"subLocations":null,"threePrimePartial":false},"sequence":"atgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","sequenceHash":"","sequenceHashFunction":"","type":"CDS"},{"attributes":{"label":["MCS"],"note":["pUC19 multiple cloning site"]},"description":"","location":{"complement":false,"end":86,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":29,"subLocations":null,"threePrimePartial":false},"sequence":"aagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattc","sequenceHash":"","sequenceHashFunction":"","type":"misc_feature"},{"attributes":{"label":["M13 fwd"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":true,"end":103,"fivePrimePartial":false,"gbkLocationString":"complement(87..103)","join":false,"start":86,"subLocations":null,"threePrimePartial":false},"sequence":"gtaaaacgacggccagt","sequenceHash":"","sequenceHashFunction":"","type":"primer_bind"}],"meta":{"accession":".","baseCount":null,"date":"","definition":"natural linear DNA","keywords":".","locus":{"circular":false,"genbankDivision":"UNA","modificationDate":"12-SEP-2023","moleculeType":"DNA","name":"pUC19_lacZ","sequenceCoding":"bp","sequenceLength":"336"},"name":"","organism":"unspecified","origin":"","other":{},"references":[{"authors":"Keoni Gandall","consortium":"","journal":"Exported Sep 12, 2023 from SnapGene 6.2.2 https://www.snapgene.com","pubMed":"","range":"(bases 1 to 336)","remark":"","title":"Direct Submission"}],"sequenceHash":"","sequenceHashFunction":"","source":"natural DNA sequence","taxonomy":null,"version":"."},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag"}]` if strings.TrimSpace(resp.Body.String()) != r { t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) } diff --git a/api/api/json/json.lua b/api/api/json/json.lua new file mode 100644 index 0000000..21d9cb2 --- /dev/null +++ b/api/api/json/json.lua @@ -0,0 +1,390 @@ +json = (function() +-- +-- json.lua +-- +-- Copyright (c) 2020 rxi +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy of +-- this software and associated documentation files (the "Software"), to deal in +-- the Software without restriction, including without limitation the rights to +-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +-- of the Software, and to permit persons to whom the Software is furnished to do +-- so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all +-- copies or substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +-- SOFTWARE. +-- + +local json = { _version = "0.1.2" } + +------------------------------------------------------------------------------- +-- Encode +------------------------------------------------------------------------------- + +local encode + +local escape_char_map = { + [ "\\" ] = "\\", + [ "\"" ] = "\"", + [ "\b" ] = "b", + [ "\f" ] = "f", + [ "\n" ] = "n", + [ "\r" ] = "r", + [ "\t" ] = "t", +} + +local escape_char_map_inv = { [ "/" ] = "/" } +for k, v in pairs(escape_char_map) do + escape_char_map_inv[v] = k +end + + +local function escape_char(c) + return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) +end + + +local function encode_nil(val) + return "null" +end + + +local function encode_table(val, stack) + local res = {} + stack = stack or {} + + -- Circular reference? + if stack[val] then error("circular reference") end + + stack[val] = true + + if rawget(val, 1) ~= nil or next(val) == nil then + -- Treat as array -- check keys are valid and it is not sparse + local n = 0 + for k in pairs(val) do + if type(k) ~= "number" then + error("invalid table: mixed or invalid key types") + end + n = n + 1 + end + if n ~= #val then + error("invalid table: sparse array") + end + -- Encode + for i, v in ipairs(val) do + table.insert(res, encode(v, stack)) + end + stack[val] = nil + return "[" .. table.concat(res, ",") .. "]" + + else + -- Treat as an object + for k, v in pairs(val) do + if type(k) ~= "string" then + error("invalid table: mixed or invalid key types") + end + table.insert(res, encode(k, stack) .. ":" .. encode(v, stack)) + end + stack[val] = nil + return "{" .. table.concat(res, ",") .. "}" + end +end + + +local function encode_string(val) + return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"' +end + + +local function encode_number(val) + -- Check for NaN, -inf and inf + if val ~= val or val <= -math.huge or val >= math.huge then + error("unexpected number value '" .. tostring(val) .. "'") + end + return string.format("%.14g", val) +end + + +local type_func_map = { + [ "nil" ] = encode_nil, + [ "table" ] = encode_table, + [ "string" ] = encode_string, + [ "number" ] = encode_number, + [ "boolean" ] = tostring, +} + + +encode = function(val, stack) + local t = type(val) + local f = type_func_map[t] + if f then + return f(val, stack) + end + error("unexpected type '" .. t .. "'") +end + + +function json.encode(val) + return ( encode(val) ) +end + + +------------------------------------------------------------------------------- +-- Decode +------------------------------------------------------------------------------- + +local parse + +local function create_set(...) + local res = {} + for i = 1, select("#", ...) do + res[ select(i, ...) ] = true + end + return res +end + +local space_chars = create_set(" ", "\t", "\r", "\n") +local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",") +local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u") +local literals = create_set("true", "false", "null") + +local literal_map = { + [ "true" ] = true, + [ "false" ] = false, + [ "null" ] = nil, +} + + +local function next_char(str, idx, set, negate) + for i = idx, #str do + if set[str:sub(i, i)] ~= negate then + return i + end + end + return #str + 1 +end + + +local function decode_error(str, idx, msg) + local line_count = 1 + local col_count = 1 + for i = 1, idx - 1 do + col_count = col_count + 1 + if str:sub(i, i) == "\n" then + line_count = line_count + 1 + col_count = 1 + end + end + error( string.format("%s at line %d col %d", msg, line_count, col_count) ) +end + + +local function codepoint_to_utf8(n) + -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa + local f = math.floor + if n <= 0x7f then + return string.char(n) + elseif n <= 0x7ff then + return string.char(f(n / 64) + 192, n % 64 + 128) + elseif n <= 0xffff then + return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128) + elseif n <= 0x10ffff then + return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, + f(n % 4096 / 64) + 128, n % 64 + 128) + end + error( string.format("invalid unicode codepoint '%x'", n) ) +end + + +local function parse_unicode_escape(s) + local n1 = tonumber( s:sub(1, 4), 16 ) + local n2 = tonumber( s:sub(7, 10), 16 ) + -- Surrogate pair? + if n2 then + return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000) + else + return codepoint_to_utf8(n1) + end +end + + +local function parse_string(str, i) + local res = "" + local j = i + 1 + local k = j + + while j <= #str do + local x = str:byte(j) + + if x < 32 then + decode_error(str, j, "control character in string") + + elseif x == 92 then -- `\`: Escape + res = res .. str:sub(k, j - 1) + j = j + 1 + local c = str:sub(j, j) + if c == "u" then + local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1) + or str:match("^%x%x%x%x", j + 1) + or decode_error(str, j - 1, "invalid unicode escape in string") + res = res .. parse_unicode_escape(hex) + j = j + #hex + else + if not escape_chars[c] then + decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string") + end + res = res .. escape_char_map_inv[c] + end + k = j + 1 + + elseif x == 34 then -- `"`: End of string + res = res .. str:sub(k, j - 1) + return res, j + 1 + end + + j = j + 1 + end + + decode_error(str, i, "expected closing quote for string") +end + + +local function parse_number(str, i) + local x = next_char(str, i, delim_chars) + local s = str:sub(i, x - 1) + local n = tonumber(s) + if not n then + decode_error(str, i, "invalid number '" .. s .. "'") + end + return n, x +end + + +local function parse_literal(str, i) + local x = next_char(str, i, delim_chars) + local word = str:sub(i, x - 1) + if not literals[word] then + decode_error(str, i, "invalid literal '" .. word .. "'") + end + return literal_map[word], x +end + + +local function parse_array(str, i) + local res = {} + local n = 1 + i = i + 1 + while 1 do + local x + i = next_char(str, i, space_chars, true) + -- Empty / end of array? + if str:sub(i, i) == "]" then + i = i + 1 + break + end + -- Read token + x, i = parse(str, i) + res[n] = x + n = n + 1 + -- Next token + i = next_char(str, i, space_chars, true) + local chr = str:sub(i, i) + i = i + 1 + if chr == "]" then break end + if chr ~= "," then decode_error(str, i, "expected ']' or ','") end + end + return res, i +end + + +local function parse_object(str, i) + local res = {} + i = i + 1 + while 1 do + local key, val + i = next_char(str, i, space_chars, true) + -- Empty / end of object? + if str:sub(i, i) == "}" then + i = i + 1 + break + end + -- Read key + if str:sub(i, i) ~= '"' then + decode_error(str, i, "expected string for key") + end + key, i = parse(str, i) + -- Read ':' delimiter + i = next_char(str, i, space_chars, true) + if str:sub(i, i) ~= ":" then + decode_error(str, i, "expected ':' after key") + end + i = next_char(str, i + 1, space_chars, true) + -- Read value + val, i = parse(str, i) + -- Set + res[key] = val + -- Next token + i = next_char(str, i, space_chars, true) + local chr = str:sub(i, i) + i = i + 1 + if chr == "}" then break end + if chr ~= "," then decode_error(str, i, "expected '}' or ','") end + end + return res, i +end + + +local char_func_map = { + [ '"' ] = parse_string, + [ "0" ] = parse_number, + [ "1" ] = parse_number, + [ "2" ] = parse_number, + [ "3" ] = parse_number, + [ "4" ] = parse_number, + [ "5" ] = parse_number, + [ "6" ] = parse_number, + [ "7" ] = parse_number, + [ "8" ] = parse_number, + [ "9" ] = parse_number, + [ "-" ] = parse_number, + [ "t" ] = parse_literal, + [ "f" ] = parse_literal, + [ "n" ] = parse_literal, + [ "[" ] = parse_array, + [ "{" ] = parse_object, +} + + +parse = function(str, idx) + local chr = str:sub(idx, idx) + local f = char_func_map[chr] + if f then + return f(str, idx) + end + decode_error(str, idx, "unexpected character '" .. chr .. "'") +end + + +function json.decode(str) + if type(str) ~= "string" then + error("expected argument of type string, got " .. type(str)) + end + local res, idx = parse(str, next_char(str, 1, space_chars, true)) + idx = next_char(str, idx, space_chars, true) + if idx <= #str then + decode_error(str, idx, "trailing garbage") + end + return res +end + + +return json +end)() diff --git a/api/api/lua.go b/api/api/lua.go index 5fdfd66..88ddf54 100644 --- a/api/api/lua.go +++ b/api/api/lua.go @@ -1,6 +1,7 @@ package api import ( + _ "embed" "encoding/json" "fmt" "net/http/httptest" @@ -11,9 +12,15 @@ import ( lua "github.com/yuin/gopher-lua" ) +//go:embed json/json.lua +var luaJson string + func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, string, error) { L := lua.NewState() defer L.Close() + if err := L.DoString(luaJson); err != nil { + panic(err) + } // Add attachments luaAttachments := L.NewTable() @@ -24,6 +31,7 @@ func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, s // Add IO functions L.SetGlobal("fasta_parse", L.NewFunction(app.LuaIoFastaParse)) + L.SetGlobal("genbank_parse", L.NewFunction(app.LuaIoGenbankParse)) // Add CDS design functions L.SetGlobal("fix", L.NewFunction(app.LuaDesignCdsFix)) @@ -104,6 +112,12 @@ func (app *App) LuaIoFastaParse(L *lua.LState) int { return app.luaResponse(L, "/api/io/fasta/parse", fastaData) } +// LuaIoGenbankParse implements genbank_parse in lua. +func (app *App) LuaIoGenbankParse(L *lua.LState) int { + genbankData := L.ToString(1) + return app.luaResponse(L, "/api/io/genbank/parse", genbankData) +} + // LuaDesignCdsFix implements fix in lua. func (app *App) LuaDesignCdsFix(L *lua.LState) int { sequence := L.ToString(1) diff --git a/api/api/lua_test.go b/api/api/lua_test.go index 58089c0..ca48ca3 100644 --- a/api/api/lua_test.go +++ b/api/api/lua_test.go @@ -10,7 +10,7 @@ func TestApp_LuaIoFastaParse(t *testing.T) { luaScript := ` parsed_fasta = fasta_parse(attachments["input.fasta"]) -output = parsed_fasta[1].name +output = parsed_fasta[1].identifier ` inputFasta := `>AAD44166.1 LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV @@ -35,6 +35,71 @@ IENY } } +func TestApp_LuaIoGenbankParse(t *testing.T) { + luaScript := ` +parsed_genbank = genbank_parse(attachments["input.gb"]) + +output = parsed_genbank[1].features[3].attributes.translation[1] +` + inputGenbank := `LOCUS pUC19_lacZ 336 bp DNA linear UNA 12-SEP-2023 +DEFINITION natural linear DNA +ACCESSION . +VERSION . +KEYWORDS . +SOURCE natural DNA sequence + ORGANISM unspecified +REFERENCE 1 (bases 1 to 336) + AUTHORS Keoni Gandall + TITLE Direct Submission + JOURNAL Exported Sep 12, 2023 from SnapGene 6.2.2 + https://www.snapgene.com +FEATURES Location/Qualifiers + source 1..336 + /mol_type="genomic DNA" + /organism="unspecified" + primer_bind 1..17 + /label=M13 rev + /note="common sequencing primer, one of multiple similar + variants" + CDS 13..336 + /codon_start=1 + /gene="lacZ" + /product="LacZ-alpha fragment of beta-galactosidase" + /label=lacZ-alpha + /translation="MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNR + LAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICS + DAA" + misc_feature 30..86 + /label=MCS + /note="pUC19 multiple cloning site" + primer_bind complement(87..103) + /label=M13 fwd + /note="common sequencing primer, one of multiple similar + variants" +ORIGIN + 1 caggaaacag ctatgaccat gattacgcca agcttgcatg cctgcaggtc gactctagag + 61 gatccccggg taccgagctc gaattcactg gccgtcgttt tacaacgtcg tgactgggaa + 121 aaccctggcg ttacccaact taatcgcctt gcagcacatc cccctttcgc cagctggcgt + 181 aatagcgaag aggcccgcac cgatcgccct tcccaacagt tgcgcagcct gaatggcgaa + 241 tggcgcctga tgcggtattt tctccttacg catctgtgcg gtatttcaca ccgcatatgg + 301 tgcactctca gtacaatctg ctctgatgcc gcatag +// +` + genbankAttachment := gen.Attachment{ + Name: "input.gb", + Content: inputGenbank, + } + + _, output, err := app.ExecuteLua(luaScript, []gen.Attachment{genbankAttachment}) + if err != nil { + t.Errorf("No error should be found. Got err: %s", err) + } + expectedOutput := "MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNRLAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICSDAA" + if output != expectedOutput { + t.Errorf("Unexpected response. Expected: " + expectedOutput + "\nGot: " + output) + } +} + func TestApp_LuaDesignCdsFix(t *testing.T) { luaScript := ` fixed = fix("ATGGGTCTCTAA", "Escherichia coli", {"GGTCTC"}) diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 81a4c8b..1a0a3af 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -38,6 +38,9 @@ type ServerInterface interface { // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(w http.ResponseWriter, r *http.Request) + // Parse Genbank data + // (POST /io/genbank/parse) + PostIoGenbankParse(w http.ResponseWriter, r *http.Request) // Simulate PCR // (POST /simulate/complex_pcr) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) @@ -92,6 +95,12 @@ func (_ Unimplemented) PostIoFastaParse(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusNotImplemented) } +// Parse Genbank data +// (POST /io/genbank/parse) +func (_ Unimplemented) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Simulate PCR // (POST /simulate/complex_pcr) func (_ Unimplemented) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { @@ -212,6 +221,21 @@ func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } +// PostIoGenbankParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoGenbankParse(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + // PostSimulateComplexPcr operation middleware func (siw *ServerInterfaceWrapper) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -430,6 +454,9 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/io/fasta/parse", wrapper.PostIoFastaParse) }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/genbank/parse", wrapper.PostIoGenbankParse) + }) r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/simulate/complex_pcr", wrapper.PostSimulateComplexPcr) }) @@ -613,6 +640,33 @@ func (response PostIoFastaParse500TextResponse) VisitPostIoFastaParseResponse(w return err } +type PostIoGenbankParseRequestObject struct { + Body *PostIoGenbankParseTextRequestBody +} + +type PostIoGenbankParseResponseObject interface { + VisitPostIoGenbankParseResponse(w http.ResponseWriter) error +} + +type PostIoGenbankParse200JSONResponse []GenbankRecord + +func (response PostIoGenbankParse200JSONResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoGenbankParse500TextResponse string + +func (response PostIoGenbankParse500TextResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + type PostSimulateComplexPcrRequestObject struct { Body *PostSimulateComplexPcrJSONRequestBody } @@ -782,6 +836,9 @@ type StrictServerInterface interface { // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(ctx context.Context, request PostIoFastaParseRequestObject) (PostIoFastaParseResponseObject, error) + // Parse Genbank data + // (POST /io/genbank/parse) + PostIoGenbankParse(ctx context.Context, request PostIoGenbankParseRequestObject) (PostIoGenbankParseResponseObject, error) // Simulate PCR // (POST /simulate/complex_pcr) PostSimulateComplexPcr(ctx context.Context, request PostSimulateComplexPcrRequestObject) (PostSimulateComplexPcrResponseObject, error) @@ -987,6 +1044,38 @@ func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request } } +// PostIoGenbankParse operation middleware +func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { + var request PostIoGenbankParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoGenbankParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoGenbankParse(ctx, request.(PostIoGenbankParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoGenbankParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoGenbankParseResponseObject); ok { + if err := validResponse.VisitPostIoGenbankParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + // PostSimulateComplexPcr operation middleware func (sh *strictHandler) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { var request PostSimulateComplexPcrRequestObject @@ -1176,29 +1265,38 @@ func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9xZTW/bOBP+KwTf9yhYbru7aH1Ln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WttHoeb9ivj0ZmvIdHdKIL3TczI6VHZteuj06mWo/WReEkaRlZz2y", + "HRJQ6jXvFNeEbkGObIyWzbpru+y19/Iwq75vx+6W5NeE1MMIERfsELAmGqW8cuRbpEUWzaKdUoWcTSaE", + "YXute7GhfIILGj3G/pzZZJLxBGc7LtXst+lvUzvn4+P/AgAA//+HQ24GVisAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index 39f7d88..88fcb58 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -23,6 +23,12 @@ type Attachment struct { Name string `json:"name"` } +// BaseCount defines model for BaseCount. +type BaseCount struct { + Base string `json:"base"` + Count int `json:"count"` +} + // Change defines model for Change. type Change struct { From string `json:"From"` @@ -37,8 +43,19 @@ type Enzyme string // FastaRecord defines model for FastaRecord. type FastaRecord struct { - Name string `json:"name"` - Sequence string `json:"sequence"` + Identifier string `json:"identifier"` + Sequence string `json:"sequence"` +} + +// Feature defines model for Feature. +type Feature struct { + Attributes map[string][]string `json:"attributes"` + Description string `json:"description"` + Location Location `json:"location"` + Sequence string `json:"sequence"` + SequenceHash string `json:"sequenceHash"` + SequenceHashFunction string `json:"sequenceHashFunction"` + Type string `json:"type"` } // Fragment defines model for Fragment. @@ -48,9 +65,70 @@ type Fragment struct { Sequence string `json:"Sequence"` } +// GenbankRecord defines model for GenbankRecord. +type GenbankRecord struct { + Features []Feature `json:"features"` + Meta Meta `json:"meta"` + Sequence string `json:"sequence"` +} + +// Location defines model for Location. +type Location struct { + Complement bool `json:"complement"` + End int `json:"end"` + FivePrimePartial bool `json:"fivePrimePartial"` + GbkLocationString string `json:"gbkLocationString"` + Join bool `json:"join"` + Start int `json:"start"` + SubLocations []Location `json:"subLocations"` + ThreePrimePartial bool `json:"threePrimePartial"` +} + +// Locus defines model for Locus. +type Locus struct { + Circular bool `json:"circular"` + GenbankDivision string `json:"genbankDivision"` + ModificationDate string `json:"modificationDate"` + MoleculeType string `json:"moleculeType"` + Name string `json:"name"` + SequenceCoding string `json:"sequenceCoding"` + SequenceLength string `json:"sequenceLength"` +} + +// Meta defines model for Meta. +type Meta struct { + Accession string `json:"accession"` + BaseCount []BaseCount `json:"baseCount"` + Date string `json:"date"` + Definition string `json:"definition"` + Keywords string `json:"keywords"` + Locus Locus `json:"locus"` + Name string `json:"name"` + Organism string `json:"organism"` + Origin string `json:"origin"` + Other map[string]string `json:"other"` + References []Reference `json:"references"` + SequenceHash string `json:"sequenceHash"` + SequenceHashFunction string `json:"sequenceHashFunction"` + Source string `json:"source"` + Taxonomy []string `json:"taxonomy"` + Version string `json:"version"` +} + // Organism defines model for Organism. type Organism string +// Reference defines model for Reference. +type Reference struct { + Authors string `json:"authors"` + Consortium string `json:"consortium"` + Journal string `json:"journal"` + PubMed string `json:"pubMed"` + Range string `json:"range"` + Remark string `json:"remark"` + Title string `json:"title"` +} + // PostDesignCdsFixJSONBody defines parameters for PostDesignCdsFix. type PostDesignCdsFixJSONBody struct { Organism Organism `json:"organism"` @@ -80,6 +158,9 @@ type PostExecuteLuaJSONBody struct { // PostIoFastaParseTextBody defines parameters for PostIoFastaParse. type PostIoFastaParseTextBody = string +// PostIoGenbankParseTextBody defines parameters for PostIoGenbankParse. +type PostIoGenbankParseTextBody = string + // PostSimulateComplexPcrJSONBody defines parameters for PostSimulateComplexPcr. type PostSimulateComplexPcrJSONBody struct { Circular *bool `json:"circular,omitempty"` @@ -135,6 +216,9 @@ type PostExecuteLuaJSONRequestBody PostExecuteLuaJSONBody // PostIoFastaParseTextRequestBody defines body for PostIoFastaParse for text/plain ContentType. type PostIoFastaParseTextRequestBody = PostIoFastaParseTextBody +// PostIoGenbankParseTextRequestBody defines body for PostIoGenbankParse for text/plain ContentType. +type PostIoGenbankParseTextRequestBody = PostIoGenbankParseTextBody + // PostSimulateComplexPcrJSONRequestBody defines body for PostSimulateComplexPcr for application/json ContentType. type PostSimulateComplexPcrJSONRequestBody PostSimulateComplexPcrJSONBody diff --git a/api/spec.yaml b/api/spec.yaml index 88a6d13..2b704b0 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -20,13 +20,207 @@ components: FastaRecord: type: object properties: - name: + identifier: type: string sequence: type: string required: + - identifier + - sequence + GenbankRecord: + type: object + required: + - meta + - features + - sequence + properties: + meta: + $ref: '#/components/schemas/Meta' + features: + type: array + items: + $ref: '#/components/schemas/Feature' + sequence: + type: string + Meta: + type: object + required: + - date + - definition + - accession + - version + - keywords + - organism + - source + - taxonomy + - origin + - locus + - references + - baseCount + - other - name + - sequenceHash + - sequenceHashFunction + properties: + date: + type: string + definition: + type: string + accession: + type: string + version: + type: string + keywords: + type: string + organism: + type: string + source: + type: string + taxonomy: + type: array + items: + type: string + origin: + type: string + locus: + $ref: '#/components/schemas/Locus' + references: + type: array + items: + $ref: '#/components/schemas/Reference' + baseCount: + type: array + items: + $ref: '#/components/schemas/BaseCount' + other: + type: object + additionalProperties: + type: string + name: + type: string + sequenceHash: + type: string + sequenceHashFunction: + type: string + Feature: + type: object + required: + - type + - description + - attributes + - sequenceHash + - sequenceHashFunction - sequence + - location + properties: + type: + type: string + description: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + sequenceHash: + type: string + sequenceHashFunction: + type: string + sequence: + type: string + location: + $ref: '#/components/schemas/Location' + Reference: + type: object + required: + - authors + - title + - journal + - pubMed + - remark + - range + - consortium + properties: + authors: + type: string + title: + type: string + journal: + type: string + pubMed: + type: string + remark: + type: string + range: + type: string + consortium: + type: string + Locus: + type: object + required: + - name + - sequenceLength + - moleculeType + - genbankDivision + - modificationDate + - sequenceCoding + - circular + properties: + name: + type: string + sequenceLength: + type: string + moleculeType: + type: string + genbankDivision: + type: string + modificationDate: + type: string + sequenceCoding: + type: string + circular: + type: boolean + Location: + type: object + required: + - start + - end + - complement + - join + - fivePrimePartial + - threePrimePartial + - gbkLocationString + - subLocations + properties: + start: + type: integer + end: + type: integer + complement: + type: boolean + join: + type: boolean + fivePrimePartial: + type: boolean + threePrimePartial: + type: boolean + gbkLocationString: + type: string + subLocations: + type: array + items: + $ref: '#/components/schemas/Location' + BaseCount: + type: object + required: + - base + - count + properties: + base: + type: string + count: + type: integer Fragment: type: object properties: @@ -135,6 +329,31 @@ paths: text/plain: schema: type: string + /io/genbank/parse: + post: + tags: + - io + summary: Parse Genbank data + requestBody: + content: + text/plain: + schema: + type: string + responses: + '200': + description: Parsed Genbank records + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GenbankRecord' + '500': + description: Internal server error + content: + text/plain: + schema: + type: string /design/cds/fix: post: tags: diff --git a/bio/fasta/fasta.go b/bio/fasta/fasta.go index 416cbf3..e3b27dc 100644 --- a/bio/fasta/fasta.go +++ b/bio/fasta/fasta.go @@ -16,6 +16,8 @@ import ( "bytes" "fmt" "io" + + "github.com/koeng101/dnadesign/api/gen" ) /****************************************************************************** @@ -51,10 +53,13 @@ Keoni ******************************************************************************/ // Record is a struct representing a single Record file element with a Identifier and its corresponding Sequence. -type Record struct { - Identifier string `json:"identifier"` - Sequence string `json:"sequence"` -} +type Record gen.FastaRecord + +// gen.FastaRecord +//type FastaRecord struct { +// Identifier string `json:"identifier"` +// Sequence string `json:"sequence"` +//} // Header is a blank struct, needed for compatibility with bio parsers. It contains nothing. type Header struct{} diff --git a/bio/genbank/genbank.go b/bio/genbank/genbank.go index 8a03d5d..242cdce 100644 --- a/bio/genbank/genbank.go +++ b/bio/genbank/genbank.go @@ -20,6 +20,7 @@ import ( "strconv" "strings" + "github.com/koeng101/dnadesign/api/gen" "github.com/koeng101/dnadesign/transform" "github.com/lunny/log" "github.com/mitchellh/go-wordwrap" @@ -37,84 +38,93 @@ var ( parseReferencesFn = parseReferences ) -// Genbank is the main struct for the Genbank file format. -type Genbank struct { - Meta Meta - Features []Feature - Sequence string // will be changed and include reader, writer, and byte slice. -} - -// Meta holds the meta data for Genbank and other annotated sequence files. -type Meta struct { - Date string `json:"date"` - Definition string `json:"definition"` - Accession string `json:"accession"` - Version string `json:"version"` - Keywords string `json:"keywords"` - Organism string `json:"organism"` - Source string `json:"source"` - Taxonomy []string `json:"taxonomy"` - Origin string `json:"origin"` - Locus Locus `json:"locus"` - References []Reference `json:"references"` - BaseCount []BaseCount `json:"base_count"` - Other map[string]string `json:"other"` - Name string `json:"name"` - SequenceHash string `json:"sequence_hash"` - SequenceHashFunction string `json:"hash_function"` -} - -// Feature holds the information for a feature in a Genbank file and other annotated sequence files. -type Feature struct { - Type string `json:"type"` - Description string `json:"description"` - Attributes map[string][]string `json:"attributes"` - SequenceHash string `json:"sequence_hash"` - SequenceHashFunction string `json:"hash_function"` - Sequence string `json:"sequence"` - Location Location `json:"location"` - ParentSequence *Genbank `json:"-"` -} - -// Reference holds information for one reference in a Meta struct. -type Reference struct { - Authors string `json:"authors"` - Title string `json:"title"` - Journal string `json:"journal"` - PubMed string `json:"pub_med"` - Remark string `json:"remark"` - Range string `json:"range"` - Consortium string `json:"consortium"` -} - -// Locus holds Locus information in a Meta struct. -type Locus struct { - Name string `json:"name"` - SequenceLength string `json:"sequence_length"` - MoleculeType string `json:"molecule_type"` - GenbankDivision string `json:"genbank_division"` - ModificationDate string `json:"modification_date"` - SequenceCoding string `json:"sequence_coding"` - Circular bool `json:"circular"` -} - -// Location is a struct that holds the location of a feature. -type Location struct { - Start int `json:"start"` - End int `json:"end"` - Complement bool `json:"complement"` - Join bool `json:"join"` - FivePrimePartial bool `json:"five_prime_partial"` - ThreePrimePartial bool `json:"three_prime_partial"` - GbkLocationString string `json:"gbk_location_string"` - SubLocations []Location `json:"sub_locations"` -} - -// BaseCount is a struct that holds the base counts for a sequence. -type BaseCount struct { - Base string - Count int -} +type Genbank gen.GenbankRecord +type Meta gen.Meta +type Feature gen.Feature +type Reference gen.Reference +type Locus gen.Locus +type Location gen.Location +type BaseCount gen.BaseCount + +// +//// Genbank is the main struct for the Genbank file format. +//type Genbank struct { +// Meta Meta +// Features []Feature +// Sequence string // will be changed and include reader, writer, and byte slice. +//} +// +//// Meta holds the meta data for Genbank and other annotated sequence files. +//type Meta struct { +// Date string `json:"date"` +// Definition string `json:"definition"` +// Accession string `json:"accession"` +// Version string `json:"version"` +// Keywords string `json:"keywords"` +// Organism string `json:"organism"` +// Source string `json:"source"` +// Taxonomy []string `json:"taxonomy"` +// Origin string `json:"origin"` +// Locus Locus `json:"locus"` +// References []Reference `json:"references"` +// BaseCount []BaseCount `json:"base_count"` +// Other map[string]string `json:"other"` +// Name string `json:"name"` +// SequenceHash string `json:"sequence_hash"` +// SequenceHashFunction string `json:"hash_function"` +//} +// +//// Feature holds the information for a feature in a Genbank file and other annotated sequence files. +//type Feature struct { +// Type string `json:"type"` +// Description string `json:"description"` +// Attributes map[string][]string `json:"attributes"` +// SequenceHash string `json:"sequence_hash"` +// SequenceHashFunction string `json:"hash_function"` +// Sequence string `json:"sequence"` +// Location Location `json:"location"` +// ParentSequence *Genbank `json:"-"` +//} +// +//// Reference holds information for one reference in a Meta struct. +//type Reference struct { +// Authors string `json:"authors"` +// Title string `json:"title"` +// Journal string `json:"journal"` +// PubMed string `json:"pub_med"` +// Remark string `json:"remark"` +// Range string `json:"range"` +// Consortium string `json:"consortium"` +//} +// +//// Locus holds Locus information in a Meta struct. +//type Locus struct { +// Name string `json:"name"` +// SequenceLength string `json:"sequence_length"` +// MoleculeType string `json:"molecule_type"` +// GenbankDivision string `json:"genbank_division"` +// ModificationDate string `json:"modification_date"` +// SequenceCoding string `json:"sequence_coding"` +// Circular bool `json:"circular"` +//} +// +//// Location is a struct that holds the location of a feature. +//type Location struct { +// Start int `json:"start"` +// End int `json:"end"` +// Complement bool `json:"complement"` +// Join bool `json:"join"` +// FivePrimePartial bool `json:"five_prime_partial"` +// ThreePrimePartial bool `json:"three_prime_partial"` +// GbkLocationString string `json:"gbk_location_string"` +// SubLocations []Location `json:"sub_locations"` +//} +// +//// BaseCount is a struct that holds the base counts for a sequence. +//type BaseCount struct { +// Base string +// Count int +//} // Precompiled regular expressions: var ( @@ -130,7 +140,7 @@ var ( // Useful when exporting for downstream analysis, such as with json.Marshal. func (sequence *Genbank) StoreFeatureSequences() error { for i := range sequence.Features { - _, err := sequence.Features[i].StoreSequence() + _, err := StoreSequence(sequence, &sequence.Features[i]) if err != nil { return err } @@ -145,23 +155,22 @@ func (sequence *Genbank) StoreFeatureSequences() error { // to modify in either location, it is recommended you first call feature.Copy() // before passing as input to save yourself trouble. func (sequence *Genbank) AddFeature(feature *Feature) error { - feature.ParentSequence = sequence - sequence.Features = append(sequence.Features, *feature) + sequence.Features = append(sequence.Features, gen.Feature(*feature)) return nil } // GetSequence returns the sequence of a feature. -func (feature Feature) GetSequence() (string, error) { - return getFeatureSequence(feature, feature.Location) +func GetSequence(parentSequence *Genbank, feature gen.Feature) (string, error) { + return getFeatureSequence(parentSequence, Feature(feature), feature.Location) } // StoreSequence infers and assigns the value of feature.Sequence // if currently an empty string. -func (feature *Feature) StoreSequence() (string, error) { +func StoreSequence(parentSequence *Genbank, feature *gen.Feature) (string, error) { if feature.Sequence != "" { return feature.Sequence, nil } - seq, err := getFeatureSequence(*feature, feature.Location) + seq, err := getFeatureSequence(parentSequence, Feature(*feature), feature.Location) if err == nil { feature.Sequence = seq } @@ -180,21 +189,21 @@ func (feature *Feature) Copy() Feature { } // CopyLocation creates deep copy of Location, which supports safe duplication -func CopyLocation(location Location) Location { +func CopyLocation(location gen.Location) gen.Location { location.SubLocations = MapSlice(location.SubLocations, CopyLocation) return location } // getFeatureSequence takes a feature and location object and returns a sequence string. -func getFeatureSequence(feature Feature, location Location) (string, error) { +func getFeatureSequence(parentGenbank *Genbank, feature Feature, location gen.Location) (string, error) { var sequenceBuffer bytes.Buffer - parentSequence := feature.ParentSequence.Sequence + parentSequence := parentGenbank.Sequence if len(location.SubLocations) == 0 { sequenceBuffer.WriteString(parentSequence[location.Start:location.End]) } else { for _, subLocation := range location.SubLocations { - sequence, err := getFeatureSequence(feature, subLocation) + sequence, err := getFeatureSequence(parentGenbank, feature, subLocation) if err != nil { return "", err } @@ -641,7 +650,7 @@ func (parser *Parser) Next() (*Genbank, error) { if err != nil { return &Genbank{}, &ParseError{line: line, lineNo: lineNum, before: true, wraps: err, info: "failed in parsing reference"} } - parser.parameters.genbank.Meta.References = append(parser.parameters.genbank.Meta.References, reference) + parser.parameters.genbank.Meta.References = append(parser.parameters.genbank.Meta.References, gen.Reference(reference)) case "FEATURES": parser.parameters.parseStep = "features" @@ -674,7 +683,7 @@ func (parser *Parser) Next() (*Genbank, error) { return &Genbank{}, &ParseError{line: line, lineNo: lineNum, wraps: err, info: "invalid base count"} } - baseCount := BaseCount{ + baseCount := gen.BaseCount{ Base: fields[countIndex+1], Count: count, } @@ -908,8 +917,8 @@ var genbankDivisions = []string{ // TODO rewrite with proper error handling. // parses locus from provided string. -func parseLocus(locusString string) Locus { - locus := Locus{} +func parseLocus(locusString string) gen.Locus { + locus := gen.Locus{} locusSplit := strings.Split(strings.TrimSpace(locusString), " ") @@ -993,28 +1002,28 @@ func getSourceOrganism(metadataData []string) (string, string, []string) { return source, organism, taxonomy } -func parseLocation(locationString string) (Location, error) { - var location Location +func parseLocation(locationString string) (gen.Location, error) { + var location gen.Location location.GbkLocationString = locationString if !strings.ContainsAny(locationString, "(") { // Case checks for simple expression of x..x if !strings.ContainsAny(locationString, ".") { //Case checks for simple expression x position, err := strconv.Atoi(partialRegex.ReplaceAllString(locationString, "")) if err != nil { - return Location{}, err + return gen.Location{}, err } - location = Location{Start: position, End: position} + location = gen.Location{Start: position, End: position} } else { // to remove FivePrimePartial and ThreePrimePartial indicators from start and end before converting to int. startEndSplit := strings.Split(locationString, "..") start, err := strconv.Atoi(partialRegex.ReplaceAllString(startEndSplit[0], "")) if err != nil { - return Location{}, err + return gen.Location{}, err } end, err := strconv.Atoi(partialRegex.ReplaceAllString(startEndSplit[1], "")) if err != nil { - return Location{}, err + return gen.Location{}, err } - location = Location{Start: start - 1, End: end} + location = gen.Location{Start: start - 1, End: end} } } else { firstOuterParentheses := strings.Index(locationString, "(") @@ -1037,7 +1046,7 @@ func parseLocation(locationString string) (Location, error) { if ParenthesesCount == 0 { parsedSubLocation, err := parseLocation(expression[prevSubLocationStart:i]) if err != nil { - return Location{}, err + return gen.Location{}, err } parsedSubLocation.GbkLocationString = locationString location.SubLocations = append(location.SubLocations, parsedSubLocation) @@ -1046,11 +1055,11 @@ func parseLocation(locationString string) (Location, error) { } } if ParenthesesCount != 0 { - return Location{}, fmt.Errorf("Unbalanced parentheses") + return gen.Location{}, fmt.Errorf("Unbalanced parentheses") } parsedSubLocation, err := parseLocation(expression[prevSubLocationStart:]) if err != nil { - return Location{}, err + return gen.Location{}, err } parsedSubLocation.GbkLocationString = locationString location.SubLocations = append(location.SubLocations, parsedSubLocation) @@ -1058,7 +1067,7 @@ func parseLocation(locationString string) (Location, error) { for _, numberRange := range strings.Split(expression, ",") { joinLocation, err := parseLocation(numberRange) if err != nil { - return Location{}, err + return gen.Location{}, err } location.SubLocations = append(location.SubLocations, joinLocation) } @@ -1068,7 +1077,7 @@ func parseLocation(locationString string) (Location, error) { // location.Complement = true subLocation, err := parseLocation(expression) if err != nil { - return Location{}, err + return gen.Location{}, err } subLocation.Complement = true subLocation.GbkLocationString = locationString @@ -1115,7 +1124,7 @@ func buildMetaString(name string, data string) string { } // BuildLocationString is a recursive function that takes a location object and creates a gbk location string for Build() -func BuildLocationString(location Location) string { +func BuildLocationString(location gen.Location) string { var locationString string if location.Complement { @@ -1141,7 +1150,7 @@ func BuildLocationString(location Location) string { } // BuildFeatureString is a helper function to build gbk feature strings for Build() -func BuildFeatureString(feature Feature) string { +func BuildFeatureString(feature gen.Feature) string { whiteSpaceTrailLength := 16 - len(feature.Type) // I wish I was kidding. whiteSpaceTrail := generateWhiteSpace(whiteSpaceTrailLength) var location string diff --git a/bio/genbank/genbank_test.go b/bio/genbank/genbank_test.go index 3bc15fe..3c62e28 100644 --- a/bio/genbank/genbank_test.go +++ b/bio/genbank/genbank_test.go @@ -14,6 +14,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/koeng101/dnadesign/api/gen" "github.com/koeng101/dnadesign/transform" "github.com/stretchr/testify/assert" ) @@ -49,7 +50,7 @@ func TestGbkIO(t *testing.T) { _ = write(gbk, tmpGbkFilePath) writeTestGbk, _ := read(tmpGbkFilePath) - if diff := cmp.Diff(gbk, writeTestGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{}, "ParentSequence")}...); diff != "" { + if diff := cmp.Diff(gbk, writeTestGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{})}...); diff != "" { t.Errorf("Parsing the output of Build() does not produce the same output as parsing the original file, \"%s\", read with read(). Got this diff:\n%s", filepath.Base(gbkPath), diff) } } // end test single gbk read, write, build, parse @@ -82,7 +83,7 @@ func TestMultiGenbankIO(t *testing.T) { writeTestGbk, _ := readMulti(tmpGbkFilePath) - if diff := cmp.Diff(multiGbk, writeTestGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{}, "ParentSequence")}...); diff != "" { + if diff := cmp.Diff(multiGbk, writeTestGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{})}...); diff != "" { t.Errorf("Parsing the output of Build() does not produce the same output as parsing the original file, \"%s\", read with read(). Got this diff:\n%s", filepath.Base(gbkPath), diff) } } @@ -110,7 +111,7 @@ func TestGbkLocationStringBuilder(t *testing.T) { testInputGbk, _ := read("data/sample.gbk") testOutputGbk, _ := read(tmpGbkFilePath) - if diff := cmp.Diff(testInputGbk, testOutputGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{}, "ParentSequence")}...); diff != "" { + if diff := cmp.Diff(testInputGbk, testOutputGbk, []cmp.Option{cmpopts.IgnoreFields(Feature{})}...); diff != "" { t.Errorf("Issue with partial location building. Parsing the output of Build() does not produce the same output as parsing the original file read with read(). Got this diff:\n%s", diff) } } @@ -135,7 +136,7 @@ func TestGbLocationStringBuilder(t *testing.T) { testInputGb, _ := read("data/t4_intron.gb") testOutputGb, _ := read(tmpGbFilePath) - if diff := cmp.Diff(testInputGb, testOutputGb, []cmp.Option{cmpopts.IgnoreFields(Feature{}, "ParentSequence")}...); diff != "" { + if diff := cmp.Diff(testInputGb, testOutputGb, []cmp.Option{cmpopts.IgnoreFields(Feature{})}...); diff != "" { t.Errorf("Issue with either Join or complement location building. Parsing the output of Build() does not produce the same output as parsing the original file read with read(). Got this diff:\n%s", diff) } } @@ -176,7 +177,7 @@ func TestSubLocationStringParseRegression(t *testing.T) { defer jsonFile.Close() byteValue, _ := io.ReadAll(jsonFile) - var testParsedLocation Location + var testParsedLocation gen.Location err = json.Unmarshal(byteValue, &testParsedLocation) if err != nil { t.Errorf("Failed to unmarshal json. Got err: %s", err) @@ -199,7 +200,7 @@ func TestGetSequenceMethod(t *testing.T) { gbk, _ := read("data/t4_intron.gb") // Check to see if GetSequence method works on Features struct - feature, _ := gbk.Features[1].GetSequence() + feature, _ := GetSequence(&gbk, gbk.Features[1]) seq := "atgagattacaacgccagagcatcaaagattcagaagttagaggtaaatggtattttaatatcatcggtaaagattctgaacttgttgaaaaagctgaacatcttttacgtgatatgggatgggaagatgaatgcgatggatgtcctctttatgaagacggagaaagcgcaggattttggatttaccattctgacgtcgagcagtttaaagctgattggaaaattgtgaaaaagtctgtttga" if feature != seq { t.Errorf("Feature GetSequence method has failed. Got this:\n%s instead of \n%s", feature, seq) @@ -210,21 +211,21 @@ func TestLocationParser(t *testing.T) { gbk, _ := read("data/t4_intron.gb") // read 1..243 - feature, _ := gbk.Features[1].GetSequence() + feature, _ := GetSequence(&gbk, gbk.Features[1]) seq := "atgagattacaacgccagagcatcaaagattcagaagttagaggtaaatggtattttaatatcatcggtaaagattctgaacttgttgaaaaagctgaacatcttttacgtgatatgggatgggaagatgaatgcgatggatgtcctctttatgaagacggagaaagcgcaggattttggatttaccattctgacgtcgagcagtttaaagctgattggaaaattgtgaaaaagtctgtttga" if feature != seq { t.Errorf("Feature sequence parser has changed on test '1..243'. Got this:\n%s instead of \n%s", feature, seq) } // read join(893..1441,2459..2770) - featureJoin, _ := gbk.Features[6].GetSequence() + featureJoin, _ := GetSequence(&gbk, gbk.Features[6]) seqJoin := "atgaaacaataccaagatttaattaaagacatttttgaaaatggttatgaaaccgatgatcgtacaggcacaggaacaattgctctgttcggatctaaattacgctgggatttaactaaaggttttcctgcggtaacaactaagaagctcgcctggaaagcttgcattgctgagctaatatggtttttatcaggaagcacaaatgtcaatgatttacgattaattcaacacgattcgttaatccaaggcaaaacagtctgggatgaaaattacgaaaatcaagcaaaagatttaggataccatagcggtgaacttggtccaatttatggaaaacagtggcgtgattttggtggtgtagaccaaattatagaagttattgatcgtattaaaaaactgccaaatgataggcgtcaaattgtttctgcatggaatccagctgaacttaaatatatggcattaccgccttgtcatatgttctatcagtttaatgtgcgtaatggctatttggatttgcagtggtatcaacgctcagtagatgttttcttgggtctaccgtttaatattgcgtcatatgctacgttagttcatattgtagctaagatgtgtaatcttattccaggggatttgatattttctggtggtaatactcatatctatatgaatcacgtagaacaatgtaaagaaattttgaggcgtgaacctaaagagctttgtgagctggtaataagtggtctaccttataaattccgatatctttctactaaagaacaattaaaatatgttcttaaacttaggcctaaagatttcgttcttaacaactatgtatcacaccctcctattaaaggaaagatggcggtgtaa" if featureJoin != seqJoin { t.Errorf("Feature sequence parser has changed on test 'join(893..1441,2459..2770)'. Got this:\n%s instead of \n%s", featureJoin, seqJoin) } // read complement(2791..3054) - featureComplement, _ := gbk.Features[10].GetSequence() + featureComplement, _ := GetSequence(&gbk, gbk.Features[10]) seqComplement := "ttattcactacccggcatagacggcccacgctggaataattcgtcatattgtttttccgttaaaacagtaatatcgtagtaacagtcagaagaagttttaactgtggaaattttattatcaaaatactcacgagtcattttatgagtatagtattttttaccataaatggtaataggctgttctggtcctggaacttctaactcgcttgggttaggaagtgtaaaaagaactacaccagaagtatctttaaatcgtaaaatcat" if featureComplement != seqComplement { t.Errorf("Feature sequence parser has changed on test 'complement(2791..3054)'. Got this:\n%s instead of \n%s", featureComplement, seqComplement) @@ -235,14 +236,14 @@ func TestLocationParser(t *testing.T) { // that the first sequence should be appended to the reverse sequence, instead of the second sequence // getting appended to the first. Biopython appends the second sequence to the first, and that is logically // the most obvious thing to do, so we are implementing it that way. - featureJoinComplement, _ := gbk.Features[3].GetSequence() + featureJoinComplement, _ := GetSequence(&gbk, gbk.Features[3]) seqJoinComplement := "ataccaatttaatcattcatttatatactgattccgtaagggttgttacttcatctattttataccaatgcgtttcaaccatttcacgcttgcttatatcatcaagaaaacttgcgtctaattgaactgttgaattaacacgatgccttttaacgatgcgagaaacaactacttcatctgcataaggtaatgcagcatataacagagcaggcccgccaattacacttactttagaattctgatcaagcatagtttcgaatggtgcattagggcttgacacttgaatttcgccgccagaaatgtaagttatatattgctcccaagtaatatagaaatgtgctaaatcgccgtctttagttacaggataatcacgcgcaaggtcacacaccacaatatggctacgaccaggaagtaatgtaggcaatgactggaacgttttagcacccataatcataattgtgccttcagtacgagctttaaaattctggaggtcctttttaactcgtccccatggtaaaccatcacctaaaccgaatgctaattcattaaagccgtcgaccgttttagttggaga" if featureJoinComplement != seqJoinComplement { t.Errorf("Feature sequence parser has changed on test 'join(complement(315..330),complement(339..896))'. Got this:\n%s instead of \n%s", featureJoinComplement, seqJoinComplement) } // read complement(join(893..1098,1101..2770)) - featureComplementJoin, _ := gbk.Features[5].GetSequence() + featureComplementJoin, _ := GetSequence(&gbk, gbk.Features[5]) seqComplementJoin := "ttacaccgccatctttcctttaataggagggtgtgatacatagttgttaagaacgaaatctttaggcctaagtttaagaacatattttaattgttctttagtagaaagatatcggaatttataaggtagaccacttattaccagctcacaaagctctttaggttcacgcctcaaaatttctttacattgttctacgtgattcatatagatatgagtattaccaccagaaaatatcaaatcccctggaataagattacacatcttagctacaatatgaactaacgtagcatatgacgcaatattaaacggtagcattatgttcagataaggtcgttaatcttaccccggaattatatccagctgcatgtcaccatgcagagcagactatatctccaacttgttaaagcaagttgtctatcgtttcgagtcacttgaccctactccccaaagggatagtcgttaggcatttatgtagaaccaattccatttatcagattttacacgataagtaactaatccagacgaaattttaaaatgtctagctgcatctgctgcacaatcaaaaataaccccatcacatgaaatctttttaatattactaggctttttacctttcatcttttctgatattttagatttagttatgtctgaatgcttatgattaaagaatgaattattttcacctgaacgatttctgcatttactacaagtataagcagaagtttgtatgcgaacaccgcacttacaaaacttatgggtttctggattccaacgcccgtttttacttccgggtttactgtaaagagctttccgaccatcaggtccaagtttaagcatcttagctttaacagtttcagaacgtttcttaataatttcttcttttaatggatgcgtagaacatgtatcaccaaacgttgcatcagcaatattgtatccattaattttagaattaagctctttaatccaaaaattttctcgttcaataatcaaatctttctcatatggaatttcttccaaaatagaacattcaaacacattaccatgtttgttaaaagacctctgaagttttatagaagaatggcatcctttttctaaatctttaaaatgcctcttccatctcttttcaaaatctttagcacttcctacatatactttattgtttaaagtatttttaatctgataaattccgcttttcataaatacctctttaaatatagaagtatttattaaagggcaagtcctacaatttagcacgggattgtctactagagaggttccccgtttagatagattacaagtataagtcaccttatactcaggcctcaattaacccaagaaaacatctactgagcgttgataccactgcaaatccaaatagccattacgcacattaaactgatagaacatatgacaaggcggtaatgccatatatttaagttcagctggattccatgcagaaacaatttgacgcctatcatttggcagttttttaatacgatcaataacttctataatttggtctacaccaccaaaatcacgccactgttttccataaattggaccaagttcaccgctatggtatcctaaatcttttgcttgattttcgtaattttcatcccagactgttttgccttggattaacgaatcgtgttgaattaatcgtaaatcatacatttgtgcttcctgataaaaaccatattagctcagcaatgcaagctttccaggcgagcttcttagttgttaccgcaggaaaacctttagttaaatcccagcgtaatttagatccgaacagagcaattgttcctgtgcctgtacgatcatcggtttcataaccattttcaaaaatgtctttaattaaatcttggtattgtttcat" if featureComplementJoin != seqComplementJoin { t.Errorf("Feature sequence parser has changed on test 'complement(join(893..1098,1101..2770))'. Got this:\n%s instead of \n%s", featureComplementJoin, seqComplementJoin) @@ -314,8 +315,8 @@ func TestFeature_GetSequence_Legacy(t *testing.T) { sequence.Sequence = gfpSequenceModified // initialize sublocations to be usedin the feature. - var subLocation Location - var subLocationReverseComplemented Location + var subLocation gen.Location + var subLocationReverseComplemented gen.Location subLocation.Start = 0 subLocation.End = sequenceLength / 2 @@ -325,13 +326,13 @@ func TestFeature_GetSequence_Legacy(t *testing.T) { subLocationReverseComplemented.Complement = true // According to genbank complement means reverse complement. What a country. feature.Description = "Green Fluorescent Protein" - feature.Location.SubLocations = []Location{subLocation, subLocationReverseComplemented} + feature.Location.SubLocations = []gen.Location{subLocation, subLocationReverseComplemented} // Add the GFP feature to the sequence struct. _ = sequence.AddFeature(&feature) // get the GFP feature sequence string from the sequence struct. - featureSequence, _ := feature.GetSequence() + featureSequence, _ := GetSequence(&sequence, gen.Feature(feature)) // check to see if the feature was inserted properly into the sequence. if gfpSequence != featureSequence { @@ -625,7 +626,7 @@ func Test_buildMetaString(t *testing.T) { func TestBuildLocationString(t *testing.T) { type args struct { - location Location + location gen.Location } tests := []struct { name string @@ -677,10 +678,10 @@ func TestRead_error(t *testing.T) { } func TestBuildFeatureString(t *testing.T) { - feature := Feature{ + feature := gen.Feature{ Type: "test type", Description: "a description", - Location: Location{ + Location: gen.Location{ GbkLocationString: "gbk location", }, } diff --git a/bio/gff/example_test.go b/bio/gff/example_test.go deleted file mode 100644 index feda318..0000000 --- a/bio/gff/example_test.go +++ /dev/null @@ -1,170 +0,0 @@ -package gff_test - -import ( - "bytes" - "fmt" - "os" - "path/filepath" - "testing" - - "github.com/koeng101/dnadesign/bio/gff" - "github.com/koeng101/dnadesign/transform" -) - -// This example shows how to open a gff file and search for a gene given its -// locus tag. We then display the EC number of that particular gene. -func Example_basic() { - sequence, _ := gff.Read("../../data/ecoli-mg1655-short.gff") - for _, feature := range sequence.Features { - if feature.Attributes["locus_tag"] == "b0003" { - fmt.Println(feature.Attributes["EC_number"]) - } - } - // Output: 2.7.1.39 -} - -func ExampleRead() { - sequence, _ := gff.Read("../../data/ecoli-mg1655-short.gff") - fmt.Println(sequence.Meta.Name) - // Output: U00096.3 -} - -func ExampleParse() { - file, _ := os.Open("../../data/ecoli-mg1655-short.gff") - sequence, _ := gff.Parse(file) - - fmt.Println(sequence.Meta.Name) - // Output: U00096.3 -} - -func ExampleBuild() { - sequence, _ := gff.Read("../../data/ecoli-mg1655-short.gff") - gffBytes, _ := gff.Build(sequence) - gffReader := bytes.NewReader(gffBytes) - reparsedSequence, _ := gff.Parse(gffReader) - - fmt.Println(reparsedSequence.Meta.Name) - // Output: U00096.3 -} - -func ExampleWrite() { - tmpDataDir, err := os.MkdirTemp("", "data-*") - if err != nil { - fmt.Println(err.Error()) - } - defer os.RemoveAll(tmpDataDir) - - sequence, _ := gff.Read("../../data/ecoli-mg1655-short.gff") - - tmpGffFilePath := filepath.Join(tmpDataDir, "ecoli-mg1655-short.gff") - _ = gff.Write(sequence, tmpGffFilePath) - - testSequence, _ := gff.Read(tmpGffFilePath) - - fmt.Println(testSequence.Meta.Name) - // Output: U00096.3 -} - -func ExampleGff_AddFeature() { - // Sequence for greenflourescent protein (GFP) that we're using as test data for this example. - gfpSequence := "ATGGCTAGCAAAGGAGAAGAACTTTTCACTGGAGTTGTCCCAATTCTTGTTGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCTACATACGGAAAGCTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCTCTTATGGTGTTCAATGCTTTTCCCGTTATCCGGATCATATGAAACGGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAACGCACTATATCTTTCAAAGATGACGGGAACTACAAGACGCGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATCGTATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTCGGACACAAACTCGAGTACAACTATAACTCACACAATGTATACATCACGGCAGACAAACAAAAGAATGGAATCAAAGCTAACTTCAAAATTCGCCACAACATTGAAGATGGATCCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCGACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGCGTGACCACATGGTCCTTCTTGAGTTTGTAACTGCTGCTGGGATTACACATGGCATGGATGAGCTCTACAAATAA" - - // initialize sequence and feature structs. - var sequence gff.Gff - var feature gff.Feature - - // set the initialized sequence struct's sequence. - sequence.Sequence = gfpSequence - - // Set the initialized feature name and sequence location. - feature.Location = gff.Location{} - feature.Location.Start = 0 - feature.Location.End = len(sequence.Sequence) - - // Add the GFP feature to the sequence struct. - _ = sequence.AddFeature(&feature) - - // get the GFP feature sequence string from the sequence struct. - featureSequence, _ := feature.GetSequence() - - // check to see if the feature was inserted properly into the sequence. - fmt.Println(gfpSequence == featureSequence) - - // Output: true -} - -func ExampleFeature_GetSequence() { - // Sequence for greenflourescent protein (GFP) that we're using as test data for this example. - gfpSequence := "ATGGCTAGCAAAGGAGAAGAACTTTTCACTGGAGTTGTCCCAATTCTTGTTGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCTACATACGGAAAGCTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCTCTTATGGTGTTCAATGCTTTTCCCGTTATCCGGATCATATGAAACGGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAACGCACTATATCTTTCAAAGATGACGGGAACTACAAGACGCGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATCGTATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTCGGACACAAACTCGAGTACAACTATAACTCACACAATGTATACATCACGGCAGACAAACAAAAGAATGGAATCAAAGCTAACTTCAAAATTCGCCACAACATTGAAGATGGATCCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCGACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGCGTGACCACATGGTCCTTCTTGAGTTTGTAACTGCTGCTGGGATTACACATGGCATGGATGAGCTCTACAAATAA" - - // initialize sequence and feature structs. - var sequence gff.Gff - var feature gff.Feature - - // set the initialized sequence struct's sequence. - sequence.Sequence = gfpSequence - - // Set the initialized feature name and sequence location. - feature.Location.Start = 0 - feature.Location.End = len(sequence.Sequence) - - // Add the GFP feature to the sequence struct. - _ = sequence.AddFeature(&feature) - - // get the GFP feature sequence string from the sequence struct. - featureSequence, _ := feature.GetSequence() - - // check to see if the feature was inserted properly into the sequence. - fmt.Println(gfpSequence == featureSequence) - - // Output: true -} - -func TestFeature_GetSequence(t *testing.T) { - // This test is a little too complex and contrived for an example function. - // Essentially, it's testing GetSequence()'s ability to parse and retrieve sequences from complex location structures. - // This was originally covered in the old package system it was not covered in the new package system so I decided to include it here. - - // Sequence for greenflourescent protein (GFP) that we're using as test data for this example. - gfpSequence := "ATGGCTAGCAAAGGAGAAGAACTTTTCACTGGAGTTGTCCCAATTCTTGTTGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCTACATACGGAAAGCTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCTCTTATGGTGTTCAATGCTTTTCCCGTTATCCGGATCATATGAAACGGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAACGCACTATATCTTTCAAAGATGACGGGAACTACAAGACGCGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATCGTATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTCGGACACAAACTCGAGTACAACTATAACTCACACAATGTATACATCACGGCAGACAAACAAAAGAATGGAATCAAAGCTAACTTCAAAATTCGCCACAACATTGAAGATGGATCCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCGACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGCGTGACCACATGGTCCTTCTTGAGTTTGTAACTGCTGCTGGGATTACACATGGCATGGATGAGCTCTACAAATAA" - - sequenceLength := len(gfpSequence) - - // Splitting the sequence into two parts to make a multi-location feature. - sequenceFirstHalf := gfpSequence[:sequenceLength/2] - sequenceSecondHalf := transform.ReverseComplement(gfpSequence[sequenceLength/2:]) // This feature is reverse complemented. - - // rejoining the two halves into a single string where the second half of the sequence is reverse complemented. - gfpSequenceModified := sequenceFirstHalf + sequenceSecondHalf - - // initialize sequence and feature structs. - var sequence gff.Gff - var feature gff.Feature - - // set the initialized sequence struct's sequence. - sequence.Sequence = gfpSequenceModified - // initialize sublocations to be usedin the feature. - - var subLocation gff.Location - var subLocationReverseComplemented gff.Location - - subLocation.Start = 0 - subLocation.End = sequenceLength / 2 - - subLocationReverseComplemented.Start = sequenceLength / 2 - subLocationReverseComplemented.End = sequenceLength - subLocationReverseComplemented.Complement = true // According to genbank complement means reverse complement. What a country. - - feature.Location.SubLocations = []gff.Location{subLocation, subLocationReverseComplemented} - - // Add the GFP feature to the sequence struct. - _ = sequence.AddFeature(&feature) - - // get the GFP feature sequence string from the sequence struct. - featureSequence, _ := feature.GetSequence() - - // check to see if the feature was inserted properly into the sequence. - if gfpSequence != featureSequence { - t.Error("Feature sequence was not properly retrieved.") - } -} diff --git a/bio/gff/gff.go b/bio/gff/gff.go deleted file mode 100644 index 9a4cfb7..0000000 --- a/bio/gff/gff.go +++ /dev/null @@ -1,332 +0,0 @@ -/* -Package gff provides gff parsers and writers. - -GFF stands for "general feature format". It is an alternative to GenBank for -storing data about genomic sequences. While not often used in synthetic biology -research, it is more commonly used in bioinformatics for digesting features of -genomic sequences. - -This package provides a parser and writer to convert between the gff file -format and the more general poly.Sequence struct. -*/ -package gff - -import ( - "bytes" - "errors" - "io" - "os" - "sort" - "strconv" - "strings" - - "lukechampine.com/blake3" - - "github.com/koeng101/dnadesign/transform" -) - -var ( - readAllFn = io.ReadAll - atoiFn = strconv.Atoi - openFn = os.Open -) - -// Gff is a struct that represents a gff file. -type Gff struct { - Meta Meta - Features []Feature // will need a GetFeatures interface to standardize - Sequence string -} - -// Meta holds meta information about a gff file. -type Meta struct { - Name string `json:"name"` - Description string `json:"description"` - Version string `json:"gff_version"` - RegionStart int `json:"region_start"` - RegionEnd int `json:"region_end"` - Size int `json:"size"` - SequenceHash string `json:"sequence_hash"` - SequenceHashFunction string `json:"hash_function"` - CheckSum [32]byte `json:"checkSum"` // blake3 checksum of the parsed file itself. Useful for if you want to check if incoming genbank/gff files are different. -} - -// Feature is a struct that represents a feature in a gff file. -type Feature struct { - Name string `json:"name"` - Source string `json:"source"` - Type string `json:"type"` - Score string `json:"score"` - Strand string `json:"strand"` - Phase string `json:"phase"` - Attributes map[string]string `json:"attributes"` - Location Location `json:"location"` - ParentSequence *Gff `json:"-"` -} - -// Location is a struct that represents a location in a gff file. -type Location struct { - Start int `json:"start"` - End int `json:"end"` - Complement bool `json:"complement"` - Join bool `json:"join"` - FivePrimePartial bool `json:"five_prime_partial"` - ThreePrimePartial bool `json:"three_prime_partial"` - SubLocations []Location `json:"sub_locations"` -} - -// AddFeature takes a feature and adds it to the Gff struct. -func (sequence *Gff) AddFeature(feature *Feature) error { - feature.ParentSequence = sequence - featureCopy := *feature - sequence.Features = append(sequence.Features, featureCopy) - return nil -} - -// GetSequence takes a feature and returns a sequence string for that feature. -func (feature Feature) GetSequence() (string, error) { - return getFeatureSequence(feature, feature.Location) -} - -// getFeatureSequence takes a feature and location object and returns a sequence string. -func getFeatureSequence(feature Feature, location Location) (string, error) { - var sequenceBuffer bytes.Buffer - var sequenceString string - parentSequence := feature.ParentSequence.Sequence - - if len(location.SubLocations) == 0 { - sequenceBuffer.WriteString(parentSequence[location.Start:location.End]) - } else { - for _, subLocation := range location.SubLocations { - sequence, _ := getFeatureSequence(feature, subLocation) - sequenceBuffer.WriteString(sequence) - } - } - - // reverse complements resulting string if needed. - if location.Complement { - sequenceString = transform.ReverseComplement(sequenceBuffer.String()) - } else { - sequenceString = sequenceBuffer.String() - } - - return sequenceString, nil -} - -// Parse Takes in a string representing a gffv3 file and parses it into an Sequence object. -func Parse(file io.Reader) (Gff, error) { - fileBytes, err := readAllFn(file) - if err != nil { - return Gff{}, err - } - - gffString := string(fileBytes) - gff := Gff{} - - // Add the CheckSum to sequence (blake3) - gff.Meta.CheckSum = blake3.Sum256(fileBytes) - - lines := strings.Split(gffString, "\n") - regionStringArray, endOfMetaInfo, err := extractInfoFromField(lines, "##sequence-region") - metaString := lines[0:endOfMetaInfo] - versionString := metaString[0] - if err != nil { - return Gff{}, err - } - // get name for general meta - meta := Meta{} - meta.Name = regionStringArray[1] // Formally region name, but changed to name here for generality/interoperability. - - // get meta info only specific to GFF files - meta.Version = strings.Split(versionString, " ")[1] - meta.RegionStart, err = atoiFn(regionStringArray[2]) - if err != nil { - return Gff{}, err - } - meta.RegionEnd, err = atoiFn(regionStringArray[3]) - if err != nil { - return Gff{}, err - } - meta.Size = meta.RegionEnd - meta.RegionStart - - var sequenceBuffer bytes.Buffer - fastaFlag := false - for _, line := range lines { - if line == "##FASTA" { - fastaFlag = true - } else if len(line) == 0 { - continue - } else if line[0:2] == "##" || line[0:2] == "#!" { - continue - } else if fastaFlag && line[0:1] != ">" { - // sequence.Sequence = sequence.Sequence + line - sequenceBuffer.WriteString(line) - } else if fastaFlag && line[0:1] == ">" { - gff.Meta.Description = line - } else { - record := Feature{} - fields := strings.Split(line, "\t") - record.Name = fields[0] - record.Source = fields[1] - record.Type = fields[2] - - // Indexing starts at 1 for gff so we need to shift down for Sequence 0 index. - record.Location.Start, err = atoiFn(fields[3]) - if err != nil { - return Gff{}, err - } - - record.Location.Start-- - record.Location.End, err = atoiFn(fields[4]) - if err != nil { - return Gff{}, err - } - - record.Score = fields[5] - record.Strand = fields[6] - record.Phase = fields[7] - record.Attributes = make(map[string]string) - attributes := fields[8] - // var eqIndex int - attributeSlice := strings.Split(attributes, ";") - - for _, attribute := range attributeSlice { - attributeSplit := strings.Split(attribute, "=") - key := attributeSplit[0] - value := attributeSplit[1] - record.Attributes[key] = value - } - err = gff.AddFeature(&record) - if err != nil { - return Gff{}, err - } - } - } - gff.Sequence = sequenceBuffer.String() - gff.Meta = meta - - return gff, err -} - -// regionString takes in the lines array,fieldName that is needed in gff file, and -// returns the region containing fieldName if found -// throws error if not found -func extractInfoFromField(lines []string, fieldName string) ([]string, int, error) { - index := 0 - endOfMetaInfo := 0 - for lineIndex, line := range lines { - if strings.Contains(line, "#") { - if strings.Contains(line, fieldName) { - index = lineIndex - } - continue - } - endOfMetaInfo = lineIndex - break - } - if index == 0 && fieldName != "gff-version" { - return nil, 0, errors.New("the given file does not have any meta information") - } - return strings.Split(lines[index], " "), endOfMetaInfo, nil -} - -// Build takes an Annotated sequence and returns a byte array representing a gff to be written out. -func Build(sequence Gff) ([]byte, error) { - var gffBuffer bytes.Buffer - - versionString := "##gff-version 3 \n" - if sequence.Meta.Version != "" { - versionString = "##gff-version " + sequence.Meta.Version + "\n" - } - - gffBuffer.WriteString(versionString) - - name := "Sequence" - start := "1" - end := strconv.Itoa(sequence.Meta.RegionEnd) - - if sequence.Meta.Name != "" { - name = sequence.Meta.Name - } - - if sequence.Meta.RegionStart != 0 { - start = strconv.Itoa(sequence.Meta.RegionStart) - } - - regionString := "##sequence-region " + name + " " + start + " " + end + "\n" - gffBuffer.WriteString(regionString) - - for _, feature := range sequence.Features { - var featureString string - - featureSource := "feature" - if feature.Source != "" { - featureSource = feature.Source - } - - featureType := "unknown" - if feature.Type != "" { - featureType = feature.Type - } - - // Indexing starts at 1 for gff so we need to shift up from Sequence 0 index. - featureStart := strconv.Itoa(feature.Location.Start + 1) - featureEnd := strconv.Itoa(feature.Location.End) - - featureScore := feature.Score - featureStrand := feature.Strand - featurePhase := feature.Phase - var featureAttributes string - - keys := make([]string, 0, len(feature.Attributes)) - for key := range feature.Attributes { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { - attributeString := key + "=" + feature.Attributes[key] + ";" - featureAttributes += attributeString - } - - if len(featureAttributes) > 0 { - featureAttributes = featureAttributes[0 : len(featureAttributes)-1] - } - TAB := "\t" - featureString = feature.Name + TAB + featureSource + TAB + featureType + TAB + featureStart + TAB + featureEnd + TAB + featureScore + TAB + featureStrand + TAB + featurePhase + TAB + featureAttributes + "\n" - gffBuffer.WriteString(featureString) - } - - gffBuffer.WriteString("###\n") - gffBuffer.WriteString("##FASTA\n") - gffBuffer.WriteString(">" + sequence.Meta.Name + "\n") - - for letterIndex, letter := range sequence.Sequence { - letterIndex++ - if letterIndex%70 == 0 && letterIndex != 0 && letterIndex != sequence.Meta.RegionEnd { - gffBuffer.WriteRune(letter) - gffBuffer.WriteString("\n") - } else { - gffBuffer.WriteRune(letter) - } - } - gffBuffer.WriteString("\n") - return gffBuffer.Bytes(), nil -} - -// Read takes in a filepath for a .gffv3 file and parses it into an Annotated poly.Sequence struct. -func Read(path string) (Gff, error) { - file, err := openFn(path) - if err != nil { - return Gff{}, err - } - - sequence, err := Parse(file) - return sequence, err -} - -// Write takes an poly.Sequence struct and a path string and writes out a gff to that path. -func Write(sequence Gff, path string) error { - gff, _ := Build(sequence) - return os.WriteFile(path, gff, 0644) -} diff --git a/bio/gff/gff_test.go b/bio/gff/gff_test.go deleted file mode 100644 index 7a6e029..0000000 --- a/bio/gff/gff_test.go +++ /dev/null @@ -1,146 +0,0 @@ -package gff - -import ( - "bytes" - "errors" - "io" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pmezard/go-difflib/difflib" -) - -/****************************************************************************** - -Gff related tests and benchmarks begin here. - -******************************************************************************/ - -// TODO should delete output files. - -func TestGffIO(t *testing.T) { - tmpDataDir, err := os.MkdirTemp("", "data-*") - if err != nil { - t.Error(err) - } - defer os.RemoveAll(tmpDataDir) - - testInputPath := "../../data/ecoli-mg1655-short.gff" - tmpGffFilePath := filepath.Join(tmpDataDir, "ecoli-mg1655-short.gff") - - testSequence, _ := Read(testInputPath) - _ = Write(testSequence, tmpGffFilePath) - - readTestSequence, _ := Read(tmpGffFilePath) - - if diff := cmp.Diff(testSequence, readTestSequence, cmpopts.IgnoreFields(Feature{}, "ParentSequence")); diff != "" { - t.Errorf("Parsing the output of Build() does not produce the same output as parsing the original file read with ReadGff(). Got this diff:\n%s", diff) - } - - original, _ := os.ReadFile(testInputPath) - builtOutput, _ := os.ReadFile(tmpGffFilePath) - gffDiff := difflib.UnifiedDiff{ - A: difflib.SplitLines(string(original)), - B: difflib.SplitLines(string(builtOutput)), - FromFile: testInputPath, - ToFile: tmpGffFilePath, - Context: 3, - } - - gffDiffText, _ := difflib.GetUnifiedDiffString(gffDiff) - - if gffDiffText != "" { - t.Errorf("Build() does not output the same file as was input through ReadGff(). Got this diff:\n%s", gffDiffText) - } -} - -// testing that readAllFn() returns an error. -func TestParseReader_error(t *testing.T) { - parseErr := errors.New("parse error") - oldReadAllFn := readAllFn - readAllFn = func(r io.Reader) ([]byte, error) { - return nil, parseErr - } - defer func() { - readAllFn = oldReadAllFn - }() - _, err := Parse(strings.NewReader("")) - if err != parseErr { - t.Errorf("Parse() did not return the expected error. Got %v, expected %v", err, parseErr) - } -} - -// testing that all Atoi() calls return an error. -func TestParseAtoi_error(t *testing.T) { - file, _ := openFn("../../data/ecoli-mg1655-short.gff") - fileBytes, _ := readAllFn(file) - fileString := string(fileBytes) - recievedAtoiInputs := []string{} - - parseErr := errors.New("parse error") - oldAtoiFn := atoiFn - // helper function to see if the input string for atoiFn is in the recievedAtoiInputs slice. - contains := func(stringSlice []string, expression string) bool { - for _, input := range stringSlice { - if input == expression { - return true - } - } - return false - } - atoiFn = func(gffString string) (int, error) { - if !contains(recievedAtoiInputs, gffString) { - recievedAtoiInputs = append(recievedAtoiInputs, gffString) - // length = len(recievedAtoiInputs) - return 0, parseErr - } - return oldAtoiFn(gffString) - } - - defer func() { - atoiFn = oldAtoiFn - }() - for index := 0; index <= 10; index++ { - var gffBuffer bytes.Buffer - gffBuffer.WriteString(fileString) - _, _ = Parse(&gffBuffer) - } -} - -// testing that Read can return an appropriate error. -func TestRead_error(t *testing.T) { - readErr := errors.New("open : no such file or directory") - oldOpenFn := openFn - openFn = func(filepath string) (*os.File, error) { - return nil, readErr - } - defer func() { - openFn = oldOpenFn - }() - _, err := Read("../../data/ecoli-mg1655-short.gff") - if err != readErr { - t.Errorf("Read() did not return the expected error. Got %v, expected %v", err, readErr) - } -} - -func BenchmarkReadGff(b *testing.B) { - for i := 0; i < b.N; i++ { - _, _ = Read("../../data/ecoli-mg1655-short.gff") - } -} - -func BenchmarkReadGff1(b *testing.B) { BenchmarkReadGff(b) } -func BenchmarkReadGff10(b *testing.B) { BenchmarkReadGff(b) } -func BenchmarkReadGff100(b *testing.B) { BenchmarkReadGff(b) } -func BenchmarkReadGff1000(b *testing.B) { BenchmarkReadGff(b) } -func BenchmarkReadGff10000(b *testing.B) { BenchmarkReadGff(b) } - -/****************************************************************************** - -Gff related tests and benchmarks end here. - -******************************************************************************/ diff --git a/data/parseLocationRegressionTest.json b/data/parseLocationRegressionTest.json index 8f59902..0146e99 100644 --- a/data/parseLocationRegressionTest.json +++ b/data/parseLocationRegressionTest.json @@ -1 +1,52 @@ -{"start":0,"end":0,"complement":false,"join":true,"five_prime_partial":false,"three_prime_partial":false,"gbk_location_string":"join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))","sub_locations":[{"start":5306941,"end":5307394,"complement":true,"join":false,"five_prime_partial":false,"three_prime_partial":false,"gbk_location_string":"join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))","sub_locations":null},{"start":5304400,"end":5305029,"complement":true,"join":false,"five_prime_partial":false,"three_prime_partial":false,"gbk_location_string":"join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))","sub_locations":null},{"start":5303327,"end":5303393,"complement":true,"join":false,"five_prime_partial":false,"three_prime_partial":false,"gbk_location_string":"join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))","sub_locations":null},{"start":5301927,"end":5302004,"complement":true,"join":false,"five_prime_partial":false,"three_prime_partial":false,"gbk_location_string":"join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))","sub_locations":null}]} \ No newline at end of file +{ + "start": 0, + "end": 0, + "complement": false, + "join": true, + "fivePrimePartial": false, + "threePrimePartial": false, + "gbkLocationString": "join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))", + "subLocations": [ + { + "start": 5306941, + "end": 5307394, + "complement": true, + "join": false, + "fivePrimePartial": false, + "threePrimePartial": false, + "gbkLocationString": "join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))", + "subLocations": null + }, + { + "start": 5304400, + "end": 5305029, + "complement": true, + "join": false, + "fivePrimePartial": false, + "threePrimePartial": false, + "gbkLocationString": "join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))", + "subLocations": null + }, + { + "start": 5303327, + "end": 5303393, + "complement": true, + "join": false, + "fivePrimePartial": false, + "threePrimePartial": false, + "gbkLocationString": "join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))", + "subLocations": null + }, + { + "start": 5301927, + "end": 5302004, + "complement": true, + "join": false, + "fivePrimePartial": false, + "threePrimePartial": false, + "gbkLocationString": "join(complement(5306942..5307394),complement(5304401..5305029),complement(5303328..5303393),complement(5301928..5302004))", + "subLocations": null + } + ] +} + diff --git a/synthesis/codon/codon.go b/synthesis/codon/codon.go index 3771101..c91385f 100644 --- a/synthesis/codon/codon.go +++ b/synthesis/codon/codon.go @@ -285,7 +285,7 @@ func extractCodingRegion(data genbank.Genbank) ([]string, error) { // iterate through the features of the genbank file and if the feature is a coding region, append the sequence to the string builder for _, feature := range data.Features { if feature.Type == "CDS" { - sequence, err := feature.GetSequence() + sequence, err := genbank.GetSequence(&data, feature) if err != nil { return nil, err } From f1442633b3647a6f755ae98a9cbacfae14e4b5c0 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 13:46:15 -0800 Subject: [PATCH 05/21] update go version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e86261..545db78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - go-version: [1.18.x,] + go-version: [1.21.x,] platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: From 2e56d5d401080a8825bf433e2ad5271b48ccba1c Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 10 Dec 2023 13:51:59 -0800 Subject: [PATCH 06/21] gomod problems? --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4ede24a..89c4074 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/koeng101/dnadesign -go 1.21.3 +go 1.18 require ( github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b From 711fc6ab3b6a57b7a60bc47dc307162332f751f0 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 11 Dec 2023 08:13:32 -0800 Subject: [PATCH 07/21] in progress --- api/api/api_test.go | 2 +- api/api/lua_test.go | 2 +- api/gen/dnadesign-server.gen.go | 64 ++++++++++++++++----------------- api/gen/dnadesign-types.gen.go | 42 ++++++++++------------ api/spec.yaml | 12 ------- 5 files changed, 53 insertions(+), 69 deletions(-) diff --git a/api/api/api_test.go b/api/api/api_test.go index 8af42c1..41a096d 100644 --- a/api/api/api_test.go +++ b/api/api/api_test.go @@ -87,7 +87,7 @@ ORIGIN resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) - r := `[{"features":[{"attributes":{"mol_type":["genomic DNA"],"organism":["unspecified"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","sequenceHash":"","sequenceHashFunction":"","type":"source"},{"attributes":{"label":["M13 rev"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":false,"end":17,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgac","sequenceHash":"","sequenceHashFunction":"","type":"primer_bind"},{"attributes":{"codon_start":["1"],"gene":["lacZ"],"label":["lacZ-alpha"],"product":["LacZ-alpha fragment of beta-galactosidase"],"translation":["MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNRLAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICSDAA"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":12,"subLocations":null,"threePrimePartial":false},"sequence":"atgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","sequenceHash":"","sequenceHashFunction":"","type":"CDS"},{"attributes":{"label":["MCS"],"note":["pUC19 multiple cloning site"]},"description":"","location":{"complement":false,"end":86,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":29,"subLocations":null,"threePrimePartial":false},"sequence":"aagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattc","sequenceHash":"","sequenceHashFunction":"","type":"misc_feature"},{"attributes":{"label":["M13 fwd"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":true,"end":103,"fivePrimePartial":false,"gbkLocationString":"complement(87..103)","join":false,"start":86,"subLocations":null,"threePrimePartial":false},"sequence":"gtaaaacgacggccagt","sequenceHash":"","sequenceHashFunction":"","type":"primer_bind"}],"meta":{"accession":".","baseCount":null,"date":"","definition":"natural linear DNA","keywords":".","locus":{"circular":false,"genbankDivision":"UNA","modificationDate":"12-SEP-2023","moleculeType":"DNA","name":"pUC19_lacZ","sequenceCoding":"bp","sequenceLength":"336"},"name":"","organism":"unspecified","origin":"","other":{},"references":[{"authors":"Keoni Gandall","consortium":"","journal":"Exported Sep 12, 2023 from SnapGene 6.2.2 https://www.snapgene.com","pubMed":"","range":"(bases 1 to 336)","remark":"","title":"Direct Submission"}],"sequenceHash":"","sequenceHashFunction":"","source":"natural DNA sequence","taxonomy":null,"version":"."},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag"}]` + r := `[{"features":[{"attributes":{"mol_type":["genomic DNA"],"organism":["unspecified"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","type":"source"},{"attributes":{"label":["M13 rev"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":false,"end":17,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":0,"subLocations":null,"threePrimePartial":false},"sequence":"caggaaacagctatgac","type":"primer_bind"},{"attributes":{"codon_start":["1"],"gene":["lacZ"],"label":["lacZ-alpha"],"product":["LacZ-alpha fragment of beta-galactosidase"],"translation":["MTMITPSLHACRSTLEDPRVPSSNSLAVVLQRRDWENPGVTQLNRLAAHPPFASWRNSEEARTDRPSQQLRSLNGEWRLMRYFLLTHLCGISHRIWCTLSTICSDAA"]},"description":"","location":{"complement":false,"end":336,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":12,"subLocations":null,"threePrimePartial":false},"sequence":"atgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag","type":"CDS"},{"attributes":{"label":["MCS"],"note":["pUC19 multiple cloning site"]},"description":"","location":{"complement":false,"end":86,"fivePrimePartial":false,"gbkLocationString":"","join":false,"start":29,"subLocations":null,"threePrimePartial":false},"sequence":"aagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattc","type":"misc_feature"},{"attributes":{"label":["M13 fwd"],"note":["common sequencing primer, one of multiple similarvariants"]},"description":"","location":{"complement":true,"end":103,"fivePrimePartial":false,"gbkLocationString":"complement(87..103)","join":false,"start":86,"subLocations":null,"threePrimePartial":false},"sequence":"gtaaaacgacggccagt","type":"primer_bind"}],"meta":{"accession":".","baseCount":null,"date":"","definition":"natural linear DNA","keywords":".","locus":{"circular":false,"genbankDivision":"UNA","modificationDate":"12-SEP-2023","moleculeType":"DNA","name":"pUC19_lacZ","sequenceCoding":"bp","sequenceLength":"336"},"name":"","organism":"unspecified","origin":"","other":{},"references":[{"authors":"Keoni Gandall","consortium":"","journal":"Exported Sep 12, 2023 from SnapGene 6.2.2 https://www.snapgene.com","pubMed":"","range":"(bases 1 to 336)","remark":"","title":"Direct Submission"}],"source":"natural DNA sequence","taxonomy":null,"version":"."},"sequence":"caggaaacagctatgaccatgattacgccaagcttgcatgcctgcaggtcgactctagaggatccccgggtaccgagctcgaattcactggccgtcgttttacaacgtcgtgactgggaaaaccctggcgttacccaacttaatcgccttgcagcacatccccctttcgccagctggcgtaatagcgaagaggcccgcaccgatcgcccttcccaacagttgcgcagcctgaatggcgaatggcgcctgatgcggtattttctccttacgcatctgtgcggtatttcacaccgcatatggtgcactctcagtacaatctgctctgatgccgcatag"}]` if strings.TrimSpace(resp.Body.String()) != r { t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) } diff --git a/api/api/lua_test.go b/api/api/lua_test.go index ca48ca3..e1a52d3 100644 --- a/api/api/lua_test.go +++ b/api/api/lua_test.go @@ -39,7 +39,7 @@ func TestApp_LuaIoGenbankParse(t *testing.T) { luaScript := ` parsed_genbank = genbank_parse(attachments["input.gb"]) -output = parsed_genbank[1].features[3].attributes.translation[1] +output = parsed_genbank[1].features[3].attributes["translation"][1] ` inputGenbank := `LOCUS pUC19_lacZ 336 bp DNA linear UNA 12-SEP-2023 DEFINITION natural linear DNA diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 1a0a3af..9ce6d47 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -1265,38 +1265,38 @@ func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9xa3W7bOBZ+FUK7l0LszuwuZnyXOE03QDo17OzVojBo8chmK5Eqf1J7irz7QqQo0RIl", - "K43TdOcqkUmev+87PIeUvkUJzwvOgCkZzb5FMtlBjs2/l0rhZJcDU+VTIXgBQlEwYwlnqhpQhwKiWSSV", - "oGwbPcYRwzkEBh7jSMAXTQWQaPZfOyuuBX2M3Xy++QSJKgVdYQlzrkP6N1hCUHni5lcjlCnYguioNwLc", - "9JDy+Q6zLXQ13wieBzUvuKSKchZSHkdLwPJorFm4UlCEF93z03Gs1VaCYmuhWVyrDTn4lv15sEAB03kp", - "6kri2yiOrjay/LPAX+bmUeZXt56ExvAbLBVeQsIF6caJEmCKphRE0GkJXzSwZARRPEHespBHN4CVFgHM", - "sFKCbrSqnggxEcPZ4thiBbkMGlv9gIXAB++50UxAJoIWLfgbARlPsBv8u4A0mkV/mzSJN6mybnLn5g1H", - "qBn8N5a7kxNuNEt6TbM/nALBjB77GfthbVnUo99zyotJEEqBt+Gd54aLr1iQDw8gygwN+rSEBxASBues", - "RhNwNcS5d8A2mH3uy4LUUvKYX0MMcBwOsC4HhU8tf1/OeVJ6GalxY+iJHLvzmNwuCXmRQX5cFTacZ4AN", - "n4GR8C6X0gdYCJrDAgtFcRZevt18drpX1pMQqp84ZeH1UmGhwgZIvXGixwPlp2pnf9gJOOlSCwdrnw1T", - "7AezcioQp5CiUKBaHvbAqmUAUyoSnWHRA4nl/jV9oLJve8k5oSm1qq+xgp5JGSQ6g/vwXtTbUjRcnXPS", - "Rwk35Q7YVu1GNyatZS0ju84HXO2YFzcBDYHwvkrwVvFKEpC98d34PdIo4jZdVYC5pA8iAilltLeKfIbD", - "Vy6I7Kt+ekw+aTmINRdbzKjMewbploZt42pnm5C+wt9X7xtkBKQgSiDH7w9LtyQU5vOVb8m16OkRFN5z", - "xvPD03qbsnKGlbXyhFiKe8SIPa42gjxyeBjWlnt21ig6yhwF3ue6AzVuZ+tQ9x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2wexrHyszS5Fj", + "vIcQcZwKsKAAhc9t/1jJPIruRmvcOnqG87ces05bdFHmUBx36Q3nOWDDL2Ak3HUyeg8LQQtYYKEozsPb", + "t5uvzvbKRhJC9QunLLxfKixU2AGpN071eKD80unU607A2ZBOcLD+2TTFfjLroAJ5ChkKJeokwh5YtQxg", + "SkWqcyx6ILHcv6L3VPZ1ooITmlFr+gor6BHKIdU53IW7TO8R33J1zkkfJZzILbCt2o0eFE62nTjZDT4Q", + "ase9uE1oCISPdYGfHCZpCrI3vxt/ZhlF3HbKCTCX9EFEIKOM9h44X+HwnQsi+04jPaaetBzEmostZlQW", + "PYt0S8O+cbWzQ0HfQdx3/rbICMhAVECO7w9LtyWUZsm16Dtp8Z4zXhweNyFU510YmxN2E0tMD87YY1ir", + "yIPUy3zjuednk3sH9FG6fIY6KGqMQyXwycPYjYnvq5QKmu4oRinPaTUr2k8llooLKoPTYgtAt6S02nEh", + "ewZ6JrlQVBc9B4wW7Kiht2ul3nwEElwSbrjvrkCBxdcwyFTlI05wF43b0DrZuNSYcZ4cxdkFojJBWWav", + "A9aL6OqPC0RA0i1DF4sbjyqzaDqZTt6ZUiuB4ZJGs+jXyXQyrRzAamcSndi9SUpkktG9AYVL07aOptno", + "mu5BopQXBWeoFHyTQyERZWh+tTJ/SwElFqbNoowLVDkmD0ztQFI5iYwXdvmGRLPqwqKujO05kdd0H9ns", + "gVSXnBxOLpe4LPO6hSdf6guUregui/x+NNQJGk5btPk9uInykdeA8UOdN2Z7tXtqPIS7USRLzqT17pfp", + "9AkpSs2ldnzTrC/BzxW7Mx8meJd2pOIYsnrRd6p2KKdSIZ4hp+khjv7RyYiCvUrKHNOTXJz62bH5bwkC", + "UVZqhUAIbobRfz6f+humoOoDSIK4B+FsmIm3KLA42LCroE1D38oqfymR0edKyK9YXipa0D+hv2yXf3xA", + "KwCCCGRY50oixdF0uBo/Oa1vWZISoOdi8rR6e4nqOgv53Q6Qw4qgxq3/O9o65lTcnZwjrxKYybyebB17", + "B2h518g/Fy+H31Zqc5SztcIbe+TXVRTN3r2Lz70tdhUMXuJfg4Yugy0HURvwK3Olcaa30cEeUq1gnWs8", + "TJH3VvBW42ejBm5evccfk95LeeioNPkZ0bSs3MtPATkP38y5VqUe4WgtFxtFY87ylTY3mkznqN77+qxb", + "aoYwyjVGdZ5b4lU0s8SjPMmwVDgpsZBn2tMNN+/fCyM5xL7RYT0V5XEPmt6jfYes3dSa8Ai6vljdXSBh", + "tsk3QM+4UXtBsHkhdehR3oJXPwKNg69+Kv5fA/D4hXs8hPW+NwfR+dEHo6SFrk6HxL657tdlKoahXNU7", + "5nbDIhXPdhoMP7iWghYgHvvlERZbUGtVHI0V/5o2kkwXGzvwKijKKrBHWTgdRhodrb++Ey9x3Ix2tcvV", + "+RKVghOdqnpAeQuiOkKhxXzpUdQx85Somf/l2FmWNl+lPRdHYZ/mmsCa11+vPZKPBd6vXQRrWd8pG17+", + "Op3GgatYQdnApl/Cm37q/ta1FHL55YcmyDKaUmDp4SjU6eT33wOV67x7SuW2OmLf+piB66JSiHiGGh0I", + "M4IwynKO32L6cqQ/Gfn7KmrLcwJse/aK6GrqQyv/bFXV/Dxi6DCuf0ThkfuxiI+l7XHObcDoQ9WksJRQ", + "bPLDX6lxhvwbgXtOx2N+S5+I97hx2XXrwOE1CinrJumCE06cyYD9wudcskbPRa83EGX2xyBrO2j0fL9i", + "fgsyJPITE9KI38I4yY6XHZ9eejw6W2p/sSkII0mryXrkOCSgspua5y9CtyBHDkbLdt+V3fbWvTzMqp/r", + "2N0j+S0h9TBCxCU7BKzJRqWvWvkRaZFHs2inVClnSUIYts+6kw3lCS5p9BD7MrMkyXmK8x2Xavbb9Lep", + "lfn88N8AAAD//+A7BjN2KgAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index 88fcb58..eb6c8ac 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -49,13 +49,11 @@ type FastaRecord struct { // Feature defines model for Feature. type Feature struct { - Attributes map[string][]string `json:"attributes"` - Description string `json:"description"` - Location Location `json:"location"` - Sequence string `json:"sequence"` - SequenceHash string `json:"sequenceHash"` - SequenceHashFunction string `json:"sequenceHashFunction"` - Type string `json:"type"` + Attributes map[string][]string `json:"attributes"` + Description string `json:"description"` + Location Location `json:"location"` + Sequence string `json:"sequence"` + Type string `json:"type"` } // Fragment defines model for Fragment. @@ -97,22 +95,20 @@ type Locus struct { // Meta defines model for Meta. type Meta struct { - Accession string `json:"accession"` - BaseCount []BaseCount `json:"baseCount"` - Date string `json:"date"` - Definition string `json:"definition"` - Keywords string `json:"keywords"` - Locus Locus `json:"locus"` - Name string `json:"name"` - Organism string `json:"organism"` - Origin string `json:"origin"` - Other map[string]string `json:"other"` - References []Reference `json:"references"` - SequenceHash string `json:"sequenceHash"` - SequenceHashFunction string `json:"sequenceHashFunction"` - Source string `json:"source"` - Taxonomy []string `json:"taxonomy"` - Version string `json:"version"` + Accession string `json:"accession"` + BaseCount []BaseCount `json:"baseCount"` + Date string `json:"date"` + Definition string `json:"definition"` + Keywords string `json:"keywords"` + Locus Locus `json:"locus"` + Name string `json:"name"` + Organism string `json:"organism"` + Origin string `json:"origin"` + Other map[string]string `json:"other"` + References []Reference `json:"references"` + Source string `json:"source"` + Taxonomy []string `json:"taxonomy"` + Version string `json:"version"` } // Organism defines model for Organism. diff --git a/api/spec.yaml b/api/spec.yaml index 2b704b0..ea99cf7 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -59,8 +59,6 @@ components: - baseCount - other - name - - sequenceHash - - sequenceHashFunction properties: date: type: string @@ -98,18 +96,12 @@ components: type: string name: type: string - sequenceHash: - type: string - sequenceHashFunction: - type: string Feature: type: object required: - type - description - attributes - - sequenceHash - - sequenceHashFunction - sequence - location properties: @@ -123,10 +115,6 @@ components: type: array items: type: string - sequenceHash: - type: string - sequenceHashFunction: - type: string sequence: type: string location: From c4b22f94c8a91819666e640e84585b92618567e8 Mon Sep 17 00:00:00 2001 From: Koeng101 Date: Sat, 16 Dec 2023 20:29:19 -0800 Subject: [PATCH 08/21] init deployment with basic k3s tests (#30) --- deployment/README.md | 5 + deployment/basic_test.go | 163 ++++++++++++++++++++ deployment/go.mod | 87 +++++++++++ deployment/go.sum | 312 +++++++++++++++++++++++++++++++++++++++ go.work | 5 +- 5 files changed, 570 insertions(+), 2 deletions(-) create mode 100644 deployment/README.md create mode 100644 deployment/basic_test.go create mode 100644 deployment/go.mod create mode 100644 deployment/go.sum diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 0000000..d6a8efc --- /dev/null +++ b/deployment/README.md @@ -0,0 +1,5 @@ +# DnaDesign Deployments + +This directory contains deployment infrastructure for DnaDesign services. Tests use docker [testcontainers](https://testcontainers.com/) running [k3s](https://k3s.io/). Deployment is on a single-host k3s server. Even though we emphasize maintainability over all else, in practice, this means using a standard deployment platform that many people can understand. Kubernetes is used as this standard platform because it can largely be defined in software upfront and rapidly re-deployed. + +Test take about 50s-100s to run. diff --git a/deployment/basic_test.go b/deployment/basic_test.go new file mode 100644 index 0000000..1151a6b --- /dev/null +++ b/deployment/basic_test.go @@ -0,0 +1,163 @@ +package deployment_test + +import ( + "context" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/k3s" +) + +func Test_LoadImages(t *testing.T) { + ctx := context.Background() + + k3sContainer, err := k3s.RunContainer(ctx, + testcontainers.WithImage("docker.io/rancher/k3s:v1.27.1-k3s1"), + ) + if err != nil { + t.Fatal(err) + } + + // Clean up the container + defer func() { + if err := k3sContainer.Terminate(ctx); err != nil { + t.Fatal(err) + } + }() + + kubeConfigYaml, err := k3sContainer.GetKubeConfig(ctx) + if err != nil { + t.Fatal(err) + } + + restcfg, err := clientcmd.RESTConfigFromKubeConfig(kubeConfigYaml) + if err != nil { + t.Fatal(err) + } + + k8s, err := kubernetes.NewForConfig(restcfg) + if err != nil { + t.Fatal(err) + } + + provider, err := testcontainers.ProviderDocker.GetProvider() + if err != nil { + t.Fatal(err) + } + + // ensure nginx image is available locally + err = provider.PullImage(context.Background(), "nginx") + if err != nil { + t.Fatal(err) + } + + t.Run("Test load image not available", func(t *testing.T) { + err := k3sContainer.LoadImages(context.Background(), "fake.registry/fake:non-existing") + if err == nil { + t.Fatal("should had failed") + } + }) + + t.Run("Test load image in cluster", func(t *testing.T) { + err := k3sContainer.LoadImages(context.Background(), "nginx") + if err != nil { + t.Fatal(err) + } + + pod := &corev1.Pod{ + TypeMeta: metav1.TypeMeta{ + Kind: "Pod", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod", + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "nginx", + Image: "nginx", + ImagePullPolicy: corev1.PullNever, // use image only if already present + }, + }, + }, + } + + _, err = k8s.CoreV1().Pods("default").Create(context.Background(), pod, metav1.CreateOptions{}) + if err != nil { + t.Fatal(err) + } + + time.Sleep(1 * time.Second) + pod, err = k8s.CoreV1().Pods("default").Get(context.Background(), "test-pod", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + waiting := pod.Status.ContainerStatuses[0].State.Waiting + if waiting != nil && waiting.Reason == "ErrImageNeverPull" { + t.Fatal("Image was not loaded") + } + }) +} + +func Test_APIServerReady(t *testing.T) { + ctx := context.Background() + + k3sContainer, err := k3s.RunContainer(ctx, + testcontainers.WithImage("docker.io/rancher/k3s:v1.27.1-k3s1"), + ) + if err != nil { + t.Fatal(err) + } + + // Clean up the container + defer func() { + if err := k3sContainer.Terminate(ctx); err != nil { + t.Fatal(err) + } + }() + + kubeConfigYaml, err := k3sContainer.GetKubeConfig(ctx) + if err != nil { + t.Fatal(err) + } + + restcfg, err := clientcmd.RESTConfigFromKubeConfig(kubeConfigYaml) + if err != nil { + t.Fatal(err) + } + + k8s, err := kubernetes.NewForConfig(restcfg) + if err != nil { + t.Fatal(err) + } + + pod := &corev1.Pod{ + TypeMeta: metav1.TypeMeta{ + Kind: "Pod", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod", + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "nginx", + Image: "nginx", + }, + }, + }, + } + + _, err = k8s.CoreV1().Pods("default").Create(context.Background(), pod, metav1.CreateOptions{}) + if err != nil { + t.Fatalf("failed to create pod %v", err) + } +} diff --git a/deployment/go.mod b/deployment/go.mod new file mode 100644 index 0000000..b7a3823 --- /dev/null +++ b/deployment/go.mod @@ -0,0 +1,87 @@ +module github.com/koeng101/dnadesign/deployment + +go 1.21.5 + +require ( + github.com/testcontainers/testcontainers-go v0.26.0 + github.com/testcontainers/testcontainers-go/modules/k3s v0.26.0 + k8s.io/api v0.29.0 + k8s.io/apimachinery v0.29.0 + k8s.io/client-go v0.29.0 +) + +require ( + dario.cat/mergo v1.0.0 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/Microsoft/hcsshim v0.11.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/containerd/containerd v1.7.7 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/cpuguy83/dockercfg v0.3.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/docker/docker v24.0.6+incompatible // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.16.0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/moby/patternmatcher v0.6.0 // indirect + github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/term v0.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/runc v1.1.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/shirou/gopsutil/v3 v3.23.9 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.12.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/grpc v1.60.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/deployment/go.sum b/deployment/go.sum new file mode 100644 index 0000000..b90f0e3 --- /dev/null +++ b/deployment/go.sum @@ -0,0 +1,312 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA= +github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= +github.com/containerd/containerd v1.7.7 h1:QOC2K4A42RQpcrZyptP6z9EJZnlHfHJUfZrAAHe15q4= +github.com/containerd/containerd v1.7.7/go.mod h1:3c4XZv6VeT9qgf9GMTxNTMFxGJrGpI2vz1yk4ye+YY8= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= +github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.6+incompatible h1:hceabKCtUgDqPu+qm0NgsaXf28Ljf4/pWFL7xjWWDgE= +github.com/docker/docker v24.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= +github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c= +github.com/testcontainers/testcontainers-go v0.26.0/go.mod h1:ICriE9bLX5CLxL9OFQ2N+2N+f+803LNJ1utJb1+Inx0= +github.com/testcontainers/testcontainers-go/modules/k3s v0.26.0 h1:qplNQ5YPVbltj5ftI++5L/OuJF8KkiiRIhg/h/cGNNc= +github.com/testcontainers/testcontainers-go/modules/k3s v0.26.0/go.mod h1:MEYf63TBYKdGlZ22N/ZszOVS35ulNx9xMJBg2lLksdw= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= +golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 h1:kzJAXnzZoFbe5bhZd4zjUuHos/I31yH4thfMb/13oVY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= +google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= +google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= +google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= +k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= +k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= +k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= +k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= +k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/go.work b/go.work index dc3f2fa..df565cc 100644 --- a/go.work +++ b/go.work @@ -1,6 +1,7 @@ go 1.21.5 use ( - ./lib - ./api/v1 + ./lib + ./deployment + ./api/v1 ) From 6c7e2bb531f545e359259aca7d2937cc0be52520 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 16 Dec 2023 20:31:20 -0800 Subject: [PATCH 09/21] changed out of v1 --- api/{v1 => }/README.md | 0 api/{v1 => }/api/api.go | 0 api/{v1 => }/api/api_test.go | 0 api/{v1 => }/api/codon_tables/README.md | 0 api/{v1 => }/api/codon_tables/freqB.json | 0 api/{v1 => }/api/codon_tables/pichia.json | 0 .../api/codon_tables/scerevisiae.json | 0 api/{v1 => }/api/converters.go | 0 api/{v1 => }/api/json/json.go | 0 api/{v1 => }/api/json/json.lua | 0 api/{v1 => }/api/json/json_test.go | 0 api/{v1 => }/api/lua.go | 0 api/{v1 => }/api/lua_test.go | 0 api/{v1 => }/api/templates/index.html | 0 api/{v1 => }/gen/dnadesign-server.gen.go | 0 api/{v1 => }/gen/dnadesign-types.gen.go | 0 api/{v1 => }/gen/gen.sh | 0 api/{v1 => }/gen/server.cfg.yaml | 0 api/{v1 => }/gen/types.cfg.yaml | 0 api/{v1 => }/go.mod | 0 api/{v1 => }/go.sum | 0 api/{v1 => }/main.go | 0 api/{v1 => }/spec.yaml | 0 deployment/go.mod | 1 - deployment/go.sum | 16 +---- go.work | 6 +- go.work.sum | 66 ------------------- 27 files changed, 4 insertions(+), 85 deletions(-) rename api/{v1 => }/README.md (100%) rename api/{v1 => }/api/api.go (100%) rename api/{v1 => }/api/api_test.go (100%) rename api/{v1 => }/api/codon_tables/README.md (100%) rename api/{v1 => }/api/codon_tables/freqB.json (100%) rename api/{v1 => }/api/codon_tables/pichia.json (100%) rename api/{v1 => }/api/codon_tables/scerevisiae.json (100%) rename api/{v1 => }/api/converters.go (100%) rename api/{v1 => }/api/json/json.go (100%) rename api/{v1 => }/api/json/json.lua (100%) rename api/{v1 => }/api/json/json_test.go (100%) rename api/{v1 => }/api/lua.go (100%) rename api/{v1 => }/api/lua_test.go (100%) rename api/{v1 => }/api/templates/index.html (100%) rename api/{v1 => }/gen/dnadesign-server.gen.go (100%) rename api/{v1 => }/gen/dnadesign-types.gen.go (100%) rename api/{v1 => }/gen/gen.sh (100%) rename api/{v1 => }/gen/server.cfg.yaml (100%) rename api/{v1 => }/gen/types.cfg.yaml (100%) rename api/{v1 => }/go.mod (100%) rename api/{v1 => }/go.sum (100%) rename api/{v1 => }/main.go (100%) rename api/{v1 => }/spec.yaml (100%) diff --git a/api/v1/README.md b/api/README.md similarity index 100% rename from api/v1/README.md rename to api/README.md diff --git a/api/v1/api/api.go b/api/api/api.go similarity index 100% rename from api/v1/api/api.go rename to api/api/api.go diff --git a/api/v1/api/api_test.go b/api/api/api_test.go similarity index 100% rename from api/v1/api/api_test.go rename to api/api/api_test.go diff --git a/api/v1/api/codon_tables/README.md b/api/api/codon_tables/README.md similarity index 100% rename from api/v1/api/codon_tables/README.md rename to api/api/codon_tables/README.md diff --git a/api/v1/api/codon_tables/freqB.json b/api/api/codon_tables/freqB.json similarity index 100% rename from api/v1/api/codon_tables/freqB.json rename to api/api/codon_tables/freqB.json diff --git a/api/v1/api/codon_tables/pichia.json b/api/api/codon_tables/pichia.json similarity index 100% rename from api/v1/api/codon_tables/pichia.json rename to api/api/codon_tables/pichia.json diff --git a/api/v1/api/codon_tables/scerevisiae.json b/api/api/codon_tables/scerevisiae.json similarity index 100% rename from api/v1/api/codon_tables/scerevisiae.json rename to api/api/codon_tables/scerevisiae.json diff --git a/api/v1/api/converters.go b/api/api/converters.go similarity index 100% rename from api/v1/api/converters.go rename to api/api/converters.go diff --git a/api/v1/api/json/json.go b/api/api/json/json.go similarity index 100% rename from api/v1/api/json/json.go rename to api/api/json/json.go diff --git a/api/v1/api/json/json.lua b/api/api/json/json.lua similarity index 100% rename from api/v1/api/json/json.lua rename to api/api/json/json.lua diff --git a/api/v1/api/json/json_test.go b/api/api/json/json_test.go similarity index 100% rename from api/v1/api/json/json_test.go rename to api/api/json/json_test.go diff --git a/api/v1/api/lua.go b/api/api/lua.go similarity index 100% rename from api/v1/api/lua.go rename to api/api/lua.go diff --git a/api/v1/api/lua_test.go b/api/api/lua_test.go similarity index 100% rename from api/v1/api/lua_test.go rename to api/api/lua_test.go diff --git a/api/v1/api/templates/index.html b/api/api/templates/index.html similarity index 100% rename from api/v1/api/templates/index.html rename to api/api/templates/index.html diff --git a/api/v1/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go similarity index 100% rename from api/v1/gen/dnadesign-server.gen.go rename to api/gen/dnadesign-server.gen.go diff --git a/api/v1/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go similarity index 100% rename from api/v1/gen/dnadesign-types.gen.go rename to api/gen/dnadesign-types.gen.go diff --git a/api/v1/gen/gen.sh b/api/gen/gen.sh similarity index 100% rename from api/v1/gen/gen.sh rename to api/gen/gen.sh diff --git a/api/v1/gen/server.cfg.yaml b/api/gen/server.cfg.yaml similarity index 100% rename from api/v1/gen/server.cfg.yaml rename to api/gen/server.cfg.yaml diff --git a/api/v1/gen/types.cfg.yaml b/api/gen/types.cfg.yaml similarity index 100% rename from api/v1/gen/types.cfg.yaml rename to api/gen/types.cfg.yaml diff --git a/api/v1/go.mod b/api/go.mod similarity index 100% rename from api/v1/go.mod rename to api/go.mod diff --git a/api/v1/go.sum b/api/go.sum similarity index 100% rename from api/v1/go.sum rename to api/go.sum diff --git a/api/v1/main.go b/api/main.go similarity index 100% rename from api/v1/main.go rename to api/main.go diff --git a/api/v1/spec.yaml b/api/spec.yaml similarity index 100% rename from api/v1/spec.yaml rename to api/spec.yaml diff --git a/deployment/go.mod b/deployment/go.mod index b7a3823..b315d29 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -71,7 +71,6 @@ require ( golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.12.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/grpc v1.60.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index b90f0e3..f6429b7 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -57,7 +57,6 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -191,7 +190,6 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -200,17 +198,14 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -239,7 +234,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -258,18 +252,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 h1:kzJAXnzZoFbe5bhZd4zjUuHos/I31yH4thfMb/13oVY= google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= -google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= -google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/go.work b/go.work index df565cc..31c6f7b 100644 --- a/go.work +++ b/go.work @@ -1,7 +1,7 @@ go 1.21.5 use ( - ./lib - ./deployment - ./api/v1 + ./lib + ./deployment + ./api ) diff --git a/go.work.sum b/go.work.sum index bd71461..9ede684 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,68 +1,2 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= -github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= -github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= -github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= -github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= -github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9/go.mod h1:ldkoR3iXABBeqlTibQ3MYaviA1oSlPvim6f55biwBh4= -github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= -github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= -github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= -github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From d5205f71762cd0595cd2ada53161e8d517e5488d Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 16 Dec 2023 20:40:49 -0800 Subject: [PATCH 10/21] add go.work.sum --- go.work.sum | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go.work.sum b/go.work.sum index 9ede684..a109a2c 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,2 +1,5 @@ +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= From 8a7bccb04b9e1dd8336425d2dff9e47a15c2b986 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sun, 17 Dec 2023 23:36:12 -0800 Subject: [PATCH 11/21] deployment integration --- deployment/dockerfiles/api.Dockerfile | 21 ++ deployment/{ => tests}/basic_test.go | 0 go.work.sum | 380 ++++++++++++++++++++++++++ 3 files changed, 401 insertions(+) create mode 100644 deployment/dockerfiles/api.Dockerfile rename deployment/{ => tests}/basic_test.go (100%) diff --git a/deployment/dockerfiles/api.Dockerfile b/deployment/dockerfiles/api.Dockerfile new file mode 100644 index 0000000..a5b2240 --- /dev/null +++ b/deployment/dockerfiles/api.Dockerfile @@ -0,0 +1,21 @@ +FROM golang:1.21 AS builder +WORKDIR /app + +# Copy the go source +COPY . . + +# Download Go modules +RUN go mod download + +# Build the Go app +RUN GOOS=linux go build -o dnadesignapi api/main.go + +# Final Stage +FROM scratch + +# Copy the binary from the builder stage +COPY --from=builder /app/dnadesignapi . + +# Command to run the executable +ENTRYPOINT ["./dnadesignapi"] + diff --git a/deployment/basic_test.go b/deployment/tests/basic_test.go similarity index 100% rename from deployment/basic_test.go rename to deployment/tests/basic_test.go diff --git a/go.work.sum b/go.work.sum index a109a2c..d8890e2 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,5 +1,385 @@ +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= +github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= +github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= +github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= +github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= +github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= +github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/checkpoint-restore/go-criu/v5 v5.3.0 h1:wpFFOoomK3389ue2lAb0Boag6XPht5QYpipxmSNL4d8= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= +github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= +github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.9.1 h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4= +github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/container-orchestrated-devices/container-device-interface v0.5.4 h1:PqQGqJqQttMP5oJ/qNGEg8JttlHqGY3xDbbcKb5T9E8= +github.com/container-orchestrated-devices/container-device-interface v0.5.4/go.mod h1:DjE95rfPiiSmG7uVXtg0z6MnPm/Lx4wxKCIts0ZE0vg= +github.com/containerd/aufs v1.0.0 h1:2oeJiwX5HstO7shSrPZjrohJZLzK36wvpdmzDRkL/LY= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/btrfs/v2 v2.0.0 h1:FN4wsx7KQrYoLXN7uLP0vBV4oVWHOIKDRQ1G2Z0oL5M= +github.com/containerd/btrfs/v2 v2.0.0/go.mod h1:swkD/7j9HApWpzl8OHfrHNxppPd9l44DFZdF94BUj9k= +github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= +github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= +github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= +github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= +github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= +github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= +github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= +github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= +github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU= +github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM= +github.com/containerd/go-runc v1.0.0 h1:oU+lLv1ULm5taqgV/CJivypVODI4SUz1znWjv3nNYS0= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/imgcrypt v1.1.7 h1:WSf9o9EQ0KGHiUx2ESFZ+PKf4nxK9BcvV/nJDX8RkB4= +github.com/containerd/imgcrypt v1.1.7/go.mod h1:FD8gqIcX5aTotCtOmjeCsi3A1dHmTZpnMISGKSczt4k= +github.com/containerd/nri v0.4.0 h1:PjgIBm0RtUiFyEO6JqPBQZRQicbsIz41Fz/5VSC0zgw= +github.com/containerd/nri v0.4.0/go.mod h1:Zw9q2lP16sdg0zYybemZ9yTDy8g7fPCIB3KXOGlggXI= +github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= +github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= +github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs= +github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= +github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= +github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= +github.com/containerd/zfs v1.1.0 h1:n7OZ7jZumLIqNJqXrEc/paBM840mORnmGdJDmAmJZHM= +github.com/containerd/zfs v1.1.0/go.mod h1:oZF9wBnrnQjpWLaPKEinrx3TQ9a+W/RJO7Zb41d8YLE= +github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ= +github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/plugins v1.2.0 h1:SWgg3dQG1yzUo4d9iD8cwSVh1VqI+bP7mkPDoSfP9VU= +github.com/containernetworking/plugins v1.2.0/go.mod h1:/VjX4uHecW5vVimFa1wkG4s+r/s9qIfPdqlLF4TW8c4= +github.com/containers/ocicrypt v1.1.6 h1:uoG52u2e91RE4UqmBICZY8dNshgfvkdl3BW6jnxiFaI= +github.com/containers/ocicrypt v1.1.6/go.mod h1:WgjxPWdTJMqYMjf3M6cuIFFA1/MpyyhIM99YInA+Rvc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d h1:1iy2qD6JEhHKKhUOA9IWs7mjco7lnw2qx8FsRI2wirE= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= +github.com/docker/cli v23.0.3+incompatible h1:Zcse1DuDqBdgI7OQDV8Go7b83xLgfhW1eza4HfEdxpY= +github.com/docker/cli v23.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= +github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= +github.com/envoyproxy/go-control-plane v0.11.1 h1:wSUXTlLfiAQRWs2F+p+EKOY9rUyis1MyGqJ2DIk5HpM= +github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= +github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88= +github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= +github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 h1:uK3X/2mt4tbSGoHvbLBHUny7CKiuwUip3MArtukol4E= +github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/go-containerregistry v0.14.0 h1:z58vMqHxuwvAsVwvKEkmVBz2TlgBgH5k6koEXBtlYkw= +github.com/google/go-containerregistry v0.14.0/go.mod h1:aiJ2fp/SXvkWgmYHioXnbMdlgB8eXiiYOY55gfN91Wk= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/intel/goresctrl v0.3.0 h1:K2D3GOzihV7xSBedGxONSlaw/un1LZgWsc9IfqipN4c= +github.com/intel/goresctrl v0.3.0/go.mod h1:fdz3mD85cmP9sHD8JUlrNWAxvwM86CrbmVXltEKd7zk= +github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw= +github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= +github.com/kataras/blocks v0.0.7 h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4= +github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= +github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= +github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= +github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9 h1:Vx8kDVhO2qepK8w44lBtp+RzN3ld743i+LYPzODJSpQ= +github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9/go.mod h1:ldkoR3iXABBeqlTibQ3MYaviA1oSlPvim6f55biwBh4= +github.com/kataras/pio v0.0.12 h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w= +github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= +github.com/kataras/sitemap v0.0.6 h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY= +github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= +github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA= +github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= +github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM= +github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= +github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= +github.com/lestrrat-go/blackmagic v1.0.0 h1:XzdxDbuQTz0RZZEmdU7cnQxUtFUzgCSPq8RCz4BxIi4= +github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= +github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= +github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= +github.com/lestrrat-go/iter v1.0.1 h1:q8faalr2dY6o8bV45uwrxq12bRa1ezKrB6oM9FUgN4A= +github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= +github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= +github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= +github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4= +github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= +github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3 h1:jUp75lepDg0phMUJBCmvaeFDldD2N3S1lBuPwUTszio= +github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= +github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw= +github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= +github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= +github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/mistifyio/go-zfs/v3 v3.0.1 h1:YaoXgBePoMA12+S1u/ddkv+QqxcfiZK4prI6HPnkFiU= +github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= +github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= +github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/symlink v0.2.0 h1:tk1rOM+Ljp0nFmfOIBtlV3rTDlWOwFRhjEeAhZB0nZc= +github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= +github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/open-policy-agent/opa v0.42.2 h1:qocVAKyjrqMjCqsU02S/gHyLr4AQQ9xMtuV1kKnnyhM= +github.com/open-policy-agent/opa v0.42.2/go.mod h1:MrmoTi/BsKWT58kXlVayBb+rYVeaMwuBm3nYAN3923s= +github.com/opencontainers/runtime-spec v1.1.0-rc.1 h1:wHa9jroFfKGQqFHj0I1fMRKLl0pfj+ynAqBxo3v6u9w= +github.com/opencontainers/runtime-spec v1.1.0-rc.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 h1:DmNGcqH3WDbV5k8OJ+esPWbqUOX5rMLR2PMvziDMJi0= +github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626/go.mod h1:BRHJJd0E+cx42OybVYSgUvZmU0B8P9gZuRXlZUP7TKI= +github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= +github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 h1:RpforrEYXWkmGwJHIGnLZ3tTWStkjVVstwzNGqxX2Ds= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 h1:lIOOHPEbXzO3vnmx2gok1Tfs31Q8GQqKLc8vVqyQq/I= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= +github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= +github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RUB4zA= +github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= +github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= +github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= +github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= +github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc= +github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= +github.com/veraison/go-cose v1.0.0-rc.1 h1:4qA7dbFJGvt7gcqv5MCIyCQvN+NpHFPkW7do3EeDLb8= +github.com/veraison/go-cose v1.0.0-rc.1/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= +github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs= +github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= +github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/yashtewari/glob-intersection v0.1.0 h1:6gJvMYQlTDOL3dMsPF6J0+26vwX9MB8/1q3uAdhmTrg= +github.com/yashtewari/glob-intersection v0.1.0/go.mod h1:LK7pIC3piUjovexikBbJ26Yml7g8xa5bsjfx2v1fwok= +github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= +github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 h1:A/5uWzF44DlIgdm/PQFwfMkW0JX+cIcQi/SwLAmZP5M= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 h1:5jD3teb4Qh7mx/nfzq4jO2WFFpvXD0vYWFDrdvNWmXk= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0/go.mod h1:UMklln0+MRhZC4e3PwmN3pCtq4DyIadWw4yikh6bNrw= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4= +go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs= +go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= +golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +k8s.io/apiserver v0.26.2 h1:Pk8lmX4G14hYqJd1poHGC08G03nIHVqdJMR0SD3IH3o= +k8s.io/apiserver v0.26.2/go.mod h1:GHcozwXgXsPuOJ28EnQ/jXEM9QeG6HT22YxSNmpYNh8= +k8s.io/component-base v0.26.2 h1:IfWgCGUDzrD6wLLgXEstJKYZKAFS2kO+rBRi0p3LqcI= +k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= +k8s.io/cri-api v0.27.1 h1:KWO+U8MfI9drXB/P4oU9VchaWYOlwDglJZVHWMpTT3Q= +k8s.io/cri-api v0.27.1/go.mod h1:+Ts/AVYbIo04S86XbTD73UPp/DkTiYxtsFeOFEu32L0= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= From 9fb768bb521de84beefb9b9182e616f7b6361dac Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 18 Dec 2023 08:49:49 -0800 Subject: [PATCH 12/21] add dockerfile creation to script --- deployment/dockerfiles/dockerfiles_test.go | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 deployment/dockerfiles/dockerfiles_test.go diff --git a/deployment/dockerfiles/dockerfiles_test.go b/deployment/dockerfiles/dockerfiles_test.go new file mode 100644 index 0000000..751c4b9 --- /dev/null +++ b/deployment/dockerfiles/dockerfiles_test.go @@ -0,0 +1,51 @@ +package dockerfiles_test + +import ( + "context" + "testing" + + "github.com/docker/docker/api/types" + testcontainers "github.com/testcontainers/testcontainers-go" +) + +func TestApiDockerfile(t *testing.T) { + provider, err := testcontainers.NewDockerProvider() + if err != nil { + t.Fatal(err) + } + defer provider.Close() + + cli := provider.Client() + + ctx := context.Background() + + tag, err := provider.BuildImage(ctx, &testcontainers.ContainerRequest{ + FromDockerfile: testcontainers.FromDockerfile{ + Context: "../../.", + Dockerfile: "deployment/dockerfiles/api.Dockerfile", + Repo: "dnadesignapi", + Tag: "test", + }, + }) + if err != nil { + t.Errorf("BuildImage should be nil. Got err: %s", err) + } + if tag != "dnadesignapi:test" { + t.Errorf("Improper tag set. \nGot: %s\nExpect:%s", tag, "dnadesignapi:test") + } + + _, _, err = cli.ImageInspectWithRaw(ctx, tag) + if err != nil { + t.Errorf("ImageInspect should be nil. Got err: %s", err) + } + + t.Cleanup(func() { + _, err := cli.ImageRemove(ctx, tag, types.ImageRemoveOptions{ + Force: true, + PruneChildren: true, + }) + if err != nil { + t.Fatal(err) + } + }) +} From e75db308681b56f7c293cce9ef8c7c44f6ae623a Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 18 Dec 2023 12:17:18 -0800 Subject: [PATCH 13/21] Add deployment tests --- .github/workflows/deployment_test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/deployment_test.yml diff --git a/.github/workflows/deployment_test.yml b/.github/workflows/deployment_test.yml new file mode 100644 index 0000000..7cc9ee5 --- /dev/null +++ b/.github/workflows/deployment_test.yml @@ -0,0 +1,24 @@ +on: + push: + tags: + - v* + branches: + - main + pull_request: +name: Deployment Test +jobs: + test: + strategy: + matrix: + go-version: [1.21.x,] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test Deployments + run: go test -v ./deployment/... From c51aff9005281bd562775f32dd2b7f5ccbf2a019 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 25 Dec 2023 22:39:20 -0800 Subject: [PATCH 14/21] Now using scalar, changed spec to include all desired functionality --- api/api/api.go | 523 +++++++++++-- api/api/api_test.go | 19 +- api/api/json/json.go | 6 +- api/api/lua.go | 249 ------ api/api/templates/scalar.html | 23 + api/gen/dnadesign-server.gen.go | 1219 ++++++++++++++++++++++-------- api/gen/dnadesign-types.gen.go | 161 ++-- api/go.mod | 1 - api/go.sum | 2 - api/spec.yaml | 1255 +++++++++++++++++++++++++++++-- 10 files changed, 2749 insertions(+), 709 deletions(-) delete mode 100644 api/api/lua.go create mode 100644 api/api/templates/scalar.html diff --git a/api/api/api.go b/api/api/api.go index 916e872..487135a 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -3,23 +3,25 @@ package api import ( "context" "embed" - _ "embed" + "encoding/json" "fmt" "html/template" "io/fs" "log" "log/slog" "net/http" + "net/http/httptest" "strings" "sync" - "github.com/flowchartsman/swaggerui" + luajson "github.com/koeng101/dnadesign/api/api/json" "github.com/koeng101/dnadesign/api/gen" "github.com/koeng101/dnadesign/lib/bio" "github.com/koeng101/dnadesign/lib/primers/pcr" "github.com/koeng101/dnadesign/lib/synthesis/codon" "github.com/koeng101/dnadesign/lib/synthesis/fix" "github.com/koeng101/dnadesign/lib/synthesis/fragment" + lua "github.com/yuin/gopher-lua" ) //go:embed codon_tables/freqB.json @@ -36,6 +38,12 @@ var ( var templatesFS embed.FS var templates = template.Must(template.ParseFS(templatesFS, "templates/*")) +// App implements the dnadesign app +type App struct { + Router *http.ServeMux + Logger *slog.Logger +} + // IndexHandler handles the basic HTML page for interacting with polyAPI. func indexHandler(w http.ResponseWriter, r *http.Request) { err := templates.ExecuteTemplate(w, "index.html", nil) @@ -44,17 +52,19 @@ func indexHandler(w http.ResponseWriter, r *http.Request) { } } -// App implements the dnadesign app -type App struct { - Router *http.ServeMux - Logger *slog.Logger -} +// ScalarHandler serves the Scalar API documentation with jsonSwagger +func scalarHandler(jsonSwagger []byte) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + // Prepare the data for the template. Pass the jsonSwagger as a string. + data := map[string]interface{}{ + "JsonSwagger": string(jsonSwagger), // Ensure jsonSwagger is in the correct format + } -func corsMiddleware(handler http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Access-Control-Allow-Origin", "*") // Set CORS header - handler.ServeHTTP(w, r) - }) + err := templates.ExecuteTemplate(w, "scalar.html", data) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } + } } // initializeApp starts here @@ -85,8 +95,8 @@ func InitializeApp() App { // Handle routes. app.Router.HandleFunc("/", indexHandler) app.Router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(subFS)))) - app.Router.Handle("/swagger/", http.StripPrefix("/swagger", swaggerui.Handler(jsonSwagger))) - app.Router.HandleFunc("/docs", func(w http.ResponseWriter, r *http.Request) { w.Write(jsonSwagger) }) + app.Router.HandleFunc("/scalar/", scalarHandler(jsonSwagger)) + app.Router.HandleFunc("/api.json", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write(jsonSwagger) }) // Lua handlers. app.Router.HandleFunc("/api/execute_lua", appImpl.PostExecuteLua) @@ -96,14 +106,16 @@ func InitializeApp() App { app.Router.HandleFunc("/api/io/genbank/parse", appImpl.PostIoGenbankParse) // CDS design handlers. - app.Router.HandleFunc("/api/design/cds/fix", appImpl.PostDesignCdsFix) - app.Router.HandleFunc("/api/design/cds/optimize", appImpl.PostDesignCdsOptimize) - app.Router.HandleFunc("/api/design/cds/translate", appImpl.PostDesignCdsTranslate) + app.Router.HandleFunc("/api/cds/fix", appImpl.PostCdsFix) + app.Router.HandleFunc("/api/cds/optimize", appImpl.PostCdsOptimize) + app.Router.HandleFunc("/api/cds/translate", appImpl.PostCdsTranslate) + + // PCR handlers. + app.Router.HandleFunc("/api/pcr/complex_pcr", appImpl.PostPcrComplexPcr) + app.Router.HandleFunc("/api/pcr/simple_pcr", appImpl.PostPcrSimplePcr) - // Simulate handlers. - app.Router.HandleFunc("/api/simulate/fragment", appImpl.PostSimulateFragment) - app.Router.HandleFunc("/api/simulate/complex_pcr", appImpl.PostSimulateComplexPcr) - app.Router.HandleFunc("/api/simulate/pcr", appImpl.PostSimulatePcr) + // Synthesis handlers. + app.Router.HandleFunc("/api/synthesis/fragment", appImpl.PostSynthesisFragment) return app } @@ -126,6 +138,101 @@ func (app *App) PostExecuteLua(ctx context.Context, request gen.PostExecuteLuaRe return gen.PostExecuteLua200JSONResponse{Output: output, Log: log}, nil } +//go:embed json/json.lua +var luaJSON string + +func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, string, error) { + L := lua.NewState() + defer L.Close() + if err := L.DoString(luaJSON); err != nil { + panic(err) + } + + // Add attachments + luaAttachments := L.NewTable() + for _, attachment := range attachments { + luaAttachments.RawSetString(attachment.Name, lua.LString(attachment.Content)) + } + L.SetGlobal("attachments", luaAttachments) + + // Add IO functions + L.SetGlobal("fasta_parse", L.NewFunction(app.LuaIoFastaParse)) + L.SetGlobal("genbank_parse", L.NewFunction(app.LuaIoGenbankParse)) + + // Add CDS design functions + L.SetGlobal("fix", L.NewFunction(app.LuaCdsFix)) + L.SetGlobal("optimize", L.NewFunction(app.LuaCdsOptimize)) + L.SetGlobal("translate", L.NewFunction(app.LuaCdsTranslate)) + + // Add simulate functions + L.SetGlobal("fragment", L.NewFunction(app.LuaSimulateFragment)) + L.SetGlobal("complex_pcr", L.NewFunction(app.LuaSimulateComplexPcr)) + L.SetGlobal("pcr", L.NewFunction(app.LuaSimulatePcr)) + + // Execute the Lua script + if err := L.DoString(data); err != nil { + return "", "", err + } + + // Extract log and output + var logBuffer, outputBuffer string + log := L.GetGlobal("log") + if str, ok := log.(lua.LString); ok { + logBuffer = string(str) + } + output := L.GetGlobal("output") + if str, ok := output.(lua.LString); ok { + outputBuffer = string(str) + } + + return logBuffer, outputBuffer, nil +} + +// luaResponse wraps the core of the lua data -> API calls -> lua data pipeline +func (app *App) luaResponse(L *lua.LState, url, dataString string) int { + req := httptest.NewRequest("POST", url, strings.NewReader(dataString)) + resp := httptest.NewRecorder() + app.Router.ServeHTTP(resp, req) + + if resp.Code != 200 { + L.RaiseError("HTTP request failed: " + resp.Body.String()) + return 0 + } + + var data interface{} + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + L.RaiseError(err.Error()) + return 0 + } + luaData := luajson.DecodeValue(L, data) + L.Push(luaData) + return 1 +} + +// luaStringArrayToGoSlice converts a Lua table at the given index in the Lua stack to a Go slice of strings. +func luaStringArrayToGoSlice(L *lua.LState, index int) ([]string, error) { + var goStrings []string + lv := L.Get(index) + if lv.Type() != lua.LTTable { + if lv.Type() == lua.LTNil { + return []string{}, nil + } + return nil, fmt.Errorf("argument at index %d is not a table", index) + } + tbl := L.ToTable(index) + + tbl.ForEach(func(key lua.LValue, value lua.LValue) { + if str, ok := value.(lua.LString); ok { + goStrings = append(goStrings, string(str)) + } + //else { + // Handle non-string values if necessary + //} + }) + + return goStrings, nil +} + /* ***************************************************************************** @@ -151,6 +258,16 @@ func (app *App) PostIoFastaParse(ctx context.Context, request gen.PostIoFastaPar return gen.PostIoFastaParse200JSONResponse(data), nil } +// LuaIoFastaParse implements fasta_parse in lua. +func (app *App) LuaIoFastaParse(L *lua.LState) int { + fastaData := L.ToString(1) + return app.luaResponse(L, "/api/io/fasta/parse", fastaData) +} + +func (app *App) PostIoFastaWrite(ctx context.Context, request gen.PostIoFastaWriteRequestObject) (gen.PostIoFastaWriteResponseObject, error) { + return nil, nil +} + func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenbankParseRequestObject) (gen.PostIoGenbankParseResponseObject, error) { genbankString := *request.Body parser, err := bio.NewGenbankParser(strings.NewReader(genbankString + "\n")) @@ -172,6 +289,24 @@ func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenban return gen.PostIoGenbankParse200JSONResponse(data), nil } +// LuaIoGenbankParse implements genbank_parse in lua. +func (app *App) LuaIoGenbankParse(L *lua.LState) int { + genbankData := L.ToString(1) + return app.luaResponse(L, "/api/io/genbank/parse", genbankData) +} + +func (app *App) PostIoGenbankWrite(ctx context.Context, request gen.PostIoGenbankWriteRequestObject) (gen.PostIoGenbankWriteResponseObject, error) { + return nil, nil +} + +func (app *App) PostIoFastqParse(ctx context.Context, request gen.PostIoFastqParseRequestObject) (gen.PostIoFastqParseResponseObject, error) { + return nil, nil +} + +func (app *App) PostIoFastqWrite(ctx context.Context, request gen.PostIoFastqWriteRequestObject) (gen.PostIoFastqWriteResponseObject, error) { + return nil, nil +} + /* ***************************************************************************** @@ -186,33 +321,58 @@ func fixFunctions(sequencesToRemove []string) []func(string, chan fix.DnaSuggest functions = append(functions, fix.RemoveRepeat(18)) functions = append(functions, fix.GcContentFixer(0.80, 0.20)) functions = append(functions, fix.RemoveSequence([]string{"GGTCTC", "GAAGAC", "CACCTGC"}, "Common TypeIIS restriction enzymes - BsaI, BbsI, PaqCI")) + functions = append(functions, fix.RemoveSequence(sequencesToRemove, "User requested sequence removal")) return functions } -func (app *App) PostDesignCdsFix(ctx context.Context, request gen.PostDesignCdsFixRequestObject) (gen.PostDesignCdsFixResponseObject, error) { +func (app *App) PostCdsFix(ctx context.Context, request gen.PostCdsFixRequestObject) (gen.PostCdsFixResponseObject, error) { var ct codon.Table organism := string(request.Body.Organism) ct, ok := CodonTables[organism] if !ok { - return gen.PostDesignCdsFix400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil + return gen.PostCdsFix400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil } sequence, fixChanges, err := fix.Cds(request.Body.Sequence, ct, fixFunctions(request.Body.RemoveSequences)) if err != nil { - return gen.PostDesignCdsFix500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + return gen.PostCdsFix500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil } changes := make([]gen.Change, len(fixChanges)) for i, change := range fixChanges { changes[i] = gen.Change{From: change.From, Position: change.Position, Reason: change.Reason, Step: change.Step, To: change.To} } - return gen.PostDesignCdsFix200JSONResponse{Sequence: sequence, Changes: changes}, nil + return gen.PostCdsFix200JSONResponse{Sequence: sequence, Changes: changes}, nil +} + +// LuaCdsFix implements fix in lua. +func (app *App) LuaCdsFix(L *lua.LState) int { + sequence := L.ToString(1) + organism := L.ToString(2) + removeSequences, err := luaStringArrayToGoSlice(L, 3) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + + type fix struct { + Sequence string `json:"sequence"` + Organism string `json:"organism"` + RemoveSequences []string `json:"remove_sequences"` + } + req := &fix{Sequence: sequence, Organism: organism, RemoveSequences: removeSequences} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/cds/fix", string(b)) } -func (app *App) PostDesignCdsOptimize(ctx context.Context, request gen.PostDesignCdsOptimizeRequestObject) (gen.PostDesignCdsOptimizeResponseObject, error) { +func (app *App) PostCdsOptimize(ctx context.Context, request gen.PostCdsOptimizeRequestObject) (gen.PostCdsOptimizeResponseObject, error) { var ct *codon.TranslationTable organism := string(request.Body.Organism) ct, ok := CodonTables[organism] if !ok { - return gen.PostDesignCdsOptimize400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil + return gen.PostCdsOptimize400TextResponse(fmt.Sprintf("Organism not found. Got: %s, Need one of the following: %v", organism, []string{"Escherichia coli"})), nil } var seed int64 if request.Body.Seed != nil { @@ -220,45 +380,71 @@ func (app *App) PostDesignCdsOptimize(ctx context.Context, request gen.PostDesig } sequence, err := ct.Optimize(request.Body.Sequence, seed) if err != nil { - return gen.PostDesignCdsOptimize500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + return gen.PostCdsOptimize500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostCdsOptimize200JSONResponse(sequence), nil +} + +// LuaCdsOptimize implements optimize in lua. +func (app *App) LuaCdsOptimize(L *lua.LState) int { + sequence := L.ToString(1) + organism := L.ToString(2) + seed := L.ToInt(3) + + type optimize struct { + Sequence string `json:"sequence"` + Organism string `json:"organism"` + Seed int `json:"seed"` + } + req := &optimize{Sequence: sequence, Organism: organism, Seed: seed} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 } - return gen.PostDesignCdsOptimize200JSONResponse(sequence), nil + return app.luaResponse(L, "/api/cds/optimize", string(b)) } -func (app *App) PostDesignCdsTranslate(ctx context.Context, request gen.PostDesignCdsTranslateRequestObject) (gen.PostDesignCdsTranslateResponseObject, error) { +func (app *App) PostCdsTranslate(ctx context.Context, request gen.PostCdsTranslateRequestObject) (gen.PostCdsTranslateResponseObject, error) { translationTableInteger := request.Body.TranslationTable ct := codon.NewTranslationTable(translationTableInteger) if ct == nil { - return gen.PostDesignCdsTranslate500TextResponse(fmt.Sprintf("Translation table of %d not found.", translationTableInteger)), nil + return gen.PostCdsTranslate500TextResponse(fmt.Sprintf("Translation table of %d not found.", translationTableInteger)), nil } sequence, err := ct.Translate(request.Body.Sequence) if err != nil { - return gen.PostDesignCdsTranslate500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + return gen.PostCdsTranslate500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostCdsTranslate200JSONResponse(sequence), nil +} + +// LuaCdsTranslate implements translate in lua. +func (app *App) LuaCdsTranslate(L *lua.LState) int { + sequence := L.ToString(1) + translationTable := L.ToInt(2) + + type translate struct { + Sequence string `json:"sequence"` + TranslationTable int `json:"translation_table"` + } + req := &translate{Sequence: sequence, TranslationTable: translationTable} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 } - return gen.PostDesignCdsTranslate200JSONResponse(sequence), nil + return app.luaResponse(L, "/api/cds/translate", string(b)) } /* ***************************************************************************** -# Simulation begins here. +# PCR functions ***************************************************************************** */ -func (app *App) PostSimulateFragment(ctx context.Context, request gen.PostSimulateFragmentRequestObject) (gen.PostSimulateFragmentResponseObject, error) { - var excludeOverhangs []string - overhangs := *request.Body.ExcludeOverhangs - if overhangs != nil { - excludeOverhangs = overhangs - } - fragments, efficiency, err := fragment.Fragment(request.Body.Sequence, request.Body.MinFragmentSize, request.Body.MaxFragmentSize, excludeOverhangs) - if err != nil { - return gen.PostSimulateFragment500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil - } - return gen.PostSimulateFragment200JSONResponse{Fragments: fragments, Efficiency: float32(efficiency)}, nil -} -func (app *App) PostSimulateComplexPcr(ctx context.Context, request gen.PostSimulateComplexPcrRequestObject) (gen.PostSimulateComplexPcrResponseObject, error) { +func (app *App) PostPcrComplexPcr(ctx context.Context, request gen.PostPcrComplexPcrRequestObject) (gen.PostPcrComplexPcrResponseObject, error) { var circular bool circularPointer := request.Body.Circular if circularPointer != nil { @@ -266,11 +452,36 @@ func (app *App) PostSimulateComplexPcr(ctx context.Context, request gen.PostSimu } amplicons, err := pcr.Simulate(request.Body.Templates, float64(request.Body.TargetTm), circular, request.Body.Primers) if err != nil { - return gen.PostSimulateComplexPcr500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + return gen.PostPcrComplexPcr500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil } - return gen.PostSimulateComplexPcr200JSONResponse(amplicons), nil + return gen.PostPcrComplexPcr200JSONResponse(amplicons), nil } -func (app *App) PostSimulatePcr(ctx context.Context, request gen.PostSimulatePcrRequestObject) (gen.PostSimulatePcrResponseObject, error) { + +// LuaSimulateComplexPcr implements complex pcr in lua. +func (app *App) LuaSimulateComplexPcr(L *lua.LState) int { + templates, err := luaStringArrayToGoSlice(L, 1) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + primers, err := luaStringArrayToGoSlice(L, 2) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + targetTm := L.ToNumber(3) + circular := L.ToBool(4) + + req := &gen.PostPcrComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: float32(targetTm), Templates: templates} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/pcr/complex_pcr", string(b)) +} + +func (app *App) PostPcrSimplePcr(ctx context.Context, request gen.PostPcrSimplePcrRequestObject) (gen.PostPcrSimplePcrResponseObject, error) { var circular bool circularPointer := request.Body.Circular if circularPointer != nil { @@ -278,16 +489,218 @@ func (app *App) PostSimulatePcr(ctx context.Context, request gen.PostSimulatePcr } amplicons := pcr.SimulateSimple([]string{request.Body.Template}, float64(request.Body.TargetTm), circular, []string{request.Body.ForwardPrimer, request.Body.ReversePrimer}) if len(amplicons) == 0 { - return gen.PostSimulatePcr500TextResponse("Got no amplicons"), nil + return gen.PostPcrSimplePcr500TextResponse("Got no amplicons"), nil + } + return gen.PostPcrSimplePcr200JSONResponse(amplicons[0]), nil +} + +// LuaSimulatePcr implements pcr in lua +func (app *App) LuaSimulatePcr(L *lua.LState) int { + template := L.ToString(1) + forwardPrimer := L.ToString(2) + reversePrimer := L.ToString(3) + targetTm := L.ToNumber(4) + circular := L.ToBool(5) + + req := &gen.PostPcrSimplePcrJSONBody{Circular: &circular, Template: template, TargetTm: float32(targetTm), ForwardPrimer: forwardPrimer, ReversePrimer: reversePrimer} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 } - return gen.PostSimulatePcr200JSONResponse(amplicons[0]), nil + return app.luaResponse(L, "/api/pcr/simple_pcr", string(b)) +} + +func (app *App) PostPcrPrimersDebruijnBarcodes(ctx context.Context, request gen.PostPcrPrimersDebruijnBarcodesRequestObject) (gen.PostPcrPrimersDebruijnBarcodesResponseObject, error) { + return nil, nil +} + +func (app *App) PostPcrPrimersMarmurDoty(ctx context.Context, request gen.PostPcrPrimersMarmurDotyRequestObject) (gen.PostPcrPrimersMarmurDotyResponseObject, error) { + return nil, nil +} + +func (app *App) PostPcrPrimersSantaLucia(ctx context.Context, request gen.PostPcrPrimersSantaLuciaRequestObject) (gen.PostPcrPrimersSantaLuciaResponseObject, error) { + return nil, nil +} + +func (app *App) PostPcrPrimersMeltingTemperature(ctx context.Context, request gen.PostPcrPrimersMeltingTemperatureRequestObject) (gen.PostPcrPrimersMeltingTemperatureResponseObject, error) { + return nil, nil } -func (app *App) PostSimulateGoldengate(ctx context.Context, request gen.PostSimulateGoldengateRequestObject) (gen.PostSimulateGoldengateResponseObject, error) { + +/* +***************************************************************************** + +# Cloning functions + +***************************************************************************** +*/ + +func (app *App) PostCloningGoldengate(ctx context.Context, request gen.PostCloningGoldengateRequestObject) (gen.PostCloningGoldengateResponseObject, error) { return nil, nil } -func (app *App) PostSimulateLigate(ctx context.Context, request gen.PostSimulateLigateRequestObject) (gen.PostSimulateLigateResponseObject, error) { +func (app *App) PostCloningLigate(ctx context.Context, request gen.PostCloningLigateRequestObject) (gen.PostCloningLigateResponseObject, error) { return nil, nil } -func (app *App) PostSimulateRestrictionDigest(ctx context.Context, request gen.PostSimulateRestrictionDigestRequestObject) (gen.PostSimulateRestrictionDigestResponseObject, error) { +func (app *App) PostCloningRestrictionDigest(ctx context.Context, request gen.PostCloningRestrictionDigestRequestObject) (gen.PostCloningRestrictionDigestResponseObject, error) { return nil, nil } +func (app *App) PostSynthesisFragment(ctx context.Context, request gen.PostSynthesisFragmentRequestObject) (gen.PostSynthesisFragmentResponseObject, error) { + var excludeOverhangs []string + overhangs := *request.Body.ExcludeOverhangs + if overhangs != nil { + excludeOverhangs = overhangs + } + fragments, efficiency, err := fragment.Fragment(request.Body.Sequence, request.Body.MinFragmentSize, request.Body.MaxFragmentSize, excludeOverhangs) + if err != nil { + return gen.PostSynthesisFragment500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + } + return gen.PostSynthesisFragment200JSONResponse{Fragments: fragments, Efficiency: float32(efficiency)}, nil +} + +// LuaSimulateFragment implements fragment in lua. +func (app *App) LuaSimulateFragment(L *lua.LState) int { + sequence := L.ToString(1) + minFragmentSize := L.ToInt(2) + maxFragmentSize := L.ToInt(3) + excludeOverhangs, err := luaStringArrayToGoSlice(L, 4) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + + type fragmentStruct struct { + Sequence string `json:"sequence"` + MinFragmentSize int `json:"min_fragment_size"` + MaxFragmentSize int `json:"max_fragment_size"` + ExcludeOverhangs []string `json:"exclude_overhangs"` + } + req := &fragmentStruct{Sequence: sequence, MinFragmentSize: minFragmentSize, MaxFragmentSize: maxFragmentSize, ExcludeOverhangs: excludeOverhangs} + b, err := json.Marshal(req) + if err != nil { + L.RaiseError(err.Error()) + return 0 + } + return app.luaResponse(L, "/api/synthesis/fragment", string(b)) +} + +/* +***************************************************************************** + +# Folding functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +// +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +// +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} + +/* +***************************************************************************** + +# Seqhash functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} + +/* +***************************************************************************** + +# CodonTable functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} + +/* +***************************************************************************** + +# Alignment functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} + +/* +***************************************************************************** + +# Utility functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} + +/* +***************************************************************************** + +# Random functions + +***************************************************************************** +*/ + +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +// +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +// +//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { +// return nil, nil +//} +// diff --git a/api/api/api_test.go b/api/api/api_test.go index a825701..293b90f 100644 --- a/api/api/api_test.go +++ b/api/api/api_test.go @@ -94,11 +94,11 @@ ORIGIN } func TestFix(t *testing.T) { - req := httptest.NewRequest("POST", "/api/design/cds/fix", strings.NewReader(`{"organism":"Escherichia coli","sequence":"ATGGGTCTCTAA","removeSequences":["GGTCTC"]}`)) + req := httptest.NewRequest("POST", "/api/cds/fix", strings.NewReader(`{"organism":"Escherichia coli","sequence":"ATGCGTCTCTAA","removeSequences":["CGTCTC"]}`)) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) - r := `{"changes":[{"From":"CTC","Position":2,"Reason":"Common TypeIIS restriction enzymes - BsaI, BbsI, PaqCI","Step":0,"To":"CTG"}],"sequence":"ATGGGTCTGTAA"}` + r := `{"changes":[{"From":"CTC","Position":2,"Reason":"User requested sequence removal","Step":0,"To":"CTG"}],"sequence":"ATGCGTCTGTAA"}` if strings.TrimSpace(resp.Body.String()) != r { t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) } @@ -106,7 +106,7 @@ func TestFix(t *testing.T) { func TestOptimize(t *testing.T) { gfp := "MASKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTFSYGVQCFSRYPDHMKRHDFFKSAMPEGYVQERTISFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYITADKQKNGIKANFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK" - req := httptest.NewRequest("POST", "/api/design/cds/optimize", strings.NewReader(fmt.Sprintf(`{"organism":"Escherichia coli","sequence":"%s"}`, gfp))) + req := httptest.NewRequest("POST", "/api/cds/optimize", strings.NewReader(fmt.Sprintf(`{"organism":"Escherichia coli","sequence":"%s"}`, gfp))) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) @@ -118,7 +118,7 @@ func TestOptimize(t *testing.T) { func TestTranslate(t *testing.T) { gfp := "ATGGCATCCAAGGGCGAGGAGTTGTTCACCGGTGTTGTGCCGATCCTGGTGGAGCTGGACGGTGACGTGAACGGTCACAAATTTAGCGTGTCCGGTGAGGGTGAGGGTGATGCTACCTATGGCAAGCTGACCCTGAAATTCATTTGTACCACGGGTAAACTGCCGGTCCCGTGGCCGACGCTGGTGACCACCTTCAGCTATGGTGTGCAGTGTTTCAGCCGCTACCCGGACCACATGAAGCGCCACGACTTTTTCAAGAGCGCGATGCCGGAGGGTTATGTGCAAGAACGTACCATCAGCTTTAAAGATGATGGTAACTATAAGACCCGCGCGGAAGTCAAGTTTGAGGGTGACACGCTGGTGAATCGTATTGAGTTGAAGGGTATTGACTTTAAGGAGGATGGTAATATTTTGGGCCACAAACTGGAGTACAATTACAATAGCCACAATGTTTACATCACGGCAGATAAACAGAAGAACGGTATCAAGGCGAACTTCAAAATTCGTCACAACATTGAGGACGGTTCTGTTCAACTGGCGGACCATTACCAACAGAATACCCCGATCGGTGACGGCCCGGTTCTGCTGCCGGACAACCATTATTTGAGCACCCAGTCCGCCCTGAGCAAGGACCCGAATGAGAAGCGTGATCATATGGTTCTGCTGGAGTTTGTGACCGCGGCGGGCATCACCCACGGCATGGACGAGCTGTACAAG" - req := httptest.NewRequest("POST", "/api/design/cds/translate", strings.NewReader(fmt.Sprintf(`{"translation_table":11,"sequence":"%s"}`, gfp))) + req := httptest.NewRequest("POST", "/api/cds/translate", strings.NewReader(fmt.Sprintf(`{"translation_table":11,"sequence":"%s"}`, gfp))) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) @@ -141,7 +141,7 @@ func TestFragment(t *testing.T) { if err != nil { t.Errorf("Failed to marshal: %s", err) } - req := httptest.NewRequest("POST", "/api/simulate/fragment", bytes.NewBuffer(b)) + req := httptest.NewRequest("POST", "/api/synthesis/fragment", bytes.NewBuffer(b)) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) @@ -149,7 +149,6 @@ func TestFragment(t *testing.T) { if strings.TrimSpace(resp.Body.String()) != r { t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) } - } func TestPCR(t *testing.T) { @@ -158,12 +157,12 @@ func TestPCR(t *testing.T) { revPrimer := "TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC" primers := []string{fwdPrimer, revPrimer} circular := false - complexReq := &gen.PostSimulateComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: 55.0, Templates: []string{gene}} + complexReq := &gen.PostPcrComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: 55.0, Templates: []string{gene}} b, err := json.Marshal(complexReq) if err != nil { t.Errorf("Failed to marshal: %s", err) } - req := httptest.NewRequest("POST", "/api/simulate/complex_pcr", bytes.NewBuffer(b)) + req := httptest.NewRequest("POST", "/api/pcr/complex_pcr", bytes.NewBuffer(b)) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) r := `["TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA"]` @@ -171,12 +170,12 @@ func TestPCR(t *testing.T) { t.Errorf("Unexpected response. Expected: " + r + "\nGot: " + resp.Body.String()) } - simpleReq := &gen.PostSimulatePcrJSONBody{Circular: &circular, TargetTm: 55.0, Template: gene, ForwardPrimer: fwdPrimer, ReversePrimer: revPrimer} + simpleReq := &gen.PostPcrSimplePcrJSONBody{Circular: &circular, TargetTm: 55.0, Template: gene, ForwardPrimer: fwdPrimer, ReversePrimer: revPrimer} b, err = json.Marshal(simpleReq) if err != nil { t.Errorf("Failed to marshal: %s", err) } - req = httptest.NewRequest("POST", "/api/simulate/pcr", bytes.NewBuffer(b)) + req = httptest.NewRequest("POST", "/api/pcr/simple_pcr", bytes.NewBuffer(b)) resp = httptest.NewRecorder() app.Router.ServeHTTP(resp, req) r = `"TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA"` diff --git a/api/api/json/json.go b/api/api/json/json.go index a1652ab..d974659 100644 --- a/api/api/json/json.go +++ b/api/api/json/json.go @@ -106,11 +106,11 @@ func (j jsonValue) MarshalJSON() (data []byte, err error) { for key != lua.LNil { if key.Type() != lua.LTNumber { err = errInvalidKeys - return + return data, err } if expectedKey != key { err = errSparseArray - return + return data, err } arr = append(arr, jsonValue{value, j.visited}) expectedKey++ @@ -122,7 +122,7 @@ func (j jsonValue) MarshalJSON() (data []byte, err error) { for key != lua.LNil { if key.Type() != lua.LTString { err = errInvalidKeys - return + return data, err } obj[key.String()] = jsonValue{value, j.visited} key, value = converted.Next(key) diff --git a/api/api/lua.go b/api/api/lua.go deleted file mode 100644 index 88ddf54..0000000 --- a/api/api/lua.go +++ /dev/null @@ -1,249 +0,0 @@ -package api - -import ( - _ "embed" - "encoding/json" - "fmt" - "net/http/httptest" - "strings" - - luajson "github.com/koeng101/dnadesign/api/api/json" - "github.com/koeng101/dnadesign/api/gen" - lua "github.com/yuin/gopher-lua" -) - -//go:embed json/json.lua -var luaJson string - -func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, string, error) { - L := lua.NewState() - defer L.Close() - if err := L.DoString(luaJson); err != nil { - panic(err) - } - - // Add attachments - luaAttachments := L.NewTable() - for _, attachment := range attachments { - luaAttachments.RawSetString(attachment.Name, lua.LString(attachment.Content)) - } - L.SetGlobal("attachments", luaAttachments) - - // Add IO functions - L.SetGlobal("fasta_parse", L.NewFunction(app.LuaIoFastaParse)) - L.SetGlobal("genbank_parse", L.NewFunction(app.LuaIoGenbankParse)) - - // Add CDS design functions - L.SetGlobal("fix", L.NewFunction(app.LuaDesignCdsFix)) - L.SetGlobal("optimize", L.NewFunction(app.LuaDesignCdsOptimize)) - L.SetGlobal("translate", L.NewFunction(app.LuaDesignCdsTranslate)) - - // Add simulate functions - L.SetGlobal("fragment", L.NewFunction(app.LuaSimulateFragment)) - L.SetGlobal("complex_pcr", L.NewFunction(app.LuaSimulateComplexPcr)) - L.SetGlobal("pcr", L.NewFunction(app.LuaSimulatePcr)) - - // Execute the Lua script - if err := L.DoString(data); err != nil { - return "", "", err - } - - // Extract log and output - var logBuffer, outputBuffer string - log := L.GetGlobal("log") - if str, ok := log.(lua.LString); ok { - logBuffer = string(str) - } - output := L.GetGlobal("output") - if str, ok := output.(lua.LString); ok { - outputBuffer = string(str) - } - - return logBuffer, outputBuffer, nil -} - -// luaResponse wraps the core of the lua data -> API calls -> lua data pipeline -func (app *App) luaResponse(L *lua.LState, url, dataString string) int { - req := httptest.NewRequest("POST", url, strings.NewReader(dataString)) - resp := httptest.NewRecorder() - app.Router.ServeHTTP(resp, req) - - if resp.Code != 200 { - L.RaiseError("HTTP request failed: " + resp.Body.String()) - return 0 - } - - var data interface{} - if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { - L.RaiseError(err.Error()) - return 0 - } - luaData := luajson.DecodeValue(L, data) - L.Push(luaData) - return 1 -} - -// luaStringArrayToGoSlice converts a Lua table at the given index in the Lua stack to a Go slice of strings. -func luaStringArrayToGoSlice(L *lua.LState, index int) ([]string, error) { - var goStrings []string - lv := L.Get(index) - if lv.Type() != lua.LTTable { - if lv.Type() == lua.LTNil { - return []string{}, nil - } - return nil, fmt.Errorf("argument at index %d is not a table", index) - } - tbl := L.ToTable(index) - - tbl.ForEach(func(key lua.LValue, value lua.LValue) { - if str, ok := value.(lua.LString); ok { - goStrings = append(goStrings, string(str)) - } else { - // Handle non-string values if necessary - } - }) - - return goStrings, nil -} - -// LuaIoFastaParse implements fasta_parse in lua. -func (app *App) LuaIoFastaParse(L *lua.LState) int { - fastaData := L.ToString(1) - return app.luaResponse(L, "/api/io/fasta/parse", fastaData) -} - -// LuaIoGenbankParse implements genbank_parse in lua. -func (app *App) LuaIoGenbankParse(L *lua.LState) int { - genbankData := L.ToString(1) - return app.luaResponse(L, "/api/io/genbank/parse", genbankData) -} - -// LuaDesignCdsFix implements fix in lua. -func (app *App) LuaDesignCdsFix(L *lua.LState) int { - sequence := L.ToString(1) - organism := L.ToString(2) - removeSequences, err := luaStringArrayToGoSlice(L, 3) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - - type fix struct { - Sequence string `json:"sequence"` - Organism string `json:"organism"` - RemoveSequences []string `json:"remove_sequences"` - } - req := &fix{Sequence: sequence, Organism: organism, RemoveSequences: removeSequences} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/design/cds/fix", string(b)) -} - -// LuaDesignCdsOptimize implements optimize in lua. -func (app *App) LuaDesignCdsOptimize(L *lua.LState) int { - sequence := L.ToString(1) - organism := L.ToString(2) - seed := L.ToInt(3) - - type optimize struct { - Sequence string `json:"sequence"` - Organism string `json:"organism"` - Seed int `json:"seed"` - } - req := &optimize{Sequence: sequence, Organism: organism, Seed: seed} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/design/cds/optimize", string(b)) -} - -// LuaDesignCdsTranslate implements translate in lua. -func (app *App) LuaDesignCdsTranslate(L *lua.LState) int { - sequence := L.ToString(1) - translationTable := L.ToInt(2) - - type translate struct { - Sequence string `json:"sequence"` - TranslationTable int `json:"translation_table"` - } - req := &translate{Sequence: sequence, TranslationTable: translationTable} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/design/cds/translate", string(b)) -} - -// LuaSimulateFragment implements fragment in lua. -func (app *App) LuaSimulateFragment(L *lua.LState) int { - sequence := L.ToString(1) - minFragmentSize := L.ToInt(2) - maxFragmentSize := L.ToInt(3) - excludeOverhangs, err := luaStringArrayToGoSlice(L, 4) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - - type fragmentStruct struct { - Sequence string `json:"sequence"` - MinFragmentSize int `json:"min_fragment_size"` - MaxFragmentSize int `json:"max_fragment_size"` - ExcludeOverhangs []string `json:"exclude_overhangs"` - } - req := &fragmentStruct{Sequence: sequence, MinFragmentSize: minFragmentSize, MaxFragmentSize: maxFragmentSize, ExcludeOverhangs: excludeOverhangs} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/simulate/fragment", string(b)) - -} - -// LuaSimulateComplexPcr implements complex pcr in lua. -func (app *App) LuaSimulateComplexPcr(L *lua.LState) int { - templates, err := luaStringArrayToGoSlice(L, 1) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - primers, err := luaStringArrayToGoSlice(L, 2) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - targetTm := L.ToNumber(3) - circular := L.ToBool(4) - - req := &gen.PostSimulateComplexPcrJSONBody{Circular: &circular, Primers: primers, TargetTm: float32(targetTm), Templates: templates} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/simulate/complex_pcr", string(b)) -} - -// LuaSimulatePcr implements pcr in lua -func (app *App) LuaSimulatePcr(L *lua.LState) int { - template := L.ToString(1) - forwardPrimer := L.ToString(2) - reversePrimer := L.ToString(3) - targetTm := L.ToNumber(4) - circular := L.ToBool(5) - - req := &gen.PostSimulatePcrJSONBody{Circular: &circular, Template: template, TargetTm: float32(targetTm), ForwardPrimer: forwardPrimer, ReversePrimer: reversePrimer} - b, err := json.Marshal(req) - if err != nil { - L.RaiseError(err.Error()) - return 0 - } - return app.luaResponse(L, "/api/simulate/pcr", string(b)) -} diff --git a/api/api/templates/scalar.html b/api/api/templates/scalar.html new file mode 100644 index 0000000..cf1b17e --- /dev/null +++ b/api/api/templates/scalar.html @@ -0,0 +1,23 @@ + + + + API Reference + + + + + + + + + + + diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 9ce6d47..198df07 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -24,41 +24,65 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { // Fix CDS - // (POST /design/cds/fix) - PostDesignCdsFix(w http.ResponseWriter, r *http.Request) + // (POST /cds/fix) + PostCdsFix(w http.ResponseWriter, r *http.Request) // Optimize CDS. - // (POST /design/cds/optimize) - PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) + // (POST /cds/optimize) + PostCdsOptimize(w http.ResponseWriter, r *http.Request) // Translate CDS - // (POST /design/cds/translate) - PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) + // (POST /cds/translate) + PostCdsTranslate(w http.ResponseWriter, r *http.Request) + // Simulate Golden Gate assembly + // (POST /cloning/goldengate) + PostCloningGoldengate(w http.ResponseWriter, r *http.Request) + // Simulate ligation + // (POST /cloning/ligate) + PostCloningLigate(w http.ResponseWriter, r *http.Request) + // Simulate restriction digest + // (POST /cloning/restriction_digest) + PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) // Run a lua script // (POST /execute_lua) PostExecuteLua(w http.ResponseWriter, r *http.Request) // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(w http.ResponseWriter, r *http.Request) + // Write FASTA data + // (POST /io/fasta/write) + PostIoFastaWrite(w http.ResponseWriter, r *http.Request) + // Parse FASTQ data + // (POST /io/fastq/parse) + PostIoFastqParse(w http.ResponseWriter, r *http.Request) + // Write FASTQ data + // (POST /io/fastq/write) + PostIoFastqWrite(w http.ResponseWriter, r *http.Request) // Parse Genbank data // (POST /io/genbank/parse) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) + // Write Genbank data + // (POST /io/genbank/write) + PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) // Simulate PCR - // (POST /simulate/complex_pcr) - PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) - // Fragment CDS - // (POST /simulate/fragment) - PostSimulateFragment(w http.ResponseWriter, r *http.Request) - // Simulate Golden Gate assembly - // (POST /simulate/goldengate) - PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) - // Simulate ligation - // (POST /simulate/ligate) - PostSimulateLigate(w http.ResponseWriter, r *http.Request) + // (POST /pcr/complex_pcr) + PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) + // Generate De Bruijn sequence-based barcodes + // (POST /pcr/primers/debruijn_barcodes) + PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) + // Calculate Melting Temperature using Marmur Doty method + // (POST /pcr/primers/marmur_doty) + PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) + // Calculate Melting Temperature + // (POST /pcr/primers/melting_temperature) + PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) + // Calculate Melting Temperature using Santa Lucia method + // (POST /pcr/primers/santa_lucia) + PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) // Simulate a simple PCR - // (POST /simulate/pcr) - PostSimulatePcr(w http.ResponseWriter, r *http.Request) - // Simulate restriction digest - // (POST /simulate/restriction_digest) - PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) + // (POST /pcr/simple_pcr) + PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) + // Fragment CDS + // (POST /synthesis/fragment) + PostSynthesisFragment(w http.ResponseWriter, r *http.Request) } // Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. @@ -66,20 +90,38 @@ type ServerInterface interface { type Unimplemented struct{} // Fix CDS -// (POST /design/cds/fix) -func (_ Unimplemented) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { +// (POST /cds/fix) +func (_ Unimplemented) PostCdsFix(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } // Optimize CDS. -// (POST /design/cds/optimize) -func (_ Unimplemented) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { +// (POST /cds/optimize) +func (_ Unimplemented) PostCdsOptimize(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } // Translate CDS -// (POST /design/cds/translate) -func (_ Unimplemented) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { +// (POST /cds/translate) +func (_ Unimplemented) PostCdsTranslate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate Golden Gate assembly +// (POST /cloning/goldengate) +func (_ Unimplemented) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate ligation +// (POST /cloning/ligate) +func (_ Unimplemented) PostCloningLigate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate restriction digest +// (POST /cloning/restriction_digest) +func (_ Unimplemented) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } @@ -95,45 +137,75 @@ func (_ Unimplemented) PostIoFastaParse(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusNotImplemented) } +// Write FASTA data +// (POST /io/fasta/write) +func (_ Unimplemented) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Parse FASTQ data +// (POST /io/fastq/parse) +func (_ Unimplemented) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Write FASTQ data +// (POST /io/fastq/write) +func (_ Unimplemented) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Parse Genbank data // (POST /io/genbank/parse) func (_ Unimplemented) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } +// Write Genbank data +// (POST /io/genbank/write) +func (_ Unimplemented) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Simulate PCR -// (POST /simulate/complex_pcr) -func (_ Unimplemented) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { +// (POST /pcr/complex_pcr) +func (_ Unimplemented) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Fragment CDS -// (POST /simulate/fragment) -func (_ Unimplemented) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { +// Generate De Bruijn sequence-based barcodes +// (POST /pcr/primers/debruijn_barcodes) +func (_ Unimplemented) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Simulate Golden Gate assembly -// (POST /simulate/goldengate) -func (_ Unimplemented) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { +// Calculate Melting Temperature using Marmur Doty method +// (POST /pcr/primers/marmur_doty) +func (_ Unimplemented) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Simulate ligation -// (POST /simulate/ligate) -func (_ Unimplemented) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { +// Calculate Melting Temperature +// (POST /pcr/primers/melting_temperature) +func (_ Unimplemented) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Calculate Melting Temperature using Santa Lucia method +// (POST /pcr/primers/santa_lucia) +func (_ Unimplemented) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } // Simulate a simple PCR -// (POST /simulate/pcr) -func (_ Unimplemented) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { +// (POST /pcr/simple_pcr) +func (_ Unimplemented) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Simulate restriction digest -// (POST /simulate/restriction_digest) -func (_ Unimplemented) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { +// Fragment CDS +// (POST /synthesis/fragment) +func (_ Unimplemented) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } @@ -146,12 +218,12 @@ type ServerInterfaceWrapper struct { type MiddlewareFunc func(http.Handler) http.Handler -// PostDesignCdsFix operation middleware -func (siw *ServerInterfaceWrapper) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { +// PostCdsFix operation middleware +func (siw *ServerInterfaceWrapper) PostCdsFix(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostDesignCdsFix(w, r) + siw.Handler.PostCdsFix(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -161,12 +233,12 @@ func (siw *ServerInterfaceWrapper) PostDesignCdsFix(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostDesignCdsOptimize operation middleware -func (siw *ServerInterfaceWrapper) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { +// PostCdsOptimize operation middleware +func (siw *ServerInterfaceWrapper) PostCdsOptimize(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostDesignCdsOptimize(w, r) + siw.Handler.PostCdsOptimize(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -176,12 +248,57 @@ func (siw *ServerInterfaceWrapper) PostDesignCdsOptimize(w http.ResponseWriter, handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostDesignCdsTranslate operation middleware -func (siw *ServerInterfaceWrapper) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { +// PostCdsTranslate operation middleware +func (siw *ServerInterfaceWrapper) PostCdsTranslate(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostDesignCdsTranslate(w, r) + siw.Handler.PostCdsTranslate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostCloningGoldengate operation middleware +func (siw *ServerInterfaceWrapper) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostCloningGoldengate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostCloningLigate operation middleware +func (siw *ServerInterfaceWrapper) PostCloningLigate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostCloningLigate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostCloningRestrictionDigest operation middleware +func (siw *ServerInterfaceWrapper) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostCloningRestrictionDigest(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -221,6 +338,51 @@ func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } +// PostIoFastaWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoFastaWrite(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostIoFastqParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoFastqParse(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostIoFastqWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoFastqWrite(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + // PostIoGenbankParse operation middleware func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -236,12 +398,27 @@ func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulateComplexPcr operation middleware -func (siw *ServerInterfaceWrapper) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { +// PostIoGenbankWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoGenbankWrite(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostPcrComplexPcr operation middleware +func (siw *ServerInterfaceWrapper) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulateComplexPcr(w, r) + siw.Handler.PostPcrComplexPcr(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -251,12 +428,12 @@ func (siw *ServerInterfaceWrapper) PostSimulateComplexPcr(w http.ResponseWriter, handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulateFragment operation middleware -func (siw *ServerInterfaceWrapper) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { +// PostPcrPrimersDebruijnBarcodes operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulateFragment(w, r) + siw.Handler.PostPcrPrimersDebruijnBarcodes(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -266,12 +443,12 @@ func (siw *ServerInterfaceWrapper) PostSimulateFragment(w http.ResponseWriter, r handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulateGoldengate operation middleware -func (siw *ServerInterfaceWrapper) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { +// PostPcrPrimersMarmurDoty operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulateGoldengate(w, r) + siw.Handler.PostPcrPrimersMarmurDoty(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -281,12 +458,12 @@ func (siw *ServerInterfaceWrapper) PostSimulateGoldengate(w http.ResponseWriter, handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulateLigate operation middleware -func (siw *ServerInterfaceWrapper) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { +// PostPcrPrimersMeltingTemperature operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulateLigate(w, r) + siw.Handler.PostPcrPrimersMeltingTemperature(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -296,12 +473,12 @@ func (siw *ServerInterfaceWrapper) PostSimulateLigate(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulatePcr operation middleware -func (siw *ServerInterfaceWrapper) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { +// PostPcrPrimersSantaLucia operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulatePcr(w, r) + siw.Handler.PostPcrPrimersSantaLucia(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -311,12 +488,27 @@ func (siw *ServerInterfaceWrapper) PostSimulatePcr(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSimulateRestrictionDigest operation middleware -func (siw *ServerInterfaceWrapper) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { +// PostPcrSimplePcr operation middleware +func (siw *ServerInterfaceWrapper) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSimulateRestrictionDigest(w, r) + siw.Handler.PostPcrSimplePcr(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostSynthesisFragment operation middleware +func (siw *ServerInterfaceWrapper) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSynthesisFragment(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -440,13 +632,22 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl } r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/design/cds/fix", wrapper.PostDesignCdsFix) + r.Post(options.BaseURL+"/cds/fix", wrapper.PostCdsFix) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cds/optimize", wrapper.PostCdsOptimize) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cds/translate", wrapper.PostCdsTranslate) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/design/cds/optimize", wrapper.PostDesignCdsOptimize) + r.Post(options.BaseURL+"/cloning/goldengate", wrapper.PostCloningGoldengate) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/design/cds/translate", wrapper.PostDesignCdsTranslate) + r.Post(options.BaseURL+"/cloning/ligate", wrapper.PostCloningLigate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cloning/restriction_digest", wrapper.PostCloningRestrictionDigest) }) r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/execute_lua", wrapper.PostExecuteLua) @@ -454,54 +655,69 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/io/fasta/parse", wrapper.PostIoFastaParse) }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fasta/write", wrapper.PostIoFastaWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fastq/parse", wrapper.PostIoFastqParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fastq/write", wrapper.PostIoFastqWrite) + }) r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/io/genbank/parse", wrapper.PostIoGenbankParse) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/complex_pcr", wrapper.PostSimulateComplexPcr) + r.Post(options.BaseURL+"/io/genbank/write", wrapper.PostIoGenbankWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/complex_pcr", wrapper.PostPcrComplexPcr) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/debruijn_barcodes", wrapper.PostPcrPrimersDebruijnBarcodes) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/fragment", wrapper.PostSimulateFragment) + r.Post(options.BaseURL+"/pcr/primers/marmur_doty", wrapper.PostPcrPrimersMarmurDoty) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/goldengate", wrapper.PostSimulateGoldengate) + r.Post(options.BaseURL+"/pcr/primers/melting_temperature", wrapper.PostPcrPrimersMeltingTemperature) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/ligate", wrapper.PostSimulateLigate) + r.Post(options.BaseURL+"/pcr/primers/santa_lucia", wrapper.PostPcrPrimersSantaLucia) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/pcr", wrapper.PostSimulatePcr) + r.Post(options.BaseURL+"/pcr/simple_pcr", wrapper.PostPcrSimplePcr) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/simulate/restriction_digest", wrapper.PostSimulateRestrictionDigest) + r.Post(options.BaseURL+"/synthesis/fragment", wrapper.PostSynthesisFragment) }) return r } -type PostDesignCdsFixRequestObject struct { - Body *PostDesignCdsFixJSONRequestBody +type PostCdsFixRequestObject struct { + Body *PostCdsFixJSONRequestBody } -type PostDesignCdsFixResponseObject interface { - VisitPostDesignCdsFixResponse(w http.ResponseWriter) error +type PostCdsFixResponseObject interface { + VisitPostCdsFixResponse(w http.ResponseWriter) error } -type PostDesignCdsFix200JSONResponse struct { +type PostCdsFix200JSONResponse struct { Changes []Change `json:"changes"` Sequence string `json:"sequence"` } -func (response PostDesignCdsFix200JSONResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { +func (response PostCdsFix200JSONResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostDesignCdsFix400TextResponse string +type PostCdsFix400TextResponse string -func (response PostDesignCdsFix400TextResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { +func (response PostCdsFix400TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(400) @@ -509,9 +725,9 @@ func (response PostDesignCdsFix400TextResponse) VisitPostDesignCdsFixResponse(w return err } -type PostDesignCdsFix500TextResponse string +type PostCdsFix500TextResponse string -func (response PostDesignCdsFix500TextResponse) VisitPostDesignCdsFixResponse(w http.ResponseWriter) error { +func (response PostCdsFix500TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -519,26 +735,26 @@ func (response PostDesignCdsFix500TextResponse) VisitPostDesignCdsFixResponse(w return err } -type PostDesignCdsOptimizeRequestObject struct { - Body *PostDesignCdsOptimizeJSONRequestBody +type PostCdsOptimizeRequestObject struct { + Body *PostCdsOptimizeJSONRequestBody } -type PostDesignCdsOptimizeResponseObject interface { - VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error +type PostCdsOptimizeResponseObject interface { + VisitPostCdsOptimizeResponse(w http.ResponseWriter) error } -type PostDesignCdsOptimize200JSONResponse string +type PostCdsOptimize200JSONResponse string -func (response PostDesignCdsOptimize200JSONResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { +func (response PostCdsOptimize200JSONResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostDesignCdsOptimize400TextResponse string +type PostCdsOptimize400TextResponse string -func (response PostDesignCdsOptimize400TextResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { +func (response PostCdsOptimize400TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(400) @@ -546,9 +762,9 @@ func (response PostDesignCdsOptimize400TextResponse) VisitPostDesignCdsOptimizeR return err } -type PostDesignCdsOptimize500TextResponse string +type PostCdsOptimize500TextResponse string -func (response PostDesignCdsOptimize500TextResponse) VisitPostDesignCdsOptimizeResponse(w http.ResponseWriter) error { +func (response PostCdsOptimize500TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -556,26 +772,94 @@ func (response PostDesignCdsOptimize500TextResponse) VisitPostDesignCdsOptimizeR return err } -type PostDesignCdsTranslateRequestObject struct { - Body *PostDesignCdsTranslateJSONRequestBody +type PostCdsTranslateRequestObject struct { + Body *PostCdsTranslateJSONRequestBody } -type PostDesignCdsTranslateResponseObject interface { - VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error +type PostCdsTranslateResponseObject interface { + VisitPostCdsTranslateResponse(w http.ResponseWriter) error } -type PostDesignCdsTranslate200JSONResponse string +type PostCdsTranslate200JSONResponse string -func (response PostDesignCdsTranslate200JSONResponse) VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error { +func (response PostCdsTranslate200JSONResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostDesignCdsTranslate500TextResponse string +type PostCdsTranslate500TextResponse string -func (response PostDesignCdsTranslate500TextResponse) VisitPostDesignCdsTranslateResponse(w http.ResponseWriter) error { +func (response PostCdsTranslate500TextResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCloningGoldengateRequestObject struct { + Body *PostCloningGoldengateJSONRequestBody +} + +type PostCloningGoldengateResponseObject interface { + VisitPostCloningGoldengateResponse(w http.ResponseWriter) error +} + +type PostCloningGoldengate200Response struct { +} + +func (response PostCloningGoldengate200Response) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningGoldengate500TextResponse string + +func (response PostCloningGoldengate500TextResponse) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCloningLigateRequestObject struct { + Body *PostCloningLigateJSONRequestBody +} + +type PostCloningLigateResponseObject interface { + VisitPostCloningLigateResponse(w http.ResponseWriter) error +} + +type PostCloningLigate200Response struct { +} + +func (response PostCloningLigate200Response) VisitPostCloningLigateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningRestrictionDigestRequestObject struct { + Body *PostCloningRestrictionDigestJSONRequestBody +} + +type PostCloningRestrictionDigestResponseObject interface { + VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error +} + +type PostCloningRestrictionDigest200Response struct { +} + +func (response PostCloningRestrictionDigest200Response) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningRestrictionDigest500TextResponse string + +func (response PostCloningRestrictionDigest500TextResponse) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -640,6 +924,55 @@ func (response PostIoFastaParse500TextResponse) VisitPostIoFastaParseResponse(w return err } +type PostIoFastaWriteRequestObject struct { + Body *PostIoFastaWriteJSONRequestBody +} + +type PostIoFastaWriteResponseObject interface { + VisitPostIoFastaWriteResponse(w http.ResponseWriter) error +} + +type PostIoFastaWrite200Response struct { +} + +func (response PostIoFastaWrite200Response) VisitPostIoFastaWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostIoFastqParseRequestObject struct { + Body *PostIoFastqParseTextRequestBody +} + +type PostIoFastqParseResponseObject interface { + VisitPostIoFastqParseResponse(w http.ResponseWriter) error +} + +type PostIoFastqParse200JSONResponse []FastqRead + +func (response PostIoFastqParse200JSONResponse) VisitPostIoFastqParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoFastqWriteRequestObject struct { + Body *PostIoFastqWriteJSONRequestBody +} + +type PostIoFastqWriteResponseObject interface { + VisitPostIoFastqWriteResponse(w http.ResponseWriter) error +} + +type PostIoFastqWrite200Response struct { +} + +func (response PostIoFastqWrite200Response) VisitPostIoFastqWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + type PostIoGenbankParseRequestObject struct { Body *PostIoGenbankParseTextRequestBody } @@ -667,26 +1000,42 @@ func (response PostIoGenbankParse500TextResponse) VisitPostIoGenbankParseRespons return err } -type PostSimulateComplexPcrRequestObject struct { - Body *PostSimulateComplexPcrJSONRequestBody +type PostIoGenbankWriteRequestObject struct { + Body *PostIoGenbankWriteJSONRequestBody +} + +type PostIoGenbankWriteResponseObject interface { + VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error +} + +type PostIoGenbankWrite200Response struct { +} + +func (response PostIoGenbankWrite200Response) VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil } -type PostSimulateComplexPcrResponseObject interface { - VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error +type PostPcrComplexPcrRequestObject struct { + Body *PostPcrComplexPcrJSONRequestBody } -type PostSimulateComplexPcr200JSONResponse []string +type PostPcrComplexPcrResponseObject interface { + VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error +} -func (response PostSimulateComplexPcr200JSONResponse) VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error { +type PostPcrComplexPcr200JSONResponse []string + +func (response PostPcrComplexPcr200JSONResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostSimulateComplexPcr500TextResponse string +type PostPcrComplexPcr500TextResponse string -func (response PostSimulateComplexPcr500TextResponse) VisitPostSimulateComplexPcrResponse(w http.ResponseWriter) error { +func (response PostPcrComplexPcr500TextResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -694,98 +1043,90 @@ func (response PostSimulateComplexPcr500TextResponse) VisitPostSimulateComplexPc return err } -type PostSimulateFragmentRequestObject struct { - Body *PostSimulateFragmentJSONRequestBody +type PostPcrPrimersDebruijnBarcodesRequestObject struct { + Body *PostPcrPrimersDebruijnBarcodesJSONRequestBody } -type PostSimulateFragmentResponseObject interface { - VisitPostSimulateFragmentResponse(w http.ResponseWriter) error +type PostPcrPrimersDebruijnBarcodesResponseObject interface { + VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error } -type PostSimulateFragment200JSONResponse struct { - Efficiency float32 `json:"efficiency"` - Fragments []string `json:"fragments"` +type PostPcrPrimersDebruijnBarcodes200Response struct { } -func (response PostSimulateFragment200JSONResponse) VisitPostSimulateFragmentResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response PostPcrPrimersDebruijnBarcodes200Response) VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error { w.WriteHeader(200) + return nil +} - return json.NewEncoder(w).Encode(response) +type PostPcrPrimersMarmurDotyRequestObject struct { + Body *PostPcrPrimersMarmurDotyJSONRequestBody } -type PostSimulateFragment500TextResponse string +type PostPcrPrimersMarmurDotyResponseObject interface { + VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error +} -func (response PostSimulateFragment500TextResponse) VisitPostSimulateFragmentResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) +type PostPcrPrimersMarmurDoty200Response struct { +} - _, err := w.Write([]byte(response)) - return err +func (response PostPcrPrimersMarmurDoty200Response) VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil } -type PostSimulateGoldengateRequestObject struct { - Body *PostSimulateGoldengateJSONRequestBody +type PostPcrPrimersMeltingTemperatureRequestObject struct { + Body *PostPcrPrimersMeltingTemperatureJSONRequestBody } -type PostSimulateGoldengateResponseObject interface { - VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error +type PostPcrPrimersMeltingTemperatureResponseObject interface { + VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error } -type PostSimulateGoldengate200Response struct { +type PostPcrPrimersMeltingTemperature200Response struct { } -func (response PostSimulateGoldengate200Response) VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersMeltingTemperature200Response) VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error { w.WriteHeader(200) return nil } -type PostSimulateGoldengate500TextResponse string - -func (response PostSimulateGoldengate500TextResponse) VisitPostSimulateGoldengateResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) - - _, err := w.Write([]byte(response)) - return err -} - -type PostSimulateLigateRequestObject struct { - Body *PostSimulateLigateJSONRequestBody +type PostPcrPrimersSantaLuciaRequestObject struct { + Body *PostPcrPrimersSantaLuciaJSONRequestBody } -type PostSimulateLigateResponseObject interface { - VisitPostSimulateLigateResponse(w http.ResponseWriter) error +type PostPcrPrimersSantaLuciaResponseObject interface { + VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error } -type PostSimulateLigate200Response struct { +type PostPcrPrimersSantaLucia200Response struct { } -func (response PostSimulateLigate200Response) VisitPostSimulateLigateResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersSantaLucia200Response) VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error { w.WriteHeader(200) return nil } -type PostSimulatePcrRequestObject struct { - Body *PostSimulatePcrJSONRequestBody +type PostPcrSimplePcrRequestObject struct { + Body *PostPcrSimplePcrJSONRequestBody } -type PostSimulatePcrResponseObject interface { - VisitPostSimulatePcrResponse(w http.ResponseWriter) error +type PostPcrSimplePcrResponseObject interface { + VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error } -type PostSimulatePcr200JSONResponse string +type PostPcrSimplePcr200JSONResponse string -func (response PostSimulatePcr200JSONResponse) VisitPostSimulatePcrResponse(w http.ResponseWriter) error { +func (response PostPcrSimplePcr200JSONResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostSimulatePcr500TextResponse string +type PostPcrSimplePcr500TextResponse string -func (response PostSimulatePcr500TextResponse) VisitPostSimulatePcrResponse(w http.ResponseWriter) error { +func (response PostPcrSimplePcr500TextResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -793,25 +1134,29 @@ func (response PostSimulatePcr500TextResponse) VisitPostSimulatePcrResponse(w ht return err } -type PostSimulateRestrictionDigestRequestObject struct { - Body *PostSimulateRestrictionDigestJSONRequestBody +type PostSynthesisFragmentRequestObject struct { + Body *PostSynthesisFragmentJSONRequestBody } -type PostSimulateRestrictionDigestResponseObject interface { - VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error +type PostSynthesisFragmentResponseObject interface { + VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error } -type PostSimulateRestrictionDigest200Response struct { +type PostSynthesisFragment200JSONResponse struct { + Efficiency float32 `json:"efficiency"` + Fragments []string `json:"fragments"` } -func (response PostSimulateRestrictionDigest200Response) VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error { +func (response PostSynthesisFragment200JSONResponse) VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } -type PostSimulateRestrictionDigest500TextResponse string +type PostSynthesisFragment500TextResponse string -func (response PostSimulateRestrictionDigest500TextResponse) VisitPostSimulateRestrictionDigestResponse(w http.ResponseWriter) error { +func (response PostSynthesisFragment500TextResponse) VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -822,41 +1167,65 @@ func (response PostSimulateRestrictionDigest500TextResponse) VisitPostSimulateRe // StrictServerInterface represents all server handlers. type StrictServerInterface interface { // Fix CDS - // (POST /design/cds/fix) - PostDesignCdsFix(ctx context.Context, request PostDesignCdsFixRequestObject) (PostDesignCdsFixResponseObject, error) + // (POST /cds/fix) + PostCdsFix(ctx context.Context, request PostCdsFixRequestObject) (PostCdsFixResponseObject, error) // Optimize CDS. - // (POST /design/cds/optimize) - PostDesignCdsOptimize(ctx context.Context, request PostDesignCdsOptimizeRequestObject) (PostDesignCdsOptimizeResponseObject, error) + // (POST /cds/optimize) + PostCdsOptimize(ctx context.Context, request PostCdsOptimizeRequestObject) (PostCdsOptimizeResponseObject, error) // Translate CDS - // (POST /design/cds/translate) - PostDesignCdsTranslate(ctx context.Context, request PostDesignCdsTranslateRequestObject) (PostDesignCdsTranslateResponseObject, error) + // (POST /cds/translate) + PostCdsTranslate(ctx context.Context, request PostCdsTranslateRequestObject) (PostCdsTranslateResponseObject, error) + // Simulate Golden Gate assembly + // (POST /cloning/goldengate) + PostCloningGoldengate(ctx context.Context, request PostCloningGoldengateRequestObject) (PostCloningGoldengateResponseObject, error) + // Simulate ligation + // (POST /cloning/ligate) + PostCloningLigate(ctx context.Context, request PostCloningLigateRequestObject) (PostCloningLigateResponseObject, error) + // Simulate restriction digest + // (POST /cloning/restriction_digest) + PostCloningRestrictionDigest(ctx context.Context, request PostCloningRestrictionDigestRequestObject) (PostCloningRestrictionDigestResponseObject, error) // Run a lua script // (POST /execute_lua) PostExecuteLua(ctx context.Context, request PostExecuteLuaRequestObject) (PostExecuteLuaResponseObject, error) // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(ctx context.Context, request PostIoFastaParseRequestObject) (PostIoFastaParseResponseObject, error) + // Write FASTA data + // (POST /io/fasta/write) + PostIoFastaWrite(ctx context.Context, request PostIoFastaWriteRequestObject) (PostIoFastaWriteResponseObject, error) + // Parse FASTQ data + // (POST /io/fastq/parse) + PostIoFastqParse(ctx context.Context, request PostIoFastqParseRequestObject) (PostIoFastqParseResponseObject, error) + // Write FASTQ data + // (POST /io/fastq/write) + PostIoFastqWrite(ctx context.Context, request PostIoFastqWriteRequestObject) (PostIoFastqWriteResponseObject, error) // Parse Genbank data // (POST /io/genbank/parse) PostIoGenbankParse(ctx context.Context, request PostIoGenbankParseRequestObject) (PostIoGenbankParseResponseObject, error) + // Write Genbank data + // (POST /io/genbank/write) + PostIoGenbankWrite(ctx context.Context, request PostIoGenbankWriteRequestObject) (PostIoGenbankWriteResponseObject, error) // Simulate PCR - // (POST /simulate/complex_pcr) - PostSimulateComplexPcr(ctx context.Context, request PostSimulateComplexPcrRequestObject) (PostSimulateComplexPcrResponseObject, error) - // Fragment CDS - // (POST /simulate/fragment) - PostSimulateFragment(ctx context.Context, request PostSimulateFragmentRequestObject) (PostSimulateFragmentResponseObject, error) - // Simulate Golden Gate assembly - // (POST /simulate/goldengate) - PostSimulateGoldengate(ctx context.Context, request PostSimulateGoldengateRequestObject) (PostSimulateGoldengateResponseObject, error) - // Simulate ligation - // (POST /simulate/ligate) - PostSimulateLigate(ctx context.Context, request PostSimulateLigateRequestObject) (PostSimulateLigateResponseObject, error) + // (POST /pcr/complex_pcr) + PostPcrComplexPcr(ctx context.Context, request PostPcrComplexPcrRequestObject) (PostPcrComplexPcrResponseObject, error) + // Generate De Bruijn sequence-based barcodes + // (POST /pcr/primers/debruijn_barcodes) + PostPcrPrimersDebruijnBarcodes(ctx context.Context, request PostPcrPrimersDebruijnBarcodesRequestObject) (PostPcrPrimersDebruijnBarcodesResponseObject, error) + // Calculate Melting Temperature using Marmur Doty method + // (POST /pcr/primers/marmur_doty) + PostPcrPrimersMarmurDoty(ctx context.Context, request PostPcrPrimersMarmurDotyRequestObject) (PostPcrPrimersMarmurDotyResponseObject, error) + // Calculate Melting Temperature + // (POST /pcr/primers/melting_temperature) + PostPcrPrimersMeltingTemperature(ctx context.Context, request PostPcrPrimersMeltingTemperatureRequestObject) (PostPcrPrimersMeltingTemperatureResponseObject, error) + // Calculate Melting Temperature using Santa Lucia method + // (POST /pcr/primers/santa_lucia) + PostPcrPrimersSantaLucia(ctx context.Context, request PostPcrPrimersSantaLuciaRequestObject) (PostPcrPrimersSantaLuciaResponseObject, error) // Simulate a simple PCR - // (POST /simulate/pcr) - PostSimulatePcr(ctx context.Context, request PostSimulatePcrRequestObject) (PostSimulatePcrResponseObject, error) - // Simulate restriction digest - // (POST /simulate/restriction_digest) - PostSimulateRestrictionDigest(ctx context.Context, request PostSimulateRestrictionDigestRequestObject) (PostSimulateRestrictionDigestResponseObject, error) + // (POST /pcr/simple_pcr) + PostPcrSimplePcr(ctx context.Context, request PostPcrSimplePcrRequestObject) (PostPcrSimplePcrResponseObject, error) + // Fragment CDS + // (POST /synthesis/fragment) + PostSynthesisFragment(ctx context.Context, request PostSynthesisFragmentRequestObject) (PostSynthesisFragmentResponseObject, error) } type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc @@ -888,11 +1257,11 @@ type strictHandler struct { options StrictHTTPServerOptions } -// PostDesignCdsFix operation middleware -func (sh *strictHandler) PostDesignCdsFix(w http.ResponseWriter, r *http.Request) { - var request PostDesignCdsFixRequestObject +// PostCdsFix operation middleware +func (sh *strictHandler) PostCdsFix(w http.ResponseWriter, r *http.Request) { + var request PostCdsFixRequestObject - var body PostDesignCdsFixJSONRequestBody + var body PostCdsFixJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -900,18 +1269,18 @@ func (sh *strictHandler) PostDesignCdsFix(w http.ResponseWriter, r *http.Request request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostDesignCdsFix(ctx, request.(PostDesignCdsFixRequestObject)) + return sh.ssi.PostCdsFix(ctx, request.(PostCdsFixRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostDesignCdsFix") + handler = middleware(handler, "PostCdsFix") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostDesignCdsFixResponseObject); ok { - if err := validResponse.VisitPostDesignCdsFixResponse(w); err != nil { + } else if validResponse, ok := response.(PostCdsFixResponseObject); ok { + if err := validResponse.VisitPostCdsFixResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -919,11 +1288,11 @@ func (sh *strictHandler) PostDesignCdsFix(w http.ResponseWriter, r *http.Request } } -// PostDesignCdsOptimize operation middleware -func (sh *strictHandler) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Request) { - var request PostDesignCdsOptimizeRequestObject +// PostCdsOptimize operation middleware +func (sh *strictHandler) PostCdsOptimize(w http.ResponseWriter, r *http.Request) { + var request PostCdsOptimizeRequestObject - var body PostDesignCdsOptimizeJSONRequestBody + var body PostCdsOptimizeJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -931,18 +1300,18 @@ func (sh *strictHandler) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Re request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostDesignCdsOptimize(ctx, request.(PostDesignCdsOptimizeRequestObject)) + return sh.ssi.PostCdsOptimize(ctx, request.(PostCdsOptimizeRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostDesignCdsOptimize") + handler = middleware(handler, "PostCdsOptimize") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostDesignCdsOptimizeResponseObject); ok { - if err := validResponse.VisitPostDesignCdsOptimizeResponse(w); err != nil { + } else if validResponse, ok := response.(PostCdsOptimizeResponseObject); ok { + if err := validResponse.VisitPostCdsOptimizeResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -950,11 +1319,11 @@ func (sh *strictHandler) PostDesignCdsOptimize(w http.ResponseWriter, r *http.Re } } -// PostDesignCdsTranslate operation middleware -func (sh *strictHandler) PostDesignCdsTranslate(w http.ResponseWriter, r *http.Request) { - var request PostDesignCdsTranslateRequestObject +// PostCdsTranslate operation middleware +func (sh *strictHandler) PostCdsTranslate(w http.ResponseWriter, r *http.Request) { + var request PostCdsTranslateRequestObject - var body PostDesignCdsTranslateJSONRequestBody + var body PostCdsTranslateJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -962,18 +1331,111 @@ func (sh *strictHandler) PostDesignCdsTranslate(w http.ResponseWriter, r *http.R request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostDesignCdsTranslate(ctx, request.(PostDesignCdsTranslateRequestObject)) + return sh.ssi.PostCdsTranslate(ctx, request.(PostCdsTranslateRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostDesignCdsTranslate") + handler = middleware(handler, "PostCdsTranslate") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostDesignCdsTranslateResponseObject); ok { - if err := validResponse.VisitPostDesignCdsTranslateResponse(w); err != nil { + } else if validResponse, ok := response.(PostCdsTranslateResponseObject); ok { + if err := validResponse.VisitPostCdsTranslateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningGoldengate operation middleware +func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { + var request PostCloningGoldengateRequestObject + + var body PostCloningGoldengateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningGoldengate(ctx, request.(PostCloningGoldengateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningGoldengate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningGoldengateResponseObject); ok { + if err := validResponse.VisitPostCloningGoldengateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningLigate operation middleware +func (sh *strictHandler) PostCloningLigate(w http.ResponseWriter, r *http.Request) { + var request PostCloningLigateRequestObject + + var body PostCloningLigateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningLigate(ctx, request.(PostCloningLigateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningLigate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningLigateResponseObject); ok { + if err := validResponse.VisitPostCloningLigateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningRestrictionDigest operation middleware +func (sh *strictHandler) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) { + var request PostCloningRestrictionDigestRequestObject + + var body PostCloningRestrictionDigestJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningRestrictionDigest(ctx, request.(PostCloningRestrictionDigestRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningRestrictionDigest") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningRestrictionDigestResponseObject); ok { + if err := validResponse.VisitPostCloningRestrictionDigestResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1044,6 +1506,100 @@ func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request } } +// PostIoFastaWrite operation middleware +func (sh *strictHandler) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoFastaWriteRequestObject + + var body PostIoFastaWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastaWrite(ctx, request.(PostIoFastaWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastaWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastaWriteResponseObject); ok { + if err := validResponse.VisitPostIoFastaWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastqParse operation middleware +func (sh *strictHandler) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { + var request PostIoFastqParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoFastqParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastqParse(ctx, request.(PostIoFastqParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastqParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastqParseResponseObject); ok { + if err := validResponse.VisitPostIoFastqParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastqWrite operation middleware +func (sh *strictHandler) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoFastqWriteRequestObject + + var body PostIoFastqWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastqWrite(ctx, request.(PostIoFastqWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastqWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastqWriteResponseObject); ok { + if err := validResponse.VisitPostIoFastqWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + // PostIoGenbankParse operation middleware func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { var request PostIoGenbankParseRequestObject @@ -1076,11 +1632,73 @@ func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Reque } } -// PostSimulateComplexPcr operation middleware -func (sh *strictHandler) PostSimulateComplexPcr(w http.ResponseWriter, r *http.Request) { - var request PostSimulateComplexPcrRequestObject +// PostIoGenbankWrite operation middleware +func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoGenbankWriteRequestObject + + var body PostIoGenbankWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoGenbankWrite(ctx, request.(PostIoGenbankWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoGenbankWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoGenbankWriteResponseObject); ok { + if err := validResponse.VisitPostIoGenbankWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostPcrComplexPcr operation middleware +func (sh *strictHandler) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { + var request PostPcrComplexPcrRequestObject + + var body PostPcrComplexPcrJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostPcrComplexPcr(ctx, request.(PostPcrComplexPcrRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostPcrComplexPcr") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostPcrComplexPcrResponseObject); ok { + if err := validResponse.VisitPostPcrComplexPcrResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostPcrPrimersDebruijnBarcodes operation middleware +func (sh *strictHandler) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersDebruijnBarcodesRequestObject - var body PostSimulateComplexPcrJSONRequestBody + var body PostPcrPrimersDebruijnBarcodesJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1088,18 +1706,18 @@ func (sh *strictHandler) PostSimulateComplexPcr(w http.ResponseWriter, r *http.R request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulateComplexPcr(ctx, request.(PostSimulateComplexPcrRequestObject)) + return sh.ssi.PostPcrPrimersDebruijnBarcodes(ctx, request.(PostPcrPrimersDebruijnBarcodesRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulateComplexPcr") + handler = middleware(handler, "PostPcrPrimersDebruijnBarcodes") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulateComplexPcrResponseObject); ok { - if err := validResponse.VisitPostSimulateComplexPcrResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersDebruijnBarcodesResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersDebruijnBarcodesResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1107,11 +1725,11 @@ func (sh *strictHandler) PostSimulateComplexPcr(w http.ResponseWriter, r *http.R } } -// PostSimulateFragment operation middleware -func (sh *strictHandler) PostSimulateFragment(w http.ResponseWriter, r *http.Request) { - var request PostSimulateFragmentRequestObject +// PostPcrPrimersMarmurDoty operation middleware +func (sh *strictHandler) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersMarmurDotyRequestObject - var body PostSimulateFragmentJSONRequestBody + var body PostPcrPrimersMarmurDotyJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1119,18 +1737,18 @@ func (sh *strictHandler) PostSimulateFragment(w http.ResponseWriter, r *http.Req request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulateFragment(ctx, request.(PostSimulateFragmentRequestObject)) + return sh.ssi.PostPcrPrimersMarmurDoty(ctx, request.(PostPcrPrimersMarmurDotyRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulateFragment") + handler = middleware(handler, "PostPcrPrimersMarmurDoty") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulateFragmentResponseObject); ok { - if err := validResponse.VisitPostSimulateFragmentResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersMarmurDotyResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersMarmurDotyResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1138,11 +1756,11 @@ func (sh *strictHandler) PostSimulateFragment(w http.ResponseWriter, r *http.Req } } -// PostSimulateGoldengate operation middleware -func (sh *strictHandler) PostSimulateGoldengate(w http.ResponseWriter, r *http.Request) { - var request PostSimulateGoldengateRequestObject +// PostPcrPrimersMeltingTemperature operation middleware +func (sh *strictHandler) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersMeltingTemperatureRequestObject - var body PostSimulateGoldengateJSONRequestBody + var body PostPcrPrimersMeltingTemperatureJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1150,18 +1768,18 @@ func (sh *strictHandler) PostSimulateGoldengate(w http.ResponseWriter, r *http.R request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulateGoldengate(ctx, request.(PostSimulateGoldengateRequestObject)) + return sh.ssi.PostPcrPrimersMeltingTemperature(ctx, request.(PostPcrPrimersMeltingTemperatureRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulateGoldengate") + handler = middleware(handler, "PostPcrPrimersMeltingTemperature") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulateGoldengateResponseObject); ok { - if err := validResponse.VisitPostSimulateGoldengateResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersMeltingTemperatureResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersMeltingTemperatureResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1169,11 +1787,11 @@ func (sh *strictHandler) PostSimulateGoldengate(w http.ResponseWriter, r *http.R } } -// PostSimulateLigate operation middleware -func (sh *strictHandler) PostSimulateLigate(w http.ResponseWriter, r *http.Request) { - var request PostSimulateLigateRequestObject +// PostPcrPrimersSantaLucia operation middleware +func (sh *strictHandler) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersSantaLuciaRequestObject - var body PostSimulateLigateJSONRequestBody + var body PostPcrPrimersSantaLuciaJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1181,18 +1799,18 @@ func (sh *strictHandler) PostSimulateLigate(w http.ResponseWriter, r *http.Reque request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulateLigate(ctx, request.(PostSimulateLigateRequestObject)) + return sh.ssi.PostPcrPrimersSantaLucia(ctx, request.(PostPcrPrimersSantaLuciaRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulateLigate") + handler = middleware(handler, "PostPcrPrimersSantaLucia") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulateLigateResponseObject); ok { - if err := validResponse.VisitPostSimulateLigateResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersSantaLuciaResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersSantaLuciaResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1200,11 +1818,11 @@ func (sh *strictHandler) PostSimulateLigate(w http.ResponseWriter, r *http.Reque } } -// PostSimulatePcr operation middleware -func (sh *strictHandler) PostSimulatePcr(w http.ResponseWriter, r *http.Request) { - var request PostSimulatePcrRequestObject +// PostPcrSimplePcr operation middleware +func (sh *strictHandler) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { + var request PostPcrSimplePcrRequestObject - var body PostSimulatePcrJSONRequestBody + var body PostPcrSimplePcrJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1212,18 +1830,18 @@ func (sh *strictHandler) PostSimulatePcr(w http.ResponseWriter, r *http.Request) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulatePcr(ctx, request.(PostSimulatePcrRequestObject)) + return sh.ssi.PostPcrSimplePcr(ctx, request.(PostPcrSimplePcrRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulatePcr") + handler = middleware(handler, "PostPcrSimplePcr") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulatePcrResponseObject); ok { - if err := validResponse.VisitPostSimulatePcrResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrSimplePcrResponseObject); ok { + if err := validResponse.VisitPostPcrSimplePcrResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1231,11 +1849,11 @@ func (sh *strictHandler) PostSimulatePcr(w http.ResponseWriter, r *http.Request) } } -// PostSimulateRestrictionDigest operation middleware -func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r *http.Request) { - var request PostSimulateRestrictionDigestRequestObject +// PostSynthesisFragment operation middleware +func (sh *strictHandler) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { + var request PostSynthesisFragmentRequestObject - var body PostSimulateRestrictionDigestJSONRequestBody + var body PostSynthesisFragmentJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1243,18 +1861,18 @@ func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSimulateRestrictionDigest(ctx, request.(PostSimulateRestrictionDigestRequestObject)) + return sh.ssi.PostSynthesisFragment(ctx, request.(PostSynthesisFragmentRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSimulateRestrictionDigest") + handler = middleware(handler, "PostSynthesisFragment") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSimulateRestrictionDigestResponseObject); ok { - if err := validResponse.VisitPostSimulateRestrictionDigestResponse(w); err != nil { + } else if validResponse, ok := response.(PostSynthesisFragmentResponseObject); ok { + if err := validResponse.VisitPostSynthesisFragmentResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1265,38 +1883,45 @@ func (sh *strictHandler) PostSimulateRestrictionDigest(w http.ResponseWriter, r // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9xaW2/bOBb+K4R2HwXLndldzPgtcZoiQDo17OzTojBo8chmK5EqL6k9Rf77QqQo0RYl", - "K81tdp9Sl4fn9n3n8JD2jyjlRckZMCWj2Y9IpjsosPnnhVI43RXAVPWpFLwEoSiYtZQzVS+oQwnRLJJK", - "ULaNHuKI4QICCw9xJOCbpgJINPuPlYobRZ9jJ883XyBVlaJLLGHOdcj+BksIGk+dfL1CmYItiI55o8CJ", - "h4zPd5htoWv5WvAiaHnBJVWUs5DxOFoClkdr7caVgjK86Y6fz2NjtlYUWw/N5sZsKMD37M+DBQqYLipV", - "lxLfRHF0uZHVnwX+NjcfZXF542loHb/GUuElpFyQbp4oAaZoRkEEg5bwTQNLRxDFU+RtC0V0DVhpEcAM", - "KyXoRqv6EyEmYzhfHHusoJBBZ+v/wELgg/e5tUxApoKWJ/C3CnKeYrf4dwFZNIv+lrSFl9RVl9w6ueEM", - "OQ/Opc6sHnsX+8nwjHg+BlMr8DbcCa65+I4F+XQPoqqYoLdLuAchYVBmNZoQqyEOfAC2wexrHyszS5Fj", - "vIcQcZwKsKAAhc9t/1jJPIruRmvcOnqG87ces05bdFHmUBx36Q3nOWDDL2Ak3HUyeg8LQQtYYKEozsPb", - "t5uvzvbKRhJC9QunLLxfKixU2AGpN071eKD80unU607A2ZBOcLD+2TTFfjLroAJ5ChkKJeokwh5YtQxg", - "SkWqcyx6ILHcv6L3VPZ1ooITmlFr+gor6BHKIdU53IW7TO8R33J1zkkfJZzILbCt2o0eFE62nTjZDT4Q", - "ase9uE1oCISPdYGfHCZpCrI3vxt/ZhlF3HbKCTCX9EFEIKOM9h44X+HwnQsi+04jPaaetBzEmostZlQW", - "PYt0S8O+cbWzQ0HfQdx3/rbICMhAVECO7w9LtyWUZsm16Dtp8Z4zXhweNyFU510YmxN2E0tMD87YY1ir", - "yIPUy3zjuedn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KhxXzpUdQx85Somf/l2FmWNl+lPRdHYZ/mmsCa11+vPZKPBd6vXQRrWd8pG17+", - "Op3GgatYQdnApl/Cm37q/ta1FHL55YcmyDKaUmDp4SjU6eT33wOV67x7SuW2OmLf+piB66JSiHiGGh0I", - "M4IwynKO32L6cqQ/Gfn7KmrLcwJse/aK6GrqQyv/bFXV/Dxi6DCuf0ThkfuxiI+l7XHObcDoQ9WksJRQ", - "bPLDX6lxhvwbgXtOx2N+S5+I97hx2XXrwOE1CinrJumCE06cyYD9wudcskbPRa83EGX2xyBrO2j0fL9i", - "fgsyJPITE9KI38I4yY6XHZ9eejw6W2p/sSkII0mryXrkOCSgspua5y9CtyBHDkbLdt+V3fbWvTzMqp/r", - "2N0j+S0h9TBCxCU7BKzJRqWvWvkRaZFHs2inVClnSUIYts+6kw3lCS5p9BD7MrMkyXmK8x2Xavbb9Lep", - "lfn88N8AAAD//+A7BjN2KgAA", + "H4sIAAAAAAAC/+xa23LbONJ+FRT//5JrKTO7WzO6s+U46ypnolje2outlAoimhISEqBxcKxJ+d23APAk", + "EqRg+TSztVeOgu5Gd39fg43DjyjhecEZMCWj2Y9IJlvIsf3nqVI42ebAlPlVCF6AUBTsWMKZKgfUroBo", + "FkklKNtED3HEcA6egYc4EnCrqQASzf7tpOLa0Je4kufrr5AoY+gMS5hz7Zt/jSV4J08q+XKEMgUbEL3p", + "rYFK3Df5fIvZBvozXwiee2decEkV5cw3eRxdA5Z7Y43iUkHhV7rhh/NYT1saip2HVrme1hfge/b7zgEF", + "TOfG1JnEl1Ecna2l+bPAt3P7U+Znly0LjeMXWCp8DQkXpJ8nSoApmlIQ3qAl3GpgSQBRWoZaar6IjD+3", + "14A93lyOe/OpMCnEmZXFhFD3c7Fno6fVc+CzxhlVOz/KwQFftgOu1Rrr3tABKy08dMVKCbrWCkZDowry", + "0RixEHjnjZmATAQtOsxvDGQ8wdXg/wtIo1n0f5NmzZmUC87kqpIbJ0flwaEk2tF97+J2MlqTtHz0plbg", + "j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15eRw+p2xVcuDYBicasuN/8FR52E86xIzhVeZTigOzfbSqFxZjefKco43DCTV+Zyz", + "BJgSuPNUqlnpnOOH5STOVIDUMbeXPhd8E8ZDcb0QQ2JE/hEjsqyZIo+oXIsusvAeqlxJTU8Y1D4urejr", + "dY+pe+a8clANvByyr5zHRI5oJwNeeVeSPS97Pr10L3mwofuDtYwYOcoN9o71c6ZJ2n4BP8jMZSVf3y09", + "2xXMfZJpAitePqJ/ZKNo2qsqhJUsX5PUDPx5Oo09naNpAoeVfvIrHbUC9mfyufzylwmQpjShwJLdXqjT", + "k19/9dRocxN1/JavsRG3Zw+5iOjfiCHMCMLVV/31XzKVfnTu/+siMkVlGWIsmKEfkRZZNIu2ShVyNpkQ", + "ht2TxpM15RNc0OghbsvMJpOMJzjbcqlmv0x/mTqZLw//CQAA///JCz1BwjcAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index eb6c8ac..497fc76 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -47,6 +47,14 @@ type FastaRecord struct { Sequence string `json:"sequence"` } +// FastqRead defines model for FastqRead. +type FastqRead struct { + Identifier string `json:"Identifier"` + Optionals *map[string]string `json:"Optionals,omitempty"` + Quality string `json:"Quality"` + Sequence string `json:"Sequence"` +} + // Feature defines model for Feature. type Feature struct { Attributes map[string][]string `json:"attributes"` @@ -125,26 +133,41 @@ type Reference struct { Title string `json:"title"` } -// PostDesignCdsFixJSONBody defines parameters for PostDesignCdsFix. -type PostDesignCdsFixJSONBody struct { +// PostCdsFixJSONBody defines parameters for PostCdsFix. +type PostCdsFixJSONBody struct { Organism Organism `json:"organism"` RemoveSequences []string `json:"removeSequences"` Sequence string `json:"sequence"` } -// PostDesignCdsOptimizeJSONBody defines parameters for PostDesignCdsOptimize. -type PostDesignCdsOptimizeJSONBody struct { +// PostCdsOptimizeJSONBody defines parameters for PostCdsOptimize. +type PostCdsOptimizeJSONBody struct { Organism Organism `json:"organism"` Seed *int `json:"seed,omitempty"` Sequence string `json:"sequence"` } -// PostDesignCdsTranslateJSONBody defines parameters for PostDesignCdsTranslate. -type PostDesignCdsTranslateJSONBody struct { +// PostCdsTranslateJSONBody defines parameters for PostCdsTranslate. +type PostCdsTranslateJSONBody struct { Sequence string `json:"sequence"` TranslationTable int `json:"translation_table"` } +// PostCloningGoldengateJSONBody defines parameters for PostCloningGoldengate. +type PostCloningGoldengateJSONBody struct { + Enzyme *Enzyme `json:"enzyme,omitempty"` + Sequences *[]string `json:"sequences,omitempty"` +} + +// PostCloningLigateJSONBody defines parameters for PostCloningLigate. +type PostCloningLigateJSONBody = []Fragment + +// PostCloningRestrictionDigestJSONBody defines parameters for PostCloningRestrictionDigest. +type PostCloningRestrictionDigestJSONBody struct { + Enzyme *Enzyme `json:"enzyme,omitempty"` + Sequence *string `json:"sequence,omitempty"` +} + // PostExecuteLuaJSONBody defines parameters for PostExecuteLua. type PostExecuteLuaJSONBody struct { Attachments *[]Attachment `json:"attachments,omitempty"` @@ -154,36 +177,60 @@ type PostExecuteLuaJSONBody struct { // PostIoFastaParseTextBody defines parameters for PostIoFastaParse. type PostIoFastaParseTextBody = string +// PostIoFastaWriteJSONBody defines parameters for PostIoFastaWrite. +type PostIoFastaWriteJSONBody = []FastaRecord + +// PostIoFastqParseTextBody defines parameters for PostIoFastqParse. +type PostIoFastqParseTextBody = string + +// PostIoFastqWriteJSONBody defines parameters for PostIoFastqWrite. +type PostIoFastqWriteJSONBody = []FastqRead + // PostIoGenbankParseTextBody defines parameters for PostIoGenbankParse. type PostIoGenbankParseTextBody = string -// PostSimulateComplexPcrJSONBody defines parameters for PostSimulateComplexPcr. -type PostSimulateComplexPcrJSONBody struct { +// PostIoGenbankWriteJSONBody defines parameters for PostIoGenbankWrite. +type PostIoGenbankWriteJSONBody = []GenbankRecord + +// PostPcrComplexPcrJSONBody defines parameters for PostPcrComplexPcr. +type PostPcrComplexPcrJSONBody struct { Circular *bool `json:"circular,omitempty"` Primers []string `json:"primers"` TargetTm float32 `json:"target_tm"` Templates []string `json:"templates"` } -// PostSimulateFragmentJSONBody defines parameters for PostSimulateFragment. -type PostSimulateFragmentJSONBody struct { - ExcludeOverhangs *[]string `json:"exclude_overhangs,omitempty"` - MaxFragmentSize int `json:"max_fragment_size"` - MinFragmentSize int `json:"min_fragment_size"` - Sequence string `json:"sequence"` +// PostPcrPrimersDebruijnBarcodesJSONBody defines parameters for PostPcrPrimersDebruijnBarcodes. +type PostPcrPrimersDebruijnBarcodesJSONBody struct { + BannedSequences *[]string `json:"banned_sequences,omitempty"` + BarcodeLength int `json:"barcode_length"` + GcRange struct { + MaxGc *float32 `json:"max_gc,omitempty"` + MinGc *float32 `json:"min_gc,omitempty"` + } `json:"gc_range"` + MaxSubSequence int `json:"max_sub_sequence"` } -// PostSimulateGoldengateJSONBody defines parameters for PostSimulateGoldengate. -type PostSimulateGoldengateJSONBody struct { - Enzyme *Enzyme `json:"enzyme,omitempty"` - Sequences *[]string `json:"sequences,omitempty"` +// PostPcrPrimersMarmurDotyJSONBody defines parameters for PostPcrPrimersMarmurDoty. +type PostPcrPrimersMarmurDotyJSONBody struct { + Sequence string `json:"sequence"` } -// PostSimulateLigateJSONBody defines parameters for PostSimulateLigate. -type PostSimulateLigateJSONBody = []Fragment +// PostPcrPrimersMeltingTemperatureJSONBody defines parameters for PostPcrPrimersMeltingTemperature. +type PostPcrPrimersMeltingTemperatureJSONBody struct { + Sequence string `json:"sequence"` +} + +// PostPcrPrimersSantaLuciaJSONBody defines parameters for PostPcrPrimersSantaLucia. +type PostPcrPrimersSantaLuciaJSONBody struct { + MagnesiumConcentration float32 `json:"magnesiumConcentration"` + PrimerConcentration float32 `json:"primerConcentration"` + SaltConcentration float32 `json:"saltConcentration"` + Sequence string `json:"sequence"` +} -// PostSimulatePcrJSONBody defines parameters for PostSimulatePcr. -type PostSimulatePcrJSONBody struct { +// PostPcrSimplePcrJSONBody defines parameters for PostPcrSimplePcr. +type PostPcrSimplePcrJSONBody struct { Circular *bool `json:"circular,omitempty"` ForwardPrimer string `json:"forward_primer"` ReversePrimer string `json:"reverse_primer"` @@ -191,20 +238,31 @@ type PostSimulatePcrJSONBody struct { Template string `json:"template"` } -// PostSimulateRestrictionDigestJSONBody defines parameters for PostSimulateRestrictionDigest. -type PostSimulateRestrictionDigestJSONBody struct { - Enzyme *Enzyme `json:"enzyme,omitempty"` - Sequence *string `json:"sequence,omitempty"` +// PostSynthesisFragmentJSONBody defines parameters for PostSynthesisFragment. +type PostSynthesisFragmentJSONBody struct { + ExcludeOverhangs *[]string `json:"exclude_overhangs,omitempty"` + MaxFragmentSize int `json:"max_fragment_size"` + MinFragmentSize int `json:"min_fragment_size"` + Sequence string `json:"sequence"` } -// PostDesignCdsFixJSONRequestBody defines body for PostDesignCdsFix for application/json ContentType. -type PostDesignCdsFixJSONRequestBody PostDesignCdsFixJSONBody +// PostCdsFixJSONRequestBody defines body for PostCdsFix for application/json ContentType. +type PostCdsFixJSONRequestBody PostCdsFixJSONBody + +// PostCdsOptimizeJSONRequestBody defines body for PostCdsOptimize for application/json ContentType. +type PostCdsOptimizeJSONRequestBody PostCdsOptimizeJSONBody + +// PostCdsTranslateJSONRequestBody defines body for PostCdsTranslate for application/json ContentType. +type PostCdsTranslateJSONRequestBody PostCdsTranslateJSONBody -// PostDesignCdsOptimizeJSONRequestBody defines body for PostDesignCdsOptimize for application/json ContentType. -type PostDesignCdsOptimizeJSONRequestBody PostDesignCdsOptimizeJSONBody +// PostCloningGoldengateJSONRequestBody defines body for PostCloningGoldengate for application/json ContentType. +type PostCloningGoldengateJSONRequestBody PostCloningGoldengateJSONBody -// PostDesignCdsTranslateJSONRequestBody defines body for PostDesignCdsTranslate for application/json ContentType. -type PostDesignCdsTranslateJSONRequestBody PostDesignCdsTranslateJSONBody +// PostCloningLigateJSONRequestBody defines body for PostCloningLigate for application/json ContentType. +type PostCloningLigateJSONRequestBody = PostCloningLigateJSONBody + +// PostCloningRestrictionDigestJSONRequestBody defines body for PostCloningRestrictionDigest for application/json ContentType. +type PostCloningRestrictionDigestJSONRequestBody PostCloningRestrictionDigestJSONBody // PostExecuteLuaJSONRequestBody defines body for PostExecuteLua for application/json ContentType. type PostExecuteLuaJSONRequestBody PostExecuteLuaJSONBody @@ -212,23 +270,38 @@ type PostExecuteLuaJSONRequestBody PostExecuteLuaJSONBody // PostIoFastaParseTextRequestBody defines body for PostIoFastaParse for text/plain ContentType. type PostIoFastaParseTextRequestBody = PostIoFastaParseTextBody +// PostIoFastaWriteJSONRequestBody defines body for PostIoFastaWrite for application/json ContentType. +type PostIoFastaWriteJSONRequestBody = PostIoFastaWriteJSONBody + +// PostIoFastqParseTextRequestBody defines body for PostIoFastqParse for text/plain ContentType. +type PostIoFastqParseTextRequestBody = PostIoFastqParseTextBody + +// PostIoFastqWriteJSONRequestBody defines body for PostIoFastqWrite for application/json ContentType. +type PostIoFastqWriteJSONRequestBody = PostIoFastqWriteJSONBody + // PostIoGenbankParseTextRequestBody defines body for PostIoGenbankParse for text/plain ContentType. type PostIoGenbankParseTextRequestBody = PostIoGenbankParseTextBody -// PostSimulateComplexPcrJSONRequestBody defines body for PostSimulateComplexPcr for application/json ContentType. -type PostSimulateComplexPcrJSONRequestBody PostSimulateComplexPcrJSONBody +// PostIoGenbankWriteJSONRequestBody defines body for PostIoGenbankWrite for application/json ContentType. +type PostIoGenbankWriteJSONRequestBody = PostIoGenbankWriteJSONBody + +// PostPcrComplexPcrJSONRequestBody defines body for PostPcrComplexPcr for application/json ContentType. +type PostPcrComplexPcrJSONRequestBody PostPcrComplexPcrJSONBody + +// PostPcrPrimersDebruijnBarcodesJSONRequestBody defines body for PostPcrPrimersDebruijnBarcodes for application/json ContentType. +type PostPcrPrimersDebruijnBarcodesJSONRequestBody PostPcrPrimersDebruijnBarcodesJSONBody -// PostSimulateFragmentJSONRequestBody defines body for PostSimulateFragment for application/json ContentType. -type PostSimulateFragmentJSONRequestBody PostSimulateFragmentJSONBody +// PostPcrPrimersMarmurDotyJSONRequestBody defines body for PostPcrPrimersMarmurDoty for application/json ContentType. +type PostPcrPrimersMarmurDotyJSONRequestBody PostPcrPrimersMarmurDotyJSONBody -// PostSimulateGoldengateJSONRequestBody defines body for PostSimulateGoldengate for application/json ContentType. -type PostSimulateGoldengateJSONRequestBody PostSimulateGoldengateJSONBody +// PostPcrPrimersMeltingTemperatureJSONRequestBody defines body for PostPcrPrimersMeltingTemperature for application/json ContentType. +type PostPcrPrimersMeltingTemperatureJSONRequestBody PostPcrPrimersMeltingTemperatureJSONBody -// PostSimulateLigateJSONRequestBody defines body for PostSimulateLigate for application/json ContentType. -type PostSimulateLigateJSONRequestBody = PostSimulateLigateJSONBody +// PostPcrPrimersSantaLuciaJSONRequestBody defines body for PostPcrPrimersSantaLucia for application/json ContentType. +type PostPcrPrimersSantaLuciaJSONRequestBody PostPcrPrimersSantaLuciaJSONBody -// PostSimulatePcrJSONRequestBody defines body for PostSimulatePcr for application/json ContentType. -type PostSimulatePcrJSONRequestBody PostSimulatePcrJSONBody +// PostPcrSimplePcrJSONRequestBody defines body for PostPcrSimplePcr for application/json ContentType. +type PostPcrSimplePcrJSONRequestBody PostPcrSimplePcrJSONBody -// PostSimulateRestrictionDigestJSONRequestBody defines body for PostSimulateRestrictionDigest for application/json ContentType. -type PostSimulateRestrictionDigestJSONRequestBody PostSimulateRestrictionDigestJSONBody +// PostSynthesisFragmentJSONRequestBody defines body for PostSynthesisFragment for application/json ContentType. +type PostSynthesisFragmentJSONRequestBody PostSynthesisFragmentJSONBody diff --git a/api/go.mod b/api/go.mod index 7ae74e6..0e513d9 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,7 +3,6 @@ module github.com/koeng101/dnadesign/api go 1.21.5 require ( - github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b github.com/getkin/kin-openapi v0.122.0 github.com/go-chi/chi/v5 v5.0.10 github.com/koeng101/dnadesign/lib v0.0.0-20231216182748-f354ee0f2714 diff --git a/api/go.sum b/api/go.sum index 3651ca0..b903719 100644 --- a/api/go.sum +++ b/api/go.sum @@ -2,8 +2,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b h1:oy54yVy300Db264NfQCJubZHpJOl+SoT6udALQdFbSI= -github.com/flowchartsman/swaggerui v0.0.0-20221017034628-909ed4f3701b/go.mod h1:/RJwPD5L4xWgCbqQ1L5cB12ndgfKKT54n9cZFf+8pus= github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10= github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= diff --git a/api/spec.yaml b/api/spec.yaml index ea99cf7..1ad2513 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -27,6 +27,108 @@ components: required: - identifier - sequence + FastqRead: + type: object + properties: + Identifier: + type: string + Optionals: + type: object + additionalProperties: + type: string + Sequence: + type: string + Quality: + type: string + required: + - Identifier + - Sequence + - Quality + Slow5Header: + type: object + properties: + HeaderValues: + type: array + items: + $ref: '#/components/schemas/HeaderValue' + HeaderValue: + type: object + properties: + ReadGroupID: + type: integer + Slow5Version: + type: string + Attributes: + type: object + additionalProperties: + type: string + EndReasonHeaderMap: + type: object + additionalProperties: + type: integer + Slow5Read: + type: object + properties: + ReadID: + type: string + ReadGroupID: + type: integer + Digitisation: + type: number + Offset: + type: number + Range: + type: number + SamplingRate: + type: number + LenRawSignal: + type: integer + RawSignal: + type: array + items: + type: integer + ChannelNumber: + type: string + MedianBefore: + type: number + ReadNumber: + type: integer + StartMux: + type: integer + StartTime: + type: integer + EndReason: + type: string + EndReasonMap: + type: object + additionalProperties: + type: integer + PileupLine: + type: object + properties: + Sequence: + type: string + Position: + type: integer + ReferenceBase: + type: string + ReadCount: + type: integer + ReadResults: + type: array + items: + type: string + Quality: + type: string + required: + - Sequence + - Position + - ReferenceBase + - ReadCount + - ReadResults + - Quality + + GenbankRecord: type: object required: @@ -251,6 +353,51 @@ components: - From - To - Reason + Codon: + type: object + properties: + Triplet: + type: string + Weight: + type: integer + required: + - Triplet + - Weight + + AminoAcid: + type: object + properties: + Letter: + type: string + Codons: + type: array + items: + $ref: '#/components/schemas/Codon' + required: + - Letter + - Codons + + CodonTable: + type: object + properties: + StartCodons: + type: array + items: + type: string + StopCodons: + type: array + items: + type: string + AminoAcids: + type: array + items: + $ref: '#/components/schemas/AminoAcid' + required: + - StartCodons + - StopCodons + - AminoAcids + + paths: /execute_lua: post: @@ -317,6 +464,21 @@ paths: text/plain: schema: type: string + /io/fasta/write: + post: + tags: + - io + summary: Write FASTA data + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FastaRecord' + responses: + '200': + description: FASTA file written successfully /io/genbank/parse: post: tags: @@ -342,7 +504,227 @@ paths: text/plain: schema: type: string - /design/cds/fix: + /io/genbank/write: + post: + tags: + - io + summary: Write Genbank data + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GenbankRecord' + responses: + '200': + description: Genbank file written successfully + /io/fastq/parse: + post: + tags: + - io + summary: Parse FASTQ data + requestBody: + content: + text/plain: + schema: + type: string + responses: + '200': + description: Parsed FASTQ records + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FastqRead' + + /io/fastq/write: + post: + tags: + - io + summary: Write FASTQ data + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FastqRead' + responses: + '200': + description: FASTQ file written successfully + /io/pileup/parse: + post: + summary: Parse Pileup Data + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: string + required: + - data + responses: + '200': + description: Array of Pileup Lines + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PileupLine' + /io/pileup/write: + post: + summary: Write Pileup Data + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + lines: + type: array + items: + $ref: '#/components/schemas/PileupLine' + responses: + '200': + description: Pileup data string + content: + application/json: + schema: + type: object + properties: + data: + type: string + + /io/slow5/parse: + post: + summary: Parse slow5 Data + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: string + required: + - data + responses: + '200': + description: Parsed slow5 data + content: + application/json: + schema: + type: object + properties: + header: + $ref: '#/components/schemas/Slow5Header' + reads: + type: array + items: + $ref: '#/components/schemas/Slow5Read' + /io/slow5/write: + post: + summary: Write slow5 Data + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + header: + $ref: '#/components/schemas/Slow5Header' + reads: + type: array + items: + $ref: '#/components/schemas/Slow5Read' + responses: + '200': + description: slow5 data written successfully + content: + application/json: + schema: + type: object + properties: + data: + type: string + /io/slow5/svb_compress: + post: + summary: Compress Raw Signal with SVB + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + rawSignal: + type: array + items: + type: integer + responses: + '200': + description: Compressed raw signal + content: + application/json: + schema: + type: object + properties: + mask: + type: string + data: + type: string + /io/slow5/svb_decompress: + post: + summary: Decompress Raw Signal with SVB + tags: + - io + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + lenRawSignal: + type: integer + mask: + type: string + data: + type: string + responses: + '200': + description: Decompressed raw signal + content: + application/json: + schema: + type: object + properties: + rawSignal: + type: array + items: + type: integer + + + /cds/fix: post: tags: - cds @@ -395,7 +777,7 @@ paths: text/plain: schema: type: string - /design/cds/optimize: + /cds/optimize: post: tags: - cds @@ -435,7 +817,7 @@ paths: text/plain: schema: type: string - /design/cds/translate: + /cds/translate: post: tags: - cds @@ -465,58 +847,113 @@ paths: text/plain: schema: type: string - /simulate/fragment: + + + + /pcr/primers/debruijn_barcodes: post: tags: - - simulate - summary: Fragment CDS + - pcr + summary: Generate De Bruijn sequence-based barcodes requestBody: content: application/json: schema: type: object properties: - sequence: - type: string - min_fragment_size: + barcode_length: type: integer - default: 200 - max_fragment_size: + max_sub_sequence: type: integer - default: 300 - exclude_overhangs: + banned_sequences: type: array items: type: string - required: [sequence, min_fragment_size, max_fragment_size] + gc_range: + type: object + properties: + max_gc: + type: number + min_gc: + type: number + required: + - barcode_length + - max_sub_sequence + - gc_range responses: '200': - description: Array of fragments and a float - content: - application/json: - schema: - type: object - properties: - fragments: - type: array - items: - type: string - efficiency: - type: number - default: 0.99 - required: - - fragments - - efficiency - '500': - description: Internal server error - content: - text/plain: - schema: - type: string - /simulate/complex_pcr: + description: Array of generated barcode sequences + + /pcr/primers/marmur_doty: + post: + tags: + - pcr + summary: Calculate Melting Temperature using Marmur Doty method + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Calculated melting temperature as float + + /pcr/primers/santa_lucia: + post: + tags: + - pcr + summary: Calculate Melting Temperature using Santa Lucia method + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + primerConcentration: + type: number + saltConcentration: + type: number + magnesiumConcentration: + type: number + required: + - sequence + - primerConcentration + - saltConcentration + - magnesiumConcentration + responses: + '200': + description: Calculated melting temperature, dH, dS as floats + + /pcr/primers/melting_temperature: + post: + tags: + - pcr + summary: Calculate Melting Temperature + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Calculated melting temperature as float + + /pcr/complex_pcr: post: tags: - - simulate + - pcr summary: Simulate PCR requestBody: content: @@ -553,10 +990,11 @@ paths: text/plain: schema: type: string - /simulate/pcr: + + /pcr/simple_pcr: post: tags: - - simulate + - pcr summary: Simulate a simple PCR requestBody: content: @@ -589,10 +1027,51 @@ paths: text/plain: schema: type: string - /simulate/ligate: + + /pcr/primers/design_primers: + post: + summary: Design PCR Primers + tags: + - pcr + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + targetTm: + type: number + forward_overhang: + type: string + default: "" + reverse_overhang: + type: string + default: "" + required: + - sequence + - targetTm + responses: + '200': + description: Forward and reverse primers + content: + application/json: + schema: + type: object + properties: + forward_primer: + type: string + reverse_primer: + type: string + + + + /cloning/ligate: post: tags: - - simulate + - cloning summary: Simulate ligation requestBody: content: @@ -604,10 +1083,10 @@ paths: responses: '200': description: Ligated product strings - /simulate/restriction_digest: + /cloning/restriction_digest: post: tags: - - simulate + - cloning summary: Simulate restriction digest requestBody: content: @@ -628,11 +1107,11 @@ paths: text/plain: schema: type: string - /simulate/goldengate: + /cloning/goldengate: post: tags: - - simulate - summary: Simulate Golden Gate assembly + - cloning + summary: Simulate GoldenGate assembly requestBody: content: application/json: @@ -647,7 +1126,55 @@ paths: $ref: '#/components/schemas/Enzyme' responses: '200': - description: Golden Gate assembly product strings + description: GoldenGate assembly product strings + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + /cloning/fragment: + post: + tags: + - cloning + summary: Fragment DNA for GoldenGate + requestBody: + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + min_fragment_size: + type: integer + default: 200 + max_fragment_size: + type: integer + default: 300 + exclude_overhangs: + type: array + items: + type: string + required: [sequence, min_fragment_size, max_fragment_size] + responses: + '200': + description: Array of fragments and a float + content: + application/json: + schema: + type: object + properties: + fragments: + type: array + items: + type: string + efficiency: + type: number + default: 0.99 + required: + - fragments + - efficiency '500': description: Internal server error content: @@ -655,3 +1182,635 @@ paths: schema: type: string + + + + /folding/zuker: + post: + summary: Zuker Folding + tags: + - folding + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + temperature: + type: number + default: 37 + required: + - sequence + responses: + '200': + description: Folding results + content: + application/json: + schema: + type: object + properties: + dot_bracket: + type: string + score: + type: number + + /folding/linearfold/vienna_rna_fold: + post: + summary: Vienna RNA Fold + tags: + - folding + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + temperature: + type: number + default: 37 + required: + - sequence + responses: + '200': + description: Folding results + content: + application/json: + schema: + type: object + properties: + dot_bracket: + type: string + score: + type: number + /folding/linearfold/contra_fold_v2: + post: + summary: Contra Fold V2 + tags: + - folding + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Folding results + content: + application/json: + schema: + type: object + properties: + dot_bracket: + type: string + score: + type: number + + + + /seqhash: + post: + summary: Sequence Hashing + tags: + - seqhash + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + sequenceType: + type: string + enum: [DNA, PROTEIN, RNA] + circular: + type: boolean + doubleStranded: + type: boolean + required: + - sequence + - sequenceType + - circular + - doubleStranded + responses: + '200': + description: Sequence hash + content: + application/json: + schema: + type: object + properties: + hash: + type: string + + /seqhash_fragment: + post: + summary: Sequence Hashing for Fragment + tags: + - seqhash + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + forwardOverhangLength: + type: integer + format: int8 + reverseOverhangLength: + type: integer + format: int8 + required: + - sequence + - forwardOverhangLength + - reverseOverhangLength + responses: + '200': + description: Fragment sequence hash + content: + application/json: + schema: + type: object + properties: + hash: + type: string + + + + /codon_tables/new: + post: + summary: Create New Codon Table + tags: + - codon_tables + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + tableNumber: + type: integer + minimum: 1 + maximum: 33 + required: + - tableNumber + responses: + '200': + description: New Codon Table + content: + application/json: + schema: + $ref: '#/components/schemas/CodonTable' + + /codon_tables/from_genbank: + post: + summary: Create Weighted Codon Table from Genbank Record + tags: + - codon_tables + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + genbankRecord: + $ref: '#/components/schemas/GenbankRecord' + codonTable: + $ref: '#/components/schemas/CodonTable' + required: + - genbankRecord + - codonTable + responses: + '200': + description: New Weighted Codon Table + content: + application/json: + schema: + $ref: '#/components/schemas/CodonTable' + + /codon_tables/compromise_tables: + post: + summary: Create Compromise Codon Table + tags: + - codon_tables + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + codonTable1: + $ref: '#/components/schemas/CodonTable' + codonTable2: + $ref: '#/components/schemas/CodonTable' + required: + - codonTable1 + - codonTable2 + responses: + '200': + description: New Compromise Codon Table + content: + application/json: + schema: + $ref: '#/components/schemas/CodonTable' + /codon_tables/add_tables: + post: + summary: Add Two Codon Tables + tags: + - codon_tables + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + codonTable1: + $ref: '#/components/schemas/CodonTable' + codonTable2: + $ref: '#/components/schemas/CodonTable' + required: + - codonTable1 + - codonTable2 + responses: + '200': + description: New Codon Table from Addition + content: + application/json: + schema: + $ref: '#/components/schemas/CodonTable' + /codon_tables/default_organisms: + get: + summary: Get Default Organism Names + tags: + - codon_tables + responses: + '200': + description: List of default organism names + content: + application/json: + schema: + type: array + items: + type: string + /codon_tables/get_organism_table: + post: + summary: Get Codon Table for an Organism + tags: + - codon_tables + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + organism: + type: string + required: + - organism + responses: + '200': + description: Codon table for the specified organism + content: + application/json: + schema: + $ref: '#/components/schemas/CodonTable' + + + + /align/needleman_wunsch: + post: + summary: Perform Needleman-Wunsch Alignment + tags: + - align + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence_a: + type: string + sequence_b: + type: string + required: + - sequence_a + - sequence_b + responses: + '200': + description: Alignment results with score + content: + application/json: + schema: + type: object + properties: + score: + type: number + alignment_a: + type: string + alignment_b: + type: string + /align/smith_waterman: + post: + summary: Perform Smith-Waterman Alignment + tags: + - align + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence_a: + type: string + sequence_b: + type: string + required: + - sequence_a + - sequence_b + responses: + '200': + description: Alignment results with score + content: + application/json: + schema: + type: object + properties: + score: + type: number + alignment_a: + type: string + alignment_b: + type: string + /align/mash: + post: + summary: Calculate Mash Distance + tags: + - align + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence_a: + type: string + sequence_b: + type: string + kmer_size: + type: integer + sketch_size: + type: integer + required: + - sequence_a + - sequence_b + - kmer_size + - sketch_size + responses: + '200': + description: Mash distance result + content: + application/json: + schema: + type: object + properties: + distance: + type: number + /align/mash_many: + post: + summary: Calculate Mash Distance Against Many Sequences + tags: + - align + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + comparison_sequences: + type: array + items: + type: string + kmer_size: + type: integer + sketch_size: + type: integer + required: + - sequence + - comparison_sequences + - kmer_size + - sketch_size + responses: + '200': + description: List of Mash distances + content: + application/json: + schema: + type: array + items: + type: number + + + + + /utils/reverse_complement: + post: + summary: Reverse Complement of DNA Sequence + tags: + - utils + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Reverse complement sequence + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + + /utils/rna_reverse_complement: + post: + summary: Reverse Complement of RNA Sequence + tags: + - utils + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Reverse complement RNA sequence + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + + /utils/is_palindromic: + post: + summary: Check if Sequence is Palindromic + tags: + - utils + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + required: + - sequence + responses: + '200': + description: Palindromic status + content: + application/json: + schema: + type: object + properties: + isPalindromic: + type: boolean + + + + /random/random_dna: + post: + summary: Generate Random DNA Sequence + tags: + - random + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + length: + type: integer + seed: + type: integer + nullable: true + required: + - length + responses: + '200': + description: Random DNA sequence + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + + /random/random_rna: + post: + summary: Generate Random RNA Sequence + tags: + - random + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + length: + type: integer + seed: + type: integer + nullable: true + required: + - length + responses: + '200': + description: Random RNA sequence + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + + /random/random_protein: + post: + summary: Generate Random Protein Sequence + tags: + - random + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + length: + type: integer + seed: + type: integer + nullable: true + required: + - length + responses: + '200': + description: Random Protein sequence + content: + application/json: + schema: + type: object + properties: + sequence: + type: string + + + From 4b4d293907270fd4ded2917f59171e06b9cb7889 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 25 Dec 2023 23:17:43 -0800 Subject: [PATCH 15/21] add blanks for everything --- api/api/api.go | 243 ++- api/gen/dnadesign-server.gen.go | 3586 +++++++++++++++++++++++++------ api/gen/dnadesign-types.gen.go | 322 ++- api/spec.yaml | 27 - 4 files changed, 3359 insertions(+), 819 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index 487135a..61c8833 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -96,7 +96,7 @@ func InitializeApp() App { app.Router.HandleFunc("/", indexHandler) app.Router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(subFS)))) app.Router.HandleFunc("/scalar/", scalarHandler(jsonSwagger)) - app.Router.HandleFunc("/api.json", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write(jsonSwagger) }) + app.Router.HandleFunc("/spec.json", func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write(jsonSwagger) }) // Lua handlers. app.Router.HandleFunc("/api/execute_lua", appImpl.PostExecuteLua) @@ -115,7 +115,7 @@ func InitializeApp() App { app.Router.HandleFunc("/api/pcr/simple_pcr", appImpl.PostPcrSimplePcr) // Synthesis handlers. - app.Router.HandleFunc("/api/synthesis/fragment", appImpl.PostSynthesisFragment) + app.Router.HandleFunc("/api/synthesis/fragment", appImpl.PostCloningFragment) return app } @@ -165,9 +165,9 @@ func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, s L.SetGlobal("translate", L.NewFunction(app.LuaCdsTranslate)) // Add simulate functions - L.SetGlobal("fragment", L.NewFunction(app.LuaSimulateFragment)) - L.SetGlobal("complex_pcr", L.NewFunction(app.LuaSimulateComplexPcr)) - L.SetGlobal("pcr", L.NewFunction(app.LuaSimulatePcr)) + L.SetGlobal("fragment", L.NewFunction(app.LuaCloningFragment)) + L.SetGlobal("complex_pcr", L.NewFunction(app.LuaPcrComplexPcr)) + L.SetGlobal("pcr", L.NewFunction(app.LuaPcrSimplePcr)) // Execute the Lua script if err := L.DoString(data); err != nil { @@ -267,6 +267,7 @@ func (app *App) LuaIoFastaParse(L *lua.LState) int { func (app *App) PostIoFastaWrite(ctx context.Context, request gen.PostIoFastaWriteRequestObject) (gen.PostIoFastaWriteResponseObject, error) { return nil, nil } +func (app *App) LuaIoFastaWrite(L *lua.LState) int { return 0 } func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenbankParseRequestObject) (gen.PostIoGenbankParseResponseObject, error) { genbankString := *request.Body @@ -298,14 +299,47 @@ func (app *App) LuaIoGenbankParse(L *lua.LState) int { func (app *App) PostIoGenbankWrite(ctx context.Context, request gen.PostIoGenbankWriteRequestObject) (gen.PostIoGenbankWriteResponseObject, error) { return nil, nil } +func (app *App) LuaIoGenbankWrite(L *lua.LState) int { return 0 } func (app *App) PostIoFastqParse(ctx context.Context, request gen.PostIoFastqParseRequestObject) (gen.PostIoFastqParseResponseObject, error) { return nil, nil } +func (app *App) LuaIoFastqParse(L *lua.LState) int { return 0 } func (app *App) PostIoFastqWrite(ctx context.Context, request gen.PostIoFastqWriteRequestObject) (gen.PostIoFastqWriteResponseObject, error) { return nil, nil } +func (app *App) LuaIoFastqWrite(L *lua.LState) int { return 0 } + +func (app *App) PostIoSlow5Parse(ctx context.Context, request gen.PostIoSlow5ParseRequestObject) (gen.PostIoSlow5ParseResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoSlow5Parse(L *lua.LState) int { return 0 } + +func (app *App) PostIoSlow5Write(ctx context.Context, request gen.PostIoSlow5WriteRequestObject) (gen.PostIoSlow5WriteResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoSlow5Write(L *lua.LState) int { return 0 } + +func (app *App) PostIoSlow5SvbCompress(ctx context.Context, request gen.PostIoSlow5SvbCompressRequestObject) (gen.PostIoSlow5SvbCompressResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoSlow5SvbCompress(L *lua.LState) int { return 0 } + +func (app *App) PostIoSlow5SvbDecompress(ctx context.Context, request gen.PostIoSlow5SvbDecompressRequestObject) (gen.PostIoSlow5SvbDecompressResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoSlow5SvbDecompress(L *lua.LState) int { return 0 } + +func (app *App) PostIoPileupParse(ctx context.Context, request gen.PostIoPileupParseRequestObject) (gen.PostIoPileupParseResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoPileupParse(L *lua.LState) int { return 0 } + +func (app *App) PostIoPileupWrite(ctx context.Context, request gen.PostIoPileupWriteRequestObject) (gen.PostIoPileupWriteResponseObject, error) { + return nil, nil +} +func (app *App) LuaIoPileupWrite(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -457,8 +491,8 @@ func (app *App) PostPcrComplexPcr(ctx context.Context, request gen.PostPcrComple return gen.PostPcrComplexPcr200JSONResponse(amplicons), nil } -// LuaSimulateComplexPcr implements complex pcr in lua. -func (app *App) LuaSimulateComplexPcr(L *lua.LState) int { +// LuaPcrComplexPcr implements complex pcr in lua. +func (app *App) LuaPcrComplexPcr(L *lua.LState) int { templates, err := luaStringArrayToGoSlice(L, 1) if err != nil { L.RaiseError(err.Error()) @@ -494,8 +528,8 @@ func (app *App) PostPcrSimplePcr(ctx context.Context, request gen.PostPcrSimpleP return gen.PostPcrSimplePcr200JSONResponse(amplicons[0]), nil } -// LuaSimulatePcr implements pcr in lua -func (app *App) LuaSimulatePcr(L *lua.LState) int { +// LuaPcrSimplePcr implements pcr in lua +func (app *App) LuaPcrSimplePcr(L *lua.LState) int { template := L.ToString(1) forwardPrimer := L.ToString(2) reversePrimer := L.ToString(3) @@ -514,18 +548,27 @@ func (app *App) LuaSimulatePcr(L *lua.LState) int { func (app *App) PostPcrPrimersDebruijnBarcodes(ctx context.Context, request gen.PostPcrPrimersDebruijnBarcodesRequestObject) (gen.PostPcrPrimersDebruijnBarcodesResponseObject, error) { return nil, nil } +func (app *App) LuaPcrPrimersDebruijnBarcodes(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersMarmurDoty(ctx context.Context, request gen.PostPcrPrimersMarmurDotyRequestObject) (gen.PostPcrPrimersMarmurDotyResponseObject, error) { return nil, nil } +func (app *App) LuaPcrPrimersMarmurDoty(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersSantaLucia(ctx context.Context, request gen.PostPcrPrimersSantaLuciaRequestObject) (gen.PostPcrPrimersSantaLuciaResponseObject, error) { return nil, nil } +func (app *App) LuaPcrPrimersSantaLucia(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersMeltingTemperature(ctx context.Context, request gen.PostPcrPrimersMeltingTemperatureRequestObject) (gen.PostPcrPrimersMeltingTemperatureResponseObject, error) { return nil, nil } +func (app *App) LuaPcrPrimersMeltingTemperature(L *lua.LState) int { return 0 } + +func (app *App) PostPcrPrimersDesignPrimers(ctx context.Context, request gen.PostPcrPrimersDesignPrimersRequestObject) (gen.PostPcrPrimersDesignPrimersResponseObject, error) { + return nil, nil +} +func (app *App) LuaPcrPrimersDesignPrimers(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -538,13 +581,16 @@ func (app *App) PostPcrPrimersMeltingTemperature(ctx context.Context, request ge func (app *App) PostCloningGoldengate(ctx context.Context, request gen.PostCloningGoldengateRequestObject) (gen.PostCloningGoldengateResponseObject, error) { return nil, nil } +func (app *App) LuaCloningGoldengate(L *lua.LState) int { return 0 } func (app *App) PostCloningLigate(ctx context.Context, request gen.PostCloningLigateRequestObject) (gen.PostCloningLigateResponseObject, error) { return nil, nil } +func (app *App) LuaCloningLigate(L *lua.LState) int { return 0 } func (app *App) PostCloningRestrictionDigest(ctx context.Context, request gen.PostCloningRestrictionDigestRequestObject) (gen.PostCloningRestrictionDigestResponseObject, error) { return nil, nil } -func (app *App) PostSynthesisFragment(ctx context.Context, request gen.PostSynthesisFragmentRequestObject) (gen.PostSynthesisFragmentResponseObject, error) { +func (app *App) LuaCloningRestrictionDigest(L *lua.LState) int { return 0 } +func (app *App) PostCloningFragment(ctx context.Context, request gen.PostCloningFragmentRequestObject) (gen.PostCloningFragmentResponseObject, error) { var excludeOverhangs []string overhangs := *request.Body.ExcludeOverhangs if overhangs != nil { @@ -552,13 +598,13 @@ func (app *App) PostSynthesisFragment(ctx context.Context, request gen.PostSynth } fragments, efficiency, err := fragment.Fragment(request.Body.Sequence, request.Body.MinFragmentSize, request.Body.MaxFragmentSize, excludeOverhangs) if err != nil { - return gen.PostSynthesisFragment500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil + return gen.PostCloningFragment500TextResponse(fmt.Sprintf("Got internal server error: %s", err)), nil } - return gen.PostSynthesisFragment200JSONResponse{Fragments: fragments, Efficiency: float32(efficiency)}, nil + return gen.PostCloningFragment200JSONResponse{Fragments: fragments, Efficiency: float32(efficiency)}, nil } -// LuaSimulateFragment implements fragment in lua. -func (app *App) LuaSimulateFragment(L *lua.LState) int { +// LuaCloningFragment implements fragment in lua. +func (app *App) LuaCloningFragment(L *lua.LState) int { sequence := L.ToString(1) minFragmentSize := L.ToInt(2) maxFragmentSize := L.ToInt(3) @@ -591,17 +637,20 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -// -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -// -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} +func (app *App) PostFoldingZuker(ctx context.Context, request gen.PostFoldingZukerRequestObject) (gen.PostFoldingZukerResponseObject, error) { + return nil, nil +} +func (app *App) LuaFoldingZuker(L *lua.LState) int { return 0 } + +func (app *App) PostFoldingLinearfoldContraFoldV2(ctx context.Context, request gen.PostFoldingLinearfoldContraFoldV2RequestObject) (gen.PostFoldingLinearfoldContraFoldV2ResponseObject, error) { + return nil, nil +} +func (app *App) LuaFoldingLinearfoldContraFoldV2(L *lua.LState) int { return 0 } + +func (app *App) PostFoldingLinearfoldViennaRnaFold(ctx context.Context, request gen.PostFoldingLinearfoldViennaRnaFoldRequestObject) (gen.PostFoldingLinearfoldViennaRnaFoldResponseObject, error) { + return nil, nil +} +func (app *App) LuaFoldingLinearfoldViennaRnaFold(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -611,12 +660,15 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} +func (app *App) PostSeqhash(ctx context.Context, request gen.PostSeqhashRequestObject) (gen.PostSeqhashResponseObject, error) { + return nil, nil +} +func (app *App) LuaSeqhash(L *lua.LState) int { return 0 } + +func (app *App) PostSeqhashFragment(ctx context.Context, request gen.PostSeqhashFragmentRequestObject) (gen.PostSeqhashFragmentResponseObject, error) { + return nil, nil +} +func (app *App) LuaSeqhashFragment(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -626,24 +678,35 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} +func (app *App) PostCodonTablesFromGenbank(ctx context.Context, request gen.PostCodonTablesFromGenbankRequestObject) (gen.PostCodonTablesFromGenbankResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesFromGenbank(L *lua.LState) int { return 0 } + +func (app *App) PostCodonTablesNew(ctx context.Context, request gen.PostCodonTablesNewRequestObject) (gen.PostCodonTablesNewResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesNew(L *lua.LState) int { return 0 } + +func (app *App) PostCodonTablesCompromiseTables(ctx context.Context, request gen.PostCodonTablesCompromiseTablesRequestObject) (gen.PostCodonTablesCompromiseTablesResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesCompromiseTables(L *lua.LState) int { return 0 } + +func (app *App) PostCodonTablesAddTables(ctx context.Context, request gen.PostCodonTablesAddTablesRequestObject) (gen.PostCodonTablesAddTablesResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesAddTables(L *lua.LState) int { return 0 } + +func (app *App) GetCodonTablesDefaultOrganisms(ctx context.Context, request gen.GetCodonTablesDefaultOrganismsRequestObject) (gen.GetCodonTablesDefaultOrganismsResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesDefaultOrganisms(L *lua.LState) int { return 0 } + +func (app *App) PostCodonTablesGetOrganismTable(ctx context.Context, request gen.PostCodonTablesGetOrganismTableRequestObject) (gen.PostCodonTablesGetOrganismTableResponseObject, error) { + return nil, nil +} +func (app *App) LuaCodonTablesGetOrganismTable(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -653,18 +716,25 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} +func (app *App) PostAlignNeedlemanWunsch(ctx context.Context, request gen.PostAlignNeedlemanWunschRequestObject) (gen.PostAlignNeedlemanWunschResponseObject, error) { + return nil, nil +} +func (app *App) LuaAlignNeedlemanWunsch(L *lua.LState) int { return 0 } + +func (app *App) PostAlignSmithWaterman(ctx context.Context, request gen.PostAlignSmithWatermanRequestObject) (gen.PostAlignSmithWatermanResponseObject, error) { + return nil, nil +} +func (app *App) LuaAlignSmithWaterman(L *lua.LState) int { return 0 } + +func (app *App) PostAlignMash(ctx context.Context, request gen.PostAlignMashRequestObject) (gen.PostAlignMashResponseObject, error) { + return nil, nil +} +func (app *App) LuaPostAlignMash(L *lua.LState) int { return 0 } + +func (app *App) PostAlignMashMany(ctx context.Context, request gen.PostAlignMashManyRequestObject) (gen.PostAlignMashManyResponseObject, error) { + return nil, nil +} +func (app *App) LuaAlignMashMany(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -674,15 +744,15 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} +func (app *App) PostUtilsReverseComplement(ctx context.Context, request gen.PostUtilsReverseComplementRequestObject) (gen.PostUtilsReverseComplementResponseObject, error) { + return nil, nil +} +func (app *App) Lua(L *lua.LState) int { return 0 } + +func (app *App) PostUtilsIsPalindromic(ctx context.Context, request gen.PostUtilsIsPalindromicRequestObject) (gen.PostUtilsIsPalindromicResponseObject, error) { + return nil, nil +} +func (app *App) LuaUtilsIsPalindromic(L *lua.LState) int { return 0 } /* ***************************************************************************** @@ -692,15 +762,30 @@ func (app *App) LuaSimulateFragment(L *lua.LState) int { ***************************************************************************** */ +func (app *App) PostRandomRandomDna(ctx context.Context, request gen.PostRandomRandomDnaRequestObject) (gen.PostRandomRandomDnaResponseObject, error) { + return nil, nil +} +func (app *App) LuaRandomRandomDna(L *lua.LState) int { return 0 } + +func (app *App) PostRandomRandomRna(ctx context.Context, request gen.PostRandomRandomRnaRequestObject) (gen.PostRandomRandomRnaResponseObject, error) { + return nil, nil +} +func (app *App) LuaRandomRandomRna(L *lua.LState) int { return 0 } + +func (app *App) PostRandomRandomProtein(ctx context.Context, request gen.PostRandomRandomProteinRequestObject) (gen.PostRandomRandomProteinResponseObject, error) { + return nil, nil +} +func (app *App) LuaRandomRandomProtein(L *lua.LState) int { return 0 } + +/* +***************************************************************************** + +# Template for functions + +***************************************************************************** +*/ +//func (app *App) Lua(L *lua.LState) int { return 0 } //func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { // return nil, nil //} -// -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -// -//func (app *App) x(ctx context.Context, request gen.RequestObject) (gen.ResponseObject, error) { -// return nil, nil -//} -// +//func (app *App) Lua(L *lua.LState) int { return 0 } diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 198df07..c1d5a62 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -23,6 +23,18 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { + // Calculate Mash Distance + // (POST /align/mash) + PostAlignMash(w http.ResponseWriter, r *http.Request) + // Calculate Mash Distance Against Many Sequences + // (POST /align/mash_many) + PostAlignMashMany(w http.ResponseWriter, r *http.Request) + // Perform Needleman-Wunsch Alignment + // (POST /align/needleman_wunsch) + PostAlignNeedlemanWunsch(w http.ResponseWriter, r *http.Request) + // Perform Smith-Waterman Alignment + // (POST /align/smith_waterman) + PostAlignSmithWaterman(w http.ResponseWriter, r *http.Request) // Fix CDS // (POST /cds/fix) PostCdsFix(w http.ResponseWriter, r *http.Request) @@ -32,7 +44,10 @@ type ServerInterface interface { // Translate CDS // (POST /cds/translate) PostCdsTranslate(w http.ResponseWriter, r *http.Request) - // Simulate Golden Gate assembly + // Fragment DNA for GoldenGate + // (POST /cloning/fragment) + PostCloningFragment(w http.ResponseWriter, r *http.Request) + // Simulate GoldenGate assembly // (POST /cloning/goldengate) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) // Simulate ligation @@ -41,9 +56,36 @@ type ServerInterface interface { // Simulate restriction digest // (POST /cloning/restriction_digest) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) + // Add Two Codon Tables + // (POST /codon_tables/add_tables) + PostCodonTablesAddTables(w http.ResponseWriter, r *http.Request) + // Create Compromise Codon Table + // (POST /codon_tables/compromise_tables) + PostCodonTablesCompromiseTables(w http.ResponseWriter, r *http.Request) + // Get Default Organism Names + // (GET /codon_tables/default_organisms) + GetCodonTablesDefaultOrganisms(w http.ResponseWriter, r *http.Request) + // Create Weighted Codon Table from Genbank Record + // (POST /codon_tables/from_genbank) + PostCodonTablesFromGenbank(w http.ResponseWriter, r *http.Request) + // Get Codon Table for an Organism + // (POST /codon_tables/get_organism_table) + PostCodonTablesGetOrganismTable(w http.ResponseWriter, r *http.Request) + // Create New Codon Table + // (POST /codon_tables/new) + PostCodonTablesNew(w http.ResponseWriter, r *http.Request) // Run a lua script // (POST /execute_lua) PostExecuteLua(w http.ResponseWriter, r *http.Request) + // Contra Fold V2 + // (POST /folding/linearfold/contra_fold_v2) + PostFoldingLinearfoldContraFoldV2(w http.ResponseWriter, r *http.Request) + // Vienna RNA Fold + // (POST /folding/linearfold/vienna_rna_fold) + PostFoldingLinearfoldViennaRnaFold(w http.ResponseWriter, r *http.Request) + // Zuker Folding + // (POST /folding/zuker) + PostFoldingZuker(w http.ResponseWriter, r *http.Request) // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(w http.ResponseWriter, r *http.Request) @@ -62,12 +104,33 @@ type ServerInterface interface { // Write Genbank data // (POST /io/genbank/write) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) + // Parse Pileup Data + // (POST /io/pileup/parse) + PostIoPileupParse(w http.ResponseWriter, r *http.Request) + // Write Pileup Data + // (POST /io/pileup/write) + PostIoPileupWrite(w http.ResponseWriter, r *http.Request) + // Parse slow5 Data + // (POST /io/slow5/parse) + PostIoSlow5Parse(w http.ResponseWriter, r *http.Request) + // Compress Raw Signal with SVB + // (POST /io/slow5/svb_compress) + PostIoSlow5SvbCompress(w http.ResponseWriter, r *http.Request) + // Decompress Raw Signal with SVB + // (POST /io/slow5/svb_decompress) + PostIoSlow5SvbDecompress(w http.ResponseWriter, r *http.Request) + // Write slow5 Data + // (POST /io/slow5/write) + PostIoSlow5Write(w http.ResponseWriter, r *http.Request) // Simulate PCR // (POST /pcr/complex_pcr) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) // Generate De Bruijn sequence-based barcodes // (POST /pcr/primers/debruijn_barcodes) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) + // Design PCR Primers + // (POST /pcr/primers/design_primers) + PostPcrPrimersDesignPrimers(w http.ResponseWriter, r *http.Request) // Calculate Melting Temperature using Marmur Doty method // (POST /pcr/primers/marmur_doty) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) @@ -80,15 +143,57 @@ type ServerInterface interface { // Simulate a simple PCR // (POST /pcr/simple_pcr) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) - // Fragment CDS - // (POST /synthesis/fragment) - PostSynthesisFragment(w http.ResponseWriter, r *http.Request) + // Generate Random DNA Sequence + // (POST /random/random_dna) + PostRandomRandomDna(w http.ResponseWriter, r *http.Request) + // Generate Random Protein Sequence + // (POST /random/random_protein) + PostRandomRandomProtein(w http.ResponseWriter, r *http.Request) + // Generate Random RNA Sequence + // (POST /random/random_rna) + PostRandomRandomRna(w http.ResponseWriter, r *http.Request) + // Sequence Hashing + // (POST /seqhash) + PostSeqhash(w http.ResponseWriter, r *http.Request) + // Sequence Hashing for Fragment + // (POST /seqhash_fragment) + PostSeqhashFragment(w http.ResponseWriter, r *http.Request) + // Check if Sequence is Palindromic + // (POST /utils/is_palindromic) + PostUtilsIsPalindromic(w http.ResponseWriter, r *http.Request) + // Reverse Complement of DNA Sequence + // (POST /utils/reverse_complement) + PostUtilsReverseComplement(w http.ResponseWriter, r *http.Request) } // Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. type Unimplemented struct{} +// Calculate Mash Distance +// (POST /align/mash) +func (_ Unimplemented) PostAlignMash(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Calculate Mash Distance Against Many Sequences +// (POST /align/mash_many) +func (_ Unimplemented) PostAlignMashMany(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Perform Needleman-Wunsch Alignment +// (POST /align/needleman_wunsch) +func (_ Unimplemented) PostAlignNeedlemanWunsch(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Perform Smith-Waterman Alignment +// (POST /align/smith_waterman) +func (_ Unimplemented) PostAlignSmithWaterman(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Fix CDS // (POST /cds/fix) func (_ Unimplemented) PostCdsFix(w http.ResponseWriter, r *http.Request) { @@ -107,7 +212,13 @@ func (_ Unimplemented) PostCdsTranslate(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusNotImplemented) } -// Simulate Golden Gate assembly +// Fragment DNA for GoldenGate +// (POST /cloning/fragment) +func (_ Unimplemented) PostCloningFragment(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Simulate GoldenGate assembly // (POST /cloning/goldengate) func (_ Unimplemented) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) @@ -125,12 +236,66 @@ func (_ Unimplemented) PostCloningRestrictionDigest(w http.ResponseWriter, r *ht w.WriteHeader(http.StatusNotImplemented) } +// Add Two Codon Tables +// (POST /codon_tables/add_tables) +func (_ Unimplemented) PostCodonTablesAddTables(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Create Compromise Codon Table +// (POST /codon_tables/compromise_tables) +func (_ Unimplemented) PostCodonTablesCompromiseTables(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get Default Organism Names +// (GET /codon_tables/default_organisms) +func (_ Unimplemented) GetCodonTablesDefaultOrganisms(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Create Weighted Codon Table from Genbank Record +// (POST /codon_tables/from_genbank) +func (_ Unimplemented) PostCodonTablesFromGenbank(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get Codon Table for an Organism +// (POST /codon_tables/get_organism_table) +func (_ Unimplemented) PostCodonTablesGetOrganismTable(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Create New Codon Table +// (POST /codon_tables/new) +func (_ Unimplemented) PostCodonTablesNew(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Run a lua script // (POST /execute_lua) func (_ Unimplemented) PostExecuteLua(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } +// Contra Fold V2 +// (POST /folding/linearfold/contra_fold_v2) +func (_ Unimplemented) PostFoldingLinearfoldContraFoldV2(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Vienna RNA Fold +// (POST /folding/linearfold/vienna_rna_fold) +func (_ Unimplemented) PostFoldingLinearfoldViennaRnaFold(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Zuker Folding +// (POST /folding/zuker) +func (_ Unimplemented) PostFoldingZuker(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Parse FASTA data // (POST /io/fasta/parse) func (_ Unimplemented) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { @@ -167,6 +332,42 @@ func (_ Unimplemented) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request w.WriteHeader(http.StatusNotImplemented) } +// Parse Pileup Data +// (POST /io/pileup/parse) +func (_ Unimplemented) PostIoPileupParse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Write Pileup Data +// (POST /io/pileup/write) +func (_ Unimplemented) PostIoPileupWrite(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Parse slow5 Data +// (POST /io/slow5/parse) +func (_ Unimplemented) PostIoSlow5Parse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Compress Raw Signal with SVB +// (POST /io/slow5/svb_compress) +func (_ Unimplemented) PostIoSlow5SvbCompress(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Decompress Raw Signal with SVB +// (POST /io/slow5/svb_decompress) +func (_ Unimplemented) PostIoSlow5SvbDecompress(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Write slow5 Data +// (POST /io/slow5/write) +func (_ Unimplemented) PostIoSlow5Write(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Simulate PCR // (POST /pcr/complex_pcr) func (_ Unimplemented) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { @@ -179,6 +380,12 @@ func (_ Unimplemented) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r * w.WriteHeader(http.StatusNotImplemented) } +// Design PCR Primers +// (POST /pcr/primers/design_primers) +func (_ Unimplemented) PostPcrPrimersDesignPrimers(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // Calculate Melting Temperature using Marmur Doty method // (POST /pcr/primers/marmur_doty) func (_ Unimplemented) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { @@ -203,9 +410,45 @@ func (_ Unimplemented) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusNotImplemented) } -// Fragment CDS -// (POST /synthesis/fragment) -func (_ Unimplemented) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { +// Generate Random DNA Sequence +// (POST /random/random_dna) +func (_ Unimplemented) PostRandomRandomDna(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Generate Random Protein Sequence +// (POST /random/random_protein) +func (_ Unimplemented) PostRandomRandomProtein(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Generate Random RNA Sequence +// (POST /random/random_rna) +func (_ Unimplemented) PostRandomRandomRna(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Sequence Hashing +// (POST /seqhash) +func (_ Unimplemented) PostSeqhash(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Sequence Hashing for Fragment +// (POST /seqhash_fragment) +func (_ Unimplemented) PostSeqhashFragment(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Check if Sequence is Palindromic +// (POST /utils/is_palindromic) +func (_ Unimplemented) PostUtilsIsPalindromic(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Reverse Complement of DNA Sequence +// (POST /utils/reverse_complement) +func (_ Unimplemented) PostUtilsReverseComplement(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } @@ -218,6 +461,66 @@ type ServerInterfaceWrapper struct { type MiddlewareFunc func(http.Handler) http.Handler +// PostAlignMash operation middleware +func (siw *ServerInterfaceWrapper) PostAlignMash(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAlignMash(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAlignMashMany operation middleware +func (siw *ServerInterfaceWrapper) PostAlignMashMany(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAlignMashMany(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAlignNeedlemanWunsch operation middleware +func (siw *ServerInterfaceWrapper) PostAlignNeedlemanWunsch(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAlignNeedlemanWunsch(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAlignSmithWaterman operation middleware +func (siw *ServerInterfaceWrapper) PostAlignSmithWaterman(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAlignSmithWaterman(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + // PostCdsFix operation middleware func (siw *ServerInterfaceWrapper) PostCdsFix(w http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -263,6 +566,21 @@ func (siw *ServerInterfaceWrapper) PostCdsTranslate(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } +// PostCloningFragment operation middleware +func (siw *ServerInterfaceWrapper) PostCloningFragment(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostCloningFragment(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + // PostCloningGoldengate operation middleware func (siw *ServerInterfaceWrapper) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { ctx := r.Context() @@ -308,12 +626,12 @@ func (siw *ServerInterfaceWrapper) PostCloningRestrictionDigest(w http.ResponseW handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostExecuteLua operation middleware -func (siw *ServerInterfaceWrapper) PostExecuteLua(w http.ResponseWriter, r *http.Request) { +// PostCodonTablesAddTables operation middleware +func (siw *ServerInterfaceWrapper) PostCodonTablesAddTables(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostExecuteLua(w, r) + siw.Handler.PostCodonTablesAddTables(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -323,12 +641,12 @@ func (siw *ServerInterfaceWrapper) PostExecuteLua(w http.ResponseWriter, r *http handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoFastaParse operation middleware -func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { +// PostCodonTablesCompromiseTables operation middleware +func (siw *ServerInterfaceWrapper) PostCodonTablesCompromiseTables(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoFastaParse(w, r) + siw.Handler.PostCodonTablesCompromiseTables(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -338,12 +656,12 @@ func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoFastaWrite operation middleware -func (siw *ServerInterfaceWrapper) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { +// GetCodonTablesDefaultOrganisms operation middleware +func (siw *ServerInterfaceWrapper) GetCodonTablesDefaultOrganisms(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoFastaWrite(w, r) + siw.Handler.GetCodonTablesDefaultOrganisms(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -353,12 +671,12 @@ func (siw *ServerInterfaceWrapper) PostIoFastaWrite(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoFastqParse operation middleware -func (siw *ServerInterfaceWrapper) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { +// PostCodonTablesFromGenbank operation middleware +func (siw *ServerInterfaceWrapper) PostCodonTablesFromGenbank(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoFastqParse(w, r) + siw.Handler.PostCodonTablesFromGenbank(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -368,12 +686,12 @@ func (siw *ServerInterfaceWrapper) PostIoFastqParse(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoFastqWrite operation middleware -func (siw *ServerInterfaceWrapper) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { +// PostCodonTablesGetOrganismTable operation middleware +func (siw *ServerInterfaceWrapper) PostCodonTablesGetOrganismTable(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoFastqWrite(w, r) + siw.Handler.PostCodonTablesGetOrganismTable(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -383,12 +701,12 @@ func (siw *ServerInterfaceWrapper) PostIoFastqWrite(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoGenbankParse operation middleware -func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { +// PostCodonTablesNew operation middleware +func (siw *ServerInterfaceWrapper) PostCodonTablesNew(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoGenbankParse(w, r) + siw.Handler.PostCodonTablesNew(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -398,12 +716,12 @@ func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostIoGenbankWrite operation middleware -func (siw *ServerInterfaceWrapper) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { +// PostExecuteLua operation middleware +func (siw *ServerInterfaceWrapper) PostExecuteLua(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostIoGenbankWrite(w, r) + siw.Handler.PostExecuteLua(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -413,12 +731,12 @@ func (siw *ServerInterfaceWrapper) PostIoGenbankWrite(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrComplexPcr operation middleware -func (siw *ServerInterfaceWrapper) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { +// PostFoldingLinearfoldContraFoldV2 operation middleware +func (siw *ServerInterfaceWrapper) PostFoldingLinearfoldContraFoldV2(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrComplexPcr(w, r) + siw.Handler.PostFoldingLinearfoldContraFoldV2(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -428,12 +746,12 @@ func (siw *ServerInterfaceWrapper) PostPcrComplexPcr(w http.ResponseWriter, r *h handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrPrimersDebruijnBarcodes operation middleware -func (siw *ServerInterfaceWrapper) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { +// PostFoldingLinearfoldViennaRnaFold operation middleware +func (siw *ServerInterfaceWrapper) PostFoldingLinearfoldViennaRnaFold(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrPrimersDebruijnBarcodes(w, r) + siw.Handler.PostFoldingLinearfoldViennaRnaFold(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -443,12 +761,12 @@ func (siw *ServerInterfaceWrapper) PostPcrPrimersDebruijnBarcodes(w http.Respons handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrPrimersMarmurDoty operation middleware -func (siw *ServerInterfaceWrapper) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { +// PostFoldingZuker operation middleware +func (siw *ServerInterfaceWrapper) PostFoldingZuker(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrPrimersMarmurDoty(w, r) + siw.Handler.PostFoldingZuker(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -458,12 +776,12 @@ func (siw *ServerInterfaceWrapper) PostPcrPrimersMarmurDoty(w http.ResponseWrite handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrPrimersMeltingTemperature operation middleware -func (siw *ServerInterfaceWrapper) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { +// PostIoFastaParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrPrimersMeltingTemperature(w, r) + siw.Handler.PostIoFastaParse(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -473,12 +791,12 @@ func (siw *ServerInterfaceWrapper) PostPcrPrimersMeltingTemperature(w http.Respo handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrPrimersSantaLucia operation middleware -func (siw *ServerInterfaceWrapper) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { +// PostIoFastaWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrPrimersSantaLucia(w, r) + siw.Handler.PostIoFastaWrite(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -488,12 +806,12 @@ func (siw *ServerInterfaceWrapper) PostPcrPrimersSantaLucia(w http.ResponseWrite handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostPcrSimplePcr operation middleware -func (siw *ServerInterfaceWrapper) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { +// PostIoFastqParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostPcrSimplePcr(w, r) + siw.Handler.PostIoFastqParse(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -503,12 +821,12 @@ func (siw *ServerInterfaceWrapper) PostPcrSimplePcr(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSynthesisFragment operation middleware -func (siw *ServerInterfaceWrapper) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { +// PostIoFastqWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSynthesisFragment(w, r) + siw.Handler.PostIoFastqWrite(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -518,645 +836,742 @@ func (siw *ServerInterfaceWrapper) PostSynthesisFragment(w http.ResponseWriter, handler.ServeHTTP(w, r.WithContext(ctx)) } -type UnescapedCookieParamError struct { - ParamName string - Err error -} +// PostIoGenbankParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (e *UnescapedCookieParamError) Error() string { - return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName) -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoGenbankParse(w, r) + })) -func (e *UnescapedCookieParamError) Unwrap() error { - return e.Err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type UnmarshalingParamError struct { - ParamName string - Err error + handler.ServeHTTP(w, r.WithContext(ctx)) } -func (e *UnmarshalingParamError) Error() string { - return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) -} +// PostIoGenbankWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (e *UnmarshalingParamError) Unwrap() error { - return e.Err -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoGenbankWrite(w, r) + })) -type RequiredParamError struct { - ParamName string -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -func (e *RequiredParamError) Error() string { - return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type RequiredHeaderError struct { - ParamName string - Err error -} +// PostIoPileupParse operation middleware +func (siw *ServerInterfaceWrapper) PostIoPileupParse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (e *RequiredHeaderError) Error() string { - return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName) -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoPileupParse(w, r) + })) -func (e *RequiredHeaderError) Unwrap() error { - return e.Err + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) } -type InvalidParamFormatError struct { - ParamName string - Err error -} +// PostIoPileupWrite operation middleware +func (siw *ServerInterfaceWrapper) PostIoPileupWrite(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (e *InvalidParamFormatError) Error() string { - return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error()) -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoPileupWrite(w, r) + })) -func (e *InvalidParamFormatError) Unwrap() error { - return e.Err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type TooManyValuesForParamError struct { - ParamName string - Count int + handler.ServeHTTP(w, r.WithContext(ctx)) } -func (e *TooManyValuesForParamError) Error() string { - return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count) -} +// PostIoSlow5Parse operation middleware +func (siw *ServerInterfaceWrapper) PostIoSlow5Parse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -// Handler creates http.Handler with routing matching OpenAPI spec. -func Handler(si ServerInterface) http.Handler { - return HandlerWithOptions(si, ChiServerOptions{}) -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoSlow5Parse(w, r) + })) -type ChiServerOptions struct { - BaseURL string - BaseRouter chi.Router - Middlewares []MiddlewareFunc - ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux. -func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler { - return HandlerWithOptions(si, ChiServerOptions{ - BaseRouter: r, - }) + handler.ServeHTTP(w, r.WithContext(ctx)) } -func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler { - return HandlerWithOptions(si, ChiServerOptions{ - BaseURL: baseURL, - BaseRouter: r, - }) -} +// PostIoSlow5SvbCompress operation middleware +func (siw *ServerInterfaceWrapper) PostIoSlow5SvbCompress(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -// HandlerWithOptions creates http.Handler with additional options -func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler { - r := options.BaseRouter + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoSlow5SvbCompress(w, r) + })) - if r == nil { - r = chi.NewRouter() - } - if options.ErrorHandlerFunc == nil { - options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) { - http.Error(w, err.Error(), http.StatusBadRequest) - } - } - wrapper := ServerInterfaceWrapper{ - Handler: si, - HandlerMiddlewares: options.Middlewares, - ErrorHandlerFunc: options.ErrorHandlerFunc, + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) } - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cds/fix", wrapper.PostCdsFix) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cds/optimize", wrapper.PostCdsOptimize) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cds/translate", wrapper.PostCdsTranslate) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cloning/goldengate", wrapper.PostCloningGoldengate) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cloning/ligate", wrapper.PostCloningLigate) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cloning/restriction_digest", wrapper.PostCloningRestrictionDigest) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/execute_lua", wrapper.PostExecuteLua) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/fasta/parse", wrapper.PostIoFastaParse) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/fasta/write", wrapper.PostIoFastaWrite) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/fastq/parse", wrapper.PostIoFastqParse) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/fastq/write", wrapper.PostIoFastqWrite) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/genbank/parse", wrapper.PostIoGenbankParse) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/io/genbank/write", wrapper.PostIoGenbankWrite) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/complex_pcr", wrapper.PostPcrComplexPcr) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/primers/debruijn_barcodes", wrapper.PostPcrPrimersDebruijnBarcodes) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/primers/marmur_doty", wrapper.PostPcrPrimersMarmurDoty) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/primers/melting_temperature", wrapper.PostPcrPrimersMeltingTemperature) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/primers/santa_lucia", wrapper.PostPcrPrimersSantaLucia) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/pcr/simple_pcr", wrapper.PostPcrSimplePcr) - }) - r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/synthesis/fragment", wrapper.PostSynthesisFragment) - }) - - return r -} - -type PostCdsFixRequestObject struct { - Body *PostCdsFixJSONRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsFixResponseObject interface { - VisitPostCdsFixResponse(w http.ResponseWriter) error -} +// PostIoSlow5SvbDecompress operation middleware +func (siw *ServerInterfaceWrapper) PostIoSlow5SvbDecompress(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCdsFix200JSONResponse struct { - Changes []Change `json:"changes"` - Sequence string `json:"sequence"` -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoSlow5SvbDecompress(w, r) + })) -func (response PostCdsFix200JSONResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - return json.NewEncoder(w).Encode(response) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsFix400TextResponse string +// PostIoSlow5Write operation middleware +func (siw *ServerInterfaceWrapper) PostIoSlow5Write(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostCdsFix400TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(400) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostIoSlow5Write(w, r) + })) - _, err := w.Write([]byte(response)) - return err + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsFix500TextResponse string +// PostPcrComplexPcr operation middleware +func (siw *ServerInterfaceWrapper) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostCdsFix500TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrComplexPcr(w, r) + })) - _, err := w.Write([]byte(response)) - return err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostCdsOptimizeRequestObject struct { - Body *PostCdsOptimizeJSONRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsOptimizeResponseObject interface { - VisitPostCdsOptimizeResponse(w http.ResponseWriter) error -} +// PostPcrPrimersDebruijnBarcodes operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCdsOptimize200JSONResponse string + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrPrimersDebruijnBarcodes(w, r) + })) -func (response PostCdsOptimize200JSONResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - return json.NewEncoder(w).Encode(response) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsOptimize400TextResponse string +// PostPcrPrimersDesignPrimers operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersDesignPrimers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostCdsOptimize400TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(400) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrPrimersDesignPrimers(w, r) + })) - _, err := w.Write([]byte(response)) - return err + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsOptimize500TextResponse string +// PostPcrPrimersMarmurDoty operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostCdsOptimize500TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrPrimersMarmurDoty(w, r) + })) - _, err := w.Write([]byte(response)) - return err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostCdsTranslateRequestObject struct { - Body *PostCdsTranslateJSONRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsTranslateResponseObject interface { - VisitPostCdsTranslateResponse(w http.ResponseWriter) error -} +// PostPcrPrimersMeltingTemperature operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCdsTranslate200JSONResponse string + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrPrimersMeltingTemperature(w, r) + })) -func (response PostCdsTranslate200JSONResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - return json.NewEncoder(w).Encode(response) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCdsTranslate500TextResponse string - -func (response PostCdsTranslate500TextResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) - - _, err := w.Write([]byte(response)) - return err -} +// PostPcrPrimersSantaLucia operation middleware +func (siw *ServerInterfaceWrapper) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCloningGoldengateRequestObject struct { - Body *PostCloningGoldengateJSONRequestBody -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrPrimersSantaLucia(w, r) + })) -type PostCloningGoldengateResponseObject interface { - VisitPostCloningGoldengateResponse(w http.ResponseWriter) error -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostCloningGoldengate200Response struct { + handler.ServeHTTP(w, r.WithContext(ctx)) } -func (response PostCloningGoldengate200Response) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil -} +// PostPcrSimplePcr operation middleware +func (siw *ServerInterfaceWrapper) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCloningGoldengate500TextResponse string + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPcrSimplePcr(w, r) + })) -func (response PostCloningGoldengate500TextResponse) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - _, err := w.Write([]byte(response)) - return err + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCloningLigateRequestObject struct { - Body *PostCloningLigateJSONRequestBody -} +// PostRandomRandomDna operation middleware +func (siw *ServerInterfaceWrapper) PostRandomRandomDna(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCloningLigateResponseObject interface { - VisitPostCloningLigateResponse(w http.ResponseWriter) error -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostRandomRandomDna(w, r) + })) -type PostCloningLigate200Response struct { -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -func (response PostCloningLigate200Response) VisitPostCloningLigateResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCloningRestrictionDigestRequestObject struct { - Body *PostCloningRestrictionDigestJSONRequestBody -} +// PostRandomRandomProtein operation middleware +func (siw *ServerInterfaceWrapper) PostRandomRandomProtein(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostCloningRestrictionDigestResponseObject interface { - VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostRandomRandomProtein(w, r) + })) -type PostCloningRestrictionDigest200Response struct { -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -func (response PostCloningRestrictionDigest200Response) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostCloningRestrictionDigest500TextResponse string +// PostRandomRandomRna operation middleware +func (siw *ServerInterfaceWrapper) PostRandomRandomRna(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostCloningRestrictionDigest500TextResponse) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostRandomRandomRna(w, r) + })) - _, err := w.Write([]byte(response)) - return err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostExecuteLuaRequestObject struct { - Body *PostExecuteLuaJSONRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostExecuteLuaResponseObject interface { - VisitPostExecuteLuaResponse(w http.ResponseWriter) error -} +// PostSeqhash operation middleware +func (siw *ServerInterfaceWrapper) PostSeqhash(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostExecuteLua200JSONResponse struct { - Log string `json:"log"` - Output string `json:"output"` -} + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSeqhash(w, r) + })) -func (response PostExecuteLua200JSONResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - return json.NewEncoder(w).Encode(response) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostExecuteLua500TextResponse string +// PostSeqhashFragment operation middleware +func (siw *ServerInterfaceWrapper) PostSeqhashFragment(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostExecuteLua500TextResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostSeqhashFragment(w, r) + })) - _, err := w.Write([]byte(response)) - return err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostIoFastaParseRequestObject struct { - Body *PostIoFastaParseTextRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostIoFastaParseResponseObject interface { - VisitPostIoFastaParseResponse(w http.ResponseWriter) error -} +// PostUtilsIsPalindromic operation middleware +func (siw *ServerInterfaceWrapper) PostUtilsIsPalindromic(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -type PostIoFastaParse200JSONResponse []FastaRecord + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostUtilsIsPalindromic(w, r) + })) -func (response PostIoFastaParse200JSONResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } - return json.NewEncoder(w).Encode(response) + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostIoFastaParse500TextResponse string +// PostUtilsReverseComplement operation middleware +func (siw *ServerInterfaceWrapper) PostUtilsReverseComplement(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() -func (response PostIoFastaParse500TextResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostUtilsReverseComplement(w, r) + })) - _, err := w.Write([]byte(response)) - return err -} + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } -type PostIoFastaWriteRequestObject struct { - Body *PostIoFastaWriteJSONRequestBody + handler.ServeHTTP(w, r.WithContext(ctx)) } -type PostIoFastaWriteResponseObject interface { - VisitPostIoFastaWriteResponse(w http.ResponseWriter) error +type UnescapedCookieParamError struct { + ParamName string + Err error } -type PostIoFastaWrite200Response struct { +func (e *UnescapedCookieParamError) Error() string { + return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName) } -func (response PostIoFastaWrite200Response) VisitPostIoFastaWriteResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil +func (e *UnescapedCookieParamError) Unwrap() error { + return e.Err } -type PostIoFastqParseRequestObject struct { - Body *PostIoFastqParseTextRequestBody +type UnmarshalingParamError struct { + ParamName string + Err error } -type PostIoFastqParseResponseObject interface { - VisitPostIoFastqParseResponse(w http.ResponseWriter) error +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -type PostIoFastqParse200JSONResponse []FastqRead - -func (response PostIoFastqParse200JSONResponse) VisitPostIoFastqParseResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) +func (e *UnmarshalingParamError) Unwrap() error { + return e.Err } -type PostIoFastqWriteRequestObject struct { - Body *PostIoFastqWriteJSONRequestBody +type RequiredParamError struct { + ParamName string } -type PostIoFastqWriteResponseObject interface { - VisitPostIoFastqWriteResponse(w http.ResponseWriter) error +func (e *RequiredParamError) Error() string { + return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName) } -type PostIoFastqWrite200Response struct { +type RequiredHeaderError struct { + ParamName string + Err error } -func (response PostIoFastqWrite200Response) VisitPostIoFastqWriteResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil +func (e *RequiredHeaderError) Error() string { + return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName) } -type PostIoGenbankParseRequestObject struct { - Body *PostIoGenbankParseTextRequestBody +func (e *RequiredHeaderError) Unwrap() error { + return e.Err } -type PostIoGenbankParseResponseObject interface { - VisitPostIoGenbankParseResponse(w http.ResponseWriter) error +type InvalidParamFormatError struct { + ParamName string + Err error } -type PostIoGenbankParse200JSONResponse []GenbankRecord - -func (response PostIoGenbankParse200JSONResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) +func (e *InvalidParamFormatError) Error() string { + return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error()) } -type PostIoGenbankParse500TextResponse string - -func (response PostIoGenbankParse500TextResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) - - _, err := w.Write([]byte(response)) - return err +func (e *InvalidParamFormatError) Unwrap() error { + return e.Err } -type PostIoGenbankWriteRequestObject struct { - Body *PostIoGenbankWriteJSONRequestBody +type TooManyValuesForParamError struct { + ParamName string + Count int } -type PostIoGenbankWriteResponseObject interface { - VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error +func (e *TooManyValuesForParamError) Error() string { + return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count) } -type PostIoGenbankWrite200Response struct { +// Handler creates http.Handler with routing matching OpenAPI spec. +func Handler(si ServerInterface) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{}) } -func (response PostIoGenbankWrite200Response) VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error { - w.WriteHeader(200) - return nil +type ChiServerOptions struct { + BaseURL string + BaseRouter chi.Router + Middlewares []MiddlewareFunc + ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) } -type PostPcrComplexPcrRequestObject struct { - Body *PostPcrComplexPcrJSONRequestBody +// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux. +func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseRouter: r, + }) } -type PostPcrComplexPcrResponseObject interface { - VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error +func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseURL: baseURL, + BaseRouter: r, + }) } -type PostPcrComplexPcr200JSONResponse []string - -func (response PostPcrComplexPcr200JSONResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) -} +// HandlerWithOptions creates http.Handler with additional options +func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler { + r := options.BaseRouter -type PostPcrComplexPcr500TextResponse string + if r == nil { + r = chi.NewRouter() + } + if options.ErrorHandlerFunc == nil { + options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusBadRequest) + } + } + wrapper := ServerInterfaceWrapper{ + Handler: si, + HandlerMiddlewares: options.Middlewares, + ErrorHandlerFunc: options.ErrorHandlerFunc, + } -func (response PostPcrComplexPcr500TextResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/align/mash", wrapper.PostAlignMash) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/align/mash_many", wrapper.PostAlignMashMany) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/align/needleman_wunsch", wrapper.PostAlignNeedlemanWunsch) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/align/smith_waterman", wrapper.PostAlignSmithWaterman) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cds/fix", wrapper.PostCdsFix) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cds/optimize", wrapper.PostCdsOptimize) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cds/translate", wrapper.PostCdsTranslate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cloning/fragment", wrapper.PostCloningFragment) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cloning/goldengate", wrapper.PostCloningGoldengate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cloning/ligate", wrapper.PostCloningLigate) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/cloning/restriction_digest", wrapper.PostCloningRestrictionDigest) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/codon_tables/add_tables", wrapper.PostCodonTablesAddTables) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/codon_tables/compromise_tables", wrapper.PostCodonTablesCompromiseTables) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/codon_tables/default_organisms", wrapper.GetCodonTablesDefaultOrganisms) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/codon_tables/from_genbank", wrapper.PostCodonTablesFromGenbank) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/codon_tables/get_organism_table", wrapper.PostCodonTablesGetOrganismTable) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/codon_tables/new", wrapper.PostCodonTablesNew) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/execute_lua", wrapper.PostExecuteLua) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/folding/linearfold/contra_fold_v2", wrapper.PostFoldingLinearfoldContraFoldV2) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/folding/linearfold/vienna_rna_fold", wrapper.PostFoldingLinearfoldViennaRnaFold) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/folding/zuker", wrapper.PostFoldingZuker) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fasta/parse", wrapper.PostIoFastaParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fasta/write", wrapper.PostIoFastaWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fastq/parse", wrapper.PostIoFastqParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/fastq/write", wrapper.PostIoFastqWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/genbank/parse", wrapper.PostIoGenbankParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/genbank/write", wrapper.PostIoGenbankWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/pileup/parse", wrapper.PostIoPileupParse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/pileup/write", wrapper.PostIoPileupWrite) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/slow5/parse", wrapper.PostIoSlow5Parse) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/slow5/svb_compress", wrapper.PostIoSlow5SvbCompress) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/slow5/svb_decompress", wrapper.PostIoSlow5SvbDecompress) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/io/slow5/write", wrapper.PostIoSlow5Write) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/complex_pcr", wrapper.PostPcrComplexPcr) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/debruijn_barcodes", wrapper.PostPcrPrimersDebruijnBarcodes) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/design_primers", wrapper.PostPcrPrimersDesignPrimers) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/marmur_doty", wrapper.PostPcrPrimersMarmurDoty) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/melting_temperature", wrapper.PostPcrPrimersMeltingTemperature) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/primers/santa_lucia", wrapper.PostPcrPrimersSantaLucia) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/pcr/simple_pcr", wrapper.PostPcrSimplePcr) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/random/random_dna", wrapper.PostRandomRandomDna) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/random/random_protein", wrapper.PostRandomRandomProtein) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/random/random_rna", wrapper.PostRandomRandomRna) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/seqhash", wrapper.PostSeqhash) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/seqhash_fragment", wrapper.PostSeqhashFragment) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/utils/is_palindromic", wrapper.PostUtilsIsPalindromic) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/utils/reverse_complement", wrapper.PostUtilsReverseComplement) + }) - _, err := w.Write([]byte(response)) - return err + return r } -type PostPcrPrimersDebruijnBarcodesRequestObject struct { - Body *PostPcrPrimersDebruijnBarcodesJSONRequestBody +type PostAlignMashRequestObject struct { + Body *PostAlignMashJSONRequestBody } -type PostPcrPrimersDebruijnBarcodesResponseObject interface { - VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error +type PostAlignMashResponseObject interface { + VisitPostAlignMashResponse(w http.ResponseWriter) error } -type PostPcrPrimersDebruijnBarcodes200Response struct { +type PostAlignMash200JSONResponse struct { + Distance *float32 `json:"distance,omitempty"` } -func (response PostPcrPrimersDebruijnBarcodes200Response) VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error { +func (response PostAlignMash200JSONResponse) VisitPostAlignMashResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil -} -type PostPcrPrimersMarmurDotyRequestObject struct { - Body *PostPcrPrimersMarmurDotyJSONRequestBody + return json.NewEncoder(w).Encode(response) } -type PostPcrPrimersMarmurDotyResponseObject interface { - VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error +type PostAlignMashManyRequestObject struct { + Body *PostAlignMashManyJSONRequestBody } -type PostPcrPrimersMarmurDoty200Response struct { +type PostAlignMashManyResponseObject interface { + VisitPostAlignMashManyResponse(w http.ResponseWriter) error } -func (response PostPcrPrimersMarmurDoty200Response) VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error { +type PostAlignMashMany200JSONResponse []float32 + +func (response PostAlignMashMany200JSONResponse) VisitPostAlignMashManyResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } -type PostPcrPrimersMeltingTemperatureRequestObject struct { - Body *PostPcrPrimersMeltingTemperatureJSONRequestBody +type PostAlignNeedlemanWunschRequestObject struct { + Body *PostAlignNeedlemanWunschJSONRequestBody } -type PostPcrPrimersMeltingTemperatureResponseObject interface { - VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error +type PostAlignNeedlemanWunschResponseObject interface { + VisitPostAlignNeedlemanWunschResponse(w http.ResponseWriter) error } -type PostPcrPrimersMeltingTemperature200Response struct { +type PostAlignNeedlemanWunsch200JSONResponse struct { + AlignmentA *string `json:"alignment_a,omitempty"` + AlignmentB *string `json:"alignment_b,omitempty"` + Score *float32 `json:"score,omitempty"` } -func (response PostPcrPrimersMeltingTemperature200Response) VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error { +func (response PostAlignNeedlemanWunsch200JSONResponse) VisitPostAlignNeedlemanWunschResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } -type PostPcrPrimersSantaLuciaRequestObject struct { - Body *PostPcrPrimersSantaLuciaJSONRequestBody +type PostAlignSmithWatermanRequestObject struct { + Body *PostAlignSmithWatermanJSONRequestBody } -type PostPcrPrimersSantaLuciaResponseObject interface { - VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error +type PostAlignSmithWatermanResponseObject interface { + VisitPostAlignSmithWatermanResponse(w http.ResponseWriter) error } -type PostPcrPrimersSantaLucia200Response struct { +type PostAlignSmithWaterman200JSONResponse struct { + AlignmentA *string `json:"alignment_a,omitempty"` + AlignmentB *string `json:"alignment_b,omitempty"` + Score *float32 `json:"score,omitempty"` } -func (response PostPcrPrimersSantaLucia200Response) VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error { +func (response PostAlignSmithWaterman200JSONResponse) VisitPostAlignSmithWatermanResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } -type PostPcrSimplePcrRequestObject struct { - Body *PostPcrSimplePcrJSONRequestBody +type PostCdsFixRequestObject struct { + Body *PostCdsFixJSONRequestBody } -type PostPcrSimplePcrResponseObject interface { - VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error +type PostCdsFixResponseObject interface { + VisitPostCdsFixResponse(w http.ResponseWriter) error } -type PostPcrSimplePcr200JSONResponse string +type PostCdsFix200JSONResponse struct { + Changes []Change `json:"changes"` + Sequence string `json:"sequence"` +} -func (response PostPcrSimplePcr200JSONResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { +func (response PostCdsFix200JSONResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostPcrSimplePcr500TextResponse string +type PostCdsFix400TextResponse string -func (response PostPcrSimplePcr500TextResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { +func (response PostCdsFix400TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(500) + w.WriteHeader(400) _, err := w.Write([]byte(response)) return err } -type PostSynthesisFragmentRequestObject struct { - Body *PostSynthesisFragmentJSONRequestBody +type PostCdsFix500TextResponse string + +func (response PostCdsFix500TextResponse) VisitPostCdsFixResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err } -type PostSynthesisFragmentResponseObject interface { - VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error +type PostCdsOptimizeRequestObject struct { + Body *PostCdsOptimizeJSONRequestBody } -type PostSynthesisFragment200JSONResponse struct { - Efficiency float32 `json:"efficiency"` - Fragments []string `json:"fragments"` +type PostCdsOptimizeResponseObject interface { + VisitPostCdsOptimizeResponse(w http.ResponseWriter) error } -func (response PostSynthesisFragment200JSONResponse) VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error { +type PostCdsOptimize200JSONResponse string + +func (response PostCdsOptimize200JSONResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostSynthesisFragment500TextResponse string +type PostCdsOptimize400TextResponse string + +func (response PostCdsOptimize400TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(400) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCdsOptimize500TextResponse string -func (response PostSynthesisFragment500TextResponse) VisitPostSynthesisFragmentResponse(w http.ResponseWriter) error { +func (response PostCdsOptimize500TextResponse) VisitPostCdsOptimizeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -1164,8 +1579,840 @@ func (response PostSynthesisFragment500TextResponse) VisitPostSynthesisFragmentR return err } -// StrictServerInterface represents all server handlers. -type StrictServerInterface interface { +type PostCdsTranslateRequestObject struct { + Body *PostCdsTranslateJSONRequestBody +} + +type PostCdsTranslateResponseObject interface { + VisitPostCdsTranslateResponse(w http.ResponseWriter) error +} + +type PostCdsTranslate200JSONResponse string + +func (response PostCdsTranslate200JSONResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCdsTranslate500TextResponse string + +func (response PostCdsTranslate500TextResponse) VisitPostCdsTranslateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCloningFragmentRequestObject struct { + Body *PostCloningFragmentJSONRequestBody +} + +type PostCloningFragmentResponseObject interface { + VisitPostCloningFragmentResponse(w http.ResponseWriter) error +} + +type PostCloningFragment200JSONResponse struct { + Efficiency float32 `json:"efficiency"` + Fragments []string `json:"fragments"` +} + +func (response PostCloningFragment200JSONResponse) VisitPostCloningFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCloningFragment500TextResponse string + +func (response PostCloningFragment500TextResponse) VisitPostCloningFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCloningGoldengateRequestObject struct { + Body *PostCloningGoldengateJSONRequestBody +} + +type PostCloningGoldengateResponseObject interface { + VisitPostCloningGoldengateResponse(w http.ResponseWriter) error +} + +type PostCloningGoldengate200Response struct { +} + +func (response PostCloningGoldengate200Response) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningGoldengate500TextResponse string + +func (response PostCloningGoldengate500TextResponse) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCloningLigateRequestObject struct { + Body *PostCloningLigateJSONRequestBody +} + +type PostCloningLigateResponseObject interface { + VisitPostCloningLigateResponse(w http.ResponseWriter) error +} + +type PostCloningLigate200Response struct { +} + +func (response PostCloningLigate200Response) VisitPostCloningLigateResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningRestrictionDigestRequestObject struct { + Body *PostCloningRestrictionDigestJSONRequestBody +} + +type PostCloningRestrictionDigestResponseObject interface { + VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error +} + +type PostCloningRestrictionDigest200Response struct { +} + +func (response PostCloningRestrictionDigest200Response) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostCloningRestrictionDigest500TextResponse string + +func (response PostCloningRestrictionDigest500TextResponse) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostCodonTablesAddTablesRequestObject struct { + Body *PostCodonTablesAddTablesJSONRequestBody +} + +type PostCodonTablesAddTablesResponseObject interface { + VisitPostCodonTablesAddTablesResponse(w http.ResponseWriter) error +} + +type PostCodonTablesAddTables200JSONResponse CodonTable + +func (response PostCodonTablesAddTables200JSONResponse) VisitPostCodonTablesAddTablesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCodonTablesCompromiseTablesRequestObject struct { + Body *PostCodonTablesCompromiseTablesJSONRequestBody +} + +type PostCodonTablesCompromiseTablesResponseObject interface { + VisitPostCodonTablesCompromiseTablesResponse(w http.ResponseWriter) error +} + +type PostCodonTablesCompromiseTables200JSONResponse CodonTable + +func (response PostCodonTablesCompromiseTables200JSONResponse) VisitPostCodonTablesCompromiseTablesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetCodonTablesDefaultOrganismsRequestObject struct { +} + +type GetCodonTablesDefaultOrganismsResponseObject interface { + VisitGetCodonTablesDefaultOrganismsResponse(w http.ResponseWriter) error +} + +type GetCodonTablesDefaultOrganisms200JSONResponse []string + +func (response GetCodonTablesDefaultOrganisms200JSONResponse) VisitGetCodonTablesDefaultOrganismsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCodonTablesFromGenbankRequestObject struct { + Body *PostCodonTablesFromGenbankJSONRequestBody +} + +type PostCodonTablesFromGenbankResponseObject interface { + VisitPostCodonTablesFromGenbankResponse(w http.ResponseWriter) error +} + +type PostCodonTablesFromGenbank200JSONResponse CodonTable + +func (response PostCodonTablesFromGenbank200JSONResponse) VisitPostCodonTablesFromGenbankResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCodonTablesGetOrganismTableRequestObject struct { + Body *PostCodonTablesGetOrganismTableJSONRequestBody +} + +type PostCodonTablesGetOrganismTableResponseObject interface { + VisitPostCodonTablesGetOrganismTableResponse(w http.ResponseWriter) error +} + +type PostCodonTablesGetOrganismTable200JSONResponse CodonTable + +func (response PostCodonTablesGetOrganismTable200JSONResponse) VisitPostCodonTablesGetOrganismTableResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostCodonTablesNewRequestObject struct { + Body *PostCodonTablesNewJSONRequestBody +} + +type PostCodonTablesNewResponseObject interface { + VisitPostCodonTablesNewResponse(w http.ResponseWriter) error +} + +type PostCodonTablesNew200JSONResponse CodonTable + +func (response PostCodonTablesNew200JSONResponse) VisitPostCodonTablesNewResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostExecuteLuaRequestObject struct { + Body *PostExecuteLuaJSONRequestBody +} + +type PostExecuteLuaResponseObject interface { + VisitPostExecuteLuaResponse(w http.ResponseWriter) error +} + +type PostExecuteLua200JSONResponse struct { + Log string `json:"log"` + Output string `json:"output"` +} + +func (response PostExecuteLua200JSONResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostExecuteLua500TextResponse string + +func (response PostExecuteLua500TextResponse) VisitPostExecuteLuaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostFoldingLinearfoldContraFoldV2RequestObject struct { + Body *PostFoldingLinearfoldContraFoldV2JSONRequestBody +} + +type PostFoldingLinearfoldContraFoldV2ResponseObject interface { + VisitPostFoldingLinearfoldContraFoldV2Response(w http.ResponseWriter) error +} + +type PostFoldingLinearfoldContraFoldV2200JSONResponse struct { + DotBracket *string `json:"dot_bracket,omitempty"` + Score *float32 `json:"score,omitempty"` +} + +func (response PostFoldingLinearfoldContraFoldV2200JSONResponse) VisitPostFoldingLinearfoldContraFoldV2Response(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostFoldingLinearfoldViennaRnaFoldRequestObject struct { + Body *PostFoldingLinearfoldViennaRnaFoldJSONRequestBody +} + +type PostFoldingLinearfoldViennaRnaFoldResponseObject interface { + VisitPostFoldingLinearfoldViennaRnaFoldResponse(w http.ResponseWriter) error +} + +type PostFoldingLinearfoldViennaRnaFold200JSONResponse struct { + DotBracket *string `json:"dot_bracket,omitempty"` + Score *float32 `json:"score,omitempty"` +} + +func (response PostFoldingLinearfoldViennaRnaFold200JSONResponse) VisitPostFoldingLinearfoldViennaRnaFoldResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostFoldingZukerRequestObject struct { + Body *PostFoldingZukerJSONRequestBody +} + +type PostFoldingZukerResponseObject interface { + VisitPostFoldingZukerResponse(w http.ResponseWriter) error +} + +type PostFoldingZuker200JSONResponse struct { + DotBracket *string `json:"dot_bracket,omitempty"` + Score *float32 `json:"score,omitempty"` +} + +func (response PostFoldingZuker200JSONResponse) VisitPostFoldingZukerResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoFastaParseRequestObject struct { + Body *PostIoFastaParseTextRequestBody +} + +type PostIoFastaParseResponseObject interface { + VisitPostIoFastaParseResponse(w http.ResponseWriter) error +} + +type PostIoFastaParse200JSONResponse []FastaRecord + +func (response PostIoFastaParse200JSONResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoFastaParse500TextResponse string + +func (response PostIoFastaParse500TextResponse) VisitPostIoFastaParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostIoFastaWriteRequestObject struct { + Body *PostIoFastaWriteJSONRequestBody +} + +type PostIoFastaWriteResponseObject interface { + VisitPostIoFastaWriteResponse(w http.ResponseWriter) error +} + +type PostIoFastaWrite200Response struct { +} + +func (response PostIoFastaWrite200Response) VisitPostIoFastaWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostIoFastqParseRequestObject struct { + Body *PostIoFastqParseTextRequestBody +} + +type PostIoFastqParseResponseObject interface { + VisitPostIoFastqParseResponse(w http.ResponseWriter) error +} + +type PostIoFastqParse200JSONResponse []FastqRead + +func (response PostIoFastqParse200JSONResponse) VisitPostIoFastqParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoFastqWriteRequestObject struct { + Body *PostIoFastqWriteJSONRequestBody +} + +type PostIoFastqWriteResponseObject interface { + VisitPostIoFastqWriteResponse(w http.ResponseWriter) error +} + +type PostIoFastqWrite200Response struct { +} + +func (response PostIoFastqWrite200Response) VisitPostIoFastqWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostIoGenbankParseRequestObject struct { + Body *PostIoGenbankParseTextRequestBody +} + +type PostIoGenbankParseResponseObject interface { + VisitPostIoGenbankParseResponse(w http.ResponseWriter) error +} + +type PostIoGenbankParse200JSONResponse []GenbankRecord + +func (response PostIoGenbankParse200JSONResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoGenbankParse500TextResponse string + +func (response PostIoGenbankParse500TextResponse) VisitPostIoGenbankParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostIoGenbankWriteRequestObject struct { + Body *PostIoGenbankWriteJSONRequestBody +} + +type PostIoGenbankWriteResponseObject interface { + VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error +} + +type PostIoGenbankWrite200Response struct { +} + +func (response PostIoGenbankWrite200Response) VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostIoPileupParseRequestObject struct { + Body *PostIoPileupParseJSONRequestBody +} + +type PostIoPileupParseResponseObject interface { + VisitPostIoPileupParseResponse(w http.ResponseWriter) error +} + +type PostIoPileupParse200JSONResponse []PileupLine + +func (response PostIoPileupParse200JSONResponse) VisitPostIoPileupParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoPileupWriteRequestObject struct { + Body *PostIoPileupWriteJSONRequestBody +} + +type PostIoPileupWriteResponseObject interface { + VisitPostIoPileupWriteResponse(w http.ResponseWriter) error +} + +type PostIoPileupWrite200JSONResponse struct { + Data *string `json:"data,omitempty"` +} + +func (response PostIoPileupWrite200JSONResponse) VisitPostIoPileupWriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoSlow5ParseRequestObject struct { + Body *PostIoSlow5ParseJSONRequestBody +} + +type PostIoSlow5ParseResponseObject interface { + VisitPostIoSlow5ParseResponse(w http.ResponseWriter) error +} + +type PostIoSlow5Parse200JSONResponse struct { + Header *Slow5Header `json:"header,omitempty"` + Reads *[]Slow5Read `json:"reads,omitempty"` +} + +func (response PostIoSlow5Parse200JSONResponse) VisitPostIoSlow5ParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoSlow5SvbCompressRequestObject struct { + Body *PostIoSlow5SvbCompressJSONRequestBody +} + +type PostIoSlow5SvbCompressResponseObject interface { + VisitPostIoSlow5SvbCompressResponse(w http.ResponseWriter) error +} + +type PostIoSlow5SvbCompress200JSONResponse struct { + Data *string `json:"data,omitempty"` + Mask *string `json:"mask,omitempty"` +} + +func (response PostIoSlow5SvbCompress200JSONResponse) VisitPostIoSlow5SvbCompressResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoSlow5SvbDecompressRequestObject struct { + Body *PostIoSlow5SvbDecompressJSONRequestBody +} + +type PostIoSlow5SvbDecompressResponseObject interface { + VisitPostIoSlow5SvbDecompressResponse(w http.ResponseWriter) error +} + +type PostIoSlow5SvbDecompress200JSONResponse struct { + RawSignal *[]int `json:"rawSignal,omitempty"` +} + +func (response PostIoSlow5SvbDecompress200JSONResponse) VisitPostIoSlow5SvbDecompressResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostIoSlow5WriteRequestObject struct { + Body *PostIoSlow5WriteJSONRequestBody +} + +type PostIoSlow5WriteResponseObject interface { + VisitPostIoSlow5WriteResponse(w http.ResponseWriter) error +} + +type PostIoSlow5Write200JSONResponse struct { + Data *string `json:"data,omitempty"` +} + +func (response PostIoSlow5Write200JSONResponse) VisitPostIoSlow5WriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostPcrComplexPcrRequestObject struct { + Body *PostPcrComplexPcrJSONRequestBody +} + +type PostPcrComplexPcrResponseObject interface { + VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error +} + +type PostPcrComplexPcr200JSONResponse []string + +func (response PostPcrComplexPcr200JSONResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostPcrComplexPcr500TextResponse string + +func (response PostPcrComplexPcr500TextResponse) VisitPostPcrComplexPcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostPcrPrimersDebruijnBarcodesRequestObject struct { + Body *PostPcrPrimersDebruijnBarcodesJSONRequestBody +} + +type PostPcrPrimersDebruijnBarcodesResponseObject interface { + VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error +} + +type PostPcrPrimersDebruijnBarcodes200Response struct { +} + +func (response PostPcrPrimersDebruijnBarcodes200Response) VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostPcrPrimersDesignPrimersRequestObject struct { + Body *PostPcrPrimersDesignPrimersJSONRequestBody +} + +type PostPcrPrimersDesignPrimersResponseObject interface { + VisitPostPcrPrimersDesignPrimersResponse(w http.ResponseWriter) error +} + +type PostPcrPrimersDesignPrimers200JSONResponse struct { + ForwardPrimer *string `json:"forward_primer,omitempty"` + ReversePrimer *string `json:"reverse_primer,omitempty"` +} + +func (response PostPcrPrimersDesignPrimers200JSONResponse) VisitPostPcrPrimersDesignPrimersResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostPcrPrimersMarmurDotyRequestObject struct { + Body *PostPcrPrimersMarmurDotyJSONRequestBody +} + +type PostPcrPrimersMarmurDotyResponseObject interface { + VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error +} + +type PostPcrPrimersMarmurDoty200Response struct { +} + +func (response PostPcrPrimersMarmurDoty200Response) VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostPcrPrimersMeltingTemperatureRequestObject struct { + Body *PostPcrPrimersMeltingTemperatureJSONRequestBody +} + +type PostPcrPrimersMeltingTemperatureResponseObject interface { + VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error +} + +type PostPcrPrimersMeltingTemperature200Response struct { +} + +func (response PostPcrPrimersMeltingTemperature200Response) VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostPcrPrimersSantaLuciaRequestObject struct { + Body *PostPcrPrimersSantaLuciaJSONRequestBody +} + +type PostPcrPrimersSantaLuciaResponseObject interface { + VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error +} + +type PostPcrPrimersSantaLucia200Response struct { +} + +func (response PostPcrPrimersSantaLucia200Response) VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error { + w.WriteHeader(200) + return nil +} + +type PostPcrSimplePcrRequestObject struct { + Body *PostPcrSimplePcrJSONRequestBody +} + +type PostPcrSimplePcrResponseObject interface { + VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error +} + +type PostPcrSimplePcr200JSONResponse string + +func (response PostPcrSimplePcr200JSONResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostPcrSimplePcr500TextResponse string + +func (response PostPcrSimplePcr500TextResponse) VisitPostPcrSimplePcrResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + +type PostRandomRandomDnaRequestObject struct { + Body *PostRandomRandomDnaJSONRequestBody +} + +type PostRandomRandomDnaResponseObject interface { + VisitPostRandomRandomDnaResponse(w http.ResponseWriter) error +} + +type PostRandomRandomDna200JSONResponse struct { + Sequence *string `json:"sequence,omitempty"` +} + +func (response PostRandomRandomDna200JSONResponse) VisitPostRandomRandomDnaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostRandomRandomProteinRequestObject struct { + Body *PostRandomRandomProteinJSONRequestBody +} + +type PostRandomRandomProteinResponseObject interface { + VisitPostRandomRandomProteinResponse(w http.ResponseWriter) error +} + +type PostRandomRandomProtein200JSONResponse struct { + Sequence *string `json:"sequence,omitempty"` +} + +func (response PostRandomRandomProtein200JSONResponse) VisitPostRandomRandomProteinResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostRandomRandomRnaRequestObject struct { + Body *PostRandomRandomRnaJSONRequestBody +} + +type PostRandomRandomRnaResponseObject interface { + VisitPostRandomRandomRnaResponse(w http.ResponseWriter) error +} + +type PostRandomRandomRna200JSONResponse struct { + Sequence *string `json:"sequence,omitempty"` +} + +func (response PostRandomRandomRna200JSONResponse) VisitPostRandomRandomRnaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostSeqhashRequestObject struct { + Body *PostSeqhashJSONRequestBody +} + +type PostSeqhashResponseObject interface { + VisitPostSeqhashResponse(w http.ResponseWriter) error +} + +type PostSeqhash200JSONResponse struct { + Hash *string `json:"hash,omitempty"` +} + +func (response PostSeqhash200JSONResponse) VisitPostSeqhashResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostSeqhashFragmentRequestObject struct { + Body *PostSeqhashFragmentJSONRequestBody +} + +type PostSeqhashFragmentResponseObject interface { + VisitPostSeqhashFragmentResponse(w http.ResponseWriter) error +} + +type PostSeqhashFragment200JSONResponse struct { + Hash *string `json:"hash,omitempty"` +} + +func (response PostSeqhashFragment200JSONResponse) VisitPostSeqhashFragmentResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostUtilsIsPalindromicRequestObject struct { + Body *PostUtilsIsPalindromicJSONRequestBody +} + +type PostUtilsIsPalindromicResponseObject interface { + VisitPostUtilsIsPalindromicResponse(w http.ResponseWriter) error +} + +type PostUtilsIsPalindromic200JSONResponse struct { + IsPalindromic *bool `json:"isPalindromic,omitempty"` +} + +func (response PostUtilsIsPalindromic200JSONResponse) VisitPostUtilsIsPalindromicResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostUtilsReverseComplementRequestObject struct { + Body *PostUtilsReverseComplementJSONRequestBody +} + +type PostUtilsReverseComplementResponseObject interface { + VisitPostUtilsReverseComplementResponse(w http.ResponseWriter) error +} + +type PostUtilsReverseComplement200JSONResponse struct { + Sequence *string `json:"sequence,omitempty"` +} + +func (response PostUtilsReverseComplement200JSONResponse) VisitPostUtilsReverseComplementResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + // Calculate Mash Distance + // (POST /align/mash) + PostAlignMash(ctx context.Context, request PostAlignMashRequestObject) (PostAlignMashResponseObject, error) + // Calculate Mash Distance Against Many Sequences + // (POST /align/mash_many) + PostAlignMashMany(ctx context.Context, request PostAlignMashManyRequestObject) (PostAlignMashManyResponseObject, error) + // Perform Needleman-Wunsch Alignment + // (POST /align/needleman_wunsch) + PostAlignNeedlemanWunsch(ctx context.Context, request PostAlignNeedlemanWunschRequestObject) (PostAlignNeedlemanWunschResponseObject, error) + // Perform Smith-Waterman Alignment + // (POST /align/smith_waterman) + PostAlignSmithWaterman(ctx context.Context, request PostAlignSmithWatermanRequestObject) (PostAlignSmithWatermanResponseObject, error) // Fix CDS // (POST /cds/fix) PostCdsFix(ctx context.Context, request PostCdsFixRequestObject) (PostCdsFixResponseObject, error) @@ -1175,7 +2422,10 @@ type StrictServerInterface interface { // Translate CDS // (POST /cds/translate) PostCdsTranslate(ctx context.Context, request PostCdsTranslateRequestObject) (PostCdsTranslateResponseObject, error) - // Simulate Golden Gate assembly + // Fragment DNA for GoldenGate + // (POST /cloning/fragment) + PostCloningFragment(ctx context.Context, request PostCloningFragmentRequestObject) (PostCloningFragmentResponseObject, error) + // Simulate GoldenGate assembly // (POST /cloning/goldengate) PostCloningGoldengate(ctx context.Context, request PostCloningGoldengateRequestObject) (PostCloningGoldengateResponseObject, error) // Simulate ligation @@ -1184,9 +2434,36 @@ type StrictServerInterface interface { // Simulate restriction digest // (POST /cloning/restriction_digest) PostCloningRestrictionDigest(ctx context.Context, request PostCloningRestrictionDigestRequestObject) (PostCloningRestrictionDigestResponseObject, error) + // Add Two Codon Tables + // (POST /codon_tables/add_tables) + PostCodonTablesAddTables(ctx context.Context, request PostCodonTablesAddTablesRequestObject) (PostCodonTablesAddTablesResponseObject, error) + // Create Compromise Codon Table + // (POST /codon_tables/compromise_tables) + PostCodonTablesCompromiseTables(ctx context.Context, request PostCodonTablesCompromiseTablesRequestObject) (PostCodonTablesCompromiseTablesResponseObject, error) + // Get Default Organism Names + // (GET /codon_tables/default_organisms) + GetCodonTablesDefaultOrganisms(ctx context.Context, request GetCodonTablesDefaultOrganismsRequestObject) (GetCodonTablesDefaultOrganismsResponseObject, error) + // Create Weighted Codon Table from Genbank Record + // (POST /codon_tables/from_genbank) + PostCodonTablesFromGenbank(ctx context.Context, request PostCodonTablesFromGenbankRequestObject) (PostCodonTablesFromGenbankResponseObject, error) + // Get Codon Table for an Organism + // (POST /codon_tables/get_organism_table) + PostCodonTablesGetOrganismTable(ctx context.Context, request PostCodonTablesGetOrganismTableRequestObject) (PostCodonTablesGetOrganismTableResponseObject, error) + // Create New Codon Table + // (POST /codon_tables/new) + PostCodonTablesNew(ctx context.Context, request PostCodonTablesNewRequestObject) (PostCodonTablesNewResponseObject, error) // Run a lua script // (POST /execute_lua) PostExecuteLua(ctx context.Context, request PostExecuteLuaRequestObject) (PostExecuteLuaResponseObject, error) + // Contra Fold V2 + // (POST /folding/linearfold/contra_fold_v2) + PostFoldingLinearfoldContraFoldV2(ctx context.Context, request PostFoldingLinearfoldContraFoldV2RequestObject) (PostFoldingLinearfoldContraFoldV2ResponseObject, error) + // Vienna RNA Fold + // (POST /folding/linearfold/vienna_rna_fold) + PostFoldingLinearfoldViennaRnaFold(ctx context.Context, request PostFoldingLinearfoldViennaRnaFoldRequestObject) (PostFoldingLinearfoldViennaRnaFoldResponseObject, error) + // Zuker Folding + // (POST /folding/zuker) + PostFoldingZuker(ctx context.Context, request PostFoldingZukerRequestObject) (PostFoldingZukerResponseObject, error) // Parse FASTA data // (POST /io/fasta/parse) PostIoFastaParse(ctx context.Context, request PostIoFastaParseRequestObject) (PostIoFastaParseResponseObject, error) @@ -1205,12 +2482,33 @@ type StrictServerInterface interface { // Write Genbank data // (POST /io/genbank/write) PostIoGenbankWrite(ctx context.Context, request PostIoGenbankWriteRequestObject) (PostIoGenbankWriteResponseObject, error) + // Parse Pileup Data + // (POST /io/pileup/parse) + PostIoPileupParse(ctx context.Context, request PostIoPileupParseRequestObject) (PostIoPileupParseResponseObject, error) + // Write Pileup Data + // (POST /io/pileup/write) + PostIoPileupWrite(ctx context.Context, request PostIoPileupWriteRequestObject) (PostIoPileupWriteResponseObject, error) + // Parse slow5 Data + // (POST /io/slow5/parse) + PostIoSlow5Parse(ctx context.Context, request PostIoSlow5ParseRequestObject) (PostIoSlow5ParseResponseObject, error) + // Compress Raw Signal with SVB + // (POST /io/slow5/svb_compress) + PostIoSlow5SvbCompress(ctx context.Context, request PostIoSlow5SvbCompressRequestObject) (PostIoSlow5SvbCompressResponseObject, error) + // Decompress Raw Signal with SVB + // (POST /io/slow5/svb_decompress) + PostIoSlow5SvbDecompress(ctx context.Context, request PostIoSlow5SvbDecompressRequestObject) (PostIoSlow5SvbDecompressResponseObject, error) + // Write slow5 Data + // (POST /io/slow5/write) + PostIoSlow5Write(ctx context.Context, request PostIoSlow5WriteRequestObject) (PostIoSlow5WriteResponseObject, error) // Simulate PCR // (POST /pcr/complex_pcr) PostPcrComplexPcr(ctx context.Context, request PostPcrComplexPcrRequestObject) (PostPcrComplexPcrResponseObject, error) // Generate De Bruijn sequence-based barcodes // (POST /pcr/primers/debruijn_barcodes) PostPcrPrimersDebruijnBarcodes(ctx context.Context, request PostPcrPrimersDebruijnBarcodesRequestObject) (PostPcrPrimersDebruijnBarcodesResponseObject, error) + // Design PCR Primers + // (POST /pcr/primers/design_primers) + PostPcrPrimersDesignPrimers(ctx context.Context, request PostPcrPrimersDesignPrimersRequestObject) (PostPcrPrimersDesignPrimersResponseObject, error) // Calculate Melting Temperature using Marmur Doty method // (POST /pcr/primers/marmur_doty) PostPcrPrimersMarmurDoty(ctx context.Context, request PostPcrPrimersMarmurDotyRequestObject) (PostPcrPrimersMarmurDotyResponseObject, error) @@ -1223,45 +2521,896 @@ type StrictServerInterface interface { // Simulate a simple PCR // (POST /pcr/simple_pcr) PostPcrSimplePcr(ctx context.Context, request PostPcrSimplePcrRequestObject) (PostPcrSimplePcrResponseObject, error) - // Fragment CDS - // (POST /synthesis/fragment) - PostSynthesisFragment(ctx context.Context, request PostSynthesisFragmentRequestObject) (PostSynthesisFragmentResponseObject, error) + // Generate Random DNA Sequence + // (POST /random/random_dna) + PostRandomRandomDna(ctx context.Context, request PostRandomRandomDnaRequestObject) (PostRandomRandomDnaResponseObject, error) + // Generate Random Protein Sequence + // (POST /random/random_protein) + PostRandomRandomProtein(ctx context.Context, request PostRandomRandomProteinRequestObject) (PostRandomRandomProteinResponseObject, error) + // Generate Random RNA Sequence + // (POST /random/random_rna) + PostRandomRandomRna(ctx context.Context, request PostRandomRandomRnaRequestObject) (PostRandomRandomRnaResponseObject, error) + // Sequence Hashing + // (POST /seqhash) + PostSeqhash(ctx context.Context, request PostSeqhashRequestObject) (PostSeqhashResponseObject, error) + // Sequence Hashing for Fragment + // (POST /seqhash_fragment) + PostSeqhashFragment(ctx context.Context, request PostSeqhashFragmentRequestObject) (PostSeqhashFragmentResponseObject, error) + // Check if Sequence is Palindromic + // (POST /utils/is_palindromic) + PostUtilsIsPalindromic(ctx context.Context, request PostUtilsIsPalindromicRequestObject) (PostUtilsIsPalindromicResponseObject, error) + // Reverse Complement of DNA Sequence + // (POST /utils/reverse_complement) + PostUtilsReverseComplement(ctx context.Context, request PostUtilsReverseComplementRequestObject) (PostUtilsReverseComplementResponseObject, error) +} + +type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc +type StrictMiddlewareFunc = strictnethttp.StrictHttpMiddlewareFunc + +type StrictHTTPServerOptions struct { + RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) + ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares, options: StrictHTTPServerOptions{ + RequestErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusBadRequest) + }, + ResponseErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusInternalServerError) + }, + }} +} + +func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares, options: options} +} + +type strictHandler struct { + ssi StrictServerInterface + middlewares []StrictMiddlewareFunc + options StrictHTTPServerOptions +} + +// PostAlignMash operation middleware +func (sh *strictHandler) PostAlignMash(w http.ResponseWriter, r *http.Request) { + var request PostAlignMashRequestObject + + var body PostAlignMashJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostAlignMash(ctx, request.(PostAlignMashRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostAlignMash") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostAlignMashResponseObject); ok { + if err := validResponse.VisitPostAlignMashResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostAlignMashMany operation middleware +func (sh *strictHandler) PostAlignMashMany(w http.ResponseWriter, r *http.Request) { + var request PostAlignMashManyRequestObject + + var body PostAlignMashManyJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostAlignMashMany(ctx, request.(PostAlignMashManyRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostAlignMashMany") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostAlignMashManyResponseObject); ok { + if err := validResponse.VisitPostAlignMashManyResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostAlignNeedlemanWunsch operation middleware +func (sh *strictHandler) PostAlignNeedlemanWunsch(w http.ResponseWriter, r *http.Request) { + var request PostAlignNeedlemanWunschRequestObject + + var body PostAlignNeedlemanWunschJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostAlignNeedlemanWunsch(ctx, request.(PostAlignNeedlemanWunschRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostAlignNeedlemanWunsch") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostAlignNeedlemanWunschResponseObject); ok { + if err := validResponse.VisitPostAlignNeedlemanWunschResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostAlignSmithWaterman operation middleware +func (sh *strictHandler) PostAlignSmithWaterman(w http.ResponseWriter, r *http.Request) { + var request PostAlignSmithWatermanRequestObject + + var body PostAlignSmithWatermanJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostAlignSmithWaterman(ctx, request.(PostAlignSmithWatermanRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostAlignSmithWaterman") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostAlignSmithWatermanResponseObject); ok { + if err := validResponse.VisitPostAlignSmithWatermanResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCdsFix operation middleware +func (sh *strictHandler) PostCdsFix(w http.ResponseWriter, r *http.Request) { + var request PostCdsFixRequestObject + + var body PostCdsFixJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCdsFix(ctx, request.(PostCdsFixRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCdsFix") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCdsFixResponseObject); ok { + if err := validResponse.VisitPostCdsFixResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCdsOptimize operation middleware +func (sh *strictHandler) PostCdsOptimize(w http.ResponseWriter, r *http.Request) { + var request PostCdsOptimizeRequestObject + + var body PostCdsOptimizeJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCdsOptimize(ctx, request.(PostCdsOptimizeRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCdsOptimize") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCdsOptimizeResponseObject); ok { + if err := validResponse.VisitPostCdsOptimizeResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCdsTranslate operation middleware +func (sh *strictHandler) PostCdsTranslate(w http.ResponseWriter, r *http.Request) { + var request PostCdsTranslateRequestObject + + var body PostCdsTranslateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCdsTranslate(ctx, request.(PostCdsTranslateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCdsTranslate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCdsTranslateResponseObject); ok { + if err := validResponse.VisitPostCdsTranslateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningFragment operation middleware +func (sh *strictHandler) PostCloningFragment(w http.ResponseWriter, r *http.Request) { + var request PostCloningFragmentRequestObject + + var body PostCloningFragmentJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningFragment(ctx, request.(PostCloningFragmentRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningFragment") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningFragmentResponseObject); ok { + if err := validResponse.VisitPostCloningFragmentResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningGoldengate operation middleware +func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { + var request PostCloningGoldengateRequestObject + + var body PostCloningGoldengateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningGoldengate(ctx, request.(PostCloningGoldengateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningGoldengate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningGoldengateResponseObject); ok { + if err := validResponse.VisitPostCloningGoldengateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningLigate operation middleware +func (sh *strictHandler) PostCloningLigate(w http.ResponseWriter, r *http.Request) { + var request PostCloningLigateRequestObject + + var body PostCloningLigateJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningLigate(ctx, request.(PostCloningLigateRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningLigate") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningLigateResponseObject); ok { + if err := validResponse.VisitPostCloningLigateResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCloningRestrictionDigest operation middleware +func (sh *strictHandler) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) { + var request PostCloningRestrictionDigestRequestObject + + var body PostCloningRestrictionDigestJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCloningRestrictionDigest(ctx, request.(PostCloningRestrictionDigestRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCloningRestrictionDigest") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCloningRestrictionDigestResponseObject); ok { + if err := validResponse.VisitPostCloningRestrictionDigestResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCodonTablesAddTables operation middleware +func (sh *strictHandler) PostCodonTablesAddTables(w http.ResponseWriter, r *http.Request) { + var request PostCodonTablesAddTablesRequestObject + + var body PostCodonTablesAddTablesJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCodonTablesAddTables(ctx, request.(PostCodonTablesAddTablesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCodonTablesAddTables") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCodonTablesAddTablesResponseObject); ok { + if err := validResponse.VisitPostCodonTablesAddTablesResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCodonTablesCompromiseTables operation middleware +func (sh *strictHandler) PostCodonTablesCompromiseTables(w http.ResponseWriter, r *http.Request) { + var request PostCodonTablesCompromiseTablesRequestObject + + var body PostCodonTablesCompromiseTablesJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCodonTablesCompromiseTables(ctx, request.(PostCodonTablesCompromiseTablesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCodonTablesCompromiseTables") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCodonTablesCompromiseTablesResponseObject); ok { + if err := validResponse.VisitPostCodonTablesCompromiseTablesResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// GetCodonTablesDefaultOrganisms operation middleware +func (sh *strictHandler) GetCodonTablesDefaultOrganisms(w http.ResponseWriter, r *http.Request) { + var request GetCodonTablesDefaultOrganismsRequestObject + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.GetCodonTablesDefaultOrganisms(ctx, request.(GetCodonTablesDefaultOrganismsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetCodonTablesDefaultOrganisms") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(GetCodonTablesDefaultOrganismsResponseObject); ok { + if err := validResponse.VisitGetCodonTablesDefaultOrganismsResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCodonTablesFromGenbank operation middleware +func (sh *strictHandler) PostCodonTablesFromGenbank(w http.ResponseWriter, r *http.Request) { + var request PostCodonTablesFromGenbankRequestObject + + var body PostCodonTablesFromGenbankJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCodonTablesFromGenbank(ctx, request.(PostCodonTablesFromGenbankRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCodonTablesFromGenbank") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCodonTablesFromGenbankResponseObject); ok { + if err := validResponse.VisitPostCodonTablesFromGenbankResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCodonTablesGetOrganismTable operation middleware +func (sh *strictHandler) PostCodonTablesGetOrganismTable(w http.ResponseWriter, r *http.Request) { + var request PostCodonTablesGetOrganismTableRequestObject + + var body PostCodonTablesGetOrganismTableJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCodonTablesGetOrganismTable(ctx, request.(PostCodonTablesGetOrganismTableRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCodonTablesGetOrganismTable") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCodonTablesGetOrganismTableResponseObject); ok { + if err := validResponse.VisitPostCodonTablesGetOrganismTableResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostCodonTablesNew operation middleware +func (sh *strictHandler) PostCodonTablesNew(w http.ResponseWriter, r *http.Request) { + var request PostCodonTablesNewRequestObject + + var body PostCodonTablesNewJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostCodonTablesNew(ctx, request.(PostCodonTablesNewRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostCodonTablesNew") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostCodonTablesNewResponseObject); ok { + if err := validResponse.VisitPostCodonTablesNewResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostExecuteLua operation middleware +func (sh *strictHandler) PostExecuteLua(w http.ResponseWriter, r *http.Request) { + var request PostExecuteLuaRequestObject + + var body PostExecuteLuaJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostExecuteLua(ctx, request.(PostExecuteLuaRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostExecuteLua") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostExecuteLuaResponseObject); ok { + if err := validResponse.VisitPostExecuteLuaResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } } -type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc -type StrictMiddlewareFunc = strictnethttp.StrictHttpMiddlewareFunc +// PostFoldingLinearfoldContraFoldV2 operation middleware +func (sh *strictHandler) PostFoldingLinearfoldContraFoldV2(w http.ResponseWriter, r *http.Request) { + var request PostFoldingLinearfoldContraFoldV2RequestObject -type StrictHTTPServerOptions struct { - RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) - ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) + var body PostFoldingLinearfoldContraFoldV2JSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostFoldingLinearfoldContraFoldV2(ctx, request.(PostFoldingLinearfoldContraFoldV2RequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostFoldingLinearfoldContraFoldV2") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostFoldingLinearfoldContraFoldV2ResponseObject); ok { + if err := validResponse.VisitPostFoldingLinearfoldContraFoldV2Response(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } } -func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { - return &strictHandler{ssi: ssi, middlewares: middlewares, options: StrictHTTPServerOptions{ - RequestErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { - http.Error(w, err.Error(), http.StatusBadRequest) - }, - ResponseErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) { - http.Error(w, err.Error(), http.StatusInternalServerError) - }, - }} +// PostFoldingLinearfoldViennaRnaFold operation middleware +func (sh *strictHandler) PostFoldingLinearfoldViennaRnaFold(w http.ResponseWriter, r *http.Request) { + var request PostFoldingLinearfoldViennaRnaFoldRequestObject + + var body PostFoldingLinearfoldViennaRnaFoldJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostFoldingLinearfoldViennaRnaFold(ctx, request.(PostFoldingLinearfoldViennaRnaFoldRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostFoldingLinearfoldViennaRnaFold") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostFoldingLinearfoldViennaRnaFoldResponseObject); ok { + if err := validResponse.VisitPostFoldingLinearfoldViennaRnaFoldResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostFoldingZuker operation middleware +func (sh *strictHandler) PostFoldingZuker(w http.ResponseWriter, r *http.Request) { + var request PostFoldingZukerRequestObject + + var body PostFoldingZukerJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostFoldingZuker(ctx, request.(PostFoldingZukerRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostFoldingZuker") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostFoldingZukerResponseObject); ok { + if err := validResponse.VisitPostFoldingZukerResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastaParse operation middleware +func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { + var request PostIoFastaParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoFastaParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastaParse(ctx, request.(PostIoFastaParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastaParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastaParseResponseObject); ok { + if err := validResponse.VisitPostIoFastaParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastaWrite operation middleware +func (sh *strictHandler) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoFastaWriteRequestObject + + var body PostIoFastaWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastaWrite(ctx, request.(PostIoFastaWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastaWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastaWriteResponseObject); ok { + if err := validResponse.VisitPostIoFastaWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastqParse operation middleware +func (sh *strictHandler) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { + var request PostIoFastqParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoFastqParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastqParse(ctx, request.(PostIoFastqParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastqParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastqParseResponseObject); ok { + if err := validResponse.VisitPostIoFastqParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoFastqWrite operation middleware +func (sh *strictHandler) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoFastqWriteRequestObject + + var body PostIoFastqWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoFastqWrite(ctx, request.(PostIoFastqWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoFastqWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoFastqWriteResponseObject); ok { + if err := validResponse.VisitPostIoFastqWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + +// PostIoGenbankParse operation middleware +func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { + var request PostIoGenbankParseRequestObject + + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + return + } + body := PostIoGenbankParseTextRequestBody(data) + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoGenbankParse(ctx, request.(PostIoGenbankParseRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoGenbankParse") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoGenbankParseResponseObject); ok { + if err := validResponse.VisitPostIoGenbankParseResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } } -func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface { - return &strictHandler{ssi: ssi, middlewares: middlewares, options: options} -} +// PostIoGenbankWrite operation middleware +func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoGenbankWriteRequestObject -type strictHandler struct { - ssi StrictServerInterface - middlewares []StrictMiddlewareFunc - options StrictHTTPServerOptions + var body PostIoGenbankWriteJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + return + } + request.Body = &body + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.PostIoGenbankWrite(ctx, request.(PostIoGenbankWriteRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostIoGenbankWrite") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(PostIoGenbankWriteResponseObject); ok { + if err := validResponse.VisitPostIoGenbankWriteResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } } -// PostCdsFix operation middleware -func (sh *strictHandler) PostCdsFix(w http.ResponseWriter, r *http.Request) { - var request PostCdsFixRequestObject +// PostIoPileupParse operation middleware +func (sh *strictHandler) PostIoPileupParse(w http.ResponseWriter, r *http.Request) { + var request PostIoPileupParseRequestObject - var body PostCdsFixJSONRequestBody + var body PostIoPileupParseJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1269,18 +3418,18 @@ func (sh *strictHandler) PostCdsFix(w http.ResponseWriter, r *http.Request) { request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCdsFix(ctx, request.(PostCdsFixRequestObject)) + return sh.ssi.PostIoPileupParse(ctx, request.(PostIoPileupParseRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCdsFix") + handler = middleware(handler, "PostIoPileupParse") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCdsFixResponseObject); ok { - if err := validResponse.VisitPostCdsFixResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoPileupParseResponseObject); ok { + if err := validResponse.VisitPostIoPileupParseResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1288,11 +3437,11 @@ func (sh *strictHandler) PostCdsFix(w http.ResponseWriter, r *http.Request) { } } -// PostCdsOptimize operation middleware -func (sh *strictHandler) PostCdsOptimize(w http.ResponseWriter, r *http.Request) { - var request PostCdsOptimizeRequestObject +// PostIoPileupWrite operation middleware +func (sh *strictHandler) PostIoPileupWrite(w http.ResponseWriter, r *http.Request) { + var request PostIoPileupWriteRequestObject - var body PostCdsOptimizeJSONRequestBody + var body PostIoPileupWriteJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1300,18 +3449,18 @@ func (sh *strictHandler) PostCdsOptimize(w http.ResponseWriter, r *http.Request) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCdsOptimize(ctx, request.(PostCdsOptimizeRequestObject)) + return sh.ssi.PostIoPileupWrite(ctx, request.(PostIoPileupWriteRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCdsOptimize") + handler = middleware(handler, "PostIoPileupWrite") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCdsOptimizeResponseObject); ok { - if err := validResponse.VisitPostCdsOptimizeResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoPileupWriteResponseObject); ok { + if err := validResponse.VisitPostIoPileupWriteResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1319,11 +3468,11 @@ func (sh *strictHandler) PostCdsOptimize(w http.ResponseWriter, r *http.Request) } } -// PostCdsTranslate operation middleware -func (sh *strictHandler) PostCdsTranslate(w http.ResponseWriter, r *http.Request) { - var request PostCdsTranslateRequestObject +// PostIoSlow5Parse operation middleware +func (sh *strictHandler) PostIoSlow5Parse(w http.ResponseWriter, r *http.Request) { + var request PostIoSlow5ParseRequestObject - var body PostCdsTranslateJSONRequestBody + var body PostIoSlow5ParseJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1331,18 +3480,18 @@ func (sh *strictHandler) PostCdsTranslate(w http.ResponseWriter, r *http.Request request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCdsTranslate(ctx, request.(PostCdsTranslateRequestObject)) + return sh.ssi.PostIoSlow5Parse(ctx, request.(PostIoSlow5ParseRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCdsTranslate") + handler = middleware(handler, "PostIoSlow5Parse") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCdsTranslateResponseObject); ok { - if err := validResponse.VisitPostCdsTranslateResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoSlow5ParseResponseObject); ok { + if err := validResponse.VisitPostIoSlow5ParseResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1350,11 +3499,11 @@ func (sh *strictHandler) PostCdsTranslate(w http.ResponseWriter, r *http.Request } } -// PostCloningGoldengate operation middleware -func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { - var request PostCloningGoldengateRequestObject +// PostIoSlow5SvbCompress operation middleware +func (sh *strictHandler) PostIoSlow5SvbCompress(w http.ResponseWriter, r *http.Request) { + var request PostIoSlow5SvbCompressRequestObject - var body PostCloningGoldengateJSONRequestBody + var body PostIoSlow5SvbCompressJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1362,18 +3511,18 @@ func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Re request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCloningGoldengate(ctx, request.(PostCloningGoldengateRequestObject)) + return sh.ssi.PostIoSlow5SvbCompress(ctx, request.(PostIoSlow5SvbCompressRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCloningGoldengate") + handler = middleware(handler, "PostIoSlow5SvbCompress") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCloningGoldengateResponseObject); ok { - if err := validResponse.VisitPostCloningGoldengateResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoSlow5SvbCompressResponseObject); ok { + if err := validResponse.VisitPostIoSlow5SvbCompressResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1381,11 +3530,11 @@ func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Re } } -// PostCloningLigate operation middleware -func (sh *strictHandler) PostCloningLigate(w http.ResponseWriter, r *http.Request) { - var request PostCloningLigateRequestObject +// PostIoSlow5SvbDecompress operation middleware +func (sh *strictHandler) PostIoSlow5SvbDecompress(w http.ResponseWriter, r *http.Request) { + var request PostIoSlow5SvbDecompressRequestObject - var body PostCloningLigateJSONRequestBody + var body PostIoSlow5SvbDecompressJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1393,18 +3542,18 @@ func (sh *strictHandler) PostCloningLigate(w http.ResponseWriter, r *http.Reques request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCloningLigate(ctx, request.(PostCloningLigateRequestObject)) + return sh.ssi.PostIoSlow5SvbDecompress(ctx, request.(PostIoSlow5SvbDecompressRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCloningLigate") + handler = middleware(handler, "PostIoSlow5SvbDecompress") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCloningLigateResponseObject); ok { - if err := validResponse.VisitPostCloningLigateResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoSlow5SvbDecompressResponseObject); ok { + if err := validResponse.VisitPostIoSlow5SvbDecompressResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1412,11 +3561,11 @@ func (sh *strictHandler) PostCloningLigate(w http.ResponseWriter, r *http.Reques } } -// PostCloningRestrictionDigest operation middleware -func (sh *strictHandler) PostCloningRestrictionDigest(w http.ResponseWriter, r *http.Request) { - var request PostCloningRestrictionDigestRequestObject +// PostIoSlow5Write operation middleware +func (sh *strictHandler) PostIoSlow5Write(w http.ResponseWriter, r *http.Request) { + var request PostIoSlow5WriteRequestObject - var body PostCloningRestrictionDigestJSONRequestBody + var body PostIoSlow5WriteJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1424,18 +3573,18 @@ func (sh *strictHandler) PostCloningRestrictionDigest(w http.ResponseWriter, r * request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCloningRestrictionDigest(ctx, request.(PostCloningRestrictionDigestRequestObject)) + return sh.ssi.PostIoSlow5Write(ctx, request.(PostIoSlow5WriteRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCloningRestrictionDigest") + handler = middleware(handler, "PostIoSlow5Write") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCloningRestrictionDigestResponseObject); ok { - if err := validResponse.VisitPostCloningRestrictionDigestResponse(w); err != nil { + } else if validResponse, ok := response.(PostIoSlow5WriteResponseObject); ok { + if err := validResponse.VisitPostIoSlow5WriteResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1443,11 +3592,11 @@ func (sh *strictHandler) PostCloningRestrictionDigest(w http.ResponseWriter, r * } } -// PostExecuteLua operation middleware -func (sh *strictHandler) PostExecuteLua(w http.ResponseWriter, r *http.Request) { - var request PostExecuteLuaRequestObject +// PostPcrComplexPcr operation middleware +func (sh *strictHandler) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { + var request PostPcrComplexPcrRequestObject - var body PostExecuteLuaJSONRequestBody + var body PostPcrComplexPcrJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1455,18 +3604,18 @@ func (sh *strictHandler) PostExecuteLua(w http.ResponseWriter, r *http.Request) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostExecuteLua(ctx, request.(PostExecuteLuaRequestObject)) + return sh.ssi.PostPcrComplexPcr(ctx, request.(PostPcrComplexPcrRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostExecuteLua") + handler = middleware(handler, "PostPcrComplexPcr") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostExecuteLuaResponseObject); ok { - if err := validResponse.VisitPostExecuteLuaResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrComplexPcrResponseObject); ok { + if err := validResponse.VisitPostPcrComplexPcrResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1474,31 +3623,30 @@ func (sh *strictHandler) PostExecuteLua(w http.ResponseWriter, r *http.Request) } } -// PostIoFastaParse operation middleware -func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request) { - var request PostIoFastaParseRequestObject +// PostPcrPrimersDebruijnBarcodes operation middleware +func (sh *strictHandler) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersDebruijnBarcodesRequestObject - data, err := io.ReadAll(r.Body) - if err != nil { - sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + var body PostPcrPrimersDebruijnBarcodesJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return } - body := PostIoFastaParseTextRequestBody(data) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoFastaParse(ctx, request.(PostIoFastaParseRequestObject)) + return sh.ssi.PostPcrPrimersDebruijnBarcodes(ctx, request.(PostPcrPrimersDebruijnBarcodesRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoFastaParse") + handler = middleware(handler, "PostPcrPrimersDebruijnBarcodes") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoFastaParseResponseObject); ok { - if err := validResponse.VisitPostIoFastaParseResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersDebruijnBarcodesResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersDebruijnBarcodesResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1506,11 +3654,11 @@ func (sh *strictHandler) PostIoFastaParse(w http.ResponseWriter, r *http.Request } } -// PostIoFastaWrite operation middleware -func (sh *strictHandler) PostIoFastaWrite(w http.ResponseWriter, r *http.Request) { - var request PostIoFastaWriteRequestObject +// PostPcrPrimersDesignPrimers operation middleware +func (sh *strictHandler) PostPcrPrimersDesignPrimers(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersDesignPrimersRequestObject - var body PostIoFastaWriteJSONRequestBody + var body PostPcrPrimersDesignPrimersJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1518,18 +3666,18 @@ func (sh *strictHandler) PostIoFastaWrite(w http.ResponseWriter, r *http.Request request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoFastaWrite(ctx, request.(PostIoFastaWriteRequestObject)) + return sh.ssi.PostPcrPrimersDesignPrimers(ctx, request.(PostPcrPrimersDesignPrimersRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoFastaWrite") + handler = middleware(handler, "PostPcrPrimersDesignPrimers") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoFastaWriteResponseObject); ok { - if err := validResponse.VisitPostIoFastaWriteResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersDesignPrimersResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersDesignPrimersResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1537,31 +3685,30 @@ func (sh *strictHandler) PostIoFastaWrite(w http.ResponseWriter, r *http.Request } } -// PostIoFastqParse operation middleware -func (sh *strictHandler) PostIoFastqParse(w http.ResponseWriter, r *http.Request) { - var request PostIoFastqParseRequestObject +// PostPcrPrimersMarmurDoty operation middleware +func (sh *strictHandler) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersMarmurDotyRequestObject - data, err := io.ReadAll(r.Body) - if err != nil { - sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + var body PostPcrPrimersMarmurDotyJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return } - body := PostIoFastqParseTextRequestBody(data) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoFastqParse(ctx, request.(PostIoFastqParseRequestObject)) + return sh.ssi.PostPcrPrimersMarmurDoty(ctx, request.(PostPcrPrimersMarmurDotyRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoFastqParse") + handler = middleware(handler, "PostPcrPrimersMarmurDoty") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoFastqParseResponseObject); ok { - if err := validResponse.VisitPostIoFastqParseResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersMarmurDotyResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersMarmurDotyResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1569,11 +3716,11 @@ func (sh *strictHandler) PostIoFastqParse(w http.ResponseWriter, r *http.Request } } -// PostIoFastqWrite operation middleware -func (sh *strictHandler) PostIoFastqWrite(w http.ResponseWriter, r *http.Request) { - var request PostIoFastqWriteRequestObject +// PostPcrPrimersMeltingTemperature operation middleware +func (sh *strictHandler) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersMeltingTemperatureRequestObject - var body PostIoFastqWriteJSONRequestBody + var body PostPcrPrimersMeltingTemperatureJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1581,18 +3728,18 @@ func (sh *strictHandler) PostIoFastqWrite(w http.ResponseWriter, r *http.Request request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoFastqWrite(ctx, request.(PostIoFastqWriteRequestObject)) + return sh.ssi.PostPcrPrimersMeltingTemperature(ctx, request.(PostPcrPrimersMeltingTemperatureRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoFastqWrite") + handler = middleware(handler, "PostPcrPrimersMeltingTemperature") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoFastqWriteResponseObject); ok { - if err := validResponse.VisitPostIoFastqWriteResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersMeltingTemperatureResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersMeltingTemperatureResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1600,31 +3747,30 @@ func (sh *strictHandler) PostIoFastqWrite(w http.ResponseWriter, r *http.Request } } -// PostIoGenbankParse operation middleware -func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Request) { - var request PostIoGenbankParseRequestObject +// PostPcrPrimersSantaLucia operation middleware +func (sh *strictHandler) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { + var request PostPcrPrimersSantaLuciaRequestObject - data, err := io.ReadAll(r.Body) - if err != nil { - sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) + var body PostPcrPrimersSantaLuciaJSONRequestBody + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return } - body := PostIoGenbankParseTextRequestBody(data) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoGenbankParse(ctx, request.(PostIoGenbankParseRequestObject)) + return sh.ssi.PostPcrPrimersSantaLucia(ctx, request.(PostPcrPrimersSantaLuciaRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoGenbankParse") + handler = middleware(handler, "PostPcrPrimersSantaLucia") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoGenbankParseResponseObject); ok { - if err := validResponse.VisitPostIoGenbankParseResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrPrimersSantaLuciaResponseObject); ok { + if err := validResponse.VisitPostPcrPrimersSantaLuciaResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1632,11 +3778,11 @@ func (sh *strictHandler) PostIoGenbankParse(w http.ResponseWriter, r *http.Reque } } -// PostIoGenbankWrite operation middleware -func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Request) { - var request PostIoGenbankWriteRequestObject +// PostPcrSimplePcr operation middleware +func (sh *strictHandler) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { + var request PostPcrSimplePcrRequestObject - var body PostIoGenbankWriteJSONRequestBody + var body PostPcrSimplePcrJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1644,18 +3790,18 @@ func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Reque request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostIoGenbankWrite(ctx, request.(PostIoGenbankWriteRequestObject)) + return sh.ssi.PostPcrSimplePcr(ctx, request.(PostPcrSimplePcrRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostIoGenbankWrite") + handler = middleware(handler, "PostPcrSimplePcr") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostIoGenbankWriteResponseObject); ok { - if err := validResponse.VisitPostIoGenbankWriteResponse(w); err != nil { + } else if validResponse, ok := response.(PostPcrSimplePcrResponseObject); ok { + if err := validResponse.VisitPostPcrSimplePcrResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1663,11 +3809,11 @@ func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Reque } } -// PostPcrComplexPcr operation middleware -func (sh *strictHandler) PostPcrComplexPcr(w http.ResponseWriter, r *http.Request) { - var request PostPcrComplexPcrRequestObject +// PostRandomRandomDna operation middleware +func (sh *strictHandler) PostRandomRandomDna(w http.ResponseWriter, r *http.Request) { + var request PostRandomRandomDnaRequestObject - var body PostPcrComplexPcrJSONRequestBody + var body PostRandomRandomDnaJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1675,18 +3821,18 @@ func (sh *strictHandler) PostPcrComplexPcr(w http.ResponseWriter, r *http.Reques request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrComplexPcr(ctx, request.(PostPcrComplexPcrRequestObject)) + return sh.ssi.PostRandomRandomDna(ctx, request.(PostRandomRandomDnaRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrComplexPcr") + handler = middleware(handler, "PostRandomRandomDna") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrComplexPcrResponseObject); ok { - if err := validResponse.VisitPostPcrComplexPcrResponse(w); err != nil { + } else if validResponse, ok := response.(PostRandomRandomDnaResponseObject); ok { + if err := validResponse.VisitPostRandomRandomDnaResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1694,11 +3840,11 @@ func (sh *strictHandler) PostPcrComplexPcr(w http.ResponseWriter, r *http.Reques } } -// PostPcrPrimersDebruijnBarcodes operation middleware -func (sh *strictHandler) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r *http.Request) { - var request PostPcrPrimersDebruijnBarcodesRequestObject +// PostRandomRandomProtein operation middleware +func (sh *strictHandler) PostRandomRandomProtein(w http.ResponseWriter, r *http.Request) { + var request PostRandomRandomProteinRequestObject - var body PostPcrPrimersDebruijnBarcodesJSONRequestBody + var body PostRandomRandomProteinJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1706,18 +3852,18 @@ func (sh *strictHandler) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrPrimersDebruijnBarcodes(ctx, request.(PostPcrPrimersDebruijnBarcodesRequestObject)) + return sh.ssi.PostRandomRandomProtein(ctx, request.(PostRandomRandomProteinRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrPrimersDebruijnBarcodes") + handler = middleware(handler, "PostRandomRandomProtein") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrPrimersDebruijnBarcodesResponseObject); ok { - if err := validResponse.VisitPostPcrPrimersDebruijnBarcodesResponse(w); err != nil { + } else if validResponse, ok := response.(PostRandomRandomProteinResponseObject); ok { + if err := validResponse.VisitPostRandomRandomProteinResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1725,11 +3871,11 @@ func (sh *strictHandler) PostPcrPrimersDebruijnBarcodes(w http.ResponseWriter, r } } -// PostPcrPrimersMarmurDoty operation middleware -func (sh *strictHandler) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http.Request) { - var request PostPcrPrimersMarmurDotyRequestObject +// PostRandomRandomRna operation middleware +func (sh *strictHandler) PostRandomRandomRna(w http.ResponseWriter, r *http.Request) { + var request PostRandomRandomRnaRequestObject - var body PostPcrPrimersMarmurDotyJSONRequestBody + var body PostRandomRandomRnaJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1737,18 +3883,18 @@ func (sh *strictHandler) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrPrimersMarmurDoty(ctx, request.(PostPcrPrimersMarmurDotyRequestObject)) + return sh.ssi.PostRandomRandomRna(ctx, request.(PostRandomRandomRnaRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrPrimersMarmurDoty") + handler = middleware(handler, "PostRandomRandomRna") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrPrimersMarmurDotyResponseObject); ok { - if err := validResponse.VisitPostPcrPrimersMarmurDotyResponse(w); err != nil { + } else if validResponse, ok := response.(PostRandomRandomRnaResponseObject); ok { + if err := validResponse.VisitPostRandomRandomRnaResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1756,11 +3902,11 @@ func (sh *strictHandler) PostPcrPrimersMarmurDoty(w http.ResponseWriter, r *http } } -// PostPcrPrimersMeltingTemperature operation middleware -func (sh *strictHandler) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, r *http.Request) { - var request PostPcrPrimersMeltingTemperatureRequestObject +// PostSeqhash operation middleware +func (sh *strictHandler) PostSeqhash(w http.ResponseWriter, r *http.Request) { + var request PostSeqhashRequestObject - var body PostPcrPrimersMeltingTemperatureJSONRequestBody + var body PostSeqhashJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1768,18 +3914,18 @@ func (sh *strictHandler) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrPrimersMeltingTemperature(ctx, request.(PostPcrPrimersMeltingTemperatureRequestObject)) + return sh.ssi.PostSeqhash(ctx, request.(PostSeqhashRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrPrimersMeltingTemperature") + handler = middleware(handler, "PostSeqhash") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrPrimersMeltingTemperatureResponseObject); ok { - if err := validResponse.VisitPostPcrPrimersMeltingTemperatureResponse(w); err != nil { + } else if validResponse, ok := response.(PostSeqhashResponseObject); ok { + if err := validResponse.VisitPostSeqhashResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1787,11 +3933,11 @@ func (sh *strictHandler) PostPcrPrimersMeltingTemperature(w http.ResponseWriter, } } -// PostPcrPrimersSantaLucia operation middleware -func (sh *strictHandler) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http.Request) { - var request PostPcrPrimersSantaLuciaRequestObject +// PostSeqhashFragment operation middleware +func (sh *strictHandler) PostSeqhashFragment(w http.ResponseWriter, r *http.Request) { + var request PostSeqhashFragmentRequestObject - var body PostPcrPrimersSantaLuciaJSONRequestBody + var body PostSeqhashFragmentJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1799,18 +3945,18 @@ func (sh *strictHandler) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrPrimersSantaLucia(ctx, request.(PostPcrPrimersSantaLuciaRequestObject)) + return sh.ssi.PostSeqhashFragment(ctx, request.(PostSeqhashFragmentRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrPrimersSantaLucia") + handler = middleware(handler, "PostSeqhashFragment") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrPrimersSantaLuciaResponseObject); ok { - if err := validResponse.VisitPostPcrPrimersSantaLuciaResponse(w); err != nil { + } else if validResponse, ok := response.(PostSeqhashFragmentResponseObject); ok { + if err := validResponse.VisitPostSeqhashFragmentResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1818,11 +3964,11 @@ func (sh *strictHandler) PostPcrPrimersSantaLucia(w http.ResponseWriter, r *http } } -// PostPcrSimplePcr operation middleware -func (sh *strictHandler) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request) { - var request PostPcrSimplePcrRequestObject +// PostUtilsIsPalindromic operation middleware +func (sh *strictHandler) PostUtilsIsPalindromic(w http.ResponseWriter, r *http.Request) { + var request PostUtilsIsPalindromicRequestObject - var body PostPcrSimplePcrJSONRequestBody + var body PostUtilsIsPalindromicJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1830,18 +3976,18 @@ func (sh *strictHandler) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostPcrSimplePcr(ctx, request.(PostPcrSimplePcrRequestObject)) + return sh.ssi.PostUtilsIsPalindromic(ctx, request.(PostUtilsIsPalindromicRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostPcrSimplePcr") + handler = middleware(handler, "PostUtilsIsPalindromic") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostPcrSimplePcrResponseObject); ok { - if err := validResponse.VisitPostPcrSimplePcrResponse(w); err != nil { + } else if validResponse, ok := response.(PostUtilsIsPalindromicResponseObject); ok { + if err := validResponse.VisitPostUtilsIsPalindromicResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1849,11 +3995,11 @@ func (sh *strictHandler) PostPcrSimplePcr(w http.ResponseWriter, r *http.Request } } -// PostSynthesisFragment operation middleware -func (sh *strictHandler) PostSynthesisFragment(w http.ResponseWriter, r *http.Request) { - var request PostSynthesisFragmentRequestObject +// PostUtilsReverseComplement operation middleware +func (sh *strictHandler) PostUtilsReverseComplement(w http.ResponseWriter, r *http.Request) { + var request PostUtilsReverseComplementRequestObject - var body PostSynthesisFragmentJSONRequestBody + var body PostUtilsReverseComplementJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -1861,18 +4007,18 @@ func (sh *strictHandler) PostSynthesisFragment(w http.ResponseWriter, r *http.Re request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostSynthesisFragment(ctx, request.(PostSynthesisFragmentRequestObject)) + return sh.ssi.PostUtilsReverseComplement(ctx, request.(PostUtilsReverseComplementRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostSynthesisFragment") + handler = middleware(handler, "PostUtilsReverseComplement") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostSynthesisFragmentResponseObject); ok { - if err := validResponse.VisitPostSynthesisFragmentResponse(w); err != nil { + } else if validResponse, ok := response.(PostUtilsReverseComplementResponseObject); ok { + if err := validResponse.VisitPostUtilsReverseComplementResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -1883,45 +4029,75 @@ func (sh *strictHandler) PostSynthesisFragment(w http.ResponseWriter, r *http.Re // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xa23LbONJ+FRT//5JrKTO7WzO6s+U46ypnolje2outlAoimhISEqBxcKxJ+d23APAk", - "EqRg+TSztVeOgu5Gd39fg43DjyjhecEZMCWj2Y9IJlvIsf3nqVI42ebAlPlVCF6AUBTsWMKZKgfUroBo", - "FkklKNtED3HEcA6egYc4EnCrqQASzf7tpOLa0Je4kufrr5AoY+gMS5hz7Zt/jSV4J08q+XKEMgUbEL3p", - "rYFK3Df5fIvZBvozXwiee2decEkV5cw3eRxdA5Z7Y43iUkHhV7rhh/NYT1saip2HVrme1hfge/b7zgEF", - "TOfG1JnEl1Ecna2l+bPAt3P7U+Znly0LjeMXWCp8DQkXpJ8nSoApmlIQ3qAl3GpgSQBRWoZaar6IjD+3", - "14A93lyOe/OpMCnEmZXFhFD3c7Fno6fVc+CzxhlVOz/KwQFftgOu1Rrr3tABKy08dMVKCbrWCkZDowry", - "0RixEHjnjZmATAQtOsxvDGQ8wdXg/wtIo1n0f5NmzZmUC87kqpIbJ0flwaEk2tF97+J2MlqTtHz0plbg", - "jX8RvODiOxbk0x0Is1h4vb2GOxASRmXCqbEco/8HYGvMvg0VZOooso/3GCIVpzwsyEHhQ+ofjcyjKt1a", - "jRtHD5T7VYtZ3a9TXmSQ73+g1pxngC2/gBH/gpvSO1gImsMCC0Vx5lffrL9Vcy9dJD5Uv3LK/PpSYaH8", - "Dki9rkyHA9UunV69bgUcDKmDg/PPpSluJ7MMypMn30S+RHUiHIBVSw+mVCQ6w2IAEsf9c3pH5dBKlHNC", - "U+qmPscKBoQySHQGN/5VZrC7abg652SIEpXIFbCN2gb3SB21jpP94D2h9tyLm4T6QPhYFnjnY5IkIAfz", - "u263a0HEbRo8D3PJEEQEUsro4AfnG+y+c0Hk0NdIh9STlqNYc7HBjMp8YJBuqN83rrauAzm+xxCQgjBA", - "hq8P15WKL82SazH0pcX3nPF897gOwXzv/Nh02E0cMVtwxi2GNYZakLYyX3ve8rPOfQX0XrraDK2gKDH2", - "lcCnFsZVh/zepFTQZEsxSnhGTZvsfhVYKi6o9DbKDQD9ktJqy4Uc2MswyYWiOh/4wGjB9hb0ZqzQ649A", - "vEOi2tf0RyDH4psfZKqygC94FU2l0DhZu1RPU3myF2cfCDMFZanbCTkvovPfThEBSTcMnS4uW1SZRdOT", - "6ck7W2oFMFzQaBb9fDI9mRoHsNraRE8SIicpvbdocGnXq702Nrqg9yBRwvOcM1QIvs4gl4gyND9f2r+F", - "gAILu76ilAtkPJI7prYgqTyJ7PRu+JJEM7NJU3MiL+h95BIGUp1xsutspXFRZOWqPflabhddEfeJ016C", - "xoq/prEDmN9B1UQ+svMP7+NanXWrXLuT+6C2hmTBmXTe/TSdPiFFid3Ch6+T5Zb/uWKvpvdzuk84YtiF", - "nF30naotyqhUiKeosvQQR3/tZUTBvZoUGaadXHT97M35TwkCUVZohUAIbvvPvz2f+UumwJQ+kiDuQFRz", - "2CY3z7HYubBN0HYN30iTv4TI6IsRskXKC0Vz+jsMV+r1bx/QEoAgAinWmZJIcTQdKsBPlb23rEIJMLD9", - "eFqJvURBHUT5ZguoQomg2q3/OqZWzDF0PRnkqxKYyaxsXCvCepl4U0s+FxXHD03K6ShnK4XX7ltelkw0", - "e/cuPnRe2jcwujt/DeZVGWxoh5qAX5ketTPDy1nGGWWbyYZnBNjmMEec/IdG/LmIAvXB79iKVR4Pt1al", - "R/ULD+GU2M+2Cxh9MLnEUkK+znamBSM6USW+8g0AXtJcW3x9/rUBd7B1QM9oMOBX9Ilgh53tVYeafeDC", - "YHJukj4y/qzZBLjN3HimBBhLiV1nCN2Ay9bBrF03audO662rxf8NP64mTg00phFMS9jetAJaECFSJduP", - "KtxDohWsMo3HYXzvBK80fjbgcH19Gb4DaF15+nYBNmMBzZmTe/kNTsb954xcq0IHOFrKxdZQyDZlqe35", - "TKozVOq+Pg+vNUMYZRqjMs8N+QzNHPEon6RYKjwpsJAHFt5Lbi8yF1ZyjH3BYT0V5bAlvHX76lnFu6m1", - "4RF0cbq8OUXCqr3FKmLdKL0g2N73VOhR3gXvu6AqDLx/WcmX/miOZzxoKXeRpzQDZKJTwJCsiyrbdbJl", - "wwrL1m041W//jFR3F/uPI/rnhugDJPx8OK3BJLx9NRIO5iKYgp+PoOBorso7qDASljfVfzYa7l+wh1Ox", - "1HvzVbfyIwDGINKX9l6F9gdzH7a5LDPwOPIfyluRiIm7Jb9fFYkYT9siEXMnu0jEszW747fjhaA5iMe+", - "9MFiA2ql8r2jor9Pa0mm87U7t1SQF2Zr8NgTgr0DptpG42/biZfopoNd7Vf2/PqPdCixmF+3iGk42DCz", - "TOaEwFpo+pWt1lgknLiMjfJ04TTPS8WzSu+5SLvGjAFZyePuo8owVln3MUXrQH2TrIT/GWeO71ebpKXV", - "sDmnzD/ku443dqRerzzb/uGnp3uOe2y0HP/y5DODDTCDLRBUToyahO/T6UMpic4BnVn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b", + "faB/PphoAlpkStaxwOfRKDpeCvXfFH+Z6K8iOz53JNSKnWIh8Qxixj1phyRAJVkRb8oYRQK+FEDjgGh2", + "BDlsvh4pfb7MAHu0Oe/X5mOucI5TTYuThJiv04aMLsfUCvxW4JTIB38oBnf43O1wxVZL93YdsCy4B+1Y", + "Sk6WhYTeroWDdqvlBETMSd5KT7WAlMXYPuyLsQtL1w8Oq8GQEfXTpnYj1xhOI46OXtNyvPaPVKeM32Ge", + "fLwFrjK6V9sZ3AIX0EsTDo15H/zPgC4xvekKyJWBSHjWs5jyoCADiYfYLxXNTpGupY5qRQfC/VfACfBP", + "OC18WT4I98Mh/YEmZqAzrV3iPECeM85uCVT56YyzIj8/8XPMU3b38yfgwh9RPpkXToy1i6ksTyFr1lNL", + "xlLAOtKAJn4tVuQWppxkMMVcEpz62dfLG9v23OjnM+ofjFA/v1Cjl18BUSyt6HDIuklkK3NtOAx2qYVI", + "o58x08g1Ztkpj518DfkM1erhZ79bC+HxKeFxkWLe4RKTBU7ILRFdOTljCVkR0/QJltBBlEJcpHDtz7ed", + "xXgdtROWdEHCklwAXctNcEnfYmspud15T1e31BvVBvU54bJMda1hNY5BdNp36c4ugoBbz0c8yE26XJTA", + "ilDSOfTewMMd44noGpeLkHgqRK+vGV9jSkTW8ZCsiV83JjemFnt8auawAq4cGZ4fZpbFZ2bBCt5Vc+B7", + "Rln2sFutdNuXxF10JwaYjjtHDsJqQY5LHctXmjt6Vra3jm6Yy0WodUXpY18IfHR8bOcKH5RJOYk3BKOY", + "pURNGMy3HAvJOBHeKcOUpFDkF4R6huz+WW5fba3G1EnX7Nw8noEoUrljsVvB5bhrTeARpdvInVc3W3B7", + "0lS7v/qvYb2dqAq5YVx0LGhQwbgkRdYxbBecNobJ+lleLC8h8T7idnFj+wlkmN/4LU9kGmBE2xvLUCtZ", + "qVQ1YzVp9NNnPV1wmfJu235OkRmeZtzK1DeB96vgn7lONphSSK+KbNkxeT0hayKJwK3YoYbDrWG97NXT", + "p9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VeKGQt1koS9PtPt6ANK", + "pUBkEdOuyPR1SirrTp2xoQ+BGeZZwRcJkw+h8LvULCeK441tmAiK+OpKlwRlkEpC18h5Y4uwsGfAui6C", + "KZmuHaZCqL8YwyBlGZSB3LBk2PxG2KL1zjjIDYbVUeO7Oyo79FtdYCrxIi1igkOtPVcsF5pjX1bO8JqC", + "IEU2YTQGKnn3FXlG8WE6gVMZQPWYY6Y+FXwNjrr69UwIGaHk1xFK5hVSxCMiV3sXafcORa4galYSNIGZ", + "a9KXm7/sY0B61IQm4L57S7ml5ZZOzz2bGZxSvLFJC0YGcp2zF45pwrLyv0VCB3LaTNOZf0/o/tJZ3wTD", + "3v5BizQ1e/lVOTa4w7oU+fKl3Y5nLtv+NcY19yNVl4P45xAO6dytao2TjU+9fs45k0BouK+nJcN3fz+X", + "v0sLh/rcku/md75LfM++x/cz+nsWHt+zgPgW8GUzeJvtvCR6mYoiYcUyhblUejbub3J/JKP3qtHyof2V", + "Bns/+8nVUTSKprOP1x/Or6JRNLs68lzI3l2NNuQ6P5GwpfIrvLAtffgIXFmEIC2jVQ/YZ79isWnulLXA", + "acBoEXbnTomnvd+5s2r++FD9QxorxjMsTVL4JfLdgsObv0m0C+ujZjZ+Vbv0+KYAVd0qI3ZAlj7R5wDC", + "D7NCklSMiVjkOCU04SwjcT/U/q04zsXUof9HHbghja77f90nYLNFJQIJiWWxNd3dQHyDyKoabhARqGlz", + "61DtwoY77VSs+btMAy4tf0Ns4v780D/IrU+tJcoV3drkXTWFpawNjdiqa+ZQ+VZnRTXLVH/+Kyp4Gh1G", + "GylzcTgeJxSbVxDvloSNcU6iryOX5nA8TlmM0w0T8vCXg18ODM3nr/8fAAD//6WJ2c3sdQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index 497fc76..b6757a9 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -17,6 +17,19 @@ const ( PichiaPastoris Organism = "Pichia pastoris" ) +// Defines values for PostSeqhashJSONBodySequenceType. +const ( + DNA PostSeqhashJSONBodySequenceType = "DNA" + PROTEIN PostSeqhashJSONBodySequenceType = "PROTEIN" + RNA PostSeqhashJSONBodySequenceType = "RNA" +) + +// AminoAcid defines model for AminoAcid. +type AminoAcid struct { + Codons []Codon `json:"Codons"` + Letter string `json:"Letter"` +} + // Attachment defines model for Attachment. type Attachment struct { Content string `json:"content"` @@ -38,6 +51,19 @@ type Change struct { To string `json:"To"` } +// Codon defines model for Codon. +type Codon struct { + Triplet string `json:"Triplet"` + Weight int `json:"Weight"` +} + +// CodonTable defines model for CodonTable. +type CodonTable struct { + AminoAcids []AminoAcid `json:"AminoAcids"` + StartCodons []string `json:"StartCodons"` + StopCodons []string `json:"StopCodons"` +} + // Enzyme defines model for Enzyme. type Enzyme string @@ -78,6 +104,14 @@ type GenbankRecord struct { Sequence string `json:"sequence"` } +// HeaderValue defines model for HeaderValue. +type HeaderValue struct { + Attributes *map[string]string `json:"Attributes,omitempty"` + EndReasonHeaderMap *map[string]int `json:"EndReasonHeaderMap,omitempty"` + ReadGroupID *int `json:"ReadGroupID,omitempty"` + Slow5Version *string `json:"Slow5Version,omitempty"` +} + // Location defines model for Location. type Location struct { Complement bool `json:"complement"` @@ -122,6 +156,16 @@ type Meta struct { // Organism defines model for Organism. type Organism string +// PileupLine defines model for PileupLine. +type PileupLine struct { + Position int `json:"Position"` + Quality string `json:"Quality"` + ReadCount int `json:"ReadCount"` + ReadResults []string `json:"ReadResults"` + ReferenceBase string `json:"ReferenceBase"` + Sequence string `json:"Sequence"` +} + // Reference defines model for Reference. type Reference struct { Authors string `json:"authors"` @@ -133,6 +177,58 @@ type Reference struct { Title string `json:"title"` } +// Slow5Header defines model for Slow5Header. +type Slow5Header struct { + HeaderValues *[]HeaderValue `json:"HeaderValues,omitempty"` +} + +// Slow5Read defines model for Slow5Read. +type Slow5Read struct { + ChannelNumber *string `json:"ChannelNumber,omitempty"` + Digitisation *float32 `json:"Digitisation,omitempty"` + EndReason *string `json:"EndReason,omitempty"` + EndReasonMap *map[string]int `json:"EndReasonMap,omitempty"` + LenRawSignal *int `json:"LenRawSignal,omitempty"` + MedianBefore *float32 `json:"MedianBefore,omitempty"` + Offset *float32 `json:"Offset,omitempty"` + Range *float32 `json:"Range,omitempty"` + RawSignal *[]int `json:"RawSignal,omitempty"` + ReadGroupID *int `json:"ReadGroupID,omitempty"` + ReadID *string `json:"ReadID,omitempty"` + ReadNumber *int `json:"ReadNumber,omitempty"` + SamplingRate *float32 `json:"SamplingRate,omitempty"` + StartMux *int `json:"StartMux,omitempty"` + StartTime *int `json:"StartTime,omitempty"` +} + +// PostAlignMashJSONBody defines parameters for PostAlignMash. +type PostAlignMashJSONBody struct { + KmerSize int `json:"kmer_size"` + SequenceA string `json:"sequence_a"` + SequenceB string `json:"sequence_b"` + SketchSize int `json:"sketch_size"` +} + +// PostAlignMashManyJSONBody defines parameters for PostAlignMashMany. +type PostAlignMashManyJSONBody struct { + ComparisonSequences []string `json:"comparison_sequences"` + KmerSize int `json:"kmer_size"` + Sequence string `json:"sequence"` + SketchSize int `json:"sketch_size"` +} + +// PostAlignNeedlemanWunschJSONBody defines parameters for PostAlignNeedlemanWunsch. +type PostAlignNeedlemanWunschJSONBody struct { + SequenceA string `json:"sequence_a"` + SequenceB string `json:"sequence_b"` +} + +// PostAlignSmithWatermanJSONBody defines parameters for PostAlignSmithWaterman. +type PostAlignSmithWatermanJSONBody struct { + SequenceA string `json:"sequence_a"` + SequenceB string `json:"sequence_b"` +} + // PostCdsFixJSONBody defines parameters for PostCdsFix. type PostCdsFixJSONBody struct { Organism Organism `json:"organism"` @@ -153,6 +249,14 @@ type PostCdsTranslateJSONBody struct { TranslationTable int `json:"translation_table"` } +// PostCloningFragmentJSONBody defines parameters for PostCloningFragment. +type PostCloningFragmentJSONBody struct { + ExcludeOverhangs *[]string `json:"exclude_overhangs,omitempty"` + MaxFragmentSize int `json:"max_fragment_size"` + MinFragmentSize int `json:"min_fragment_size"` + Sequence string `json:"sequence"` +} + // PostCloningGoldengateJSONBody defines parameters for PostCloningGoldengate. type PostCloningGoldengateJSONBody struct { Enzyme *Enzyme `json:"enzyme,omitempty"` @@ -168,12 +272,57 @@ type PostCloningRestrictionDigestJSONBody struct { Sequence *string `json:"sequence,omitempty"` } +// PostCodonTablesAddTablesJSONBody defines parameters for PostCodonTablesAddTables. +type PostCodonTablesAddTablesJSONBody struct { + CodonTable1 CodonTable `json:"codonTable1"` + CodonTable2 CodonTable `json:"codonTable2"` +} + +// PostCodonTablesCompromiseTablesJSONBody defines parameters for PostCodonTablesCompromiseTables. +type PostCodonTablesCompromiseTablesJSONBody struct { + CodonTable1 CodonTable `json:"codonTable1"` + CodonTable2 CodonTable `json:"codonTable2"` +} + +// PostCodonTablesFromGenbankJSONBody defines parameters for PostCodonTablesFromGenbank. +type PostCodonTablesFromGenbankJSONBody struct { + CodonTable CodonTable `json:"codonTable"` + GenbankRecord GenbankRecord `json:"genbankRecord"` +} + +// PostCodonTablesGetOrganismTableJSONBody defines parameters for PostCodonTablesGetOrganismTable. +type PostCodonTablesGetOrganismTableJSONBody struct { + Organism string `json:"organism"` +} + +// PostCodonTablesNewJSONBody defines parameters for PostCodonTablesNew. +type PostCodonTablesNewJSONBody struct { + TableNumber int `json:"tableNumber"` +} + // PostExecuteLuaJSONBody defines parameters for PostExecuteLua. type PostExecuteLuaJSONBody struct { Attachments *[]Attachment `json:"attachments,omitempty"` Script string `json:"script"` } +// PostFoldingLinearfoldContraFoldV2JSONBody defines parameters for PostFoldingLinearfoldContraFoldV2. +type PostFoldingLinearfoldContraFoldV2JSONBody struct { + Sequence string `json:"sequence"` +} + +// PostFoldingLinearfoldViennaRnaFoldJSONBody defines parameters for PostFoldingLinearfoldViennaRnaFold. +type PostFoldingLinearfoldViennaRnaFoldJSONBody struct { + Sequence string `json:"sequence"` + Temperature *float32 `json:"temperature,omitempty"` +} + +// PostFoldingZukerJSONBody defines parameters for PostFoldingZuker. +type PostFoldingZukerJSONBody struct { + Sequence string `json:"sequence"` + Temperature *float32 `json:"temperature,omitempty"` +} + // PostIoFastaParseTextBody defines parameters for PostIoFastaParse. type PostIoFastaParseTextBody = string @@ -192,6 +341,39 @@ type PostIoGenbankParseTextBody = string // PostIoGenbankWriteJSONBody defines parameters for PostIoGenbankWrite. type PostIoGenbankWriteJSONBody = []GenbankRecord +// PostIoPileupParseJSONBody defines parameters for PostIoPileupParse. +type PostIoPileupParseJSONBody struct { + Data string `json:"data"` +} + +// PostIoPileupWriteJSONBody defines parameters for PostIoPileupWrite. +type PostIoPileupWriteJSONBody struct { + Lines *[]PileupLine `json:"lines,omitempty"` +} + +// PostIoSlow5ParseJSONBody defines parameters for PostIoSlow5Parse. +type PostIoSlow5ParseJSONBody struct { + Data string `json:"data"` +} + +// PostIoSlow5SvbCompressJSONBody defines parameters for PostIoSlow5SvbCompress. +type PostIoSlow5SvbCompressJSONBody struct { + RawSignal *[]int `json:"rawSignal,omitempty"` +} + +// PostIoSlow5SvbDecompressJSONBody defines parameters for PostIoSlow5SvbDecompress. +type PostIoSlow5SvbDecompressJSONBody struct { + Data *string `json:"data,omitempty"` + LenRawSignal *int `json:"lenRawSignal,omitempty"` + Mask *string `json:"mask,omitempty"` +} + +// PostIoSlow5WriteJSONBody defines parameters for PostIoSlow5Write. +type PostIoSlow5WriteJSONBody struct { + Header *Slow5Header `json:"header,omitempty"` + Reads *[]Slow5Read `json:"reads,omitempty"` +} + // PostPcrComplexPcrJSONBody defines parameters for PostPcrComplexPcr. type PostPcrComplexPcrJSONBody struct { Circular *bool `json:"circular,omitempty"` @@ -211,6 +393,14 @@ type PostPcrPrimersDebruijnBarcodesJSONBody struct { MaxSubSequence int `json:"max_sub_sequence"` } +// PostPcrPrimersDesignPrimersJSONBody defines parameters for PostPcrPrimersDesignPrimers. +type PostPcrPrimersDesignPrimersJSONBody struct { + ForwardOverhang *string `json:"forward_overhang,omitempty"` + ReverseOverhang *string `json:"reverse_overhang,omitempty"` + Sequence string `json:"sequence"` + TargetTm float32 `json:"targetTm"` +} + // PostPcrPrimersMarmurDotyJSONBody defines parameters for PostPcrPrimersMarmurDoty. type PostPcrPrimersMarmurDotyJSONBody struct { Sequence string `json:"sequence"` @@ -238,14 +428,64 @@ type PostPcrSimplePcrJSONBody struct { Template string `json:"template"` } -// PostSynthesisFragmentJSONBody defines parameters for PostSynthesisFragment. -type PostSynthesisFragmentJSONBody struct { - ExcludeOverhangs *[]string `json:"exclude_overhangs,omitempty"` - MaxFragmentSize int `json:"max_fragment_size"` - MinFragmentSize int `json:"min_fragment_size"` - Sequence string `json:"sequence"` +// PostRandomRandomDnaJSONBody defines parameters for PostRandomRandomDna. +type PostRandomRandomDnaJSONBody struct { + Length int `json:"length"` + Seed *int `json:"seed"` +} + +// PostRandomRandomProteinJSONBody defines parameters for PostRandomRandomProtein. +type PostRandomRandomProteinJSONBody struct { + Length int `json:"length"` + Seed *int `json:"seed"` +} + +// PostRandomRandomRnaJSONBody defines parameters for PostRandomRandomRna. +type PostRandomRandomRnaJSONBody struct { + Length int `json:"length"` + Seed *int `json:"seed"` +} + +// PostSeqhashJSONBody defines parameters for PostSeqhash. +type PostSeqhashJSONBody struct { + Circular bool `json:"circular"` + DoubleStranded bool `json:"doubleStranded"` + Sequence string `json:"sequence"` + SequenceType PostSeqhashJSONBodySequenceType `json:"sequenceType"` +} + +// PostSeqhashJSONBodySequenceType defines parameters for PostSeqhash. +type PostSeqhashJSONBodySequenceType string + +// PostSeqhashFragmentJSONBody defines parameters for PostSeqhashFragment. +type PostSeqhashFragmentJSONBody struct { + ForwardOverhangLength int8 `json:"forwardOverhangLength"` + ReverseOverhangLength int8 `json:"reverseOverhangLength"` + Sequence string `json:"sequence"` +} + +// PostUtilsIsPalindromicJSONBody defines parameters for PostUtilsIsPalindromic. +type PostUtilsIsPalindromicJSONBody struct { + Sequence string `json:"sequence"` +} + +// PostUtilsReverseComplementJSONBody defines parameters for PostUtilsReverseComplement. +type PostUtilsReverseComplementJSONBody struct { + Sequence string `json:"sequence"` } +// PostAlignMashJSONRequestBody defines body for PostAlignMash for application/json ContentType. +type PostAlignMashJSONRequestBody PostAlignMashJSONBody + +// PostAlignMashManyJSONRequestBody defines body for PostAlignMashMany for application/json ContentType. +type PostAlignMashManyJSONRequestBody PostAlignMashManyJSONBody + +// PostAlignNeedlemanWunschJSONRequestBody defines body for PostAlignNeedlemanWunsch for application/json ContentType. +type PostAlignNeedlemanWunschJSONRequestBody PostAlignNeedlemanWunschJSONBody + +// PostAlignSmithWatermanJSONRequestBody defines body for PostAlignSmithWaterman for application/json ContentType. +type PostAlignSmithWatermanJSONRequestBody PostAlignSmithWatermanJSONBody + // PostCdsFixJSONRequestBody defines body for PostCdsFix for application/json ContentType. type PostCdsFixJSONRequestBody PostCdsFixJSONBody @@ -255,6 +495,9 @@ type PostCdsOptimizeJSONRequestBody PostCdsOptimizeJSONBody // PostCdsTranslateJSONRequestBody defines body for PostCdsTranslate for application/json ContentType. type PostCdsTranslateJSONRequestBody PostCdsTranslateJSONBody +// PostCloningFragmentJSONRequestBody defines body for PostCloningFragment for application/json ContentType. +type PostCloningFragmentJSONRequestBody PostCloningFragmentJSONBody + // PostCloningGoldengateJSONRequestBody defines body for PostCloningGoldengate for application/json ContentType. type PostCloningGoldengateJSONRequestBody PostCloningGoldengateJSONBody @@ -264,9 +507,33 @@ type PostCloningLigateJSONRequestBody = PostCloningLigateJSONBody // PostCloningRestrictionDigestJSONRequestBody defines body for PostCloningRestrictionDigest for application/json ContentType. type PostCloningRestrictionDigestJSONRequestBody PostCloningRestrictionDigestJSONBody +// PostCodonTablesAddTablesJSONRequestBody defines body for PostCodonTablesAddTables for application/json ContentType. +type PostCodonTablesAddTablesJSONRequestBody PostCodonTablesAddTablesJSONBody + +// PostCodonTablesCompromiseTablesJSONRequestBody defines body for PostCodonTablesCompromiseTables for application/json ContentType. +type PostCodonTablesCompromiseTablesJSONRequestBody PostCodonTablesCompromiseTablesJSONBody + +// PostCodonTablesFromGenbankJSONRequestBody defines body for PostCodonTablesFromGenbank for application/json ContentType. +type PostCodonTablesFromGenbankJSONRequestBody PostCodonTablesFromGenbankJSONBody + +// PostCodonTablesGetOrganismTableJSONRequestBody defines body for PostCodonTablesGetOrganismTable for application/json ContentType. +type PostCodonTablesGetOrganismTableJSONRequestBody PostCodonTablesGetOrganismTableJSONBody + +// PostCodonTablesNewJSONRequestBody defines body for PostCodonTablesNew for application/json ContentType. +type PostCodonTablesNewJSONRequestBody PostCodonTablesNewJSONBody + // PostExecuteLuaJSONRequestBody defines body for PostExecuteLua for application/json ContentType. type PostExecuteLuaJSONRequestBody PostExecuteLuaJSONBody +// PostFoldingLinearfoldContraFoldV2JSONRequestBody defines body for PostFoldingLinearfoldContraFoldV2 for application/json ContentType. +type PostFoldingLinearfoldContraFoldV2JSONRequestBody PostFoldingLinearfoldContraFoldV2JSONBody + +// PostFoldingLinearfoldViennaRnaFoldJSONRequestBody defines body for PostFoldingLinearfoldViennaRnaFold for application/json ContentType. +type PostFoldingLinearfoldViennaRnaFoldJSONRequestBody PostFoldingLinearfoldViennaRnaFoldJSONBody + +// PostFoldingZukerJSONRequestBody defines body for PostFoldingZuker for application/json ContentType. +type PostFoldingZukerJSONRequestBody PostFoldingZukerJSONBody + // PostIoFastaParseTextRequestBody defines body for PostIoFastaParse for text/plain ContentType. type PostIoFastaParseTextRequestBody = PostIoFastaParseTextBody @@ -285,12 +552,33 @@ type PostIoGenbankParseTextRequestBody = PostIoGenbankParseTextBody // PostIoGenbankWriteJSONRequestBody defines body for PostIoGenbankWrite for application/json ContentType. type PostIoGenbankWriteJSONRequestBody = PostIoGenbankWriteJSONBody +// PostIoPileupParseJSONRequestBody defines body for PostIoPileupParse for application/json ContentType. +type PostIoPileupParseJSONRequestBody PostIoPileupParseJSONBody + +// PostIoPileupWriteJSONRequestBody defines body for PostIoPileupWrite for application/json ContentType. +type PostIoPileupWriteJSONRequestBody PostIoPileupWriteJSONBody + +// PostIoSlow5ParseJSONRequestBody defines body for PostIoSlow5Parse for application/json ContentType. +type PostIoSlow5ParseJSONRequestBody PostIoSlow5ParseJSONBody + +// PostIoSlow5SvbCompressJSONRequestBody defines body for PostIoSlow5SvbCompress for application/json ContentType. +type PostIoSlow5SvbCompressJSONRequestBody PostIoSlow5SvbCompressJSONBody + +// PostIoSlow5SvbDecompressJSONRequestBody defines body for PostIoSlow5SvbDecompress for application/json ContentType. +type PostIoSlow5SvbDecompressJSONRequestBody PostIoSlow5SvbDecompressJSONBody + +// PostIoSlow5WriteJSONRequestBody defines body for PostIoSlow5Write for application/json ContentType. +type PostIoSlow5WriteJSONRequestBody PostIoSlow5WriteJSONBody + // PostPcrComplexPcrJSONRequestBody defines body for PostPcrComplexPcr for application/json ContentType. type PostPcrComplexPcrJSONRequestBody PostPcrComplexPcrJSONBody // PostPcrPrimersDebruijnBarcodesJSONRequestBody defines body for PostPcrPrimersDebruijnBarcodes for application/json ContentType. type PostPcrPrimersDebruijnBarcodesJSONRequestBody PostPcrPrimersDebruijnBarcodesJSONBody +// PostPcrPrimersDesignPrimersJSONRequestBody defines body for PostPcrPrimersDesignPrimers for application/json ContentType. +type PostPcrPrimersDesignPrimersJSONRequestBody PostPcrPrimersDesignPrimersJSONBody + // PostPcrPrimersMarmurDotyJSONRequestBody defines body for PostPcrPrimersMarmurDoty for application/json ContentType. type PostPcrPrimersMarmurDotyJSONRequestBody PostPcrPrimersMarmurDotyJSONBody @@ -303,5 +591,23 @@ type PostPcrPrimersSantaLuciaJSONRequestBody PostPcrPrimersSantaLuciaJSONBody // PostPcrSimplePcrJSONRequestBody defines body for PostPcrSimplePcr for application/json ContentType. type PostPcrSimplePcrJSONRequestBody PostPcrSimplePcrJSONBody -// PostSynthesisFragmentJSONRequestBody defines body for PostSynthesisFragment for application/json ContentType. -type PostSynthesisFragmentJSONRequestBody PostSynthesisFragmentJSONBody +// PostRandomRandomDnaJSONRequestBody defines body for PostRandomRandomDna for application/json ContentType. +type PostRandomRandomDnaJSONRequestBody PostRandomRandomDnaJSONBody + +// PostRandomRandomProteinJSONRequestBody defines body for PostRandomRandomProtein for application/json ContentType. +type PostRandomRandomProteinJSONRequestBody PostRandomRandomProteinJSONBody + +// PostRandomRandomRnaJSONRequestBody defines body for PostRandomRandomRna for application/json ContentType. +type PostRandomRandomRnaJSONRequestBody PostRandomRandomRnaJSONBody + +// PostSeqhashJSONRequestBody defines body for PostSeqhash for application/json ContentType. +type PostSeqhashJSONRequestBody PostSeqhashJSONBody + +// PostSeqhashFragmentJSONRequestBody defines body for PostSeqhashFragment for application/json ContentType. +type PostSeqhashFragmentJSONRequestBody PostSeqhashFragmentJSONBody + +// PostUtilsIsPalindromicJSONRequestBody defines body for PostUtilsIsPalindromic for application/json ContentType. +type PostUtilsIsPalindromicJSONRequestBody PostUtilsIsPalindromicJSONBody + +// PostUtilsReverseComplementJSONRequestBody defines body for PostUtilsReverseComplement for application/json ContentType. +type PostUtilsReverseComplementJSONRequestBody PostUtilsReverseComplementJSONBody diff --git a/api/spec.yaml b/api/spec.yaml index 1ad2513..3e8db23 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -1666,33 +1666,6 @@ paths: sequence: type: string - /utils/rna_reverse_complement: - post: - summary: Reverse Complement of RNA Sequence - tags: - - utils - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - sequence: - type: string - required: - - sequence - responses: - '200': - description: Reverse complement RNA sequence - content: - application/json: - schema: - type: object - properties: - sequence: - type: string - /utils/is_palindromic: post: summary: Check if Sequence is Palindromic From 4dda1b5eaf63496230eb6def5ef13c642bb0e934 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Mon, 25 Dec 2023 23:36:50 -0800 Subject: [PATCH 16/21] Add handlers --- api/api/api.go | 60 +++++++++- api/api/api_test.go | 2 +- api/gen/dnadesign-server.gen.go | 190 ++++++++++++++++---------------- api/gen/dnadesign-types.gen.go | 8 +- api/spec.yaml | 2 +- 5 files changed, 156 insertions(+), 106 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index 61c8833..86978ba 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -103,7 +103,17 @@ func InitializeApp() App { // IO handlers. app.Router.HandleFunc("/api/io/fasta/parse", appImpl.PostIoFastaParse) + app.Router.HandleFunc("/api/io/fasta/write", appImpl.PostIoFastaWrite) app.Router.HandleFunc("/api/io/genbank/parse", appImpl.PostIoGenbankParse) + app.Router.HandleFunc("/api/io/genbank/write", appImpl.PostIoGenbankWrite) + app.Router.HandleFunc("/api/io/fastq/parse", appImpl.PostIoFastqParse) + app.Router.HandleFunc("/api/io/fastq/write", appImpl.PostIoFastqWrite) + app.Router.HandleFunc("/api/io/pileup/parse", appImpl.PostIoPileupParse) + app.Router.HandleFunc("/api/io/pileup/write", appImpl.PostIoPileupWrite) + app.Router.HandleFunc("/api/io/slow5/parse", appImpl.PostIoSlow5Parse) + app.Router.HandleFunc("/api/io/slow5/write", appImpl.PostIoSlow5Write) + app.Router.HandleFunc("/api/io/slow5/svb_compress", appImpl.PostIoSlow5SvbCompress) + app.Router.HandleFunc("/api/io/slow5/svb_decompress", appImpl.PostIoSlow5SvbDecompress) // CDS design handlers. app.Router.HandleFunc("/api/cds/fix", appImpl.PostCdsFix) @@ -111,11 +121,51 @@ func InitializeApp() App { app.Router.HandleFunc("/api/cds/translate", appImpl.PostCdsTranslate) // PCR handlers. + app.Router.HandleFunc("/api/pcr/primers/debruijn_barcodes", appImpl.PostPcrPrimersDebruijnBarcodes) + app.Router.HandleFunc("/api/pcr/primers/marmur_doty", appImpl.PostPcrPrimersMarmurDoty) + app.Router.HandleFunc("/api/pcr/primers/santa_lucia", appImpl.PostPcrPrimersSantaLucia) + app.Router.HandleFunc("/api/pcr/primers/melting_temperature", appImpl.PostPcrPrimersMeltingTemperature) + app.Router.HandleFunc("/api/pcr/primers/design_primers", appImpl.PostPcrPrimersDesignPrimers) app.Router.HandleFunc("/api/pcr/complex_pcr", appImpl.PostPcrComplexPcr) app.Router.HandleFunc("/api/pcr/simple_pcr", appImpl.PostPcrSimplePcr) - // Synthesis handlers. - app.Router.HandleFunc("/api/synthesis/fragment", appImpl.PostCloningFragment) + // Cloning handlers. + app.Router.HandleFunc("/api/cloning/ligate", appImpl.PostCloningLigate) + app.Router.HandleFunc("/api/cloning/restriction_digest", appImpl.PostCloningRestrictionDigest) + app.Router.HandleFunc("/api/cloning/golden_gate", appImpl.PostCloningGoldenGate) + app.Router.HandleFunc("/api/cloning/fragment", appImpl.PostCloningFragment) + + // Folding handlers. + app.Router.HandleFunc("/api/folding/zuker", appImpl.PostFoldingZuker) + app.Router.HandleFunc("/api/folding/linearfold/contra_fold_v2", appImpl.PostFoldingLinearfoldContraFoldV2) + app.Router.HandleFunc("/api/folding/linearfold/vienna_rna_fold", appImpl.PostFoldingLinearfoldViennaRnaFold) + + // Seqhash handlers. + app.Router.HandleFunc("/api/seqhash", appImpl.PostSeqhash) + app.Router.HandleFunc("/api/seqhash_fragment", appImpl.PostSeqhashFragment) + + // Codon Table handlers. + app.Router.HandleFunc("/api/codon_tables/new", appImpl.PostCodonTablesNew) + app.Router.HandleFunc("/api/codon_tables/from_genbank", appImpl.PostCodonTablesFromGenbank) + app.Router.HandleFunc("/api/codon_tables/compromise_tables", appImpl.PostCodonTablesCompromiseTables) + app.Router.HandleFunc("/api/codon_tables/add_tables", appImpl.PostCodonTablesAddTables) + app.Router.HandleFunc("/api/codon_tables/default_organisms", appImpl.GetCodonTablesDefaultOrganisms) + app.Router.HandleFunc("/api/codon_tables/get_organism_table", appImpl.PostCodonTablesGetOrganismTable) + + // Alignment handlers. + app.Router.HandleFunc("/api/align/needleman_wunsch", appImpl.PostAlignNeedlemanWunsch) + app.Router.HandleFunc("/api/align/smith_waterman", appImpl.PostAlignSmithWaterman) + app.Router.HandleFunc("/api/align/mash", appImpl.PostAlignMash) + app.Router.HandleFunc("/api/align/mash_many", appImpl.PostAlignMashMany) + + // Utils handlers. + app.Router.HandleFunc("/api/utils/reverse_complement", appImpl.PostUtilsReverseComplement) + app.Router.HandleFunc("/api/utils/is_palindromic", appImpl.PostUtilsIsPalindromic) + + // Random handlers. + app.Router.HandleFunc("/api/random/random_dna", appImpl.PostRandomRandomDna) + app.Router.HandleFunc("/api/random/random_rna", appImpl.PostRandomRandomRna) + app.Router.HandleFunc("/api/random/random_protein", appImpl.PostRandomRandomProtein) return app } @@ -578,10 +628,10 @@ func (app *App) LuaPcrPrimersDesignPrimers(L *lua.LState) int { return 0 } ***************************************************************************** */ -func (app *App) PostCloningGoldengate(ctx context.Context, request gen.PostCloningGoldengateRequestObject) (gen.PostCloningGoldengateResponseObject, error) { +func (app *App) PostCloningGoldenGate(ctx context.Context, request gen.PostCloningGoldenGateRequestObject) (gen.PostCloningGoldenGateResponseObject, error) { return nil, nil } -func (app *App) LuaCloningGoldengate(L *lua.LState) int { return 0 } +func (app *App) LuaCloningGoldenGate(L *lua.LState) int { return 0 } func (app *App) PostCloningLigate(ctx context.Context, request gen.PostCloningLigateRequestObject) (gen.PostCloningLigateResponseObject, error) { return nil, nil } @@ -626,7 +676,7 @@ func (app *App) LuaCloningFragment(L *lua.LState) int { L.RaiseError(err.Error()) return 0 } - return app.luaResponse(L, "/api/synthesis/fragment", string(b)) + return app.luaResponse(L, "/api/cloning/fragment", string(b)) } /* diff --git a/api/api/api_test.go b/api/api/api_test.go index 293b90f..ff9ec92 100644 --- a/api/api/api_test.go +++ b/api/api/api_test.go @@ -141,7 +141,7 @@ func TestFragment(t *testing.T) { if err != nil { t.Errorf("Failed to marshal: %s", err) } - req := httptest.NewRequest("POST", "/api/synthesis/fragment", bytes.NewBuffer(b)) + req := httptest.NewRequest("POST", "/api/cloning/fragment", bytes.NewBuffer(b)) resp := httptest.NewRecorder() app.Router.ServeHTTP(resp, req) diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index c1d5a62..2c949f8 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -48,8 +48,8 @@ type ServerInterface interface { // (POST /cloning/fragment) PostCloningFragment(w http.ResponseWriter, r *http.Request) // Simulate GoldenGate assembly - // (POST /cloning/goldengate) - PostCloningGoldengate(w http.ResponseWriter, r *http.Request) + // (POST /cloning/golden_gate) + PostCloningGoldenGate(w http.ResponseWriter, r *http.Request) // Simulate ligation // (POST /cloning/ligate) PostCloningLigate(w http.ResponseWriter, r *http.Request) @@ -219,8 +219,8 @@ func (_ Unimplemented) PostCloningFragment(w http.ResponseWriter, r *http.Reques } // Simulate GoldenGate assembly -// (POST /cloning/goldengate) -func (_ Unimplemented) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { +// (POST /cloning/golden_gate) +func (_ Unimplemented) PostCloningGoldenGate(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } @@ -581,12 +581,12 @@ func (siw *ServerInterfaceWrapper) PostCloningFragment(w http.ResponseWriter, r handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostCloningGoldengate operation middleware -func (siw *ServerInterfaceWrapper) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { +// PostCloningGoldenGate operation middleware +func (siw *ServerInterfaceWrapper) PostCloningGoldenGate(w http.ResponseWriter, r *http.Request) { ctx := r.Context() handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostCloningGoldengate(w, r) + siw.Handler.PostCloningGoldenGate(w, r) })) for _, middleware := range siw.HandlerMiddlewares { @@ -1304,7 +1304,7 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl r.Post(options.BaseURL+"/cloning/fragment", wrapper.PostCloningFragment) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/cloning/goldengate", wrapper.PostCloningGoldengate) + r.Post(options.BaseURL+"/cloning/golden_gate", wrapper.PostCloningGoldenGate) }) r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/cloning/ligate", wrapper.PostCloningLigate) @@ -1636,25 +1636,25 @@ func (response PostCloningFragment500TextResponse) VisitPostCloningFragmentRespo return err } -type PostCloningGoldengateRequestObject struct { - Body *PostCloningGoldengateJSONRequestBody +type PostCloningGoldenGateRequestObject struct { + Body *PostCloningGoldenGateJSONRequestBody } -type PostCloningGoldengateResponseObject interface { - VisitPostCloningGoldengateResponse(w http.ResponseWriter) error +type PostCloningGoldenGateResponseObject interface { + VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error } -type PostCloningGoldengate200Response struct { +type PostCloningGoldenGate200Response struct { } -func (response PostCloningGoldengate200Response) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { +func (response PostCloningGoldenGate200Response) VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error { w.WriteHeader(200) return nil } -type PostCloningGoldengate500TextResponse string +type PostCloningGoldenGate500TextResponse string -func (response PostCloningGoldengate500TextResponse) VisitPostCloningGoldengateResponse(w http.ResponseWriter) error { +func (response PostCloningGoldenGate500TextResponse) VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(500) @@ -2426,8 +2426,8 @@ type StrictServerInterface interface { // (POST /cloning/fragment) PostCloningFragment(ctx context.Context, request PostCloningFragmentRequestObject) (PostCloningFragmentResponseObject, error) // Simulate GoldenGate assembly - // (POST /cloning/goldengate) - PostCloningGoldengate(ctx context.Context, request PostCloningGoldengateRequestObject) (PostCloningGoldengateResponseObject, error) + // (POST /cloning/golden_gate) + PostCloningGoldenGate(ctx context.Context, request PostCloningGoldenGateRequestObject) (PostCloningGoldenGateResponseObject, error) // Simulate ligation // (POST /cloning/ligate) PostCloningLigate(ctx context.Context, request PostCloningLigateRequestObject) (PostCloningLigateResponseObject, error) @@ -2821,11 +2821,11 @@ func (sh *strictHandler) PostCloningFragment(w http.ResponseWriter, r *http.Requ } } -// PostCloningGoldengate operation middleware -func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Request) { - var request PostCloningGoldengateRequestObject +// PostCloningGoldenGate operation middleware +func (sh *strictHandler) PostCloningGoldenGate(w http.ResponseWriter, r *http.Request) { + var request PostCloningGoldenGateRequestObject - var body PostCloningGoldengateJSONRequestBody + var body PostCloningGoldenGateJSONRequestBody if err := json.NewDecoder(r.Body).Decode(&body); err != nil { sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) return @@ -2833,18 +2833,18 @@ func (sh *strictHandler) PostCloningGoldengate(w http.ResponseWriter, r *http.Re request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { - return sh.ssi.PostCloningGoldengate(ctx, request.(PostCloningGoldengateRequestObject)) + return sh.ssi.PostCloningGoldenGate(ctx, request.(PostCloningGoldenGateRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostCloningGoldengate") + handler = middleware(handler, "PostCloningGoldenGate") } response, err := handler(r.Context(), w, r, request) if err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) - } else if validResponse, ok := response.(PostCloningGoldengateResponseObject); ok { - if err := validResponse.VisitPostCloningGoldengateResponse(w); err != nil { + } else if validResponse, ok := response.(PostCloningGoldenGateResponseObject); ok { + if err := validResponse.VisitPostCloningGoldenGateResponse(w); err != nil { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { @@ -4029,75 +4029,75 @@ func (sh *strictHandler) PostUtilsReverseComplement(w http.ResponseWriter, r *ht // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xdbXPbtpP/KhjevVQjN73e9e93thy7nrEdVfI/nbmbjAYiVxJqEmAA0A/t5LvfACBI", - "kAJJyJYf0uZNIpm7i8XubxcLEID+imKW5YwClSI6/CsS8QYyrD8eZYSyo5gk6kvOWQ5cEtCPJixhVH8i", - "EjL94T85rKLD6D/GtbxxKWysyaOvo0g+5BAdRphz/KC+X4CUwBV7+URITug6+vp1FHH4UhAOSXT4f5Zu", - "ZBv+XIliyz8glkrWkZQ43mRA5ba+MaOyfNB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qK/mvLIhLu5ThPMWnZoq3nVpv/FsARoXkhEXDOdKXw8/7En1MJasKPBPBb4LaN", - "RvyeknvVaSdM40Q4QcpySbKyNvNH6uzqDM0BEpTACutkIRk66ArAj1bea0ahAEh2LlUDQuw5AmrQy9cb", - "QNZLCarU+tsh1SJHwfVdJ14lx1Sk5TpCdzUyScR1RbnvOsSfzMvmCKMLaXfblCETHf7442ho6rMtoPed", - "70sgz1qwhh2qO/zC8KiU6U5nKaOErscrd5NCN0IMdbWjYV8ggfs4LRJYsHKXw441QIbvF7YD1aS5gtFP", - "BwcjT1bLCO1heu9nelQq3G7Jp/LzFx6wWpGYAI0fGl09ePevf422Z+dWu6dsLqtljNzWQ0qPIyVQVRmV", - "DIRpgjBapQzL1ygKSj10Ua2K6zOWJkDPTLKsIstESCu61pp0PZyBDf1ZTb63CKs26/XVA+WWPgfou3o/", - "FMJN+9emRFgIyJbpg5rfJEUsy+QpXsHjc5KZlSWPeoMuT0mwuy/IE10dthvLJm3PyluQk4yaybZj/EbT", - "BjAvKfstxUFJivUYnpA1iLBBaFaznRiu146VoM1WgcbeTn+vGQCOi1Bijd3hVZbYWkyMcZKUHwdcWm23", - "FkdJYj7scSnfCv8x6OyC2fatX2/bb+93YWyNgW7zTZkvsX4WrPQWQK7gDmkKpEnQirMMHZXvdltAOUoS", - "dH3HXHp3qd3FhA8mSjfOMiJgV7RMKs7voHk7oLE+cfHQfm3DQU9L/LTh0Cmr2IVdbtD9XYMHOWfgAufE", - "8H2s2Pb8lquzROp8y1X2BNmeIIqzrbddZyBRqTqyuqMrTRhuMxXJi3KnY3CknXKWlRvEnyHIdouxdXuj", - "eh9rc1d7O9CaotxQ+wYizRxggmQ4znyUJqOX5kGVBUJRtIY66urFmyAsnUEVeDbe97/u2T89712efDte", - "Nu6Sxl2MI7kBJHKIyYpAUqUKT5Jo+JlxhGmVL3bwMYW7YKdewd3e/KibrzdHZfieZEUWHf70k15NMV8C", - "VgcdMd9UseUP4jZRrx/hHuJCwiIt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rNP169O7uMRtH8cuK5kb27Gm3IdX4jYUflF3hhW/rwAbiyCEFaRqsesM9+xWLb3Clr", + "gdOA0TLs0p0STwe/dGfd/PWh+pc01oxnWJqk8EvkuwaHN3+UaB/WB81s/Kp26fFNAaq6VkbsgSx9os8B", + "hB9mhSSpGBOxzHFKaMJZRuJ+qP1bcZyJmUP/jzpwQxpd9/+8T8Bmi0oEEhLLYme6u4X4GpF1NdwgIlDT", + "5tah2oUNd9qpWPOHmQZcWv6I2NT9/aF/kFsfW0uUK7q1ybtqCktZGxqxddfMofKtzopqlqn+/FdU8DQ6", + "jrZS5uJ4PE4oNq8g3qwIG+OcRF9HLs3xeJyyGKdbJuTxL0e/HBmaz1//PwAA//9s4PMu7XUAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index b6757a9..f6ba8b1 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -257,8 +257,8 @@ type PostCloningFragmentJSONBody struct { Sequence string `json:"sequence"` } -// PostCloningGoldengateJSONBody defines parameters for PostCloningGoldengate. -type PostCloningGoldengateJSONBody struct { +// PostCloningGoldenGateJSONBody defines parameters for PostCloningGoldenGate. +type PostCloningGoldenGateJSONBody struct { Enzyme *Enzyme `json:"enzyme,omitempty"` Sequences *[]string `json:"sequences,omitempty"` } @@ -498,8 +498,8 @@ type PostCdsTranslateJSONRequestBody PostCdsTranslateJSONBody // PostCloningFragmentJSONRequestBody defines body for PostCloningFragment for application/json ContentType. type PostCloningFragmentJSONRequestBody PostCloningFragmentJSONBody -// PostCloningGoldengateJSONRequestBody defines body for PostCloningGoldengate for application/json ContentType. -type PostCloningGoldengateJSONRequestBody PostCloningGoldengateJSONBody +// PostCloningGoldenGateJSONRequestBody defines body for PostCloningGoldenGate for application/json ContentType. +type PostCloningGoldenGateJSONRequestBody PostCloningGoldenGateJSONBody // PostCloningLigateJSONRequestBody defines body for PostCloningLigate for application/json ContentType. type PostCloningLigateJSONRequestBody = PostCloningLigateJSONBody diff --git a/api/spec.yaml b/api/spec.yaml index 3e8db23..1e490c1 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -1107,7 +1107,7 @@ paths: text/plain: schema: type: string - /cloning/goldengate: + /cloning/golden_gate: post: tags: - cloning From ce7228b87108dc37b5225f8a7fac9bc182591f8c Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Tue, 26 Dec 2023 21:45:58 -0800 Subject: [PATCH 17/21] Add write typed functions --- api/api/api.go | 54 ++++++++-- api/api/converters.go | 86 +++++++++++++++ api/gen/dnadesign-server.gen.go | 181 ++++++++++++++++---------------- api/gen/dnadesign-types.gen.go | 46 ++++---- api/spec.yaml | 54 +++++++--- 5 files changed, 285 insertions(+), 136 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index 86978ba..fd5971b 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -1,6 +1,7 @@ package api import ( + "bytes" "context" "embed" "encoding/json" @@ -17,6 +18,9 @@ import ( luajson "github.com/koeng101/dnadesign/api/api/json" "github.com/koeng101/dnadesign/api/gen" "github.com/koeng101/dnadesign/lib/bio" + "github.com/koeng101/dnadesign/lib/bio/fasta" + "github.com/koeng101/dnadesign/lib/bio/fastq" + "github.com/koeng101/dnadesign/lib/bio/slow5" "github.com/koeng101/dnadesign/lib/primers/pcr" "github.com/koeng101/dnadesign/lib/synthesis/codon" "github.com/koeng101/dnadesign/lib/synthesis/fix" @@ -209,16 +213,24 @@ func (app *App) ExecuteLua(data string, attachments []gen.Attachment) (string, s L.SetGlobal("fasta_parse", L.NewFunction(app.LuaIoFastaParse)) L.SetGlobal("genbank_parse", L.NewFunction(app.LuaIoGenbankParse)) - // Add CDS design functions + // Add CDS functions L.SetGlobal("fix", L.NewFunction(app.LuaCdsFix)) L.SetGlobal("optimize", L.NewFunction(app.LuaCdsOptimize)) L.SetGlobal("translate", L.NewFunction(app.LuaCdsTranslate)) - // Add simulate functions - L.SetGlobal("fragment", L.NewFunction(app.LuaCloningFragment)) + // Add PCR functions L.SetGlobal("complex_pcr", L.NewFunction(app.LuaPcrComplexPcr)) L.SetGlobal("pcr", L.NewFunction(app.LuaPcrSimplePcr)) + // Add Cloning functions + L.SetGlobal("fragment", L.NewFunction(app.LuaCloningFragment)) + + // Add Folding functions + // Add Seqhash functions + // Add CodonTable functions + // Add Utils functions + // Add Random functions + // Execute the Lua script if err := L.DoString(data); err != nil { return "", "", err @@ -315,7 +327,12 @@ func (app *App) LuaIoFastaParse(L *lua.LState) int { } func (app *App) PostIoFastaWrite(ctx context.Context, request gen.PostIoFastaWriteRequestObject) (gen.PostIoFastaWriteResponseObject, error) { - return nil, nil + var w bytes.Buffer + for _, fastaRecord := range *request.Body { + fastaStruct := fasta.Record(fastaRecord) + _, _ = fastaStruct.WriteTo(&w) // other than memory problems, there are no circumstances where bytes.Buffer errors + } + return gen.PostIoFastaWrite200TextResponse(w.String()), nil } func (app *App) LuaIoFastaWrite(L *lua.LState) int { return 0 } @@ -357,7 +374,12 @@ func (app *App) PostIoFastqParse(ctx context.Context, request gen.PostIoFastqPar func (app *App) LuaIoFastqParse(L *lua.LState) int { return 0 } func (app *App) PostIoFastqWrite(ctx context.Context, request gen.PostIoFastqWriteRequestObject) (gen.PostIoFastqWriteResponseObject, error) { - return nil, nil + var w bytes.Buffer + for _, fastqRead := range *request.Body { + fastqStruct := fastq.Read{Identifier: fastqRead.Identifier, Sequence: fastqRead.Sequence, Quality: fastqRead.Quality, Optionals: *fastqRead.Optionals} + _, _ = fastqStruct.WriteTo(&w) // other than memory problems, there are no circumstances where bytes.Buffer errors + } + return gen.PostIoFastqWrite200TextResponse(w.String()), nil } func (app *App) LuaIoFastqWrite(L *lua.LState) int { return 0 } @@ -367,7 +389,20 @@ func (app *App) PostIoSlow5Parse(ctx context.Context, request gen.PostIoSlow5Par func (app *App) LuaIoSlow5Parse(L *lua.LState) int { return 0 } func (app *App) PostIoSlow5Write(ctx context.Context, request gen.PostIoSlow5WriteRequestObject) (gen.PostIoSlow5WriteResponseObject, error) { - return nil, nil + var w bytes.Buffer + var headerValues []slow5.HeaderValue + requestHeaderValues := request.Body.Header.HeaderValues + for _, headerValue := range requestHeaderValues { + headerValues = append(headerValues, slow5.HeaderValue{ReadGroupID: uint32(headerValue.ReadGroupID), Slow5Version: headerValue.Slow5Version, EndReasonHeaderMap: headerValue.EndReasonHeaderMap}) + } + header := slow5.Header{HeaderValues: headerValues} + reads := request.Body.Reads + _, _ = header.WriteTo(&w) + for _, read := range *reads { + slow5Struct := ConvertSlow5ReadToRead(read) + _, _ = slow5Struct.WriteTo(&w) + } + return gen.PostIoSlow5Write200TextResponse(w.String()), nil } func (app *App) LuaIoSlow5Write(L *lua.LState) int { return 0 } @@ -387,7 +422,12 @@ func (app *App) PostIoPileupParse(ctx context.Context, request gen.PostIoPileupP func (app *App) LuaIoPileupParse(L *lua.LState) int { return 0 } func (app *App) PostIoPileupWrite(ctx context.Context, request gen.PostIoPileupWriteRequestObject) (gen.PostIoPileupWriteResponseObject, error) { - return nil, nil + var w bytes.Buffer + for _, pileupLine := range *request.Body { + pileupStruct := ConvertGenPileupLineToPileupLine(pileupLine) + _, _ = pileupStruct.WriteTo(&w) // other than memory problems, there are no circumstances where bytes.Buffer errors + } + return gen.PostIoPileupWrite200TextResponse(w.String()), nil } func (app *App) LuaIoPileupWrite(L *lua.LState) int { return 0 } diff --git a/api/api/converters.go b/api/api/converters.go index 96ff226..1e73bd5 100644 --- a/api/api/converters.go +++ b/api/api/converters.go @@ -3,8 +3,94 @@ package api import ( "github.com/koeng101/dnadesign/api/gen" "github.com/koeng101/dnadesign/lib/bio/genbank" + "github.com/koeng101/dnadesign/lib/bio/pileup" + "github.com/koeng101/dnadesign/lib/bio/slow5" ) +func ConvertPileupLineToGenPileupLine(pileupLine pileup.Line) gen.PileupLine { + return gen.PileupLine{ + Position: int(pileupLine.Position), + Quality: pileupLine.Quality, + ReadCount: int(pileupLine.ReadCount), + ReadResults: pileupLine.ReadResults, + ReferenceBase: pileupLine.ReferenceBase, + Sequence: pileupLine.Sequence, + } +} + +func ConvertGenPileupLineToPileupLine(genPileupLine gen.PileupLine) pileup.Line { + return pileup.Line{ + Sequence: genPileupLine.Sequence, + Position: uint(genPileupLine.Position), + ReferenceBase: genPileupLine.ReferenceBase, + ReadCount: uint(genPileupLine.ReadCount), + ReadResults: genPileupLine.ReadResults, + Quality: genPileupLine.Quality, + } +} + +//nolint:dupl +func ConvertSlow5ReadToRead(slow5Read gen.Slow5Read) slow5.Read { + var read slow5.Read + + // Convert and assign each field + read.ReadID = slow5Read.ReadID + read.ReadGroupID = uint32(slow5Read.ReadGroupID) + read.Digitisation = float64(slow5Read.Digitisation) + read.Offset = float64(slow5Read.Offset) + read.Range = float64(slow5Read.Range) + read.SamplingRate = float64(slow5Read.SamplingRate) + read.LenRawSignal = uint64(slow5Read.LenRawSignal) + + read.RawSignal = make([]int16, len(slow5Read.RawSignal)) + for i, v := range slow5Read.RawSignal { + read.RawSignal[i] = int16(v) + } + + // Auxiliary fields + read.ChannelNumber = slow5Read.ChannelNumber + read.MedianBefore = float64(slow5Read.MedianBefore) + read.ReadNumber = int32(slow5Read.ReadNumber) + read.StartMux = uint8(slow5Read.StartMux) + read.StartTime = uint64(slow5Read.StartTime) + read.EndReason = slow5Read.EndReason + + read.EndReasonMap = slow5Read.EndReasonMap + + return read +} + +//nolint:dupl +func ConvertReadToSlow5Read(read slow5.Read) gen.Slow5Read { + var slow5Read gen.Slow5Read + + // Convert and assign each field + slow5Read.ReadID = read.ReadID + slow5Read.ReadGroupID = int(read.ReadGroupID) + slow5Read.Digitisation = float32(read.Digitisation) + slow5Read.Offset = float32(read.Offset) + slow5Read.Range = float32(read.Range) + slow5Read.SamplingRate = float32(read.SamplingRate) + slow5Read.LenRawSignal = int(read.LenRawSignal) + + slow5Read.RawSignal = make([]int, len(read.RawSignal)) + for i, v := range read.RawSignal { + slow5Read.RawSignal[i] = int(v) + } + + // Auxiliary fields + slow5Read.ChannelNumber = read.ChannelNumber + slow5Read.MedianBefore = float32(read.MedianBefore) + slow5Read.ReadNumber = int(read.ReadNumber) + slow5Read.StartMux = int(read.StartMux) + slow5Read.StartTime = int(read.StartTime) + slow5Read.EndReason = read.EndReason + + slow5Read.EndReasonMap = read.EndReasonMap + + return slow5Read +} + // ConvertGenbankToGenbankRecord converts a genbank.Genbank object to a gen.GenbankRecord object. func ConvertGenbankToGenbankRecord(gb genbank.Genbank) gen.GenbankRecord { var features []gen.Feature diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 2c949f8..5d17d2f 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -1930,12 +1930,14 @@ type PostIoFastaWriteResponseObject interface { VisitPostIoFastaWriteResponse(w http.ResponseWriter) error } -type PostIoFastaWrite200Response struct { -} +type PostIoFastaWrite200TextResponse string -func (response PostIoFastaWrite200Response) VisitPostIoFastaWriteResponse(w http.ResponseWriter) error { +func (response PostIoFastaWrite200TextResponse) VisitPostIoFastaWriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) - return nil + + _, err := w.Write([]byte(response)) + return err } type PostIoFastqParseRequestObject struct { @@ -1963,12 +1965,14 @@ type PostIoFastqWriteResponseObject interface { VisitPostIoFastqWriteResponse(w http.ResponseWriter) error } -type PostIoFastqWrite200Response struct { -} +type PostIoFastqWrite200TextResponse string -func (response PostIoFastqWrite200Response) VisitPostIoFastqWriteResponse(w http.ResponseWriter) error { +func (response PostIoFastqWrite200TextResponse) VisitPostIoFastqWriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) - return nil + + _, err := w.Write([]byte(response)) + return err } type PostIoGenbankParseRequestObject struct { @@ -2039,15 +2043,14 @@ type PostIoPileupWriteResponseObject interface { VisitPostIoPileupWriteResponse(w http.ResponseWriter) error } -type PostIoPileupWrite200JSONResponse struct { - Data *string `json:"data,omitempty"` -} +type PostIoPileupWrite200TextResponse string -func (response PostIoPileupWrite200JSONResponse) VisitPostIoPileupWriteResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response PostIoPileupWrite200TextResponse) VisitPostIoPileupWriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) - return json.NewEncoder(w).Encode(response) + _, err := w.Write([]byte(response)) + return err } type PostIoSlow5ParseRequestObject struct { @@ -2117,15 +2120,14 @@ type PostIoSlow5WriteResponseObject interface { VisitPostIoSlow5WriteResponse(w http.ResponseWriter) error } -type PostIoSlow5Write200JSONResponse struct { - Data *string `json:"data,omitempty"` -} +type PostIoSlow5Write200TextResponse string -func (response PostIoSlow5Write200JSONResponse) VisitPostIoSlow5WriteResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response PostIoSlow5Write200TextResponse) VisitPostIoSlow5WriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) - return json.NewEncoder(w).Encode(response) + _, err := w.Write([]byte(response)) + return err } type PostPcrComplexPcrRequestObject struct { @@ -4029,75 +4031,76 @@ func (sh *strictHandler) PostUtilsReverseComplement(w http.ResponseWriter, r *ht // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xdbXPbtpP/KhjevVQjN73e9e93spyknrEdVfI/nbmbjAYiVxJqEmAA0A/t5LvfACBI", - "kAJJyJYf0uZNIpm7i8XubxcLEID+imKW5YwClSI6/isS8RYyrD9OMkLZJCaJ+pJzlgOXBPSjKUsY1Z+I", - "hEx/+E8O6+g4+o9xLW9cChtr8ujrKJL3OUTHEeYc36vv5yAlcMVePhGSE7qJvn4dRRy+FIRDEh3/n6Ub", - "2YY/V6LY6g+IpZI1kRLH2wyo3NU3ZlSWD1oNjSKKMxjWQFONKkE+BU6wgCkrfO2vsABv47GlL58QKmED", - "fKd5LcCS+xqf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P7s8", + "ieJoNv9w9eb8Moqj+eWJ54L5/mq0Jdf5yYcdlV/gFWzlwwfgyiIEaRmdesA++xWLbXtDrAVOC0bLsLt1", + "Kjwd/G6ddfuHmZofBlkznmNpksIvke+2G97+vaZ9WB80s/Gr2qfHNwWo+vYYsQey9ME9BxB+mJWSZGJC", + "xLLAGaEpZzlJhqH2b8VxLmYO/T/qXA1pdd3/a0UB2ydqEUhILMud6e4WkmtE1vVwg4hAbZtbh2oXttxp", + "p2Lt35kacWn1+2pT9+eU/kFufWwtUa3oNibvqyksZWNoxNZ9M4fatzorqlmm+vNfUcmz6DjaSlmI48kk", + "pdi8gni1ImyCCxJ9iV2a48kkYwnOtkzI41+OfjkyNJ++/H8AAAD//9ZX+4EIdwAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index f6ba8b1..5429eb0 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -106,10 +106,10 @@ type GenbankRecord struct { // HeaderValue defines model for HeaderValue. type HeaderValue struct { - Attributes *map[string]string `json:"Attributes,omitempty"` - EndReasonHeaderMap *map[string]int `json:"EndReasonHeaderMap,omitempty"` - ReadGroupID *int `json:"ReadGroupID,omitempty"` - Slow5Version *string `json:"Slow5Version,omitempty"` + Attributes map[string]string `json:"Attributes"` + EndReasonHeaderMap map[string]int `json:"EndReasonHeaderMap"` + ReadGroupID int `json:"ReadGroupID"` + Slow5Version string `json:"Slow5Version"` } // Location defines model for Location. @@ -179,26 +179,26 @@ type Reference struct { // Slow5Header defines model for Slow5Header. type Slow5Header struct { - HeaderValues *[]HeaderValue `json:"HeaderValues,omitempty"` + HeaderValues []HeaderValue `json:"HeaderValues"` } // Slow5Read defines model for Slow5Read. type Slow5Read struct { - ChannelNumber *string `json:"ChannelNumber,omitempty"` - Digitisation *float32 `json:"Digitisation,omitempty"` - EndReason *string `json:"EndReason,omitempty"` - EndReasonMap *map[string]int `json:"EndReasonMap,omitempty"` - LenRawSignal *int `json:"LenRawSignal,omitempty"` - MedianBefore *float32 `json:"MedianBefore,omitempty"` - Offset *float32 `json:"Offset,omitempty"` - Range *float32 `json:"Range,omitempty"` - RawSignal *[]int `json:"RawSignal,omitempty"` - ReadGroupID *int `json:"ReadGroupID,omitempty"` - ReadID *string `json:"ReadID,omitempty"` - ReadNumber *int `json:"ReadNumber,omitempty"` - SamplingRate *float32 `json:"SamplingRate,omitempty"` - StartMux *int `json:"StartMux,omitempty"` - StartTime *int `json:"StartTime,omitempty"` + ChannelNumber string `json:"ChannelNumber"` + Digitisation float32 `json:"Digitisation"` + EndReason string `json:"EndReason"` + EndReasonMap map[string]int `json:"EndReasonMap"` + LenRawSignal int `json:"LenRawSignal"` + MedianBefore float32 `json:"MedianBefore"` + Offset float32 `json:"Offset"` + Range float32 `json:"Range"` + RawSignal []int `json:"RawSignal"` + ReadGroupID int `json:"ReadGroupID"` + ReadID string `json:"ReadID"` + ReadNumber int `json:"ReadNumber"` + SamplingRate float32 `json:"SamplingRate"` + StartMux int `json:"StartMux"` + StartTime int `json:"StartTime"` } // PostAlignMashJSONBody defines parameters for PostAlignMash. @@ -347,9 +347,7 @@ type PostIoPileupParseJSONBody struct { } // PostIoPileupWriteJSONBody defines parameters for PostIoPileupWrite. -type PostIoPileupWriteJSONBody struct { - Lines *[]PileupLine `json:"lines,omitempty"` -} +type PostIoPileupWriteJSONBody = []PileupLine // PostIoSlow5ParseJSONBody defines parameters for PostIoSlow5Parse. type PostIoSlow5ParseJSONBody struct { @@ -556,7 +554,7 @@ type PostIoGenbankWriteJSONRequestBody = PostIoGenbankWriteJSONBody type PostIoPileupParseJSONRequestBody PostIoPileupParseJSONBody // PostIoPileupWriteJSONRequestBody defines body for PostIoPileupWrite for application/json ContentType. -type PostIoPileupWriteJSONRequestBody PostIoPileupWriteJSONBody +type PostIoPileupWriteJSONRequestBody = PostIoPileupWriteJSONBody // PostIoSlow5ParseJSONRequestBody defines body for PostIoSlow5Parse for application/json ContentType. type PostIoSlow5ParseJSONRequestBody PostIoSlow5ParseJSONBody diff --git a/api/spec.yaml b/api/spec.yaml index 1e490c1..b9ecd1e 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -51,6 +51,8 @@ components: type: array items: $ref: '#/components/schemas/HeaderValue' + required: + - HeaderValues HeaderValue: type: object properties: @@ -66,6 +68,11 @@ components: type: object additionalProperties: type: integer + required: + - ReadGroupID + - Slow5Version + - Attributes + - EndReasonHeaderMap Slow5Read: type: object properties: @@ -103,6 +110,22 @@ components: type: object additionalProperties: type: integer + required: + - ReadID + - ReadGroupID + - Digitisation + - Offset + - Range + - SamplingRate + - LenRawSignal + - RawSignal + - ChannelNumber + - MedianBefore + - ReadNumber + - StartMux + - StartTime + - EndReason + - EndReasonMap PileupLine: type: object properties: @@ -479,6 +502,10 @@ paths: responses: '200': description: FASTA file written successfully + content: + text/plain: + schema: + type: string /io/genbank/parse: post: tags: @@ -554,6 +581,10 @@ paths: responses: '200': description: FASTQ file written successfully + content: + text/plain: + schema: + type: string /io/pileup/parse: post: summary: Parse Pileup Data @@ -589,22 +620,16 @@ paths: content: application/json: schema: - type: object - properties: - lines: - type: array - items: - $ref: '#/components/schemas/PileupLine' + type: array + items: + $ref: '#/components/schemas/PileupLine' responses: '200': description: Pileup data string content: - application/json: + text/plain: schema: - type: object - properties: - data: - type: string + type: string /io/slow5/parse: post: @@ -658,12 +683,9 @@ paths: '200': description: slow5 data written successfully content: - application/json: + text/plain: schema: - type: object - properties: - data: - type: string + type: string /io/slow5/svb_compress: post: summary: Compress Raw Signal with SVB From 6260b276d53d612151852366f99407e4f5413066 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Fri, 19 Jan 2024 15:50:43 -0800 Subject: [PATCH 18/21] fix tests --- api/api/api.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index fd5971b..62bfa0d 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -305,17 +305,14 @@ func luaStringArrayToGoSlice(L *lua.LState, index int) ([]string, error) { func (app *App) PostIoFastaParse(ctx context.Context, request gen.PostIoFastaParseRequestObject) (gen.PostIoFastaParseResponseObject, error) { fastaString := *request.Body - parser, err := bio.NewFastaParser(strings.NewReader(fastaString + "\n")) - if err != nil { - return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil - } + parser := bio.NewFastaParser(strings.NewReader(fastaString + "\n")) fastas, err := parser.Parse() if err != nil { return gen.PostIoFastaParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil } data := make([]gen.FastaRecord, len(fastas)) for i, fastaRecord := range fastas { - data[i] = gen.FastaRecord(*fastaRecord) + data[i] = gen.FastaRecord(fastaRecord) } return gen.PostIoFastaParse200JSONResponse(data), nil } @@ -338,10 +335,7 @@ func (app *App) LuaIoFastaWrite(L *lua.LState) int { return 0 } func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenbankParseRequestObject) (gen.PostIoGenbankParseResponseObject, error) { genbankString := *request.Body - parser, err := bio.NewGenbankParser(strings.NewReader(genbankString + "\n")) - if err != nil { - return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil - } + parser := bio.NewGenbankParser(strings.NewReader(genbankString + "\n")) genbanks, err := parser.Parse() if err != nil { return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil @@ -352,7 +346,7 @@ func (app *App) PostIoGenbankParse(ctx context.Context, request gen.PostIoGenban if err != nil { return gen.PostIoGenbankParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil } - data[i] = ConvertGenbankToGenbankRecord(*genbankRecord) + data[i] = ConvertGenbankToGenbankRecord(genbankRecord) } return gen.PostIoGenbankParse200JSONResponse(data), nil } From 2230f927225be308dd82cbb3ca02252ba5995fd3 Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Fri, 19 Jan 2024 22:18:30 -0800 Subject: [PATCH 19/21] Finished all API endpoints for io --- api/api/api.go | 78 ++++++++++++++++++-- api/api/converters.go | 30 ++++++++ api/gen/dnadesign-server.gen.go | 123 ++++++++++++++++++++++---------- api/gen/dnadesign-types.gen.go | 32 ++++----- api/spec.yaml | 72 ++++++++++++++----- 5 files changed, 252 insertions(+), 83 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index 62bfa0d..96c205b 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "embed" + "encoding/base64" "encoding/json" "fmt" "html/template" @@ -358,12 +359,27 @@ func (app *App) LuaIoGenbankParse(L *lua.LState) int { } func (app *App) PostIoGenbankWrite(ctx context.Context, request gen.PostIoGenbankWriteRequestObject) (gen.PostIoGenbankWriteResponseObject, error) { - return nil, nil + var w bytes.Buffer + for _, genbankRecord := range *request.Body { + genbankStruct := ConvertGenbankRecordToGenbank(genbankRecord) + _, _ = genbankStruct.WriteTo(&w) + } + return gen.PostIoGenbankWrite200TextResponse(w.String()), nil } func (app *App) LuaIoGenbankWrite(L *lua.LState) int { return 0 } func (app *App) PostIoFastqParse(ctx context.Context, request gen.PostIoFastqParseRequestObject) (gen.PostIoFastqParseResponseObject, error) { - return nil, nil + fastqString := *request.Body + parser := bio.NewFastqParser(strings.NewReader(fastqString + "\n")) + fastqs, err := parser.Parse() + if err != nil { + return gen.PostIoFastqParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data := make([]gen.FastqRead, len(fastqs)) + for i, fastqRead := range fastqs { + data[i] = gen.FastqRead{Identifier: fastqRead.Identifier, Optionals: &fastqRead.Optionals, Sequence: fastqRead.Sequence, Quality: fastqRead.Quality} + } + return gen.PostIoFastqParse200JSONResponse(data), nil } func (app *App) LuaIoFastqParse(L *lua.LState) int { return 0 } @@ -378,7 +394,20 @@ func (app *App) PostIoFastqWrite(ctx context.Context, request gen.PostIoFastqWri func (app *App) LuaIoFastqWrite(L *lua.LState) int { return 0 } func (app *App) PostIoSlow5Parse(ctx context.Context, request gen.PostIoSlow5ParseRequestObject) (gen.PostIoSlow5ParseResponseObject, error) { - return nil, nil + slow5String := *request.Body + parser, err := bio.NewSlow5Parser(strings.NewReader(slow5String)) + if err != nil { + return gen.PostIoSlow5Parse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + reads, header, err := parser.ParseWithHeader() + if err != nil { + return gen.PostIoSlow5Parse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data := make([]gen.Slow5Read, len(reads)) + for i, read := range reads { + data[i] = ConvertReadToSlow5Read(read) + } + return gen.PostIoSlow5Parse200JSONResponse(gen.PostIoSlow5WriteJSONBody{Header: ConvertToGenSlow5Header(header), Reads: data}), nil } func (app *App) LuaIoSlow5Parse(L *lua.LState) int { return 0 } @@ -392,7 +421,7 @@ func (app *App) PostIoSlow5Write(ctx context.Context, request gen.PostIoSlow5Wri header := slow5.Header{HeaderValues: headerValues} reads := request.Body.Reads _, _ = header.WriteTo(&w) - for _, read := range *reads { + for _, read := range reads { slow5Struct := ConvertSlow5ReadToRead(read) _, _ = slow5Struct.WriteTo(&w) } @@ -401,17 +430,52 @@ func (app *App) PostIoSlow5Write(ctx context.Context, request gen.PostIoSlow5Wri func (app *App) LuaIoSlow5Write(L *lua.LState) int { return 0 } func (app *App) PostIoSlow5SvbCompress(ctx context.Context, request gen.PostIoSlow5SvbCompressRequestObject) (gen.PostIoSlow5SvbCompressResponseObject, error) { - return nil, nil + input := *request.Body + rawSignal := make([]int16, len(input.RawSignal)) + for i, integer := range input.RawSignal { + rawSignal[i] = int16(integer) + } + mask, data := slow5.SvbCompressRawSignal(rawSignal) + encodedMask := base64.StdEncoding.EncodeToString(mask) + encodedData := base64.StdEncoding.EncodeToString(data) + + return gen.PostIoSlow5SvbCompress200JSONResponse{Mask: encodedMask, Data: encodedData, LenRawSignal: len(rawSignal)}, nil } func (app *App) LuaIoSlow5SvbCompress(L *lua.LState) int { return 0 } func (app *App) PostIoSlow5SvbDecompress(ctx context.Context, request gen.PostIoSlow5SvbDecompressRequestObject) (gen.PostIoSlow5SvbDecompressResponseObject, error) { - return nil, nil + input := *request.Body + decodedMask, err := base64.StdEncoding.DecodeString(input.Mask) + if err != nil { + return gen.PostIoSlow5SvbDecompress500TextResponse(fmt.Sprintf("Failed to base64 decode mask. Got err: %s", err)), nil + } + + decodedData, err := base64.StdEncoding.DecodeString(input.Data) + if err != nil { + return gen.PostIoSlow5SvbDecompress500TextResponse(fmt.Sprintf("Failed to base64 decode data. Got err: %s", err)), nil + } + + rawSignal := slow5.SvbDecompressRawSignal(input.LenRawSignal, decodedMask, decodedData) + intRawSignal := make([]int, len(rawSignal)) + for i, integer := range rawSignal { + intRawSignal[i] = int(integer) + } + return gen.PostIoSlow5SvbDecompress200JSONResponse{RawSignal: intRawSignal}, nil } func (app *App) LuaIoSlow5SvbDecompress(L *lua.LState) int { return 0 } func (app *App) PostIoPileupParse(ctx context.Context, request gen.PostIoPileupParseRequestObject) (gen.PostIoPileupParseResponseObject, error) { - return nil, nil + pileupString := *request.Body + parser := bio.NewPileupParser(strings.NewReader(pileupString)) + pileups, err := parser.Parse() + if err != nil { + return gen.PostIoPileupParse500TextResponse(fmt.Sprintf("Got error: %s", err)), nil + } + data := make([]gen.PileupLine, len(pileups)) + for i, pileupRead := range pileups { + data[i] = gen.PileupLine{Sequence: pileupRead.Sequence, Position: int(pileupRead.Position), ReferenceBase: pileupRead.ReferenceBase, ReadCount: int(pileupRead.ReadCount), ReadResults: pileupRead.ReadResults, Quality: pileupRead.Quality} + } + return gen.PostIoPileupParse200JSONResponse(data), nil } func (app *App) LuaIoPileupParse(L *lua.LState) int { return 0 } diff --git a/api/api/converters.go b/api/api/converters.go index 1e73bd5..1a27ff2 100644 --- a/api/api/converters.go +++ b/api/api/converters.go @@ -282,3 +282,33 @@ func convertMetaGenToGenbank(meta gen.Meta) genbank.Meta { Version: meta.Version, } } + +func ConvertToSlow5Header(genHeader gen.Slow5Header) slow5.Header { + var slow5HeaderValues []slow5.HeaderValue + for _, hv := range genHeader.HeaderValues { + slow5HV := slow5.HeaderValue{ + ReadGroupID: uint32(hv.ReadGroupID), + Slow5Version: hv.Slow5Version, + Attributes: hv.Attributes, + EndReasonHeaderMap: hv.EndReasonHeaderMap, + } + slow5HeaderValues = append(slow5HeaderValues, slow5HV) + } + + return slow5.Header{HeaderValues: slow5HeaderValues} +} + +func ConvertToGenSlow5Header(slow5Header slow5.Header) gen.Slow5Header { + var genHeaderValues []gen.HeaderValue + for _, hv := range slow5Header.HeaderValues { + genHV := gen.HeaderValue{ + ReadGroupID: int(hv.ReadGroupID), + Slow5Version: hv.Slow5Version, + Attributes: hv.Attributes, + EndReasonHeaderMap: hv.EndReasonHeaderMap, + } + genHeaderValues = append(genHeaderValues, genHV) + } + + return gen.Slow5Header{HeaderValues: genHeaderValues} +} diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 5d17d2f..303fdd0 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -1957,6 +1957,16 @@ func (response PostIoFastqParse200JSONResponse) VisitPostIoFastqParseResponse(w return json.NewEncoder(w).Encode(response) } +type PostIoFastqParse500TextResponse string + +func (response PostIoFastqParse500TextResponse) VisitPostIoFastqParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + type PostIoFastqWriteRequestObject struct { Body *PostIoFastqWriteJSONRequestBody } @@ -2010,16 +2020,18 @@ type PostIoGenbankWriteResponseObject interface { VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error } -type PostIoGenbankWrite200Response struct { -} +type PostIoGenbankWrite200TextResponse string -func (response PostIoGenbankWrite200Response) VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error { +func (response PostIoGenbankWrite200TextResponse) VisitPostIoGenbankWriteResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) - return nil + + _, err := w.Write([]byte(response)) + return err } type PostIoPileupParseRequestObject struct { - Body *PostIoPileupParseJSONRequestBody + Body *PostIoPileupParseTextRequestBody } type PostIoPileupParseResponseObject interface { @@ -2035,6 +2047,16 @@ func (response PostIoPileupParse200JSONResponse) VisitPostIoPileupParseResponse( return json.NewEncoder(w).Encode(response) } +type PostIoPileupParse500TextResponse string + +func (response PostIoPileupParse500TextResponse) VisitPostIoPileupParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + type PostIoPileupWriteRequestObject struct { Body *PostIoPileupWriteJSONRequestBody } @@ -2054,7 +2076,7 @@ func (response PostIoPileupWrite200TextResponse) VisitPostIoPileupWriteResponse( } type PostIoSlow5ParseRequestObject struct { - Body *PostIoSlow5ParseJSONRequestBody + Body *PostIoSlow5ParseTextRequestBody } type PostIoSlow5ParseResponseObject interface { @@ -2062,8 +2084,8 @@ type PostIoSlow5ParseResponseObject interface { } type PostIoSlow5Parse200JSONResponse struct { - Header *Slow5Header `json:"header,omitempty"` - Reads *[]Slow5Read `json:"reads,omitempty"` + Header Slow5Header `json:"header"` + Reads []Slow5Read `json:"reads"` } func (response PostIoSlow5Parse200JSONResponse) VisitPostIoSlow5ParseResponse(w http.ResponseWriter) error { @@ -2073,6 +2095,16 @@ func (response PostIoSlow5Parse200JSONResponse) VisitPostIoSlow5ParseResponse(w return json.NewEncoder(w).Encode(response) } +type PostIoSlow5Parse500TextResponse string + +func (response PostIoSlow5Parse500TextResponse) VisitPostIoSlow5ParseResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + type PostIoSlow5SvbCompressRequestObject struct { Body *PostIoSlow5SvbCompressJSONRequestBody } @@ -2082,8 +2114,9 @@ type PostIoSlow5SvbCompressResponseObject interface { } type PostIoSlow5SvbCompress200JSONResponse struct { - Data *string `json:"data,omitempty"` - Mask *string `json:"mask,omitempty"` + Data string `json:"data"` + LenRawSignal int `json:"lenRawSignal"` + Mask string `json:"mask"` } func (response PostIoSlow5SvbCompress200JSONResponse) VisitPostIoSlow5SvbCompressResponse(w http.ResponseWriter) error { @@ -2102,7 +2135,7 @@ type PostIoSlow5SvbDecompressResponseObject interface { } type PostIoSlow5SvbDecompress200JSONResponse struct { - RawSignal *[]int `json:"rawSignal,omitempty"` + RawSignal []int `json:"rawSignal"` } func (response PostIoSlow5SvbDecompress200JSONResponse) VisitPostIoSlow5SvbDecompressResponse(w http.ResponseWriter) error { @@ -2112,6 +2145,16 @@ func (response PostIoSlow5SvbDecompress200JSONResponse) VisitPostIoSlow5SvbDecom return json.NewEncoder(w).Encode(response) } +type PostIoSlow5SvbDecompress500TextResponse string + +func (response PostIoSlow5SvbDecompress500TextResponse) VisitPostIoSlow5SvbDecompressResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(500) + + _, err := w.Write([]byte(response)) + return err +} + type PostIoSlow5WriteRequestObject struct { Body *PostIoSlow5WriteJSONRequestBody } @@ -3412,11 +3455,12 @@ func (sh *strictHandler) PostIoGenbankWrite(w http.ResponseWriter, r *http.Reque func (sh *strictHandler) PostIoPileupParse(w http.ResponseWriter, r *http.Request) { var request PostIoPileupParseRequestObject - var body PostIoPileupParseJSONRequestBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) return } + body := PostIoPileupParseTextRequestBody(data) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { @@ -3474,11 +3518,12 @@ func (sh *strictHandler) PostIoPileupWrite(w http.ResponseWriter, r *http.Reques func (sh *strictHandler) PostIoSlow5Parse(w http.ResponseWriter, r *http.Request) { var request PostIoSlow5ParseRequestObject - var body PostIoSlow5ParseJSONRequestBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err)) + data, err := io.ReadAll(r.Body) + if err != nil { + sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't read body: %w", err)) return } + body := PostIoSlow5ParseTextRequestBody(data) request.Body = &body handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { @@ -4079,28 +4124,28 @@ var swaggerSpec = []string{ "88fXz/Faom8h9wX25TG5XHGcXPecE3/MdobKzHYzQzfhaJsjRYS01a2bK+f2u/qGAKV4yalx956+/qi5", "51S7+5neQUGu9apODDevDf4n9tj1H48M4yE0vzxBlY+GofFneV1t/x9Dwf9qyu8+//p8rj2DKppejxM2", "WWMh8aTAXIzMBc6Zvi9hpimHXB48nB1sm+rgErpzyUPAzF53L0VvTxZXJ4hrtpdYxdVqVFqkWB8rtx4k", - "rOu8W05kmPN+15RP/dJi2OLjXn+wZY291iQDpGwigSJRl2DZfcfG2hhhNv4cHiCfv8UAMbeO7BcevzXh", - "0QPd38bNGgzdz88G3V5bPDFwf3sAcActXC2ThUG3WlL61sDbWSgMBrBdQXvpDG/1CHBjUKhU8p4lWEZt", - "H7aNoLLAfuAPsFuhj1eHod8cxR4H/161H5Y46Lg7ft4zPUMudY6kB8RS/b7bsCHF5x8NKoKzUW8FgdxI", - "exaMjxlkXx89OKVUFlRwQQ6UunExbmiRsdufw6JCn7b+WwdFW7ltfe59CBLuEXndPt7jJr7mAHvQRqye", - "0Uv70OQ+X7SZx6MYEDerpX6LD0IEQWFxs5pa+kMBgj/oSPqX55/J+4EbRzkW14GbiHZfFBljQoo4vkXC", - "2KG7qmdo0BzfImMpc6Jj8fF01Lsp7Ovfs4bjiUM+jrLRWxD2su1Tev+QKG1joDH4EAoaqr1xEDSiavc/", - "dkD9+pPps43WTYIOL2mHs3aR8Im5c+1uWSQjq7Ozh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ez0X5RkL9ZKEvSvV7ejjaJVA", + "ZBHTrcD05Vkq686csWEIgTnmecmXKZP3ofB7r1nOFMdXtjsmKOLrC3xSlEMmCd0g5/U8wsKe+Ou79qdi", + "unKYSqH+YgyDlGVQDnLL0nHzG2HLzgaBIDcYVkeN7+6o7TBsdYGpxMusTAgOtfZCsVxojkNZOccbCoKU", + "+ZTRBKjk/Zc7GsXH6QTOZADVQw4V+1TwNRj39euJEBKj9NcYpYsaKeIBkau9i7R7xyJXEDUrCZrALDTp", + "881fDjEgPWhCE/CLEJZyR8sdnZ56NjP+BuDrmrRgZCDXO3vhmKYsr/5bpnQkp801nfn3jB4unQ1NMOxd", + "L7TMMnNwQ5Vjo9vpK5HPX9rtecC2619jXHMbVn0VjH8O4ZAu3KrWONn41OvngjMJhIb7elYxfPf3U/m7", + "snCozy35fn7n+8T3/Ht8P6G/5+HxPQ+IbwGft6N3Fy8qouepKFJWrjJYSKVn67Yu96dfBi+WrR7a3x6x", + "vzpwdnkSxdFs/uHqzfllFEfzyxPPzwz0V6Mtuc4Pf+yo/PzYsj58AK4sQpCW0akH7LNfsdi2t0Vb4LRg", + "tAy7YanC08FvWFq3f56r+XmYNeM5liYp/BL57jzi7V/t2of1QTMbv6p9enxTgKrvEBJ7IEsf33QA4YdZ", + "KUkmJkQsC5wRmnKWk2QYav9WHOdi5tD/o05XkVbX/b9ZFbCZpRaBhMSy3JnubiG5RmRdDzeICNS2uXWo", + "dmHLnXYq1v61sRGXVr+yN3V/VOsf5NbH1hLVim5j8r6awlI2hkZs3TdzqH2rs6KaZao//xWVPIuOo62U", + "hTieTFKKzSuIVyvCJrgg0ZfYpTmeTDKW4GzLhDz+5eiXI0Pz6cv/BwAA//+r/Ue9DnkAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index 5429eb0..ac7d309 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -341,35 +341,31 @@ type PostIoGenbankParseTextBody = string // PostIoGenbankWriteJSONBody defines parameters for PostIoGenbankWrite. type PostIoGenbankWriteJSONBody = []GenbankRecord -// PostIoPileupParseJSONBody defines parameters for PostIoPileupParse. -type PostIoPileupParseJSONBody struct { - Data string `json:"data"` -} +// PostIoPileupParseTextBody defines parameters for PostIoPileupParse. +type PostIoPileupParseTextBody = string // PostIoPileupWriteJSONBody defines parameters for PostIoPileupWrite. type PostIoPileupWriteJSONBody = []PileupLine -// PostIoSlow5ParseJSONBody defines parameters for PostIoSlow5Parse. -type PostIoSlow5ParseJSONBody struct { - Data string `json:"data"` -} +// PostIoSlow5ParseTextBody defines parameters for PostIoSlow5Parse. +type PostIoSlow5ParseTextBody = string // PostIoSlow5SvbCompressJSONBody defines parameters for PostIoSlow5SvbCompress. type PostIoSlow5SvbCompressJSONBody struct { - RawSignal *[]int `json:"rawSignal,omitempty"` + RawSignal []int `json:"rawSignal"` } // PostIoSlow5SvbDecompressJSONBody defines parameters for PostIoSlow5SvbDecompress. type PostIoSlow5SvbDecompressJSONBody struct { - Data *string `json:"data,omitempty"` - LenRawSignal *int `json:"lenRawSignal,omitempty"` - Mask *string `json:"mask,omitempty"` + Data string `json:"data"` + LenRawSignal int `json:"lenRawSignal"` + Mask string `json:"mask"` } // PostIoSlow5WriteJSONBody defines parameters for PostIoSlow5Write. type PostIoSlow5WriteJSONBody struct { - Header *Slow5Header `json:"header,omitempty"` - Reads *[]Slow5Read `json:"reads,omitempty"` + Header Slow5Header `json:"header"` + Reads []Slow5Read `json:"reads"` } // PostPcrComplexPcrJSONBody defines parameters for PostPcrComplexPcr. @@ -550,14 +546,14 @@ type PostIoGenbankParseTextRequestBody = PostIoGenbankParseTextBody // PostIoGenbankWriteJSONRequestBody defines body for PostIoGenbankWrite for application/json ContentType. type PostIoGenbankWriteJSONRequestBody = PostIoGenbankWriteJSONBody -// PostIoPileupParseJSONRequestBody defines body for PostIoPileupParse for application/json ContentType. -type PostIoPileupParseJSONRequestBody PostIoPileupParseJSONBody +// PostIoPileupParseTextRequestBody defines body for PostIoPileupParse for text/plain ContentType. +type PostIoPileupParseTextRequestBody = PostIoPileupParseTextBody // PostIoPileupWriteJSONRequestBody defines body for PostIoPileupWrite for application/json ContentType. type PostIoPileupWriteJSONRequestBody = PostIoPileupWriteJSONBody -// PostIoSlow5ParseJSONRequestBody defines body for PostIoSlow5Parse for application/json ContentType. -type PostIoSlow5ParseJSONRequestBody PostIoSlow5ParseJSONBody +// PostIoSlow5ParseTextRequestBody defines body for PostIoSlow5Parse for text/plain ContentType. +type PostIoSlow5ParseTextRequestBody = PostIoSlow5ParseTextBody // PostIoSlow5SvbCompressJSONRequestBody defines body for PostIoSlow5SvbCompress for application/json ContentType. type PostIoSlow5SvbCompressJSONRequestBody PostIoSlow5SvbCompressJSONBody diff --git a/api/spec.yaml b/api/spec.yaml index b9ecd1e..ef6bc42 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -546,6 +546,10 @@ paths: responses: '200': description: Genbank file written successfully + content: + text/plain: + schema: + type: string /io/fastq/parse: post: tags: @@ -558,14 +562,19 @@ paths: type: string responses: '200': - description: Parsed FASTQ records + description: Parsed FASTA records content: application/json: schema: type: array items: $ref: '#/components/schemas/FastqRead' - + '500': + description: Internal server error + content: + text/plain: + schema: + type: string /io/fastq/write: post: tags: @@ -591,16 +600,10 @@ paths: tags: - io requestBody: - required: true content: - application/json: + text/plain: schema: - type: object - properties: - data: - type: string - required: - - data + type: string responses: '200': description: Array of Pileup Lines @@ -610,6 +613,12 @@ paths: type: array items: $ref: '#/components/schemas/PileupLine' + '500': + description: Internal server error + content: + text/plain: + schema: + type: string /io/pileup/write: post: summary: Write Pileup Data @@ -637,16 +646,10 @@ paths: tags: - io requestBody: - required: true content: - application/json: + text/plain: schema: - type: object - properties: - data: - type: string - required: - - data + type: string responses: '200': description: Parsed slow5 data @@ -661,6 +664,15 @@ paths: type: array items: $ref: '#/components/schemas/Slow5Read' + required: + - header + - reads + '500': + description: Internal server error + content: + text/plain: + schema: + type: string /io/slow5/write: post: summary: Write slow5 Data @@ -679,6 +691,9 @@ paths: type: array items: $ref: '#/components/schemas/Slow5Read' + required: + - header + - reads responses: '200': description: slow5 data written successfully @@ -702,6 +717,8 @@ paths: type: array items: type: integer + required: + - rawSignal responses: '200': description: Compressed raw signal @@ -714,6 +731,12 @@ paths: type: string data: type: string + lenRawSignal: + type: integer + required: + - mask + - data + - lenRawSignal /io/slow5/svb_decompress: post: summary: Decompress Raw Signal with SVB @@ -732,6 +755,10 @@ paths: type: string data: type: string + required: + - mask + - data + - lenRawSignal responses: '200': description: Decompressed raw signal @@ -744,7 +771,14 @@ paths: type: array items: type: integer - + required: + - rawSignal + '500': + description: Internal server error + content: + text/plain: + schema: + type: string /cds/fix: post: From d383019aedb95319dff5a0c8ffa543327e417a7a Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Fri, 19 Jan 2024 22:54:43 -0800 Subject: [PATCH 20/21] add endpoints for primers --- api/api/api.go | 45 +++++++- api/gen/dnadesign-server.gen.go | 183 +++++++++++++++++--------------- api/gen/dnadesign-types.gen.go | 16 +-- api/spec.yaml | 61 ++++++++--- 4 files changed, 192 insertions(+), 113 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index 96c205b..c626f8d 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -22,6 +22,8 @@ import ( "github.com/koeng101/dnadesign/lib/bio/fasta" "github.com/koeng101/dnadesign/lib/bio/fastq" "github.com/koeng101/dnadesign/lib/bio/slow5" + "github.com/koeng101/dnadesign/lib/checks" + "github.com/koeng101/dnadesign/lib/primers" "github.com/koeng101/dnadesign/lib/primers/pcr" "github.com/koeng101/dnadesign/lib/synthesis/codon" "github.com/koeng101/dnadesign/lib/synthesis/fix" @@ -694,27 +696,60 @@ func (app *App) LuaPcrSimplePcr(L *lua.LState) int { } func (app *App) PostPcrPrimersDebruijnBarcodes(ctx context.Context, request gen.PostPcrPrimersDebruijnBarcodesRequestObject) (gen.PostPcrPrimersDebruijnBarcodesResponseObject, error) { - return nil, nil + input := *request.Body + barcodeLength := input.BarcodeLength + maxSubSequence := input.MaxSubSequence + var bannedSequences []string + if input.BannedSequences != nil { + bannedSequences = *input.BannedSequences + } + minGcContent := input.GcRange.MinGc + maxGcContent := input.GcRange.MaxGc + + gcBarcodeFunc := func(barcodeToCheck string) bool { + gcContent := float32(checks.GcContent(barcodeToCheck)) + if gcContent < minGcContent || gcContent > maxGcContent { + return false + } + return true + } + barcodes := primers.CreateBarcodesWithBannedSequences(barcodeLength, maxSubSequence, bannedSequences, []func(string) bool{gcBarcodeFunc}) + return gen.PostPcrPrimersDebruijnBarcodes200JSONResponse(barcodes), nil } func (app *App) LuaPcrPrimersDebruijnBarcodes(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersMarmurDoty(ctx context.Context, request gen.PostPcrPrimersMarmurDotyRequestObject) (gen.PostPcrPrimersMarmurDotyResponseObject, error) { - return nil, nil + input := *request.Body + return gen.PostPcrPrimersMarmurDoty200JSONResponse(primers.MarmurDoty(input.Sequence)), nil } func (app *App) LuaPcrPrimersMarmurDoty(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersSantaLucia(ctx context.Context, request gen.PostPcrPrimersSantaLuciaRequestObject) (gen.PostPcrPrimersSantaLuciaResponseObject, error) { - return nil, nil + input := *request.Body + meltingTemp, dH, dS := primers.SantaLucia(input.Sequence, float64(input.PrimerConcentration), float64(input.SaltConcentration), float64(input.MagnesiumConcentration)) + return gen.PostPcrPrimersSantaLucia200JSONResponse{MeltingTemp: float32(meltingTemp), DH: float32(dH), DS: float32(dS)}, nil } func (app *App) LuaPcrPrimersSantaLucia(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersMeltingTemperature(ctx context.Context, request gen.PostPcrPrimersMeltingTemperatureRequestObject) (gen.PostPcrPrimersMeltingTemperatureResponseObject, error) { - return nil, nil + input := *request.Body + return gen.PostPcrPrimersMeltingTemperature200JSONResponse(primers.MeltingTemp(input.Sequence)), nil } func (app *App) LuaPcrPrimersMeltingTemperature(L *lua.LState) int { return 0 } func (app *App) PostPcrPrimersDesignPrimers(ctx context.Context, request gen.PostPcrPrimersDesignPrimersRequestObject) (gen.PostPcrPrimersDesignPrimersResponseObject, error) { - return nil, nil + input := *request.Body + sequence := input.Sequence + targetTm := float64(input.TargetTm) + var forwardOverhang, reverseOverhang string + if input.ForwardOverhang != nil { + forwardOverhang = *input.ForwardOverhang + } + if input.ReverseOverhang != nil { + reverseOverhang = *input.ReverseOverhang + } + forward, reverse := pcr.DesignPrimersWithOverhangs(sequence, forwardOverhang, reverseOverhang, targetTm) + return gen.PostPcrPrimersDesignPrimers200JSONResponse{ForwardPrimer: forward, ReversePrimer: reverse}, nil } func (app *App) LuaPcrPrimersDesignPrimers(L *lua.LState) int { return 0 } diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index 303fdd0..e4c59e9 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -2208,12 +2208,13 @@ type PostPcrPrimersDebruijnBarcodesResponseObject interface { VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error } -type PostPcrPrimersDebruijnBarcodes200Response struct { -} +type PostPcrPrimersDebruijnBarcodes200JSONResponse []string -func (response PostPcrPrimersDebruijnBarcodes200Response) VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersDebruijnBarcodes200JSONResponse) VisitPostPcrPrimersDebruijnBarcodesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostPcrPrimersDesignPrimersRequestObject struct { @@ -2225,8 +2226,8 @@ type PostPcrPrimersDesignPrimersResponseObject interface { } type PostPcrPrimersDesignPrimers200JSONResponse struct { - ForwardPrimer *string `json:"forward_primer,omitempty"` - ReversePrimer *string `json:"reverse_primer,omitempty"` + ForwardPrimer string `json:"forwardPrimer"` + ReversePrimer string `json:"reversePrimer"` } func (response PostPcrPrimersDesignPrimers200JSONResponse) VisitPostPcrPrimersDesignPrimersResponse(w http.ResponseWriter) error { @@ -2244,12 +2245,13 @@ type PostPcrPrimersMarmurDotyResponseObject interface { VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error } -type PostPcrPrimersMarmurDoty200Response struct { -} +type PostPcrPrimersMarmurDoty200JSONResponse float32 -func (response PostPcrPrimersMarmurDoty200Response) VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersMarmurDoty200JSONResponse) VisitPostPcrPrimersMarmurDotyResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostPcrPrimersMeltingTemperatureRequestObject struct { @@ -2260,12 +2262,13 @@ type PostPcrPrimersMeltingTemperatureResponseObject interface { VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error } -type PostPcrPrimersMeltingTemperature200Response struct { -} +type PostPcrPrimersMeltingTemperature200JSONResponse float32 -func (response PostPcrPrimersMeltingTemperature200Response) VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersMeltingTemperature200JSONResponse) VisitPostPcrPrimersMeltingTemperatureResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostPcrPrimersSantaLuciaRequestObject struct { @@ -2276,12 +2279,17 @@ type PostPcrPrimersSantaLuciaResponseObject interface { VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error } -type PostPcrPrimersSantaLucia200Response struct { +type PostPcrPrimersSantaLucia200JSONResponse struct { + DH float32 `json:"dH"` + DS float32 `json:"dS"` + MeltingTemp float32 `json:"meltingTemp"` } -func (response PostPcrPrimersSantaLucia200Response) VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error { +func (response PostPcrPrimersSantaLucia200JSONResponse) VisitPostPcrPrimersSantaLuciaResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostPcrSimplePcrRequestObject struct { @@ -4076,76 +4084,77 @@ func (sh *strictHandler) PostUtilsReverseComplement(w http.ResponseWriter, r *ht // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xdb3PbNpP/KhjevWQjN73e9fE7W05SzziOKvlJZ+4mo4HIlYSaBBgA9J928t1vABAk", - "SIEkZMt20uZNIpm7i8XubxcLEID+ihKWF4wClSI6/isSyRZyrD+e5ISyk4Sk6kvBWQFcEtCPpixlVH8i", - "EnL94T85rKPj6D8mjbxJJWyiyaMvcSTvC4iOI8w5vlffL0BK4Iq9eiIkJ3QTffkSRxw+l4RDGh3/n6WL", - "bcOfalFs9QckUsk6kRIn2xyo3NU3YVRWDzoNxRHFOYxroKniWpBPgVMsYMpKX/srLMDbeGLpqyeEStgA", - "32leC7DkvsanW0w3sNvyW85yb8szJogkjPoaj6M5YNF61jAuJBR+pis2bse62UpQbDTUzHWz3g5qDO30", - "74qTIgO/Z38HstmGWNcKqVl6FbjCq8xj5TpUwmOiiS5PXCwk5tITZDtd3GVkxf58HXO4rbdExm5HfTZ6", - "Q/+8N9EEtMyVrFOBz6M4Ol0J9d8Mf57qryI/PXckNIq9xULiOSSMe9IOSYFKsibelBFHAj6XQJOAaHYE", - "OWy+Hil9Ps8Be7Q5H9bmQ6FwjjNNi9OUmK+zlow+xzQK/FbijMh7fygGd/jc7XDN1kj3dh2wLLkH7VhK", - "TlalhMGuhYN2p+UURMJJ0UlPjYCMJdg+HIqxC0s3DA6rwZgR9dO2drFrDKcRR0evaTne+Eeqt4zfYp5+", - "uAGuMrpX2zncABcwSBMOjcUQ/N8BXWF63ReQawOR8KxnMeVBQQ4Sj7G/VzR7RbqWGjeKjoT7r4BT4B9x", - "VvqyfBDux0P6DU3NQGdae4+LAHnOOLsjUOWnd5yVxfmZn2ORsdufPwIX/ojq2MwV1+GNXSN4e+Kz6oUT", - "r93CLC8yyNu12YqxDLCOWqCpv0drcgMzTnKYYS4Jzvzsm9W1bXth+upz0B+MUD+/UCOhXwFRrqzocPi7", - "CWknC245jHap4ymjnzFT7Bqz6pTHTr6GfIbq9LDHraXw+JTwpMww73GJyShn5IaIvvyes5SsiWn6DEvo", - "IcogKTO48ufu3sK+yQBTlvZBwpJcAN3IbfD0oMPWUXK3856u7qgXNwb1OeF9lTY7Q3SSgOi178qdqQQB", - "t5nbeJCb9rkohTWhpHcYv4b7W8ZT0TfGlyHxVIpBXzO+wZSIvOch2RC/bkxuTV338DTPYQ1cOTI8P8wt", - "i8/MgpW8r37Bd4yy/H6/uusmdEBIDTAdd8YOwhpBjksdy9eaO3rWtreObpnLRah1ReVjXwh8cHxs5x1v", - "lEk5SbYEo4RlRE0+zLcCC8k4Ed7px4xkUBYXhHqG/+EZ81CdrgbUad9M3zyegygzuWfhXMPltG994QFl", - "YOzO0dstuD1pqz08k2hgvZuoSrllXPQsjlDBuCRl3jNsl5y2hsnmWVGu3kPqfcTtQsnuE8gxv/Zbnsgs", - "wIi2N5ahUbJWqW7GatLqp896ugAzBdau/ZyCNTzNuFXu2GJAq4Fe9fwz5OkWUwrZZZmveibJZ2RDJBG4", - "E1fUcLi1spe9fvr4GvoC6BzfLsimDSmH5T2kBNNTWDMOXl0/rNeitRTVPJp3QOc+cRrthv6uwk7sj9T8", - "iqD1rJ2PdpziThdwXmSEbubtgb1RWq8QvS/vetjV0yvSGpH7lt4qLePOpKOFi9qy1o4dDTvOc20adzDY", - "8WLLFE633D64GOwgbjccVPcIXZuFUJMzorPLE5SCIBuKTmbnznB5HB29Onr1oy43CqC4INFx9NOro1dH", - "Kl1gudVQmOCMbOgkx0LXoQUTGmIK3to852l0rFK2PFF07xWZMTEIecrS+876Ny6KrKo3J39UcWXywm78", - "XufAl4L8CT1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InY+4WSjpPoEU81u35YlM", + "PIxoemMYaiUrlapmjCaNfrqspwowXWB17WcVrP5pxq5yxxYDGg30queeIU+3mFJIrvN01TNJPiMbIonA", + "rbiimsOulZ3s1dPn19CXQOf4fkE2TUhZLFcQE0xPYc04OHX9tF6LxlJU/WjeAp39xGq0Hfpdha3YH6n5", + "C4LGs2Y+6jjFni7gNEsI3cybA3uttFohusofetiLpzekMSL3Lb2VWoatSUcDF5VljR1bGracZ9s0bGGw", + "5cWGKaxu2X2wMdhCXDcciu4RutYLoTpnBGfXJygGQTYUncwurOHyODh6d/TuB1VuZEBxRoLj4Md3R++O", + "inSB5VZBYYITsqGTFAtVh2ZMKIgV8FbmuYiD4yJly5OC7qog0yYGIU9Z/Nha/8ZZlpT15uSPMq50XujG", + "720KfCnIn9AzBSqHjCUerKGXK/fjW5DRtld8e6ZTt9WQHFpKNmW6nVPLlDwH9QeRMSp0h98fHT3DXDER", + "EjcHWxMyX53KNNa5gsJ1yMhAXI2silPkaYr5Y3AcTHFSzAQkIEV8ZhosKquNUCNQAYLg94LNAs4yxfTR", + "Ez1XBem+EFQMPpgTwejSOG3HGscTg3uEWDmT7qj9ulBrW6xOxq3hu4OrSyIkYmvUwJfwQxY62WBChUQF", + "KtDCskU/4ChAnECK6fI+pyLyyVrXhuU3zbEv+D0nQ3kmoMOnGWXlFKjs6VX9vCfxRu4CxidHnRjZZX4S", + "6J7ILdIim4iaAV8znqLKt//QzkWVjEEUiZTI7fIeS+Apph4YWhQMvxn67wj690GQ8uw/jGtH8RPFYrIm", + "DzZkmip8JA8gUMTSlFGUcbZKIBWIUDQ9W6j/Mw4Z1hhDa8ZRUcGJRyq3IIh4F4QOCE5j8ZE87A129rLV", + "0EyuWvrQ01d2B4unDbP+b1SsYdJa4mk37gL1fkEcqR0PO2xC0Tsk9tV30/zvHpgvABcX6EJaroZ8Uo7L", + "RtLXMPivjkUkPMhJlmDSskVbz06b/xLAEaFZLhFwzlSl8NP+xF9QCZziBAngd8BNG434/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/jzX0HOk+A42EqZiePJJKZYv+F5tyJs", + "gjMSfA1tmuPJJGERTrZMyOOfj34+0jS/f/3/AAAA//8RToKq1HoAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index ac7d309..763346c 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -378,19 +378,19 @@ type PostPcrComplexPcrJSONBody struct { // PostPcrPrimersDebruijnBarcodesJSONBody defines parameters for PostPcrPrimersDebruijnBarcodes. type PostPcrPrimersDebruijnBarcodesJSONBody struct { - BannedSequences *[]string `json:"banned_sequences,omitempty"` - BarcodeLength int `json:"barcode_length"` + BannedSequences *[]string `json:"bannedSequences,omitempty"` + BarcodeLength int `json:"barcodeLength"` GcRange struct { - MaxGc *float32 `json:"max_gc,omitempty"` - MinGc *float32 `json:"min_gc,omitempty"` - } `json:"gc_range"` - MaxSubSequence int `json:"max_sub_sequence"` + MaxGc float32 `json:"maxGc"` + MinGc float32 `json:"minGc"` + } `json:"gcRange"` + MaxSubSequence int `json:"maxSubSequence"` } // PostPcrPrimersDesignPrimersJSONBody defines parameters for PostPcrPrimersDesignPrimers. type PostPcrPrimersDesignPrimersJSONBody struct { - ForwardOverhang *string `json:"forward_overhang,omitempty"` - ReverseOverhang *string `json:"reverse_overhang,omitempty"` + ForwardOverhang *string `json:"forwardOverhang,omitempty"` + ReverseOverhang *string `json:"reverseOverhang,omitempty"` Sequence string `json:"sequence"` TargetTm float32 `json:"targetTm"` } diff --git a/api/spec.yaml b/api/spec.yaml index ef6bc42..a2b572c 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -917,28 +917,37 @@ paths: schema: type: object properties: - barcode_length: + barcodeLength: type: integer - max_sub_sequence: + maxSubSequence: type: integer - banned_sequences: + bannedSequences: type: array items: type: string - gc_range: + gcRange: type: object properties: - max_gc: + maxGc: type: number - min_gc: + minGc: type: number + required: + - maxGc + - minGc required: - - barcode_length - - max_sub_sequence - - gc_range + - barcodeLength + - maxSubSequence + - gcRange responses: '200': description: Array of generated barcode sequences + content: + application/json: + schema: + type: array + items: + type: string /pcr/primers/marmur_doty: post: @@ -958,6 +967,10 @@ paths: responses: '200': description: Calculated melting temperature as float + content: + application/json: + schema: + type: number /pcr/primers/santa_lucia: post: @@ -986,6 +999,21 @@ paths: responses: '200': description: Calculated melting temperature, dH, dS as floats + content: + application/json: + schema: + type: object + properties: + meltingTemp: + type: number + dH: + type: number + dS: + type: number + required: + - meltingTemp + - dH + - dS /pcr/primers/melting_temperature: post: @@ -1005,6 +1033,10 @@ paths: responses: '200': description: Calculated melting temperature as float + content: + application/json: + schema: + type: number /pcr/complex_pcr: post: @@ -1100,10 +1132,10 @@ paths: type: string targetTm: type: number - forward_overhang: + forwardOverhang: type: string default: "" - reverse_overhang: + reverseOverhang: type: string default: "" required: @@ -1117,10 +1149,13 @@ paths: schema: type: object properties: - forward_primer: + forwardPrimer: type: string - reverse_primer: + reversePrimer: type: string + required: + - forwardPrimer + - reversePrimer From 960ab3667e0bc460cd146552cab7e49f401950ff Mon Sep 17 00:00:00 2001 From: Keoni Gandall Date: Sat, 20 Jan 2024 09:25:15 -0800 Subject: [PATCH 21/21] added cloning functions --- api/api/api.go | 36 ++++++- api/gen/dnadesign-server.gen.go | 170 +++++++++++++++++--------------- api/gen/dnadesign-types.gen.go | 22 +++-- api/spec.yaml | 82 +++++++++++++-- 4 files changed, 214 insertions(+), 96 deletions(-) diff --git a/api/api/api.go b/api/api/api.go index c626f8d..222c08f 100644 --- a/api/api/api.go +++ b/api/api/api.go @@ -23,6 +23,7 @@ import ( "github.com/koeng101/dnadesign/lib/bio/fastq" "github.com/koeng101/dnadesign/lib/bio/slow5" "github.com/koeng101/dnadesign/lib/checks" + "github.com/koeng101/dnadesign/lib/clone" "github.com/koeng101/dnadesign/lib/primers" "github.com/koeng101/dnadesign/lib/primers/pcr" "github.com/koeng101/dnadesign/lib/synthesis/codon" @@ -762,15 +763,44 @@ func (app *App) LuaPcrPrimersDesignPrimers(L *lua.LState) int { return 0 } */ func (app *App) PostCloningGoldenGate(ctx context.Context, request gen.PostCloningGoldenGateRequestObject) (gen.PostCloningGoldenGateResponseObject, error) { - return nil, nil + input := *request.Body + parts := make([]clone.Part, len(input.Sequences)) + for i, sequence := range input.Sequences { + parts[i] = clone.Part{Sequence: sequence.Sequence, Circular: sequence.Circular} + } + enzymeManager := clone.NewEnzymeManager(clone.GetBaseRestrictionEnzymes()) + enzyme, err := enzymeManager.GetEnzymeByName(string(input.Enzyme)) + if err != nil { + return gen.PostCloningGoldenGate500TextResponse(fmt.Sprintf("Failed to get enzyme for GoldenGate. Got error: %s", err)), nil + } + clones, infiniteLoops := clone.GoldenGate(parts, enzyme, input.Methylated) + return gen.PostCloningGoldenGate200JSONResponse{Clones: clones, InfiniteLoops: infiniteLoops}, nil } func (app *App) LuaCloningGoldenGate(L *lua.LState) int { return 0 } func (app *App) PostCloningLigate(ctx context.Context, request gen.PostCloningLigateRequestObject) (gen.PostCloningLigateResponseObject, error) { - return nil, nil + input := *request.Body + fragments := make([]clone.Fragment, len(input)) + for i, fragment := range input { + fragments[i] = clone.Fragment{Sequence: fragment.Sequence, ForwardOverhang: fragment.ForwardOverhang, ReverseOverhang: fragment.ReverseOverhang} + } + clones, infiniteLoops := clone.CircularLigate(fragments) + return gen.PostCloningLigate200JSONResponse{Clones: clones, InfiniteLoops: infiniteLoops}, nil } func (app *App) LuaCloningLigate(L *lua.LState) int { return 0 } func (app *App) PostCloningRestrictionDigest(ctx context.Context, request gen.PostCloningRestrictionDigestRequestObject) (gen.PostCloningRestrictionDigestResponseObject, error) { - return nil, nil + input := *request.Body + enzymeManager := clone.NewEnzymeManager(clone.GetBaseRestrictionEnzymes()) + enzyme, err := enzymeManager.GetEnzymeByName(string(input.Enzyme)) + if err != nil { + return gen.PostCloningRestrictionDigest500TextResponse(fmt.Sprintf("Failed to get enzyme. Got error: %s", err)), nil + } + directional := true // We only support GoldenGate enzymes right now, so this will be true. + fragments := clone.CutWithEnzyme(clone.Part{Sequence: input.Sequence.Sequence, Circular: input.Sequence.Circular}, directional, enzyme, input.Methylated) + output := make([]gen.Fragment, len(fragments)) + for i, fragment := range fragments { + output[i] = gen.Fragment{Sequence: fragment.Sequence, ForwardOverhang: fragment.ForwardOverhang, ReverseOverhang: fragment.ReverseOverhang} + } + return gen.PostCloningRestrictionDigest200JSONResponse(output), nil } func (app *App) LuaCloningRestrictionDigest(L *lua.LState) int { return 0 } func (app *App) PostCloningFragment(ctx context.Context, request gen.PostCloningFragmentRequestObject) (gen.PostCloningFragmentResponseObject, error) { diff --git a/api/gen/dnadesign-server.gen.go b/api/gen/dnadesign-server.gen.go index e4c59e9..de86bbf 100644 --- a/api/gen/dnadesign-server.gen.go +++ b/api/gen/dnadesign-server.gen.go @@ -1644,12 +1644,16 @@ type PostCloningGoldenGateResponseObject interface { VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error } -type PostCloningGoldenGate200Response struct { +type PostCloningGoldenGate200JSONResponse struct { + Clones []string `json:"clones"` + InfiniteLoops []string `json:"infiniteLoops"` } -func (response PostCloningGoldenGate200Response) VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error { +func (response PostCloningGoldenGate200JSONResponse) VisitPostCloningGoldenGateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostCloningGoldenGate500TextResponse string @@ -1670,12 +1674,16 @@ type PostCloningLigateResponseObject interface { VisitPostCloningLigateResponse(w http.ResponseWriter) error } -type PostCloningLigate200Response struct { +type PostCloningLigate200JSONResponse struct { + Clones []string `json:"clones"` + InfiniteLoops []string `json:"infiniteLoops"` } -func (response PostCloningLigate200Response) VisitPostCloningLigateResponse(w http.ResponseWriter) error { +func (response PostCloningLigate200JSONResponse) VisitPostCloningLigateResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostCloningRestrictionDigestRequestObject struct { @@ -1686,12 +1694,13 @@ type PostCloningRestrictionDigestResponseObject interface { VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error } -type PostCloningRestrictionDigest200Response struct { -} +type PostCloningRestrictionDigest200JSONResponse []Fragment -func (response PostCloningRestrictionDigest200Response) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { +func (response PostCloningRestrictionDigest200JSONResponse) VisitPostCloningRestrictionDigestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) - return nil + + return json.NewEncoder(w).Encode(response) } type PostCloningRestrictionDigest500TextResponse string @@ -4084,77 +4093,78 @@ func (sh *strictHandler) PostUtilsReverseComplement(w http.ResponseWriter, r *ht // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xdb3PbNpP/KhjeveQTuen1ro/f2XLiesZ2VMlPOnM3HQ1EriTUJMAAoP+0k+9+Q4Ag", - "QRIkIVuWnad5k0jm7mKx+9vFAgSgv4KIpRmjQKUIjv8KRLSFFKuPJymh7CQicfEl4ywDLgmoR1MWM6o+", - "EQmp+vCfHNbBcfAfk1repBQ2UeTB1zCQjxkExwHmHD8W3y9BSuAFe/lESE7oJvj6NQw4fMkJhzg4/j9D", + "H4sIAAAAAAAC/+xdb3PbNpP/KhjeveQTuen1ro/f2XKSesZ2VMlPOnM3HQ1EriTUJMAAoP+0k+9+Q4Ag", + "QRIkIVuW7ad5k0jm7mKx+9vFAgSgv4KIpRmjQKUIjv8KRLSFFKuPJymh7CQicfEl4ywDLgmoR1MWM6o+", + "EQmp+vCfHNbBcfAfk1repBQ2UeTBtzCQDxkExwHmHD8U3y9ASuAFe/lESE7oJvj2LQw4fM0Jhzg4/j9D", "F5qGf69EsdUfEMlC1omUONqmQGVX34hRWT5oNRQGFKcwroGiCitBLgVOsYApy13tr7AAZ+ORoS+fECph", - "A7zTvBJgy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0ARS1NGUcbZKoFUIELR9Gyh/s84ZFhjDK0ZR0UFJx6o3IIg4l0QOiA4jcVH", + "cr832NnLVkMzuWrpQ09f2S0sHjfMPuqdkrXE027cBer9gjhSuyJ22Kiid1Hsq++m+d89MF8ALi7QhbRc", + "DfmkHJeNpG9h8F8di0i4l5MswaRli7aenTb/JYAjQrNcIuCcqUrhp/2JP6cSOMUJEsBvgZs2GvH7kdwX", + "nbbCNIqFFaQskyQtazN3pM6vPqEFQIxiWGOVLCRDR30B+NnIe8koFADxzqWqR4g9R0CNevl6C8h4KUaV", + "Wv92SDXIKeD6rhevkmMqknJNpL8amcbiuqLcdx3iTuZlc4TRpTS7mMqQCY5/+CEcm/p0BQy+Jz8E8owF", + "a9ihusMHhkelTH86SxgldDNZ25s/+hGiqaudIvsCCdxHSR7DkpVbOnasAVJ8vzQdqCbNFYx+PDoKHVkt", + "JXSA6b2b6VGpsNuSS+XnLzxgvSYRARo9NLp69O6f/wy7s3Oj3VM27dUyQrt1n9LjpBBYVBmVDIRpjDBa", + "JwzLlygKSj1UUV0U159YEgP9pJNlFVk6QlrRtVGky814CtYMDdF7CrFqF+RQQVDuldS7mrYPKo81wLLG", + "iYDQtePEWb7vssHicdXs0BaDQWza62OlcRq9PsBEIGF01+kOoepVNlwwlj0lMsu22wJ9IrMGJ8JCQLpK", + "HorJaJxHshzpxAuE54KkehnQod5ofCbEOzQvNOnjw9Jvu6EZYR3LpN9BqNaGN6rG6gDPDQrlYP1KbhgJ", + "HApJkSooY7IB4VcRzWu2M8311vL2S2frgfKp7lGVqZ8jOT85MMdLmJfMixayUWww2hMMLDbzKTHBcVx+", + "HImE6iiKOIlj/WGPr+OM8B+8znXpIzFqK4759n4XxnaisppvyjzEGri30h2AXMEdUhRIkaA1Zyk6Kfea", + "tIByEsfo+o7Z9PbrMhsTLpgUunGWEgG7omVacX4HzesBjfGJjYf2q1cOamnBTesPnXKQWpolQ9XfDTiQ", + "8wls4Jxpvs8V257fVPdWMb1vqsueINMT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fe+mvpRtyrQs3OiofHlvGh4/AlUEIUjJa9YB59gsW2+bmdgOcBoyWflfdlXja", + "+1V3rcW6ehV5zXiKpU4KPweuy+day3a7sO7jlxerBWK3Hm8KUNVlbmIHZKlDuBYg3DDLJUnEhIhlhhNC", + "Y85SEg1D7V8Fx7mYWfR/qzNypNF1948HemxJqkQgIbHMO9PdLUQ3iKyr4QYRgZo2Nw5VLmy400zFmj/7", + "OOLSuWaa2r9u+Ddy61NriXIdvDZ5X01hKGtDI7bumzlUvlVZsZhlFn/+K8h5EhwHWykzcTyZxBTrNzzv", + "VoRNcEaCb6FNczyZJCzCyZYJefzz0c9Hmub3b/8fAAD//5k99+27fgAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/gen/dnadesign-types.gen.go b/api/gen/dnadesign-types.gen.go index 763346c..a87541c 100644 --- a/api/gen/dnadesign-types.gen.go +++ b/api/gen/dnadesign-types.gen.go @@ -92,9 +92,9 @@ type Feature struct { // Fragment defines model for Fragment. type Fragment struct { - ForwardOverhang *string `json:"ForwardOverhang,omitempty"` - ReverseOverhang *string `json:"ReverseOverhang,omitempty"` - Sequence string `json:"Sequence"` + ForwardOverhang string `json:"forwardOverhang"` + ReverseOverhang string `json:"reverseOverhang"` + Sequence string `json:"sequence"` } // GenbankRecord defines model for GenbankRecord. @@ -259,8 +259,12 @@ type PostCloningFragmentJSONBody struct { // PostCloningGoldenGateJSONBody defines parameters for PostCloningGoldenGate. type PostCloningGoldenGateJSONBody struct { - Enzyme *Enzyme `json:"enzyme,omitempty"` - Sequences *[]string `json:"sequences,omitempty"` + Enzyme Enzyme `json:"enzyme"` + Methylated bool `json:"methylated"` + Sequences []struct { + Circular bool `json:"circular"` + Sequence string `json:"sequence"` + } `json:"sequences"` } // PostCloningLigateJSONBody defines parameters for PostCloningLigate. @@ -268,8 +272,12 @@ type PostCloningLigateJSONBody = []Fragment // PostCloningRestrictionDigestJSONBody defines parameters for PostCloningRestrictionDigest. type PostCloningRestrictionDigestJSONBody struct { - Enzyme *Enzyme `json:"enzyme,omitempty"` - Sequence *string `json:"sequence,omitempty"` + Enzyme Enzyme `json:"enzyme"` + Methylated bool `json:"methylated"` + Sequence struct { + Circular bool `json:"circular"` + Sequence string `json:"sequence"` + } `json:"sequence"` } // PostCodonTablesAddTablesJSONBody defines parameters for PostCodonTablesAddTables. diff --git a/api/spec.yaml b/api/spec.yaml index a2b572c..b248f6c 100644 --- a/api/spec.yaml +++ b/api/spec.yaml @@ -337,14 +337,16 @@ components: Fragment: type: object properties: - Sequence: + sequence: type: string - ForwardOverhang: + forwardOverhang: type: string - ReverseOverhang: + reverseOverhang: type: string required: - - Sequence + - sequence + - forwardOverhang + - reverseOverhang Organism: type: string enum: @@ -1174,6 +1176,22 @@ paths: responses: '200': description: Ligated product strings + content: + application/json: + schema: + type: object + properties: + clones: + type: array + items: + type: string + infiniteLoops: + type: array + items: + type: string + required: + - clones + - infiniteLoops /cloning/restriction_digest: post: tags: @@ -1186,12 +1204,33 @@ paths: type: object properties: sequence: - type: string + type: object + properties: + sequence: + type: string + circular: + type: boolean + required: + - sequence + - circular + methylated: + type: boolean + default: false enzyme: $ref: '#/components/schemas/Enzyme' + required: + - sequence + - methylated + - enzyme responses: '200': description: Array of fragments + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Fragment' '500': description: Internal server error content: @@ -1212,12 +1251,43 @@ paths: sequences: type: array items: - type: string + type: object + properties: + sequence: + type: string + circular: + type: boolean + required: + - sequence + - circular + methylated: + type: boolean + default: false enzyme: $ref: '#/components/schemas/Enzyme' + required: + - sequences + - enzyme + - methylated responses: '200': description: GoldenGate assembly product strings + content: + application/json: + schema: + type: object + properties: + clones: + type: array + items: + type: string + infiniteLoops: + type: array + items: + type: string + required: + - clones + - infiniteLoops '500': description: Internal server error content: