experiment.py 文件源码

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

项目:Enrich2 作者: FowlerLab 项目源码 文件源码
def calc_shared(self, label):
        """
        Get the subset of scores that are shared across all Selections in each
        Condition.
        """
        if self.check_store("/main/{}/scores_shared".format(label)):
            return

        idx = pd.IndexSlice

        logging.info("Identifying subset shared across all Selections ({})"
                     "".format(label), extra={'oname': self.name})
        data = self.store.select("/main/{}/scores_shared_full".format(label))

        # identify variants found in all selections in at least one condition
        complete = np.full(len(data.index), False, dtype=bool)
        for cnd in data.columns.levels[0]:
            complete = np.logical_or(complete,
                                     data.loc[:, idx[cnd, :, :]].notnull().all(
                                         axis='columns'))

        data = data.loc[complete]

        self.store.put("/main/{}/scores_shared".format(label), data,
                       format="table")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号