Commit 10badf91 authored by Carine Rey's avatar Carine Rey
Browse files

get more info from simus

parent e51ad99e
......@@ -170,6 +170,8 @@ for leaf in NonConvLeaves:
ConvAA_l = [0] * n_sites #A = nb AA in ConvLeaves
NonConvAA_l = [0] * n_sites #A = nb AA in NonConvLeaves
OnlyConvAA = [0] * n_sites #A = nb AA only in ConvLeaves
OnlyNonConvAA = [0] * n_sites #C = nb AA only in NonConvLeaves
OnlyNonConv_ConvAA = [0] * n_sites #B = nb AA only in (NonConvLeaves AND ConvLeaves)
......@@ -183,16 +185,20 @@ for i in range(n_sites):
logger.debug(NonConv_AA_per_site_l[i])
logger.debug(NonConvAA)
ConvAA_l[i] = len(ConvAA)
NonConvAA_l[i] = len(NonConvAA)
OnlyConvAA[i] = len(ConvAA - NonConvAA)
OnlyNonConvAA[i] = len(NonConvAA - ConvAA)
OnlyNonConv_ConvAA[i] = len(ConvAA.intersection(NonConvAA))
df_final = pd.DataFrame({'Sites': Sites,
'NbConvAA' : ConvAA_l,
'NbNonConvAA' : NonConvAA_l,
'NbOnlyConvAA' : OnlyConvAA,
'NbOnlyNonConvAA' : OnlyNonConvAA,
'NbCommonAA' : OnlyNonConv_ConvAA})
df_final = df_final[["Sites","NbOnlyConvAA","NbOnlyNonConvAA","NbCommonAA"]]
df_final = df_final[["Sites","NbConvAA","NbNonConvAA","NbOnlyConvAA","NbOnlyNonConvAA","NbCommonAA"]]
#===================================================================================================
# Read profile info per site table
......
......@@ -68,14 +68,30 @@ plotC = ggplot(df, aes(x=NbOnlyNonConvAA, fill=hyp)) + theme_bw() + labs(x=x_lab
plotC = plotC + geom_histogram(binwidth = 0.05)
plotC = plotC + facet_grid(hyp ~ tree)
plot_all <- plot_grid(plotA, plotB, plotC,
labels=c("AUTO"), nrow = 3)
alpha = 0.7
x_labs = " # of AA in ConvLeaves"
y_labs = "# of sites"
plotD = ggplot(df, aes(x=NbConvAA, fill=hyp)) + theme_bw() + labs(x=x_labs, y=y_labs)
plotD = plotD + geom_histogram(binwidth = 0.05)
plotD = plotD + facet_grid(hyp ~ tree)
alpha = 0.7
x_labs = " # of AA in NonConvLeaves"
y_labs = "# of sites"
plotE = ggplot(df, aes(x=NbnonConvAA, fill=hyp)) + theme_bw() + labs(x=x_labs, y=y_labs)
plotE = plotE + geom_histogram(binwidth = 0.05)
plotE = plotE + facet_grid(hyp ~ tree)
plot_all <- plot_grid(plotA, plotB, plotC, plotD, plotE,
labels=c("AUTO"), nrow = 5)
output_pdf = paste0(opt$out,".pdf")
save_plot(output_pdf,
plot_all,
ncol = 0.8 * length(unique(df$tree)),
nrow = 0.35 * length(unique(df$hyp)) * 3,
nrow = 0.35 * length(unique(df$hyp)) * 5,
base_aspect_ratio = 2,
limitsize = FALSE
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment