def analyseTitDB(self, DB, col, names=None): """Extract titdb pKas""" import matplotlib.pyplot as plt plt.rc('font',size=28) plt.rc('savefig',dpi=300) plt.rc('axes',linewidth=.5) #plt.rc('text',usetex=True) nuclnames = {'1H NMR':'H','15N NMR':'N'} t = TitrationAnalyser() #extract reliable pkas from selected proteins #p = t.extractpKas(DB, col, names=names, titratable=False, reliable=False, minspan=0.06) #t.analysepKas(p) t.compareNuclei(DB, '15N NMR', '1H NMR', names=names, titratable=True) return
def showAnalysis(self): """Analysis of current pKas""" from PEATDB.Ekin.Titration import TitrationAnalyser self.showHeader(menu=1) DB = self.DB = self.connect() t = TitrationAnalyser() print '<div class="main">' print '<p>Selected plots below reflect some of the analysis shown in the \ <a href="%s/paper_2010.pdf"> original paper</a> updated for the current dataset. </p>' %self.bindir print '<a>The distributions shown are of the change in chemical shift over all\ detected titrations. `Reliable` pKas are those associated with\ the largest chemical shift changes in a titration curve and that meets the criteria defined in\ the paper. We define primary pKa values simply as the subset of the reliable pKa values \ that originate from titration curves with with only one titration.</a>' sys.stdout.flush() colnames = ['1H NMR','15N NMR','13C NMR'] for col in colnames: p = t.extractpKas(DB,col,silent=True,minspan=0.06) print '<div>' print "<h2>%s: Distribution of Δδ for fitted pKa values</h2>" %col img1 = t.analysepKas(p, silent=True, prefix=col, path=self.imagepath) #t.makepKasTable(p) print '<img src="%s/%s" align=center width=800 class="plot">' %(self.plotsdir, img1) print '</div>' sys.stdout.flush() #compare nuclei img2, img3 = t.compareNuclei(DB, '15N NMR', '1H NMR', titratable=False, silent=True, path=self.imagepath) print '<p>Below is an analysis of the correspondence between fitted pKas for 1H and 15N \ where they are available for the same residue in the same protein. This is the same\ plot as figure 4 in the original paper updated for the current dataset.\ The plots are divided into reliable and other pKas for comparison.</p>' print '<div>' print '<center><img src="%s/%s" align=center width=600 class="plot"></center>' %(self.plotsdir, img2) print '</div>' print '<p>The same plot as above broken down by residue type and shown only for titratable\ residues.</p>' print '<div>' print '<center><img src="%s/%s" align=center width=600 class="plot"></center>' %(self.plotsdir, img3) print '</div>' self.footer() return