Skip to content

Commit

Permalink
Merge pull request #102 from glycojones/fix_cglycan_diagnostic
Browse files Browse the repository at this point in the history
Fix cglycan diagnostic
  • Loading branch information
louholland authored Aug 2, 2024
2 parents 22cfa2b + f4d4776 commit ba14939
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/privateer/cpp/clipper-glyco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5483,6 +5483,14 @@ void MGlycology::init ( const clipper::MiniMol& mmol, const clipper::MAtomNonBon
{
sugar.override_conformation_diag ( true );
}
if (sugar.type().trim() == "BMA")
{
sugar.override_anomer_diag( false );
if ( sugar.conformation_name() == "4c1" )
{
sugar.override_conformation_diag ( false );
}
}

clipper::MAtom o5 = sugar.ring_members()[0]; // O5
clipper::MAtom c1 = sugar.ring_members()[1]; // C1
Expand Down
2 changes: 2 additions & 0 deletions src/privateer/cpp/clipper-glyco.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ namespace clipper

void override_conformation_diag ( bool is_it_ok ) { sugar_diag_conformation = is_it_ok; }

void override_anomer_diag ( bool is_it_ok ) { sugar_diag_anomer = is_it_ok; }

void set_occupancy_check ( bool occupancy_check_in ) { sugar_occupancy_check = occupancy_check_in; }

clipper::String get_diagnostic() const { return sugar_diagnostic; }
Expand Down
21 changes: 21 additions & 0 deletions src/privateer/cpp/privateer-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,13 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i
{
ligandList[index].second.override_conformation_diag ( true );
}
if (ligandList[index].second.type().trim() == "BMA" )
{
ligandList[index].second.override_anomer_diag ( false );
if (ligandList[index].second.conformation_name() == "4c1"){
ligandList[index].second.override_conformation_diag ( false );
}
}
fprintf ( output, "\t(c) " );
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down Expand Up @@ -1171,6 +1178,13 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i
{
ligandList[index].second.override_conformation_diag ( true );
}
if (ligandList[index].second.type().trim() == "BMA" )
{
ligandList[index].second.override_anomer_diag ( false );
if (ligandList[index].second.conformation_name() == "4c1"){
ligandList[index].second.override_conformation_diag ( false );
}
}
std::cout << "\t(c) ";
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down Expand Up @@ -1289,6 +1303,13 @@ void privateer::util::print_monosaccharide_summary_python (bool batch, bool show
{
ligandList[index].second.override_conformation_diag ( true );
}
if (ligandList[index].second.type().trim() == "BMA" )
{
ligandList[index].second.override_anomer_diag ( false );
if (ligandList[index].second.conformation_name() == "4c1"){
ligandList[index].second.override_conformation_diag ( false );
}
}
std::cout << "\t(c) ";
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down
30 changes: 26 additions & 4 deletions src/privateer/cpp/privateer-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,20 @@ namespace privateer
<< "<tspan>Detected type: " << sugar.type_of_sugar() << ". </tspan>";
if ( validation )
{
if ( ( glycan.get_type() == "c-glycan" ) && (sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4"))
if ( glycan.get_type() == "c-glycan" )
{
sugar.override_conformation_diag ( true );
if ((sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4"))
{
sugar.override_conformation_diag ( true );
}
if (sugar.type().trim() == "BMA")
{
sugar.override_anomer_diag( false );
if ( sugar.conformation_name() == "4c1" )
{
sugar.override_conformation_diag ( false );
}
}
}
if ( sugar.ok_with_conformation() && sugar.ok_with_anomer() &&
sugar.ok_with_chirality() && sugar.ok_with_puckering() )
Expand All @@ -135,9 +146,20 @@ namespace privateer

inline const bool sugar_contains_issues ( clipper::MSugar sugar, clipper::MGlycan glycan )
{
if ( ( glycan.get_type() == "c-glycan" ) && (sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4"))
if ( glycan.get_type() == "c-glycan" )
{
sugar.override_conformation_diag ( true );
if ((sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4"))
{
sugar.override_conformation_diag ( true );
}
if (sugar.type().trim() == "BMA")
{
sugar.override_anomer_diag( false );
if ( sugar.conformation_name() == "4c1" )
{
sugar.override_conformation_diag ( false );
}
}
}

if ( sugar.ok_with_conformation() && sugar.ok_with_anomer() &&
Expand Down

0 comments on commit ba14939

Please sign in to comment.