def plotQuantile(df, kde): import Util as utl quantiles = np.sort(np.append(np.linspace(0.0, 1, 1000)[:-1], np.linspace(0.999, 1, 10))) qq = pd.concat([utl.getQantilePvalues(df.COMALE, kde, quantiles=quantiles), utl.getQantilePvalues(df.COMALENC, kde, quantiles=quantiles)], axis=1); qq.columns = ['data', 'null']; QQPval(qq, fname=utl.paperFiguresPath + 'qq.pdf')
def real(): G = pd.read_pickle(utl.outpath + 'real/real.replicates.uptoF59.maxLikelihoods.regularized.LowCovRemoved.df'); G = G.s * (G.alt - G.null) R = pd.read_pickle(utl.outpath + 'real/real.replicates.uptoF59.df'); F=pd.read_pickle(utl.outpath+'real/negativeControl.Simulations.maxLikelihoods.regularized.df');F=F.s*(F.alt-F.null) kde=utl.getDensity(F,width=100) q = np.sort(np.append(np.linspace(0.0, 1, 100)[:-1], np.linspace(0.999, 1, 1000))) qq=pd.concat([utl.getQantilePvalues(G,kde,quantiles=q),utl.getQantilePvalues(F,kde,quantiles=q)],axis=1);qq.columns=['data','null']; pplt.QQPval(qq, fname=utl.paperFiguresPath + 'qq.pdf') reload(pplt)
def Simulation(): a=pd.read_pickle('{}ROC/{}.df'.format(utl.outpath, 'COMALE'));a=a.s*(a.alt-a.null); pos=a.loc[(0.1,'COMALE',0.1,1,0)];neg=a.loc[(0.005,'COMALE',0.0,-1,0)] F=pd.read_pickle(utl.outpath+'real/negativeControl.Simulations.maxLikelihoods.regularized.df').loc[0];F=F.s*(F.alt-F.null) q=np.linspace(0,1,1200) kde=utl.getDensity(F,width=50) qq=pd.concat([utl.getQantilePvalues(pos,kde,quantiles=q),utl.getQantilePvalues(neg,kde,quantiles=q)],axis=1);qq.columns=['data','null']; pplt.QQPval(qq) plt.savefig(utl.paperFiguresPath + 'qqsim.pdf')