Ejemplo n.º 1
0
            bplot = plt.boxplot([rdmavals, rdmbvals, corrvals],
                                showfliers=False,
                                positions=pos,
                                patch_artist=True,
                                widths=config['go_boxplot_width'],
                                medianprops=medianprops,
                                boxprops=boxprops,
                                whiskerprops=whiskerprops,
                                capprops=capprops,
                                flierprops=flierprops)
            colors = [
                config['rdm_a_boxplot_color'], config['rdm_b_boxplot_color'],
                config['fc_path_boxplot_color']
            ]
            utils.plot_significances_paths([rdmavals, rdmbvals, corrvals],
                                           pos,
                                           no_fliers=True)
            for patch, color in zip(bplot['boxes'], colors):
                patch.set_facecolor(color)

            pos = pos + 3
        if groups.shape[0] > 2:
            plt.xticks(range(1, 3 * groups.shape[0] + 1),
                       create_labels(groups.group_label.tolist()))
        else:
            plt.xticks(range(1, 3 * groups.shape[0] + 1),
                       create_labels(groups.group_label.tolist()))
        for lnx in np.arange(3.5, groups.shape[0] * 3, 3):
            plt.axvline(lnx, linestyle=':', color='lightgray')
    else:
        plt.text(0, 0, 'No control group', fontsize=15, ha='center')
    [asthma_pneumonia_disease, asthma_ipf_disease, asthma_copd_disease_4302],
    showfliers=False,
    positions=pos,
    patch_artist=True,
    widths=config['go_boxplot_width'],
    medianprops=medianprops,
    boxprops=boxprops,
    whiskerprops=whiskerprops,
    capprops=capprops,
    flierprops=flierprops)
colors = [
    config['pneumonia_boxplot_color'], config['ipf_boxplot_color'],
    config['fc_path_boxplot_color']
]
utils.plot_significances_paths(
    [asthma_pneumonia_disease, asthma_ipf_disease, asthma_copd_disease_4302],
    pos,
    no_fliers=True)
for patch, color in zip(bplot['boxes'], colors):
    patch.set_facecolor(color)

plt.xticks(range(1, 4), labels)
plt.ylabel('Sequential coexpression', fontsize=12)
plt.title('SC in asthmatic patients (GSE4302)')
plt.tight_layout()

if not args.dry:
    plt.savefig(out_file)

if not args.no_show:
    plt.show()
Ejemplo n.º 3
0
    capprops = {'linewidth': 1.}
    medianprops = {'color': 'red', 'linewidth': 1.5, 'zorder': 6}
    flierprops = {'marker': 'o', 'markeredgecolor': 'lightgray', 'zorder': 3}
    bplot = plt.boxplot([typea_seqsims[i], typeb_seqsims[i], obs_seqsims[i]],
                        positions=pos,
                        showfliers=False,
                        patch_artist=True,
                        widths=0.3,
                        medianprops=medianprops,
                        boxprops=boxprops,
                        whiskerprops=whiskerprops,
                        capprops=capprops,
                        flierprops=flierprops)

    utils.plot_significances_paths(
        [typea_seqsims[i], typeb_seqsims[i], obs_seqsims[i]],
        delta_ratio=30,
        no_fliers=True)
    colors = ['lightblue', 'lightblue', 'lightcoral']
    for patch, color in zip(bplot['boxes'], colors):
        patch.set_facecolor(color)
    labels = ['Rdm\n(Type A)', 'Rdm\n(Type B)', 'FC paths']
    plt.xticks(pos, labels, fontsize=10)
    plt.gca().tick_params(axis='both', which='major', labelsize=5)
    # plt.ylabel('Sequential GO similarity', fontsize=13);
    # plt.ylim([None,9.3])
    plt.title(ylbl_short[i], fontsize=7)
plt.suptitle('Sequential similarity of similar disease pairs',
             fontsize=20,
             y=1.02)
plt.tight_layout()
    [copd_pneumonia_disease, copd_ipf_disease, asthma_copd_disease_57148],
    showfliers=False,
    positions=pos,
    patch_artist=True,
    widths=config['go_boxplot_width'],
    medianprops=medianprops,
    boxprops=boxprops,
    whiskerprops=whiskerprops,
    capprops=capprops,
    flierprops=flierprops)
colors = [
    config['pneumonia_boxplot_color'], config['ipf_boxplot_color'],
    config['fc_path_boxplot_color']
]
utils.plot_significances_paths(
    [copd_pneumonia_disease, copd_ipf_disease, asthma_copd_disease_57148],
    pos,
    no_fliers=True)
for patch, color in zip(bplot['boxes'], colors):
    patch.set_facecolor(color)

plt.xticks(range(1, 4), labels)
plt.ylabel('Sequential coexpression', fontsize=12)
plt.title('SC in COPD patients (GSE57148)')
plt.tight_layout()
if not args.dry:
    plt.savefig(out_file)

if not args.no_show:
    plt.show()