Ejemplo n.º 1
0
 def __init__(self, list_cif=None, another_list_cif=None, verbose=False):
     if (list_cif is None):
         list_cif = mon_lib_list_cif()
     if (another_list_cif is None):
         # get the geostd CIF links object and merge
         geostd_list_cif_obj = geostd_list_cif()
         list_cif = merge_and_overwrite_cifs(
             geostd_list_cif_obj,
             list_cif,
         )
     self.root_path = os.path.dirname(os.path.dirname(list_cif.path))
     self.geostd_path = os.path.join(os.path.dirname(self.root_path),
                                     "geostd")
     self.deriv_list_dict = {}
     self.comp_synonym_list_dict = {}
     self.comp_synonym_atom_list_dict = dicts.with_default_factory(dict)
     self.comp_comp_id_dict = {}
     self.link_link_id_list = []
     self.link_link_id_dict = {}
     self.mod_mod_id_list = []
     self.mod_mod_id_dict = {}
     self.convert_all(source_info="file: " + list_cif.path,
                      cif_object=list_cif.cif,
                      skip_comp_list=True)
     self.comp_comp_id_mod_dict = {}
     self.process_geostd_rna_dna()
Ejemplo n.º 2
0
def analyze_redundancies(asu, n, redundancies, verbose=1):
    if (len(redundancies) == 0): return
    print("Overview:")
    for symop, pairs in redundancies:
        print(symop, ": number of redundancies:", len(pairs))
        print("  ", rt_mx_analysis(sgtbx.rt_mx(symop)))
    print("Details:")
    for symop, pairs in redundancies:
        print(symop, ": number of redundancies:", len(pairs))
        print("  ", rt_mx_analysis(sgtbx.rt_mx(symop)))
        all_cuts = dicts.with_default_factory(dict)
        not_in_cuts = {}
        for pair in pairs:
            for point in pair:
                cuts = asu.in_which_cuts(rational.vector(point, n))
                if (len(cuts) == 0):
                    not_in_cuts[point] = 1
                all_cuts[tuple(cuts)][point] = 1
        print("    In cuts:")
        for cuts, points in all_cuts.items():
            print("     ", end=' ')
            show_amp = False
            for cut in cuts:
                if (show_amp): print("&", end=' ')
                print(cut, end=' ')
                show_amp = True
            print("#points: %d:" % len(points), end=' ')
            # FIXME : ordering of keys in py2/3 is different
            print(str(list(points.keys())[:4]).replace(" ", ""))
        if (verbose):
            print("    Pairs:")
            for pair in pairs:
                print("      ", pair)
        if (len(not_in_cuts) > 0):
            print("    Not in cuts:")
            for point in not_in_cuts.keys():
                print("     ", point)
            raise AssertionError("Some redundant points not in any cuts.")
        print()
Ejemplo n.º 3
0
def analyze_redundancies(asu, n, redundancies, verbose=1):
    if (len(redundancies) == 0): return
    print "Overview:"
    for symop, pairs in redundancies:
        print symop, ": number of redundancies:", len(pairs)
        print "  ", rt_mx_analysis(sgtbx.rt_mx(symop))
    print "Details:"
    for symop, pairs in redundancies:
        print symop, ": number of redundancies:", len(pairs)
        print "  ", rt_mx_analysis(sgtbx.rt_mx(symop))
        all_cuts = dicts.with_default_factory(dict)
        not_in_cuts = {}
        for pair in pairs:
            for point in pair:
                cuts = asu.in_which_cuts(rational.vector(point, n))
                if (len(cuts) == 0):
                    not_in_cuts[point] = 1
                all_cuts[tuple(cuts)][point] = 1
        print "    In cuts:"
        for cuts, points in all_cuts.items():
            print "     ",
            show_amp = False
            for cut in cuts:
                if (show_amp): print "&",
                print cut,
                show_amp = True
            print "#points: %d:" % len(points),
            print str(points.keys()[:4]).replace(" ", "")
        if (verbose):
            print "    Pairs:"
            for pair in pairs:
                print "      ", pair
        if (len(not_in_cuts) > 0):
            print "    Not in cuts:"
            for point in not_in_cuts.keys():
                print "     ", point
            raise AssertionError, "Some redundant points not in any cuts."
        print
Ejemplo n.º 4
0
 def __init__(self, list_cif=None, another_list_cif=None, verbose=False):
   if (list_cif is None):
     list_cif = mon_lib_list_cif()
   if (another_list_cif is None):
     # get the geostd CIF links object and merge
     geostd_list_cif_obj = geostd_list_cif()
     list_cif = merge_and_overwrite_cifs(geostd_list_cif_obj,
                                         list_cif,
                                         )
   self.root_path = os.path.dirname(os.path.dirname(list_cif.path))
   self.geostd_path = os.path.join(os.path.dirname(self.root_path), "geostd")
   self.deriv_list_dict = {}
   self.comp_synonym_list_dict = {}
   self.comp_synonym_atom_list_dict = dicts.with_default_factory(dict)
   self.comp_comp_id_dict = {}
   self.link_link_id_list = []
   self.link_link_id_dict = {}
   self.mod_mod_id_list = []
   self.mod_mod_id_dict = {}
   self.convert_all(
     source_info="file: "+list_cif.path,
     cif_object=list_cif.cif, skip_comp_list=True)
   self.comp_comp_id_mod_dict = {}
   self.process_geostd_rna_dna()