Пример #1
0
def select_right_pdb(hklin, pdb_list):
    '''Find a coordinate file which appears to have the right symmetry.'''

    candidates = []

    im = module_factory().interrogate_mtz()
    im.set_hklin(hklin)
    im.interrogate_mtz()
    reference = ersatz_pointgroup(im.get_symmetry())
    reference_cell = im.get_cell()

    cells = {}

    for xyzin in pdb_list:
        ip = module_factory().interrogate_pdb()
        ip.set_xyzin(xyzin)
        try:
            ip.interrogate_pdb()
            if reference == ersatz_pointgroup(ip.get_symmetry_full()):
                candidates.append(xyzin)
                if reference == 'P222':
                    cells[xyzin] = nearest_orthorhombic(
                        reference_cell, ip.get_cell())
                else:
                    cells[xyzin] = ip.get_cell()
        except RuntimeError, e:
            sys.stderr.write('%s\n' % e)
            continue
Пример #2
0
def select_right_pdb(hklin, pdb_list):
    '''Find a coordinate file which appears to have the right symmetry.'''

    candidates = []

    im = module_factory().interrogate_mtz()
    im.set_hklin(hklin)
    im.interrogate_mtz()
    reference = ersatz_pointgroup(im.get_symmetry())

    reference_cell = im.get_cell()

    cells = { }

    for xyzin in pdb_list:
        ip = module_factory().interrogate_pdb()
        ip.set_xyzin(xyzin)
        ip.interrogate_pdb()
        if reference == ersatz_pointgroup(ip.get_symmetry_full()):
            candidates.append(xyzin)
            cells[xyzin] = ip.get_cell()

    if len(candidates) == 0:
        raise RuntimeError, 'no matching coordinate files found'

    # then if there are more than one, see if one matches closer than
    # the others... do this by sorting on the absolute differences in
    # cell constants then picking the closest match

    # erm. doesn't this need to consider permutations for P222?

    if len(candidates) == 1:
        return candidates[0]

    diffs = []

    for xyzin in candidates:
        diff = sum([math.fabs(reference_cell[j] - cells[xyzin][j]) \
                    for j in range(6)])
        diffs.append((diff, xyzin))

    diffs.sort()

    return diffs[0][1]
Пример #3
0
    def __init__(self):

        self._working_directory = os.getcwd()
        self._factory = module_factory()

        self._hklin = None
        self._nha = None

        self._symmetry = None
        self._reindex_op = None

        self._cc = None
        self._cc_weak = None

        return
Пример #4
0
    def __init__(self):

        self._working_directory = os.getcwd()
        self._factory = module_factory()

        self._hklin = None
        self._hklout = None
        self._xyzin = None
        self._xyzout = None

        self._nres = None

        self._symmetry = None
        self._reindex_op = None

        self._mode = LP_MODE_MS

        return
Пример #5
0
    def __init__(self):

        self._working_directory = os.getcwd()
        self._factory = module_factory()
        self._image = None

        self._matrix = None
        self._spacegroup = None
        self._cell = None
        self._mosaic = None

        self._phi_start = None
        self._phi_end = None
        self._phi_width = None

        self._completeness = None

        self._resolution = None

        return
Пример #6
0
    if len(candidates) == 0:
        raise RuntimeError, 'no candidate pdb files matched %s' % os.getcwd()

    hklin = 'fast_dp.mtz'
    hklout = 'map.mtz'
    xyzout = 'refined.pdb'

    xyzin = select_right_pdb(hklin, candidates)

    if not xyzin:
        raise RuntimeError, 'no candidate pdb files matched %s' % os.getcwd()

    print 'Selected %s' % xyzin

    im = module_factory().interrogate_mtz()
    im.set_hklin(hklin)
    im.interrogate_mtz()

    reindex_op = None

    if ersatz_pointgroup(im.get_symmetry()) == 'P222':

        # compare unit cells...

        ip = module_factory().interrogate_pdb()
        ip.set_xyzin(xyzin)
        ip.interrogate_pdb()
        reindex_op = test_orthorhombic(ip.get_cell(), im.get_cell())

    lp = ligand_pipeline()