Changeset 3239 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Jan 23, 2018 9:51:03 AM (7 years ago)
Author:
vondreele
Message:

implement use of 2-site disordered amino acid residues in proteins:
1.read disordered residues from PDB files - atoms are interleaved in disordered residues
2.draw disordered residues with no "cross" bonds
3.apply residue rigid body to each disordered residue - makes RB entry for each
4.create restraints for disordered residues - bonds, angles, planes, chiral volumes, torsions & Ramachandran restraints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIphsGUI.py

    r3234 r3239  
    10361036    Styles = []
    10371037    Radii = []
     1038    Names = []
    10381039    for atom in atomData:
    10391040        Atoms.append(np.array(atom[cx:cx+3]))
    10401041        Styles.append(atom[cs])
     1042        Names.append(ord(atom[ct-1].ljust(4)[3]))
    10411043        try:
    10421044            if not hydro and atom[ct] == 'H':
     
    10481050    Atoms = np.array(Atoms)
    10491051    Radii = np.array(Radii)
    1050     IASR = zip(Indx,Atoms,Styles,Radii)
    1051     for atomA in IASR:
     1052    Names = np.array(Names)
     1053    IASRN = zip(Indx,Atoms,Styles,Radii,Names)
     1054    for atomA in IASRN:
    10521055        if atomA[2] in ['lines','sticks','ellipsoids','balls & sticks','polyhedra']:
    10531056            Dx = Atoms-atomA[1]
    10541057            dist = ma.masked_less(np.sqrt(np.sum(np.inner(Amat,Dx)**2,axis=0)),0.5) #gets rid of G2frame & disorder "bonds" < 0.5A
     1058            if generalData['Type'] == 'macromolecular':     #eliminate cross disorder residue bonds
     1059                m1 = ma.getmask(dist)
     1060                if atomA[4] in [ord('A'),]:
     1061                    m2 = ma.getmask(ma.masked_equal(Names,ord('B')))
     1062                    dist = ma.array(dist,mask=ma.mask_or(m1,m2))
     1063                if atomA[4] in [ord('B'),]:
     1064                    m2 = ma.getmask(ma.masked_equal(Names,ord('A')))
     1065                    dist = ma.array(dist,mask=ma.mask_or(m1,m2))
    10551066            sumR = atomA[3]+Radii
    10561067            IndB = ma.nonzero(ma.masked_greater(dist-data['Drawing']['radiusFactor']*sumR,0.))                 #get indices of bonded atoms
     
    73207331        wx.BeginBusyCursor()
    73217332        try:
     7333            isave = 0
    73227334            while iatm < len(Atoms):
    73237335                atom = Atoms[iatm]
     
    73317343                VAR = rbRes['rbXYZ'][rbRef[1]]-rbRes['rbXYZ'][rbRef[0]]
    73327344                VBR = rbRes['rbXYZ'][rbRef[2]]-rbRes['rbXYZ'][rbRef[0]]
     7345                incr = 1
     7346                isave = 0
     7347                if 'N  A' in atom[3]:   #disordered residue - read every other atom
     7348                    isave = iatm+1
     7349                    incr = 2
     7350                if 'N  B' in atom[3]:
     7351                    incr = 2
    73337352                rbObj = {'RBname':rbRes['RBname']+':'+str(rbRes['useCount']),'numChain':numChain}
    73347353                rbAtoms = []
     
    73377356                    rbAtoms.append(np.array(Atoms[iatm][cx:cx+3]))
    73387357                    rbIds.append(Atoms[iatm][20])
    7339                     iatm += 1    #puts this at beginning of next residue?
     7358                    iatm += incr    #puts this at beginning of next residue?
     7359                if 'N  B' in atom[3]:   #end of disorder - reset next atom position
     7360                    iatm -= 1
     7361                    incr = 1
    73407362                Orig = rbAtoms[rbRef[0]]
    73417363                rbObj['RBId'] = RBIds[res]
     
    73717393                rbRes['useCount'] += 1
    73727394                RBObjs.append(rbObj)
     7395                if isave:
     7396                    iatm = isave
    73737397            data['RBModels']['Residue'] = RBObjs
    73747398            for RBObj in RBObjs:
Note: See TracChangeset for help on using the changeset viewer.