Skip to content

Commit

Permalink
Merge pull request #106 from glycojones/update-cglycan-diag
Browse files Browse the repository at this point in the history
update diagnostic for cglycans
  • Loading branch information
Dialpuri authored Aug 22, 2024
2 parents ecbd434 + e838a54 commit 8b5380f
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
push:
branches: [ "webapp" ]
paths:
- src/privateer/cpp/privateer-bind.cpp
- src/privateer/cpp/*

pull_request:
branches: [ "webapp" ]
paths:
- src/privateer/cpp/privateer-bind.cpp
- src/privateer/cpp/*

jobs:
build:
Expand Down
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.conformation_name() == "4c1" )
{
sugar.override_conformation_diag ( false );
}
if (sugar.type().trim() == "BMA")
{
sugar.override_anomer_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
24 changes: 24 additions & 0 deletions src/privateer/cpp/privateer-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,14 @@ 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 );
}
fprintf ( output, "\t(c) " );
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down Expand Up @@ -1171,6 +1179,14 @@ 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 );
}
std::cout << "\t(c) ";
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down Expand Up @@ -1289,6 +1305,14 @@ 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 );
}
std::cout << "\t(c) ";
}
else if ( ligandList[index].second.get_context() == "o-glycan" )
Expand Down
37 changes: 34 additions & 3 deletions src/privateer/cpp/privateer-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,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.ok_with_conformation() && sugar.ok_with_anomer() &&
sugar.ok_with_chirality() && sugar.ok_with_puckering() )
str << "<tspan>No issues have been detected.</tspan>";
Expand Down Expand Up @@ -155,9 +163,20 @@ namespace privateer
{

GlycanErrorCount err;
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.conformation_name() == "4c1" )
{
sugar.override_conformation_diag ( false );
}
if (sugar.type().trim() == "BMA")
{
sugar.override_anomer_diag( false );
}
}
if ( ! sugar.ok_with_anomer() ) {
err.anomer_err++;
Expand All @@ -180,10 +199,22 @@ 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" )
{
if ((sugar.type().trim() == "MAN" ) && (sugar.conformation_name() == "1c4"))
{
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.ok_with_conformation() && sugar.ok_with_anomer() &&
sugar.ok_with_chirality() && sugar.ok_with_puckering() )
return false;
Expand Down
10 changes: 5 additions & 5 deletions webapp/src/wasm/privateer.js

Large diffs are not rendered by default.

Binary file modified webapp/src/wasm/privateer.wasm
Binary file not shown.

0 comments on commit 8b5380f

Please sign in to comment.