Esempio n. 1
0
def model_contour(p,res=4.0,emmap=False,t=-1.):
  blurrer = StructureBlurrer()
  modelmap = blurrer.gaussian_blur_real_space(p, res,densMap=emmap,normalise=True) 
  c1 = None
  if t != -1.0:
    c1 = t*emmap.std()#0.0
  return modelmap,c1
Esempio n. 2
0
def blur_model(p,res=4.0,emmap=False):
  pName = os.path.basename(p).split('.')[0]
  print 'reading the model'
  structure_instance=PDBParser.read_PDB_file(pName,p,hetatm=False,water=False)
  print 'filtering the model'
  blurrer = StructureBlurrer()
  if res is None: sys.exit('Map resolution required..')
  #emmap = blurrer.gaussian_blur(structure_instance, res,densMap=emmap_1,normalise=True)
  modelmap = blurrer.gaussian_blur_real_space(structure_instance, res,sigma_coeff=0.187,densMap=emmap,normalise=True) 
  return pName,modelmap, structure_instance
Esempio n. 3
0
def blur_model(p, res=4.0, emmap=False):
    pName = os.path.basename(p).split('.')[0]
    structure_instance = PDBParser.read_PDB_file(pName,
                                                 p,
                                                 hetatm=False,
                                                 water=False)
    blurrer = StructureBlurrer()
    if res is None:
        sys.exit('Map resolution required..')
    modelmap = blurrer.gaussian_blur_real_space(structure_instance,
                                                res,
                                                densMap=emmap,
                                                normalise=True)
    return pName, modelmap
Esempio n. 4
0
    def _ccc(self, mapname, modelname, res):
        path_test = "./"
        m = os.path.join(path_test, mapname)
        emmap1 = MapParser.readMRC(m)
        p = os.path.join(path_test, modelname)
        structure_instance = PDBParser.read_PDB_file('pdbfile',
                                                     p,
                                                     hetatm=False,
                                                     water=False)
        blurrer = StructureBlurrer()

        t = 1.5
        c1 = None
        c2 = None
        #calculate map contour
        zeropeak, ave, sigma1 = emmap1._peak_density()
        if not zeropeak is None: c1 = zeropeak + (t * sigma1)

        mt = 0.1
        if res > 20.0: mt = 2.0
        elif res > 10.0: mt = 1.0
        elif res > 6.0: mt = 0.5

        #emmap2 = blurrer.gaussian_blur(structure_instance, res, densMap=emmap1)
        emmap2 = blurrer.gaussian_blur_real_space(structure_instance,
                                                  res,
                                                  sigma_coeff=0.187,
                                                  densMap=emmap1,
                                                  normalise=True)

        # calculate model contour - emmap1 apparently?
        c2 = mt * emmap2.std()

        sc = ScoringFunctions()
        _, ovr = sc.CCC_map(emmap1, emmap2, c1, c2, 3, cmode=False)
        ccc, _ = sc.CCC_map(emmap1, emmap2, c1, c2, cmode=False)

        print("Printing CCC", ccc, ovr, c1, c2)

        return (ccc, ovr)