Skip to content

Commit

Permalink
Merge pull request #105 from glycojones/update-cglycan_diag_pybind
Browse files Browse the repository at this point in the history
update cglycan diagnostic in python bindings
  • Loading branch information
louholland authored Aug 22, 2024
2 parents 4ae2656 + cecfab2 commit 168f21c
Showing 1 changed file with 84 additions and 14 deletions.
98 changes: 84 additions & 14 deletions src/privateer/cpp/pybind11/privateer-pyanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,11 +1132,21 @@ void privateer::pyanalysis::GlycosylationComposition::read_from_file( std::strin
}
else if ( list_of_glycans[i].get_type() == "c-glycan" )
{
if ( ligandList[index].second.type().trim() == "MAN" ) {
if ( ligandList[index].second.conformation_name() == "1c4" ) {
if ( ligandList[index].second.type().trim() == "MAN" )
{
if ( 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" );
}
else if ( list_of_glycans[i].get_type() == "o-glycan" )
Expand Down Expand Up @@ -2803,12 +2813,22 @@ void privateer::pyanalysis::CarbohydrateStructure::pyinit( clipper::MGlycan& mgl
this->sugar_diag_puckering=inputSugar.ok_with_puckering();

if(sugar_context == "c-glycan")
{
if ( inputSugar.type().trim() == "MAN" ) {
if ( inputSugar.conformation_name() == "1c4" ) {
inputSugar.override_conformation_diag ( true );
this->sugar_diag_conformation=inputSugar.ok_with_conformation();
}
}
if ( inputSugar.conformation_name() == "4c1" ) {
inputSugar.override_conformation_diag ( false );
this->sugar_diag_conformation=inputSugar.ok_with_conformation();
}
if ( inputSugar.type().trim() == "BMA" ) {
inputSugar.override_anomer_diag ( false );
this->sugar_diag_anomer=inputSugar.ok_with_anomer();
}
}

this->sugarNode = parentGlycan.get_node(sugarID);
this->sugar_connections=sugarNode.number_of_connections();
Expand Down Expand Up @@ -3075,12 +3095,22 @@ void privateer::pyanalysis::CarbohydrateStructure::pyinitLigand( const int sugar
this->sugar_ring_atoms = ringatoms;

if(sugar_context == "c-glycan")
{
if ( inputSugar.second.type().trim() == "MAN" ) {
if ( inputSugar.second.conformation_name() == "1c4" ) {
inputSugar.second.override_conformation_diag ( true );
this->sugar_diag_conformation=inputSugar.second.ok_with_conformation();
}
}
if ( inputSugar.second.conformation_name() == "4c1" ) {
inputSugar.second.override_conformation_diag ( false );
this->sugar_diag_conformation=inputSugar.second.ok_with_conformation();
}
if ( inputSugar.second.type().trim() == "BMA" ) {
inputSugar.second.override_anomer_diag ( false );
this->sugar_diag_anomer=inputSugar.second.ok_with_anomer();
}
}

this->sugar_rscc=inputSugar.second.get_rscc();
this->sugar_accum=inputSugar.second.get_accum();
Expand Down Expand Up @@ -3922,10 +3952,20 @@ void privateer::pyanalysis::XRayData::read_from_file( std::string& path_to_mtz_f
}
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 );
if ( ligandList[index].second.type().trim() == "MAN" )
{
if ( 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" );
}
Expand Down Expand Up @@ -4056,11 +4096,21 @@ void privateer::pyanalysis::XRayData::read_from_file( std::string& path_to_mtz_f
}
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 );
if ( ligandList[index].second.type().trim() == "MAN" )
{
if ( 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" );
}
else if ( list_of_glycans[i].get_type() == "o-glycan" )
Expand Down Expand Up @@ -4489,10 +4539,20 @@ void privateer::pyanalysis::CryoEMData::read_from_file( std::string& path_to_mrc
}
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 );
if ( ligandList[index].second.type().trim() == "MAN" )
{
if ( 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" );
}
Expand Down Expand Up @@ -4618,11 +4678,21 @@ void privateer::pyanalysis::CryoEMData::read_from_file( std::string& path_to_mrc
}
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 );
if ( ligandList[index].second.type().trim() == "MAN" )
{
if ( 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" );
}
else if ( list_of_glycans[i].get_type() == "o-glycan" )
Expand Down

0 comments on commit 168f21c

Please sign in to comment.