figure.null_shared_response.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:microbiomeHD 作者: cduvallet 项目源码 文件源码
def plot_null(fnull, fcore, ax=None):
    """
    Plot the null shared response overlayed with the actual number of
    shared responders.
    """
    null = pd.read_csv(fnull, sep='\t')
    core = pd.read_csv(fcore, sep='\t', index_col=0)
    ncore = core.groupby('overall').size()

    for i in [-1, 0, 1]:
        if i not in ncore:
            ncore.loc[i] = 0

    order = ['health', 'mixed', 'disease']

    if ax is None:
        fig, ax = plt.subplots()

    sns.stripplot(data=null, x='type', y='n', order=order, jitter=True, ax=ax, alpha=0.2)

    ax.scatter([0, 1, 2], [ncore.loc[-1], ncore.loc[0], ncore.loc[1]],
               c='k', marker='D', s=25, zorder=10)

    return ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号