diff --git a/src/privateer/cpp/clipper-glyco.cpp b/src/privateer/cpp/clipper-glyco.cpp index 0f7de680..66dc9bfb 100644 --- a/src/privateer/cpp/clipper-glyco.cpp +++ b/src/privateer/cpp/clipper-glyco.cpp @@ -5483,13 +5483,13 @@ void MGlycology::init ( const clipper::MiniMol& mmol, const clipper::MAtomNonBon { sugar.override_conformation_diag ( true ); } + if ( sugar.conformation_name() == "4c1" ) + { + sugar.override_conformation_diag ( false ); + } 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 diff --git a/src/privateer/cpp/privateer-lib.cpp b/src/privateer/cpp/privateer-lib.cpp index 7f77cd71..05339172 100644 --- a/src/privateer/cpp/privateer-lib.cpp +++ b/src/privateer/cpp/privateer-lib.cpp @@ -1046,7 +1046,6 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i printf("%c%c%c%c\t%s-",input_model[1+pos_slash],input_model[2+pos_slash],input_model[3+pos_slash],input_model[4+pos_slash], ligandList[index].second.type().c_str()); std::cout << ligandList[index].first << "-" << ligandList[index].second.id().trim() << " "; } - if (batch) { std::vector cpParams(10, 0); @@ -1072,12 +1071,13 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i { ligandList[index].second.override_conformation_diag ( true ); } + if (ligandList[index].second.conformation_name() == "4c1") + { + ligandList[index].second.override_conformation_diag ( false ); + } 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) " ); } @@ -1108,6 +1108,10 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i { fprintf(output, "\tcheck"); } + else if ( ! ligandList[index].second.ok_with_anomer () ) + { + fprintf(output, "\tcheck"); + } else fprintf(output, "\tyes"); } else @@ -1178,12 +1182,13 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i { ligandList[index].second.override_conformation_diag ( true ); } + if (ligandList[index].second.conformation_name() == "4c1") + { + ligandList[index].second.override_conformation_diag ( false ); + } 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) "; } @@ -1212,6 +1217,10 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i { if ( ! ligandList[index].second.ok_with_conformation () ) printf("\tcheck"); + else if ( ! ligandList[index].second.ok_with_anomer () ) + { + printf("\tcheck"); + } else printf("\tyes"); } @@ -1303,12 +1312,13 @@ void privateer::util::print_monosaccharide_summary_python (bool batch, bool show { ligandList[index].second.override_conformation_diag ( true ); } + if (ligandList[index].second.conformation_name() == "4c1") + { + ligandList[index].second.override_conformation_diag ( false ); + } 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) "; } @@ -1337,6 +1347,10 @@ void privateer::util::print_monosaccharide_summary_python (bool batch, bool show { if ( ! ligandList[index].second.ok_with_conformation () ) printf("\tcheck"); + else if ( ! ligandList[index].second.ok_with_anomer () ) + { + printf("\tcheck"); + } else printf("\tyes"); } diff --git a/src/privateer/cpp/privateer-lib.h b/src/privateer/cpp/privateer-lib.h index 10c8b03d..dfb695de 100644 --- a/src/privateer/cpp/privateer-lib.h +++ b/src/privateer/cpp/privateer-lib.h @@ -114,13 +114,13 @@ namespace privateer { sugar.override_conformation_diag ( true ); } + if ( sugar.conformation_name() == "4c1" ) + { + sugar.override_conformation_diag ( false ); + } 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() && @@ -152,13 +152,14 @@ namespace privateer { sugar.override_conformation_diag ( true ); } + if ( sugar.conformation_name() == "4c1" ) + { + sugar.override_conformation_diag ( false ); + } if (sugar.type().trim() == "BMA") { sugar.override_anomer_diag( false ); - if ( sugar.conformation_name() == "4c1" ) - { - sugar.override_conformation_diag ( false ); - } + } } diff --git a/src/privateer/cpp/privateer.cpp b/src/privateer/cpp/privateer.cpp index 3caebed8..066c9469 100644 --- a/src/privateer/cpp/privateer.cpp +++ b/src/privateer/cpp/privateer.cpp @@ -931,9 +931,20 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - - ligandList[index].second.set_context ( "c-glycan" ); - fprintf ( output, "\t(c) " ); + if ( (ligandList[index].second.type().trim() == "MAN" ) && (ligandList[index].second.conformation_name() == "1c4")) + { + ligandList[index].second.override_conformation_diag ( true ); + } + if (ligandList[index].second.conformation_name() == "4c1") + { + ligandList[index].second.override_conformation_diag ( false ); + } + if (ligandList[index].second.type().trim() == "BMA" ) + { + ligandList[index].second.override_anomer_diag ( false ); + } + ligandList[index].second.set_context ( "c-glycan" ); + fprintf ( output, "\t(c) " ); } else if ( list_of_glycans[i].get_type() == "o-glycan" ) { @@ -981,6 +992,10 @@ int main(int argc, char** argv) { fprintf(output, "\tcheck"); } + else if ( ! ligandList[index].second.ok_with_anomer() ) + { + fprintf(output, "\tcheck"); + } else fprintf(output, "\tyes"); } @@ -1070,6 +1085,18 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { + if ( (ligandList[index].second.type().trim() == "MAN" ) && (ligandList[index].second.conformation_name() == "1c4")) + { + ligandList[index].second.override_conformation_diag ( true ); + } + if (ligandList[index].second.conformation_name() == "4c1") + { + ligandList[index].second.override_conformation_diag ( false ); + } + if (ligandList[index].second.type().trim() == "BMA" ) + { + ligandList[index].second.override_anomer_diag ( false ); + } ligandList[index].second.set_context ( "c-glycan" ); std::cout << "\t(c) "; @@ -1122,6 +1149,10 @@ int main(int argc, char** argv) { printf("\tcheck"); } + else if ( ! ligandList[index].second.ok_with_anomer () ) + { + printf("\tcheck"); + } else printf("\tyes"); } else @@ -1255,6 +1286,15 @@ int main(int argc, char** argv) } else // sugar is sane, but still need to check higher-energy conformations { + if (!ligandList[k].second.ok_with_anomer()) // FLAG: Here for c-glycan case where sanity check has happened before diagnostics overidden. + { + if ( n_errors > 0 ) + diagnostic.append(", wrong anomer"); + else + diagnostic.append("wrong anomer"); + + n_errors++; n_anomer++; + } if ( !ligandList[k].second.ok_with_conformation() ) { if ( n_errors > 0 ) @@ -3206,6 +3246,22 @@ int main(int argc, char** argv) } else // sugar is sane, but still need to check higher-energy conformations { + if (!ligandList[k].second.ok_with_anomer()) // FLAG: Here for c-glycan case where sanity check has happened before diagnostics overidden. + { + if ( n_errors > 0 ) + { + diagnostic.append(", wrong anomer"); + report.append(", wrong anomer"); + } + else + { + diagnostic.append("wrong anomer"); + report.append("Wrong anomer"); + } + + n_errors++; + n_anomer++; + } if ( !ligandList[k].second.ok_with_conformation() ) { if ( n_errors > 0 )