Changeset 2859 for trunk/GSASIImath.py


Ignore:
Timestamp:
Jun 6, 2017 7:49:22 AM (6 years ago)
Author:
vondreele
Message:

partial implementation of protein check function - not done yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r2858 r2859  
    26092609        Boxes[box[0],box[1],box[2],0] += 1
    26102610        Boxes[box[0],box[1],box[2],Boxes[box[0],box[1],box[2],0]] = ib
    2611     pstat = 0.
    2612     stat = 0.
    2613     mtrxstat = 0.
    2614     for ia,atom in cartAtoms:
    2615         if not i:   #skip 1st atom
     2611    indices = (-1,0,1)
     2612    Units = np.array([[h,k,l] for h in indices for k in indices for l in indices])
     2613    dsmax = 3.75**2
     2614    for ia,atom in enumerate(cartAtoms):
     2615        if atom[3].strip() in ['C','N']:    #skip main chain C & N atoms
    26162616            continue
    2617         if atom[0] != cartAtom[ia-1][0]:    #new residue - start analysis
    2618             c = np.zeros((3,3))
    2619             s = 1
    2620    
     2617        ibox = iBox[ia]         #box location of atom
     2618        tgts = []
     2619        for unit in Units:
     2620            jbox = ibox+unit
     2621            if np.all(jbox>=0) and np.all((jbox-nbox[:3])<0):               
     2622                tgts += list(Boxes[jbox[0],jbox[1],jbox[2]])
     2623        tgts = list(set(tgts))
     2624        tgts = [tgt for tgt in tgts if atom[1:3] != cartAtoms[tgt][1:3]]    #exclude same residue
     2625        tgts = [tgt for tgt in tgts if cartAtoms[tgt][3].strip() not in ['C','N']]  #exclude main chain
     2626        tgts = [tgt for tgt in tgts if np.sum((XYZ[ia]-XYZ[tgt])**2) <= dsmax]
     2627           
     2628       
    26212629    print 'Do VALIDPROTEIN analysis - TBD'
    26222630           
Note: See TracChangeset for help on using the changeset viewer.