Esempio n. 1
0
    def _chromosomes_plot_aesthetics(self, ax, genome):
        plt.gcf().set_size_inches(self.FIGSIZE)

        max_len = genome["chr_length"].max()
        hide_spines_and_ticks(ax)

        ax.title.set_fontsize(16)
        ax.title.set_fontweight("bold")

        ax.set_xlabel("Autosoma")
        ax.set_xlim([0, 23])
        ax.set_xticks(genome.index)
        ax.set_xticklabels(genome.index, rotation=0, fontsize=14)

        ax.yaxis.labelpad = 15
        ax.xaxis.labelpad = 15

        ax.set_ylim([0, max_len * 1.05])
        ax.set_ylabel("Posición (Mb)", )
        yinterval = 10**7
        yticks = np.arange(0, max_len + yinterval, yinterval) // 1
        yticks = [t for t in yticks if t % (50*10**6) == 0]
        ax.set_yticks(yticks)
        yticklabels = np.arange(0, max_len + yinterval, yinterval) // 10**6
        ax.set_yticklabels([l for l in yticklabels if l % 50 == 0])
        ax.legend(loc="best", scatterpoints=1)

        return ax
Esempio n. 2
0
    def _pca_plot_aesthetics(self, ax):
        plot_helpers.hide_spines_and_ticks(ax, spines="all")
        ax.tick_params(axis="x", bottom="off", top="off", labelbottom="off")
        ax.tick_params(axis="y", left="off", right="off", labelleft="off")
        grey_spines(ax)

        return ax
    def _ternary_plot_aesthetics(self, tax, title, df):
        hide_spines_and_ticks(tax.get_axes(), spines="all")
        tax.boundary(linewidth=0.25)
        tax.clear_matplotlib_ticks()
        tax.set_title(title, position=(0.5, 1.15))
        tax.legend(frameon=False,  scatterpoints=1, bbox_to_anchor=(0.975, 1.125))
        tax.bottom_axis_label(df.columns[0], position=(1, 0, 0), rotation=0)
        tax.right_axis_label(df.columns[1], position=(-0.1, 1.2, -0.1), rotation=0)
        tax.left_axis_label(df.columns[2], position=(0, 0, 1), rotation=0)

        return tax
Esempio n. 4
0
    def _boxplot_aesthetics(self, ax, legend_on=False):
        title = "\n".join(["MAF promedio por población"])
        ax.set_title(title, y=1.08, fontweight="bold")
        ax.set_ylabel("Frecuencia del alelo menor")
        ax.set_xlabel("")

        ax.yaxis.labelpad = ax.xaxis.labelpad = 15
        ax.legend(loc="upper left", bbox_to_anchor=(0.8, 1.29),
                  frameon=True)
        ax.legend_.get_frame().set_facecolor("white")

        ax.yaxis.grid(linestyle="dotted")
        hide_spines_and_ticks(ax)
Esempio n. 5
0
    def _boxplot_aesthetics(self, ax):
        ax.set_title("Distancia media entre AIMs", y=1.08, fontweight="bold")

        ax.set_ylabel("Distancia (Mpb)")
        ax.set_xlabel("Cromosoma")

        y_range = np.array(ax.get_yticks())
        ax.set_yticklabels([int(y) for y in y_range // 10**6])

        ax.yaxis.labelpad = ax.xaxis.labelpad = 15

        ax.yaxis.grid(linestyle="dotted")
        hide_spines_and_ticks(ax)