diff --git a/backend/server.go b/backend/server.go index 2bc5f0c..827f461 100644 --- a/backend/server.go +++ b/backend/server.go @@ -264,6 +264,7 @@ func server(jobsystem JobSystem, config ConfigRoot) { var dbs []string var mode string var email string + var iterativesearch bool var taxfilter string if strings.HasPrefix(req.Header.Get("Content-Type"), "multipart/form-data") { @@ -285,6 +286,7 @@ func server(jobsystem JobSystem, config ConfigRoot) { dbs = req.Form["database[]"] mode = req.FormValue("mode") email = req.FormValue("email") + iterativesearch = req.FormValue("iterativesearch") == "true" taxfilter = req.FormValue("taxfilter") } else { err := req.ParseForm() @@ -296,6 +298,7 @@ func server(jobsystem JobSystem, config ConfigRoot) { dbs = req.Form["database[]"] mode = req.FormValue("mode") email = req.FormValue("email") + iterativesearch = req.FormValue("iterativesearch") == "true" taxfilter = req.FormValue("taxfilter") } @@ -315,7 +318,7 @@ func server(jobsystem JobSystem, config ConfigRoot) { modeWithoutComplex := strings.Join(append(modes[:modeIdx], modes[modeIdx+1:]...), "-") request, err = NewComplexSearchJobRequest(query, dbs, databases, modeWithoutComplex, config.Paths.Results, email, taxfilter) } else { - request, err = NewStructureSearchJobRequest(query, dbs, databases, mode, config.Paths.Results, email, taxfilter) + request, err = NewStructureSearchJobRequest(query, dbs, databases, mode, config.Paths.Results, email, iterativesearch, taxfilter) } } else { http.Error(w, "Job type not supported by this server", http.StatusBadRequest) diff --git a/backend/structuresearchjob.go b/backend/structuresearchjob.go index 32d4837..33866c9 100644 --- a/backend/structuresearchjob.go +++ b/backend/structuresearchjob.go @@ -10,10 +10,11 @@ import ( ) type StructureSearchJob struct { - Size int `json:"size" validate:"required"` - Database []string `json:"database" validate:"required"` - Mode string `json:"mode" validate:"oneof=3di tmalign 3diaa"` - TaxFilter string `json:"taxfilter"` + Size int `json:"size" validate:"required"` + Database []string `json:"database" validate:"required"` + Mode string `json:"mode" validate:"oneof=3di tmalign 3diaa"` + IterativeSearch bool `json:"iterativesearch"` + TaxFilter string `json:"taxfilter" query string } @@ -22,6 +23,9 @@ func (r StructureSearchJob) Hash() Id { h.Write(([]byte)(JobStructureSearch)) h.Write([]byte(r.query)) h.Write([]byte(r.Mode)) + if r.IterativeSearch { + h.Write([]byte("Iterative")) + } if r.TaxFilter != "" { h.Write([]byte(r.TaxFilter)) } @@ -48,11 +52,12 @@ func (r StructureSearchJob) WritePDB(path string) error { return nil } -func NewStructureSearchJobRequest(query string, dbs []string, validDbs []Params, mode string, resultPath string, email string, taxfilter string) (JobRequest, error) { +func NewStructureSearchJobRequest(query string, dbs []string, validDbs []Params, mode string, resultPath string, email string, iterativeSearch bool, taxfilter string) (JobRequest, error) { job := StructureSearchJob{ max(strings.Count(query, "HEADER"), 1), dbs, mode, + iterativeSearch, taxfilter, query, } diff --git a/backend/worker.go b/backend/worker.go index 55f3583..4840384 100644 --- a/backend/worker.go +++ b/backend/worker.go @@ -405,6 +405,10 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup" parameters = append(parameters, "0") } + if job.IterativeSearch { + parameters = append(parameters, "--num-iterations") + parameters = append(parameters, "3") + } cmd, done, err := execCommand(config.Verbose, parameters...) if err != nil { errChan <- &JobExecutionError{err} diff --git a/frontend/Search.vue b/frontend/Search.vue index b1f21e8..82f032b 100644 --- a/frontend/Search.vue +++ b/frontend/Search.vue @@ -55,17 +55,27 @@ - & search settings
- + :selected="database" + :all-databases="databases" + @update:selected="database = $event" + @update:all-databases="databases = $event" + :hideEmail="hideEmail" + > +
+ + + +
with {{ $STRINGS.APP_NAME }} in {{ modes[mode] }} mode iterative.
{{ errorMessage }}
@@ -176,6 +201,7 @@ export default { query: "", database: JSON.parse(storage.getItem('database') || '[]'), databases: JSON.parse(storage.getItem('databases') || '[]'), + iterativeSearch: JSON.parse(storage.getItem('iterativeSearch') || false), taxFilter: JSON.parse(storage.getItem('taxFilter') || 'null'), predictable: false, accessionLoading: false, @@ -235,6 +261,9 @@ export default { databases(value) { storage.setItem('databases', JSON.stringify(value)); }, + iterativeSearch(value) { + storage.setItem('iterativeSearch', JSON.stringify(value)); + }, taxFilter(value) { storage.setItem('taxFilter', JSON.stringify(value)); }, @@ -265,6 +294,9 @@ export default { if (this.taxFilter) { request.taxfilter = this.taxFilter.value; } + if (this.iterativeSearch) { + request.iterativesearch = this.iterativeSearch.value; + } try { this.inSearch = true; const response = await this.$axios.post("api/ticket", convertToQueryUrl(request), {