Skip to content

Commit

Permalink
Merge branch 'trunk' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Jan 14, 2025
2 parents f3c89bb + 44226bd commit d1ca35e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cpp_compiler: clang++

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set reusable strings
id: strings
Expand Down
17 changes: 13 additions & 4 deletions src/alphafill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using json = zeep::json::element;
// --------------------------------------------------------------------

// The regex to check and/or read FastA files
const std::regex kIDRx(R"(^>pdb-entity\|(\w{4,})\|(\w+)\|([^ |]+)( .*)?)");
const std::regex kIDRx(R"(^>pdb-entity\|(\w{4,})\|(\w+)\|([^ |]+)?( .*)?)");

// --------------------------------------------------------------------

Expand Down Expand Up @@ -579,7 +579,7 @@ zeep::json::element alphafill(cif::datablock &db, const std::string &source,
throw std::runtime_error("Invalid sequence");

seq.erase(i, j - i + 1);
i = seq.find('(', i + 1);
i = seq.find('(', i);
}
}

Expand Down Expand Up @@ -1086,8 +1086,17 @@ zeep::json::element alphafill(cif::datablock &db, const std::string &source,

// validation info?
if (hsp.identity() == 1)
hsp_t["validation"] = calculateValidationScores(db, pdb_res, af_ix_trimmed, pdb_ix_trimmed,
af_structure.get_residue(asym_id), res, config.get<float>("max-ligand-to-polymer-atom-distance"), ligand);
{
try
{
hsp_t["validation"] = calculateValidationScores(db, af_asym_id, pdb_res, af_ix_trimmed, pdb_ix_trimmed,
af_structure.get_residue(asym_id), res, config.get<float>("max-ligand-to-polymer-atom-distance"), ligand);
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

if (cif::VERBOSE > 0)
std::cerr << "Created asym " << asym_id << " for " << res << '\n';
Expand Down
5 changes: 3 additions & 2 deletions src/validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,14 @@ zeep::json::element calculatePAEScore(const std::vector<cif::mm::residue *> &af_
// --------------------------------------------------------------------

zeep::json::element calculateValidationScores(
cif::datablock af_db, const std::vector<cif::mm::residue *> &pdb_res,
cif::datablock af_db, const std::string &asym_id,
const std::vector<cif::mm::residue *> &pdb_res,
const std::vector<size_t> &af_ix, const std::vector<size_t> &pdb_ix,
const cif::mm::residue &af_ligand, const cif::mm::residue &pdb_ligand,
float maxDistance, const Ligand &ligand)
{
cif::mm::structure af_structure(af_db);
auto &poly = af_structure.get_polymer_by_asym_id("A");
auto &poly = af_structure.get_polymer_by_asym_id(asym_id);

std::vector<cif::mm::monomer *> af_res_selected, pdb_res_selected;

Expand Down
3 changes: 2 additions & 1 deletion src/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ float ClashScore(cif::datablock &db, float maxDistance = 4);
// --------------------------------------------------------------------

zeep::json::element calculateValidationScores(
cif::datablock af_db, const std::vector<cif::mm::residue *> &pdb_res,
cif::datablock af_db, const std::string &asym_id,
const std::vector<cif::mm::residue *> &pdb_res,
const std::vector<size_t> &af_ix, const std::vector<size_t> &pdb_ix,
const cif::mm::residue &af_ligand, const cif::mm::residue &pdb_ligand,
float maxDistance, const Ligand &ligand);
Expand Down

0 comments on commit d1ca35e

Please sign in to comment.