Skip to content

Commit 218174a

Browse files
authored
Update toppar regex (#137)
* update toppar regex * bump version
1 parent d507f7e commit 218174a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

dataset/dataset.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ func LoadDataset(projectDir string, pdbList string, rsuf string, lsuf string, ss
368368
// Find root and receptor/ligand names
369369
match := rootRegex.FindStringSubmatch(basePath)
370370
if len(match) == 0 {
371-
glog.Info(fullPath)
372371
// Neither receptor nor ligand, add to a list of PDBs
373372
pdbArr = append(pdbArr, fullPath)
374373
continue
@@ -448,7 +447,7 @@ func LoadDataset(projectDir string, pdbList string, rsuf string, lsuf string, ss
448447
}
449448

450449
// Handle the Toppar
451-
topparRegex := regexp.MustCompile(`(` + k + `)\w+\.(top|param)`)
450+
topparRegex := regexp.MustCompile(`(` + k + `)_.*(top|param)`)
452451
topparMatch := topparRegex.FindStringSubmatch(line)
453452
if len(topparMatch) != 0 {
454453
v.Toppar = append(v.Toppar, s.Text())
@@ -480,7 +479,6 @@ func LoadDataset(projectDir string, pdbList string, rsuf string, lsuf string, ss
480479
for _, v := range m {
481480
arr = append(arr, v)
482481
}
483-
484482
return arr, nil
485483
}
486484

dataset/dataset_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ func TestLoadDataset(t *testing.T) {
152152
"some/path/structure4_ambig.tbl\n"+
153153
"some/path/structure4_unambig-rest.tbl\n"+
154154
"some/path/structure4_ATP.top\n"+
155+
"some/path/structure42_ATP.top\n"+
155156
"some/path/structure4_ATP.param\n"+
157+
"some/path/structure42_ATP.param\n"+
156158
"some/path/structure5_r_u.pdb\n"+
157159
"some/path/structure5_l_u.pdb\n"+
158160
"some/path/structure5_target.pdb\n"+
@@ -181,7 +183,11 @@ func TestLoadDataset(t *testing.T) {
181183
t.Errorf("Failed: Not all restraints were loaded")
182184
}
183185
if len(v.Toppar) != 2 {
184-
t.Errorf("Failed: Not all toppar files were loaded")
186+
if len(v.Toppar) > 2 {
187+
t.Errorf("Failed: Too many toppar were loaded")
188+
} else {
189+
t.Errorf("Failed: Not all toppar files were loaded")
190+
}
185191
}
186192
}
187193
if v.ID == "structure3" {

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/golang/glog"
1919
)
2020

21-
const version = "v1.12.0"
21+
const version = "v1.12.1"
2222

2323
func init() {
2424
var versionPrint bool

0 commit comments

Comments
 (0)