Skip to content

Commit 41a3135

Browse files
committed
Changed lookup logic for interface search
1 parent 420b3fc commit 41a3135

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

backend/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ func (c *ConfigRoot) CheckPaths() error {
389389
if _, err := os.Stat(c.Paths.FoldDisco); err != nil {
390390
return errors.New("FoldDisco binary was not found at " + c.Paths.FoldDisco)
391391
}
392-
// if _, err := os.Stat(c.Paths.FoldseekInterface); err != nil {
393-
// return errors.New("FoldseekInterface binary was not found at " + c.Paths.FoldseekInterface)
394-
// }
392+
if _, err := os.Stat(c.Paths.FoldseekInterface); err != nil {
393+
return errors.New("FoldseekInterface binary was not found at " + c.Paths.FoldseekInterface)
394+
}
395395
} else if _, err := os.Stat(c.Paths.Mmseqs); err != nil {
396396
return errors.New("MMseqs2 binary was not found at " + c.Paths.Mmseqs)
397397
}

backend/lookup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func Lookup(ticketId Id, page uint64, limit uint64, basepath string, shouldGroup
3232
return LookupResponse{}, err
3333
}
3434

35-
isComplex := request.Type == JobComplexSearch && shouldGroup
35+
isComplex := request.Type == JobComplexSearch || request.Type == JobInterfaceSearch && shouldGroup
3636

3737
results := make([]LookupResult, 0)
3838
res := LookupResult{}

backend/worker.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,6 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup"
847847
"--db-output",
848848
"--db-load-mode",
849849
"2",
850-
"--write-lookup",
851-
"1",
852850
"--format-output",
853851
columns,
854852
"--complex-report-mode",
@@ -907,7 +905,7 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup"
907905
[]string{
908906
config.Paths.Foldseek,
909907
"mvdb",
910-
filepath.Join(resultBase, "tmp0", "latest", "query_h"),
908+
filepath.Join(resultBase, "tmp0", "latest", "interfacedb_query_h"),
911909
filepath.Join(resultBase, "query_h"),
912910
},
913911
[]string{},
@@ -921,7 +919,7 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup"
921919
[]string{
922920
config.Paths.Foldseek,
923921
"mvdb",
924-
filepath.Join(resultBase, "tmp0", "latest", "query"),
922+
filepath.Join(resultBase, "tmp0", "latest", "interfacedb_query"),
925923
filepath.Join(resultBase, "query"),
926924
},
927925
[]string{},
@@ -930,6 +928,19 @@ mv -f -- "${BASE}/query.lookup_tmp" "${BASE}/query.lookup"
930928
if err != nil {
931929
return &JobExecutionError{err}
932930
}
931+
err = execCommandSync(
932+
config.Verbose,
933+
[]string{
934+
"mv",
935+
filepath.Join(resultBase, "tmp0", "latest", "dimerdb_query.lookup"),
936+
filepath.Join(resultBase, "query.lookup"),
937+
},
938+
[]string{},
939+
1*time.Minute,
940+
)
941+
if err != nil {
942+
return &JobExecutionError{err}
943+
}
933944
for index, _ := range job.Database {
934945
err := os.RemoveAll(filepath.Join(resultBase, "tmp"+strconv.Itoa(index)))
935946
if err != nil {

0 commit comments

Comments
 (0)