Changeset 2964
- Timestamp:
- Aug 7, 2017 8:18:52 AM (6 years ago)
- Location:
- branch/2frame
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASIImath.py
r2957 r2964 2584 2584 'LEU','LYS','MET','PHE','PRO','SER','THR','TRP','TYR','VAL','MSE'] 2585 2585 # data taken from erratv2.ccp 2586 lmt = np.array([17.190823041860433,11.526684477428809])2587 2586 b1 = np.array([ [0,0,0,0,0,0], 2588 2587 [0, 5040.279078850848200, 3408.805141583649400, 4152.904423767300600, 4236.200004171890200, 5054.781210204625500], … … 2624 2623 chainIntAct = [] 2625 2624 res = [] 2625 resNames = [] 2626 resname = [] 2626 2627 newChain = True 2627 2628 intact = {'CC':0,'CN':0,'CO':0,'NN':0,'NO':0,'OO':0,'NC':0,'OC':0,'ON':0} … … 2632 2633 resIntAct.append(sumintact(intact)) 2633 2634 chainIntAct.append(resIntAct) 2635 resNames += resname 2634 2636 res = [] 2637 resname = [] 2635 2638 resIntAct = [] 2636 2639 intact = {'CC':0,'CN':0,'CO':0,'NN':0,'NO':0,'OO':0,'NC':0,'OC':0,'ON':0} … … 2638 2641 if atom[0] not in res: #new residue, get residue no. 2639 2642 res.append(atom[0]) 2643 resname.append('%s-%s%s'%(atom[2],atom[0],atom[1])) 2640 2644 if not newChain: 2641 2645 resIntAct.append(sumintact(intact)) … … 2658 2662 mult = 2.*(3.75-dsqt) 2659 2663 intype = atom[4].strip()+cartAtoms[tgt][4].strip() 2660 intact[intype] += mult 2664 intact[intype] += mult 2665 resNames += resname 2661 2666 resIntAct.append(sumintact(intact)) 2662 2667 chainIntAct.append(resIntAct) … … 2665 2670 IntAct = chainIntAct[ich] 2666 2671 nRes = len(IntAct) 2667 Probs = [ ]2672 Probs = [0.,0.,0.,0.] 2668 2673 for i in range(4,nRes-4): 2669 2674 mtrx = np.zeros(6) … … 2671 2676 for j in range(i-4,i+4): 2672 2677 summ += np.sum(np.array(IntAct[j].values())) 2678 print 'CC',IntAct[j]['CC'],'CN',IntAct[j]['CN'],'CO',IntAct[j]['CO'] 2679 print 'NN',IntAct[j]['NN'],'NO',IntAct[j]['NO'],'OO',IntAct[j]['OO'] 2673 2680 mtrx[1] += IntAct[j]['CC'] 2674 2681 mtrx[2] += IntAct[j]['CN'] … … 2678 2685 mtrx /= summ 2679 2686 mtrx -= avg 2680 prob = np.inner(np.inner(mtrx,b1),mtrx) 2687 prob = np.inner(np.inner(mtrx,b1),mtrx)/36. 2688 print i, mtrx 2681 2689 Probs.append(prob) 2682 chainProb.append(Probs) 2683 2684 2685 print 'Do VALIDPROTEIN analysis - TBD' 2686 2690 Probs += 4*[0.,] 2691 chainProb += Probs 2692 return resNames,chainProb 2687 2693 2688 2694 ################################################################################ -
branch/2frame/GSASIIphsGUI.py
r2956 r2964 2103 2103 line3Sizer.Add(slope,0,WACV) 2104 2104 elif 'Basin Hopping' in MCSAdata['Algorithm']: 2105 pass #TODO basinhopping controls here 2105 pass #TODO basinhopping controls here? 2106 2106 mcsaSizer.Add(line3Sizer) 2107 2107 mcsaSizer.Add((5,5),) … … 3291 3291 3292 3292 def OnValidProtein(event): 3293 G2mth.validProtein(data) 3293 resNames,Probs = G2mth.validProtein(data) 3294 G2plt.PlotAAProb(G2frame,resNames,Probs,Title='Error score for %s'%(data['General']['Name']), 3295 thresh=[17.190823041860433,11.526684477428809]) 3294 3296 3295 3297 def OnSetAll(event): -
branch/2frame/GSASIIplot.py
r2945 r2964 3085 3085 else: 3086 3086 Page.canvas.draw() 3087 3088 ################################################################################ 3089 ##### PlotHist 3090 ################################################################################ 3091 def PlotAAProb(G2frame,resNames,Probs,Title='',thresh=None,newPlot=True): 3092 3093 3094 global xylim 3095 def OnMotion(event): 3096 xpos = event.xdata 3097 if xpos: #avoid out of frame mouse position 3098 ypos = int(event.ydata) 3099 Page.canvas.SetCursor(wx.CROSS_CURSOR) 3100 try: 3101 if 0 <= ypos < len(resNames): 3102 G2frame.G2plotNB.status.SetStatusText('Residue: %s score: %.2f'%(resNames[ypos],xpos),1) 3103 except TypeError: 3104 G2frame.G2plotNB.status.SetStatusText('Select AA error plot first',1) 3105 3106 def Draw(): 3107 global xylim 3108 Plot.clear() 3109 Plot.set_title(Title) 3110 Plot.set_xlabel(r'Error score',fontsize=14) 3111 Plot.set_ylabel(r'Residue',fontsize=14) 3112 colors=['b','r','g','c','m','k'] 3113 Plot.barh(np.arange(len(resNames)),Probs,tick_label=resNames,) 3114 if thresh is not None: 3115 for item in thresh: 3116 Plot.axvline(item,dashes=(5,5),picker=False) 3117 if not newPlot: 3118 Page.toolbar.push_current() 3119 Plot.set_xlim(xylim[0]) 3120 Plot.set_ylim(xylim[1]) 3121 xylim = [] 3122 Page.toolbar.push_current() 3123 Page.toolbar.draw() 3124 Page.canvas.draw() 3125 else: 3126 Page.canvas.draw() 3127 3128 3129 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(Title,'mpl') 3130 Page.Offset = [0,0] 3131 if not new: 3132 if not newPlot: 3133 xylim = lim 3134 else: 3135 newPlot = True 3136 # Page.canvas.mpl_connect('key_press_event', OnKeyPress) 3137 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 3138 Page.Offset = [0,0] 3139 Page.Choice = None 3140 3141 Draw() 3087 3142 3088 3143 ################################################################################ -
branch/2frame/GSASIIstrIO.py
r2935 r2964 2226 2226 hapDict[pfx+name] = hapData['HStrain'][0][i] 2227 2227 HSvals.append(hapDict[pfx+name]) 2228 if hapData['HStrain'][1][i] and not hapDict[pfx+'LeBail']: 2228 if hapData['HStrain'][1][i]: 2229 # if hapData['HStrain'][1][i] and not hapDict[pfx+'LeBail']: 2229 2230 hapVary.append(pfx+name) 2230 2231 controlDict[pfx+'poType'] = hapData['Pref.Ori.'][0]
Note: See TracChangeset
for help on using the changeset viewer.