def rmsd(ind1, ind2, subjects, threshold, *args, **kwargs): """ Function to check if two individuals are two identical solution. Parameters ---------- ind1, ind2 : dict Dictionaries representing one individual. threshold : float Maximum RMSD value to consider two individuals as similar. If rmsd > threshold, they are considered different. subjects : list List of molecules to measure. Returns ------- bool Returns True if both individuals are equal. """ enable_chimera() molecules_1 = [chimera.openModels.open(ind1[s])[0] for s in subjects] molecules_2 = [chimera.openModels.open(ind2[s])[0] for s in subjects] for m1, m2 in zip(molecules_1, molecules_2): coords1 = m1.activeCoordSet.xyzArray() coords2 = m2.activeCoordSet.xyzArray() if coords1.shape[0] != coords2.shape[0]: return False rmsd_squared = _rmsd_squared(coords1, coords2) if rmsd_squared > threshold * threshold: return False return True
############## # dummyatoms: Cathionic Method algortihm for metal systems # # # https://github.com/miniaoshi/dummyatoms # # Copyright 2017 Daniel Soler, Jaime Rodriguez # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############## import sys import pytest from pychimera import patch_environ, enable_chimera if __name__ == '__main__': patch_environ() enable_chimera() pytest.main(sys.argv[1:])
type=str, help='Particle box size') argparser.add_argument( '--output_name', default='./matrix_dictionary.txt', type=str, help= 'Name for output file containing a transformation matrix for each particle.' ) args = argparser.parse_args() #import pychimera.__main__ #update_dict = pychimera.__main__.run() import pychimera pychimera.patch_environ(nogui=True) pychimera.enable_chimera() import chimera if (not args.particle_name_prefix) and (not args.particle_name_postfix): sys.exit('You must provide a particle prefix or postfix') sess = args.sessions_path part_prefix = '' if args.particle_name_prefix: part_prefix = args.particle_name_prefix part_postfix = '' if args.particle_name_postfix: part_postfix = args.particle_name_postfix print('Will search for particles starting with %s and ending with %s' % (part_prefix, part_postfix)) refname = args.reference_name p_angpix = float(args.particle_angpix) r_angpix = float(args.reference_angpix)
import pandas as pd from io import StringIO # If the script is invoked with a normal python interpreter, # the environment must be patched. Not necessary if called # with pychimera # Ensure the shell environment variable $CHIMERADIR is set and # points to the root directory of the Chimera installation. # Should match the output of: $ chimera --root if not sys.argv[0].endswith("pychimera"): import pychimera pychimera.patch_environ() pychimera.enable_chimera() import chimera from chimera import openModels, Molecule from chimera import runCommand as rc from MatchMaker import (match, CP_BEST, GAP_OPEN,GAP_EXTEND, defaults, MATRIX, ITER_CUTOFF) # HHSuite output parser/template template = \ u""" ---|------|------------------------|----|-------|-------|------|-----|----|---------|--------------| No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM """ def hhparse(hhresult_file):
def load_chimera(nogui=True): pychimera.patch_environ(nogui=nogui) pychimera.enable_chimera()