diff --git a/src/privateer/cpp/privateer-lib.cpp b/src/privateer/cpp/privateer-lib.cpp index fa71cb9c..52c61776 100644 --- a/src/privateer/cpp/privateer-lib.cpp +++ b/src/privateer/cpp/privateer-lib.cpp @@ -1068,6 +1068,10 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i } else if ( ligandList[index].second.get_context() == "c-glycan" ) { + if ( (ligandList[index].second.type().trim() == "MAN" ) && (ligandList[index].second.conformation_name() == "1c4")) + { + ligandList[index].second.override_conformation_diag ( true ); + } fprintf ( output, "\t(c) " ); } else if ( ligandList[index].second.get_context() == "o-glycan" ) @@ -1163,6 +1167,10 @@ void privateer::util::print_monosaccharide_summary (bool batch, bool showGeom, i } else if ( ligandList[index].second.get_context() == "c-glycan" ) { + if ( (ligandList[index].second.type().trim() == "MAN" ) && (ligandList[index].second.conformation_name() == "1c4")) + { + ligandList[index].second.override_conformation_diag ( true ); + } std::cout << "\t(c) "; } else if ( ligandList[index].second.get_context() == "o-glycan" ) @@ -1277,6 +1285,10 @@ void privateer::util::print_monosaccharide_summary_python (bool batch, bool show } else if ( ligandList[index].second.get_context() == "c-glycan" ) { + if ( (ligandList[index].second.type().trim() == "MAN" ) && (ligandList[index].second.conformation_name() == "1c4")) + { + ligandList[index].second.override_conformation_diag ( true ); + } std::cout << "\t(c) "; } else if ( ligandList[index].second.get_context() == "o-glycan" ) @@ -2448,197 +2460,197 @@ void privateer::glycanbuilderplot::Plot::recursive_paint ( clipper::MGlycan mg, bool node_contains_issue_with_sugar = false; int branches = node.number_of_connections(); - node_contains_issue_with_sugar = sugar_contains_issues(sugar); + node_contains_issue_with_sugar = sugar_contains_issues(sugar,mg); if ( sugname == "Glc" ) { - Glc * glc = new Glc (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Glc * glc = new Glc (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( glc ); if (node_contains_issue_with_sugar && this->potential_issue_shading) { - shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shCrcl); } } else if ( sugname == "Gal" ) { - Gal * gal = new Gal (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Gal * gal = new Gal (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( gal ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shCrcl); } } else if ( sugname == "Man" ) { - Man * man = new Man (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Man * man = new Man (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( man ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedCircle * shCrcl = new shadedCircle (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shCrcl); } } else if ( sugname == "Fuc" ) { - Fuc * fuc = new Fuc (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Fuc * fuc = new Fuc (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( fuc ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedTriangle * shTrngl = new shadedTriangle (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedTriangle * shTrngl = new shadedTriangle (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shTrngl); } } else if ( sugname == "Xyl" ) { - Xyl * xyl = new Xyl (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Xyl * xyl = new Xyl (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( xyl ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedStar * shStar = new shadedStar (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedStar * shStar = new shadedStar (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shStar); } } else if ( sugname == "GlcN" ) { - GlcN * glcn = new GlcN (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + GlcN * glcn = new GlcN (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( glcn ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "GalN" ) { - GalN * galn = new GalN (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + GalN * galn = new GalN (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( galn ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "ManN" ) { - ManN * mann = new ManN (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + ManN * mann = new ManN (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( mann ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "GlcNAc" ) { - GlcNAc * glcnac = new GlcNAc (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + GlcNAc * glcnac = new GlcNAc (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( glcnac ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "GalNAc" ) { - GalNAc * galnac = new GalNAc (x, y, get_svg_tooltip ( sugar, validation ) , mmdbsel ); + GalNAc * galnac = new GalNAc (x, y, get_svg_tooltip ( sugar, validation, mg ) , mmdbsel ); add_block ( galnac ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "ManNAc" ) { - ManNAc * mannac = new ManNAc (x, y, get_svg_tooltip ( sugar, validation ) , mmdbsel ); + ManNAc * mannac = new ManNAc (x, y, get_svg_tooltip ( sugar, validation, mg ) , mmdbsel ); add_block ( mannac ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "GlcA" ) { - GlcA * glca = new GlcA (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + GlcA * glca = new GlcA (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( glca ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "GalA" ) { - GalA * gala = new GalA (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + GalA * gala = new GalA (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( gala ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "ManA" ) { - ManA * mana = new ManA (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + ManA * mana = new ManA (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( mana ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedSquare * shSqr = new shadedSquare (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shSqr); } } else if ( sugname == "Neu5Gc" ) { - Neu5Gc *neu5gc = new Neu5Gc ( x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Neu5Gc *neu5gc = new Neu5Gc ( x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( neu5gc ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shDiam); } } else if ( sugname == "Neu5Ac" ) { - Neu5Ac *neu5ac = new Neu5Ac ( x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + Neu5Ac *neu5ac = new Neu5Ac ( x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( neu5ac ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shDiam); } } else if ( sugname == "IdoA" ) { - IdoA *idoa = new IdoA ( x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + IdoA *idoa = new IdoA ( x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( idoa ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shDiam); } } else if ( sugname == "KDN" ) { - KDN *kdn = new KDN ( x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + KDN *kdn = new KDN ( x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( kdn ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedDiamond * shDiam = new shadedDiamond (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shDiam); } } else { - Unk *unk = new Unk ( x, y, *(sugar.type().substr(0,1).c_str()), get_svg_tooltip ( sugar, validation ), mmdbsel ); + Unk *unk = new Unk ( x, y, *(sugar.type().substr(0,1).c_str()), get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_block ( unk ); if (node_contains_issue_with_sugar && this->potential_issue_shading ) { - shadedHexagon * shHex = new shadedHexagon (x, y, get_svg_tooltip ( sugar, validation ), mmdbsel ); + shadedHexagon * shHex = new shadedHexagon (x, y, get_svg_tooltip ( sugar, validation, mg ), mmdbsel ); add_shaded_node (shHex); } } diff --git a/src/privateer/cpp/privateer-lib.h b/src/privateer/cpp/privateer-lib.h index 42d51e50..5d95b73b 100644 --- a/src/privateer/cpp/privateer-lib.h +++ b/src/privateer/cpp/privateer-lib.h @@ -98,7 +98,7 @@ namespace privateer std::string get_colour ( Colour colour, bool original_style, bool inverted = false ); - inline const std::string get_svg_tooltip ( clipper::MSugar sugar, bool validation ) + inline const std::string get_svg_tooltip ( clipper::MSugar sugar, bool validation, clipper::MGlycan glycan ) { std::ostringstream str; str << std::setprecision(2) << std::fixed @@ -108,6 +108,10 @@ namespace privateer << "Detected type: " << sugar.type_of_sugar() << ". "; if ( validation ) { + if ( ( glycan.get_type() == "c-glycan" ) && (sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4")) + { + sugar.override_conformation_diag ( true ); + } if ( sugar.ok_with_conformation() && sugar.ok_with_anomer() && sugar.ok_with_chirality() && sugar.ok_with_puckering() ) str << "No issues have been detected."; @@ -129,8 +133,12 @@ namespace privateer return str.str(); } - inline const bool sugar_contains_issues ( clipper::MSugar sugar ) + 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")) + { + sugar.override_conformation_diag ( true ); + } if ( sugar.ok_with_conformation() && sugar.ok_with_anomer() && sugar.ok_with_chirality() && sugar.ok_with_puckering() ) diff --git a/src/privateer/cpp/privateer.cpp b/src/privateer/cpp/privateer.cpp index a6e0d02c..3caebed8 100644 --- a/src/privateer/cpp/privateer.cpp +++ b/src/privateer/cpp/privateer.cpp @@ -931,11 +931,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); fprintf ( output, "\t(c) " ); @@ -1075,11 +1070,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); std::cout << "\t(c) "; @@ -2192,11 +2182,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); } else if ( list_of_glycans[i].get_type() == "o-glycan" ) @@ -2328,11 +2313,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); } else if ( list_of_glycans[i].get_type() == "o-glycan" ) @@ -2907,11 +2887,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); } else if ( list_of_glycans[i].get_type() == "o-glycan" ) @@ -3047,11 +3022,6 @@ int main(int argc, char** argv) } else if ( list_of_glycans[i].get_type() == "c-glycan" ) { - if ( ligandList[index].second.type().trim() == "MAN" ) { - if ( ligandList[index].second.conformation_name() == "1c4" ) { - ligandList[index].second.override_conformation_diag ( true ); - } - } ligandList[index].second.set_context ( "c-glycan" ); } else if ( list_of_glycans[i].get_type() == "o-glycan" )