Пример #1
0
 def __init__(self, pdbf, mtzf, log):
     self.log = log
     # Get objects out of files, and set grid step
     D = get_data(pdbf, mtzf)
     #
     print("-" * 79, file=log)
     print("A-2013, all defaults", file=log)
     step_default = min(0.8, D.f_obs().d_min() / 4)
     if (step_default < 0.15): step_default = 0.15
     f_mask = mosaic.get_f_mask(xrs=D.xray_structure,
                                ma=D.f_obs(),
                                step=step_default)
     self.fmodel_2013 = get_fmodel(o=D,
                                   f_mask=f_mask,
                                   remove_outliers=False,
                                   log=self.log).fmodel
     #
     # Compute masks and F_masks (Mosaic)
     print("-" * 79, file=log)
     print("Mosaic", file=log)
     self.mm = mosaic.mosaic_f_mask(
         xray_structure=D.xray_structure,
         step=0.6,
         volume_cutoff=50,
         mean_diff_map_threshold=0.5,
         r_sol=1.1,  # whole
         r_shrink=0.9,  # whole
         f_obs=self.fmodel_2013.f_obs(),
         f_calc=self.fmodel_2013.f_calc(),
         log=log)
     #
     if (self.mm.do_mosaic):
         ######
         print("-" * 79, file=log)
         print("A-2013, opt step/radii", file=log)
         f_mask_opt = mosaic.get_f_mask(xrs=D.xray_structure,
                                        ma=self.fmodel_2013.f_obs(),
                                        step=0.6,
                                        r_shrink=0.9,
                                        r_sol=1.1)
         o = get_fmodel(o=self.fmodel_2013,
                        f_mask=f_mask_opt,
                        remove_outliers=False,
                        log=self.log)
         self.fmodel_2013_opt = o.fmodel
         self.mc_whole_mask = o.mc
         ######
         print("-" * 79, file=log)
         print("A-2013, opt step/radii, using largest mask only", file=log)
         o = get_fmodel(o=self.fmodel_2013,
                        f_mask=self.mm.f_mask_0,
                        remove_outliers=False,
                        log=self.log)
         self.fmodel_0 = o.fmodel
         self.mc_0 = o.mc
Пример #2
0
 def __init__(self, pdbf, mtzf, log, volume_cutoff=30):
     self.log = log
     # Get objects out of files, and set grid step
     D = get_data(pdbf, mtzf)
     step = min(0.4, D.f_obs().d_min() / 4)
     #
     print("-" * 79, file=log)
     print("A-2013, all defaults (except set binning)", file=log)
     f_mask = mosaic.get_f_mask(xrs=D.xray_structure,
                                ma=D.f_obs(),
                                step=D.f_obs().d_min() / 4)
     self.fmodel_2013 = get_fmodel(o=D,
                                   f_mask=f_mask,
                                   remove_outliers=True,
                                   log=self.log).fmodel
     #
     # Compute masks and F_masks (Mosaic)
     print("-" * 79, file=log)
     print("Mosaic", file=log)
     self.mm = mosaic.mosaic_f_mask(xray_structure=D.xray_structure,
                                    step=step,
                                    volume_cutoff=volume_cutoff,
                                    f_obs=self.fmodel_2013.f_obs(),
                                    f_calc=self.fmodel_2013.f_calc(),
                                    log=log)
     #
     if (self.mm.do_mosaic):
         #
         print("-" * 79, file=log)
         print("A-2013, step=0.4A", file=log)
         f_mask_04 = mosaic.get_f_mask(xrs=D.xray_structure,
                                       ma=self.fmodel_2013.f_obs(),
                                       step=step)
         o = get_fmodel(o=self.fmodel_2013,
                        f_mask=f_mask_04,
                        remove_outliers=False,
                        log=self.log)
         self.fmodel_2013_04 = o.fmodel
         self.mc_whole_mask = o.mc
         #
         self.fmodel_largest_mask = None
         self.mc_largest_mask = None
         if (self.mm.f_mask_0 is not None):
             print("-" * 79, file=log)
             print("A-2013, step=0.4A, using largest mask only", file=log)
             o = get_fmodel(o=self.fmodel_2013,
                            f_mask=self.mm.f_mask_0,
                            remove_outliers=False,
                            log=self.log)
             self.fmodel_largest_mask = o.fmodel
             self.mc_largest_mask = o.mc
         #
         print("-" * 79, file=log)
         print(
             "A-2013, step=0.4A, filtered mask (no small/negative volumes)",
             file=log)
         f_mask_fil = self.mm.FV.keys()[0].data()
         for fm in self.mm.FV.keys()[1:]:
             f_mask_fil = f_mask_fil + fm.data()
         f_mask_fil = self.mm.FV.keys()[0].set().array(data=f_mask_fil)
         o = get_fmodel(o=self.fmodel_2013,
                        f_mask=f_mask_fil,
                        remove_outliers=False,
                        log=self.log)
         self.fmodel_filtered = o.fmodel
         self.mc_filtered = o.mc