Browse Source

Ok likelihood swp2

tforest 5 months ago
parent
commit
23fef174f2
1 changed files with 13 additions and 15 deletions
  1. 13 15
      swp2.py

+ 13 - 15
swp2.py View File

@@ -288,7 +288,6 @@ def plot_all_epochs_thetafolder(folder_path, mu, tgen, title = "Title", theta_sc
288 288
         plt.title(title)
289 289
         plt.savefig(title+'_b'+str(breaks)+'.pdf')
290 290
     # plot likelihood against nb of breakpoints
291
-
292 291
     # best possible likelihood from SFS
293 292
     # Segregating sites
294 293
     S = sum(SFS_stored)
@@ -390,20 +389,19 @@ def plot_test_theta(folder_path, mu, tgen, title = "Title", theta_scale = True,
390 389
         for i in range(0, len(x)):
391 390
             T += y[i] / (x[i]*(x[i]-1))
392 391
             x_2.append(T)
393
-    # Plotting (fig 2)
394
-    plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks')
395
-    plt.xlabel("# breaks")
396
-    plt.ylabel("theta")
397
-    plt.legend(loc='upper right')
398
-    plt.savefig(title+'_test'+str(k)+'.pdf')
399
-
400
-    # Plotting (fig 3) which is the same but log scale for x
401
-    plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks')
402
-    plt.xscale('log')
403
-    plt.xlabel("# breaks")
404
-    plt.ylabel("theta")
405
-    plt.legend(loc='upper right')
406
-    plt.savefig(title+'_test'+str(k)+'_log.pdf')
392
+        # Plotting (fig 2)
393
+        plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks')
394
+        plt.xlabel("# breaks")
395
+        plt.ylabel("theta")
396
+        plt.legend(loc='upper right')
397
+        plt.savefig(title+'_test'+str(k)+'.pdf')
398
+        # Plotting (fig 3) which is the same but log scale for x
399
+        plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks')
400
+        plt.xscale('log')
401
+        plt.xlabel("# breaks")
402
+        plt.ylabel("theta")
403
+        plt.legend(loc='upper right')
404
+        plt.savefig(title+'_test'+str(k)+'_log.pdf')
407 405
 
408 406
 def save_multi_image(filename):
409 407
     pp = PdfPages(filename)