Changeset 3045


Ignore:
Timestamp:
Sep 4, 2017 12:46:53 PM (4 years ago)
Author:
vondreele
Message:

plot both protein vlidators (#2 still in erroe)
remove config value for choice - not needed

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3044 r3045  
    27122712                prob = np.inner(np.inner(mtrx,b1),mtrx)
    27132713            Probs.append(prob)
    2714             print i,prob
    27152714        Probs += 4*[0.,]
    27162715        chainProb += Probs
  • trunk/GSASIIphsGUI.py

    r3033 r3045  
    32913291       
    32923292    def OnValidProtein(event):
    3293         old = GSASIIpath.GetConfigValue('Old_protein_validator',True)
    3294         resNames,Probs = G2mth.validProtein(data,old)
    3295         if old:             #duplicate errat.f 
    3296             print 'Protein validation based on errat.f'
    3297             print 'Ref: Colovos, C. & Yeates, T.O. Protein Science 2, 1511-1519 (1991).'
    3298             print 'Residue error scores >6 for 5% & >8 for 1% likelihood of being correct'
    3299             G2plt.PlotAAProb(G2frame,resNames,Probs,Title='Error score for %s'%(data['General']['Name']),
    3300                 thresh=[8.0,6.0])
    3301         else:
    3302             print 'Protein validation based on erratv2.cpp; by D. Obukhov & T. Yeates'
    3303             print 'Ref: Colovos, C. & Yates, T.O. Protein Science 2, 1511-1519 (1991).'
    3304             print 'Residue error scores >11.5 for 5% & >17.2 for 1% likelihood of being correct'
    3305             G2plt.PlotAAProb(G2frame,resNames,Probs,Title='Error score for %s'%(data['General']['Name']),
    3306                 thresh=[17.191,11.527])
     3293        resNames,Probs1 = G2mth.validProtein(data,True)
     3294        resNames,Probs2 = G2mth.validProtein(data,False)
     3295        print 'Plot 1 is Protein validation based on errat.f'
     3296        print 'Ref: Colovos, C. & Yeates, T.O. Protein Science 2, 1511-1519 (1991).'
     3297        print 'Residue error scores >6 for 5% & >8 for 1% likelihood of being correct'
     3298        print 'Plot 2 is Protein validation based on erratv2.cpp; by D. Obukhov & T. Yeates'
     3299        print 'Ref: Colovos, C. & Yates, T.O. Protein Science 2, 1511-1519 (1991).'
     3300        print 'Residue error scores >11.5 for 5% & >17.2 for 1% likelihood of being correct'
     3301        print 'NB: this calc. still in error'
     3302        G2plt.PlotAAProb(G2frame,resNames,Probs1,Probs2,Title='Error score for %s'%(data['General']['Name']),
     3303            thresh=[[8.0,6.0],[17.191,11.527]])
    33073304
    33083305    def OnSetAll(event):
  • trunk/GSASIIplot.py

    r3042 r3045  
    31513151##### PlotHist
    31523152################################################################################
    3153 def PlotAAProb(G2frame,resNames,Probs,Title='',thresh=None,newPlot=True):
     3153def PlotAAProb(G2frame,resNames,Probs1,Probs2,Title='',thresh=None,newPlot=True):
    31543154
    31553155
     
    31703170        Plot.clear()
    31713171        Plot.set_title(Title)
    3172         Plot.set_xlabel(r'Error score',fontsize=14)
    3173         Plot.set_ylabel(r'Residue',fontsize=14)
    3174         try:
    3175             Plot.barh(np.arange(len(resNames)),Probs,tick_label=resNames,)
    3176         except AttributeError:  #tick_label not in mpl 1.4
    3177             Plot.barh(np.arange(len(resNames)),Probs)
     3172        Plot.set_axis_off()
     3173        Plot1 = Page.figure.add_subplot(211)
     3174        Plot1.set_xlabel(r'Error score 1',fontsize=14)
     3175        Plot1.set_ylabel(r'Residue',fontsize=14)
     3176        colors = list(np.where(np.array(Probs1)>thresh[0][1],'r','b'))
     3177        Plot1.barh(np.arange(len(resNames)),Probs1,color=colors,linewidth=0)
    31783178        if thresh is not None:
    3179             for item in thresh:
    3180                 Plot.axvline(item,dashes=(5,5),picker=False)
    3181         if not newPlot:
    3182             Page.toolbar.push_current()
    3183             Plot.set_xlim(xylim[0])
    3184             Plot.set_ylim(xylim[1])
    3185             xylim = []
    3186             Page.toolbar.push_current()
    3187             Page.toolbar.draw()
    3188             Page.canvas.draw()
    3189         else:
    3190             Page.canvas.draw()
     3179            for item in thresh[0]:
     3180                Plot1.axvline(item,dashes=(5,5),picker=False)
     3181        Plot2 = Page.figure.add_subplot(212)
     3182        Plot2.set_xlabel(r'Error score 2',fontsize=14)
     3183        Plot2.set_ylabel(r'Residue',fontsize=14)       
     3184        colors = list(np.where(np.array(Probs2)>thresh[1][1],'r','b'))
     3185        Plot2.barh(np.arange(len(resNames)),Probs2,color=colors,linewidth=0)
     3186        if thresh is not None:
     3187            for item in thresh[1]:
     3188                Plot2.axvline(item,dashes=(5,5),picker=False)
     3189        Page.canvas.draw()
    31913190   
    31923191    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(Title,'mpl')
Note: See TracChangeset for help on using the changeset viewer.