예제 #1
0
 def __init__(self, pdb_file, pdb_hierarchy=None):
     for name in self.__slots__:
         setattr(self, name, None)
     if (pdb_file is not None):
         import iotbx.pdb.hierarchy
         from iotbx.pdb import extract_rfactors_resolutions_sigma
         pdb_in = iotbx.pdb.hierarchy.input(file_name=pdb_file)
         published_results = extract_rfactors_resolutions_sigma.extract(
             file_lines=pdb_in.input.remark_section(), file_name=None)
         if (published_results is not None):
             self.r_work = published_results.r_work
             self.r_free = published_results.r_free
             self.d_min = published_results.high
             self.d_max = published_results.low
         self.refinement_program = pdb_in.input.get_program_name()
         # XXX phenix.refine hack, won't work for other programs
         lines = open(pdb_file).readlines()
         for line in lines:
             if (line.startswith("REMARK Final:")):
                 fields = line.strip().split()
                 self.rms_bonds = float(fields[-4])
                 self.rms_angles = float(fields[-1])
                 break
         if (pdb_hierarchy is not None):
             tls_groups = pdb_in.input.extract_tls_params(
                 pdb_hierarchy).tls_params
             if (tls_groups is not None):
                 self.n_tls_groups = len(tls_groups)
예제 #2
0
 def __init__ (self, pdb_file, pdb_hierarchy=None) :
   for name in self.__slots__ :
     setattr(self, name, None)
   if (pdb_file is not None) :
     import iotbx.pdb.hierarchy
     from iotbx.pdb import extract_rfactors_resolutions_sigma
     pdb_in = iotbx.pdb.hierarchy.input(file_name=pdb_file)
     published_results = extract_rfactors_resolutions_sigma.extract(
       file_lines=pdb_in.input.remark_section(), file_name=None)
     if (published_results is not None) :
       self.r_work = published_results.r_work
       self.r_free = published_results.r_free
       self.d_min = published_results.high
       self.d_max = published_results.low
     self.refinement_program = pdb_in.input.get_program_name()
     # XXX phenix.refine hack, won't work for other programs
     lines = open(pdb_file).readlines()
     for line in lines :
       if (line.startswith("REMARK Final:")) :
         fields = line.strip().split()
         self.rms_bonds = float(fields[-4])
         self.rms_angles = float(fields[-1])
         break
     if (pdb_hierarchy is not None) :
       tls_groups = pdb_in.input.extract_tls_params(pdb_hierarchy).tls_params
       if (tls_groups is not None) :
         self.n_tls_groups = len(tls_groups)
def run():
  result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
    remark_2_and_3_records = example_cns.splitlines(), file_name = None)
  assert approx_equal(result.r_work      , 0.171)
  assert approx_equal(result.r_free      , 0.221)
  assert approx_equal(result.high        , 2.2  )
  assert approx_equal(result.low         , 99.0 )
  assert approx_equal(result.resolution  , 2.2  )
  assert approx_equal(result.sigma       , 2.0  )
  #
  result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
    remark_2_and_3_records = example_refmac.splitlines(), file_name = None)
  assert approx_equal(result.r_work      , 0.198 )
  assert approx_equal(result.r_free      , 0.248 )
  assert approx_equal(result.high        , 1.55  )
  assert approx_equal(result.low         , 18.0  )
  assert approx_equal(result.resolution  , 1.55  )
  assert approx_equal(result.sigma       , 0.0   )
  #
  result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
    remark_2_and_3_records = example_shelx.splitlines(), file_name = None)
  assert approx_equal(result.r_work      , 0.140 )
  assert approx_equal(result.r_free      , 0.166 )
  assert approx_equal(result.high        , 1.05  )
  assert approx_equal(result.low         , 20.0  )
  assert approx_equal(result.resolution  , 1.05  )
  assert approx_equal(result.sigma       , 0.0   )
  result = extract_rfactors_resolutions_sigma.extract(
    file_lines=example_shelx.splitlines(), file_name=None)
  assert approx_equal(result.r_work      , 0.140 )
예제 #4
0
def run():
    result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
        remark_2_and_3_records=example_cns.splitlines(), file_name=None)
    assert approx_equal(result.r_work, 0.171)
    assert approx_equal(result.r_free, 0.221)
    assert approx_equal(result.high, 2.2)
    assert approx_equal(result.low, 99.0)
    assert approx_equal(result.resolution, 2.2)
    assert approx_equal(result.sigma, 2.0)
    #
    result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
        remark_2_and_3_records=example_refmac.splitlines(), file_name=None)
    assert approx_equal(result.r_work, 0.198)
    assert approx_equal(result.r_free, 0.248)
    assert approx_equal(result.high, 1.55)
    assert approx_equal(result.low, 18.0)
    assert approx_equal(result.resolution, 1.55)
    assert approx_equal(result.sigma, 0.0)
    #
    result = extract_rfactors_resolutions_sigma.get_r_rfree_sigma(
        remark_2_and_3_records=example_shelx.splitlines(), file_name=None)
    assert approx_equal(result.r_work, 0.140)
    assert approx_equal(result.r_free, 0.166)
    assert approx_equal(result.high, 1.05)
    assert approx_equal(result.low, 20.0)
    assert approx_equal(result.resolution, 1.05)
    assert approx_equal(result.sigma, 0.0)
    result = extract_rfactors_resolutions_sigma.extract(
        file_lines=example_shelx.splitlines(), file_name=None)
    assert approx_equal(result.r_work, 0.140)