Skip to content

Commit

Permalink
add cif support for foldmason
Browse files Browse the repository at this point in the history
  • Loading branch information
gamcil committed Nov 12, 2024
1 parent 8da39f7 commit 102cbca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/foldmasonmsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
)

type FoldMasonMSAJob struct {
Expand Down Expand Up @@ -38,8 +39,11 @@ func (r FoldMasonMSAJob) WritePDB(path string) error {
var pdbDir = filepath.Join(path, "pdbs")
os.Mkdir(pdbDir, os.ModePerm)
for idx, query := range r.Queries {
// FIXME check CIF vs PDB here
name := cleanPathComponent.ReplaceAllString(r.FileNames[idx], "")
ext := filepath.Ext(r.FileNames[idx])
if ext == ".cif" || ext == ".mmcif" {
name = strings.TrimSuffix(name, ext) + ".cif"
}
err := os.WriteFile(filepath.Join(pdbDir, name), []byte(query), 0644)
if err != nil {
return err
Expand All @@ -48,6 +52,8 @@ func (r FoldMasonMSAJob) WritePDB(path string) error {
return nil
}

//err := os.WriteFile(filepath.Join(pdbDir, r.FileNames[idx]), []byte(query), 0644)

func NewFoldMasonMSAJobRequest(
queries []string,
fileNames []string,
Expand Down

0 comments on commit 102cbca

Please sign in to comment.