Beispiel #1
0
NucleicAcid::NucleicAcid( const clipper::Coord_orth& cp, const clipper::Coord_orth& co5, const clipper::Coord_orth& cc5, const clipper::Coord_orth& cc4, const clipper::Coord_orth& co4, const clipper::Coord_orth& cc3, const clipper::Coord_orth& co3, const clipper::Coord_orth& cc2, const clipper::Coord_orth& cc1, const clipper::Coord_orth& cn, const clipper::String& type )
{
  clipper::String t = type + "?";
  typ = t.trim()[0];
  clipper::Util::set_null( p_x );
  clipper::Util::set_null( o5x );
  clipper::Util::set_null( c5x );
  clipper::Util::set_null( c4x );
  clipper::Util::set_null( o4x );
  clipper::Util::set_null( c3x );
  clipper::Util::set_null( o3x );
  clipper::Util::set_null( c2x );
  clipper::Util::set_null( c1x );
  clipper::Util::set_null( n_x );
  if ( !cp.is_null()  ) { p_x = cp.x(); p_y = cp.y(); p_z = cp.z(); }
  if ( !co5.is_null() ) { o5x = co5.x(); o5y = co5.y(); o5z = co5.z(); }
  if ( !cc5.is_null() ) { c5x = cc5.x(); c5y = cc5.y(); c5z = cc5.z(); }
  if ( !cc4.is_null() ) { c4x = cc4.x(); c4y = cc4.y(); c4z = cc4.z(); }
  if ( !co4.is_null() ) { o4x = co4.x(); o4y = co4.y(); o4z = co4.z(); }
  if ( !cc3.is_null() ) { c3x = cc3.x(); c3y = cc3.y(); c3z = cc3.z(); }
  if ( !co3.is_null() ) { o3x = co3.x(); o3y = co3.y(); o3z = co3.z(); }
  if ( !cc2.is_null() ) { c2x = cc2.x(); c2y = cc2.y(); c2z = cc2.z(); }
  if ( !cc1.is_null() ) { c1x = cc1.x(); c1y = cc1.y(); c1z = cc1.z(); }
  if ( !cn.is_null()  ) { n_x = cn.x(); n_y = cn.y(); n_z = cn.z(); }
  set_flag();
}
Beispiel #2
0
bool Chain::is_continuous() const
{
  // go through and find elements where there is a chain break
  const double dmin = 2.0;
  std::vector<bool> cterm( dbmonomers.size(), false );
  for ( int i = 0; i < int(dbmonomers.size()-1); i++ ) {
    int j = i + 1;
    const clipper::Coord_orth co1 = dbmonomers[i].coord_o3();
    const clipper::Coord_orth co2 = dbmonomers[j].coord_p();
    if ( co1.is_null() || co2.is_null() ) return false;
    const double d2 = ( co1 - co2 ).lengthsq();
    if ( d2 > dmin*dmin ) return false;
  }
  return true;
}
Beispiel #3
0
clipper::Coord_orth NucleicAcidTools::coord_adjust( const clipper::Coord_orth& co, const clipper::Coord_orth& cc3, const clipper::Coord_orth& cf3, const clipper::Coord_orth& cc4, const clipper::Coord_orth& cf4, double rad )
{
  if ( co.is_null() ) return co;
  clipper::Coord_orth result = co;
  double w3 = 1.0 - sqrt( ( co - cf3 ).lengthsq() ) / rad;
  double w4 = 1.0 - sqrt( ( co - cf4 ).lengthsq() ) / rad;
  if ( w3 > 0.0 ) result += w3 * ( cc3 - cf3 );
  if ( w4 > 0.0 ) result += w4 * ( cc4 - cf4 );
  return result;
}