当前位置: 首页>>代码示例>>Python>>正文


Python CharonSession.seqrun_delete方法代码示例

本文整理汇总了Python中ngi_pipeline.database.classes.CharonSession.seqrun_delete方法的典型用法代码示例。如果您正苦于以下问题:Python CharonSession.seqrun_delete方法的具体用法?Python CharonSession.seqrun_delete怎么用?Python CharonSession.seqrun_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ngi_pipeline.database.classes.CharonSession的用法示例。


在下文中一共展示了CharonSession.seqrun_delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_charon_entries_from_project

# 需要导入模块: from ngi_pipeline.database.classes import CharonSession [as 别名]
# 或者: from ngi_pipeline.database.classes.CharonSession import seqrun_delete [as 别名]

#.........这里部分代码省略.........
            else:
                update_failed=True
                LOG.error(e)
                continue
        for libprep in sample:
            if delete_existing:
                LOG.warn('Deleting existing libprep "{}"'.format(libprep))
                try:
                    charon_session.libprep_delete(projectid=project.project_id,
                                                  sampleid=sample.name,
                                                  libprepid=libprep.name)
                except CharonError as e:
                    LOG.warn('Could not delete libprep "{}": {}'.format(libprep, e))
            try:
                qc = "PASSED"
                LOG.info('Creating libprep "{}" with qc status "{}"'.format(libprep, qc))
                charon_session.libprep_create(projectid=project.project_id,
                                              sampleid=sample.name,
                                              libprepid=libprep.name,
                                              qc=qc)
                LOG.info(('Project/sample/libprep "{}/{}/{}" created in '
                          'Charon').format(project, sample, libprep))
            except CharonError as e:
                if e.status_code == 400:
                    if force_overwrite:
                        LOG.warn('Overwriting data for project "{}" / '
                                 'sample "{}" / libprep "{}"'.format(project, sample,
                                                                     libprep))
                        charon_session.libprep_update(projectid=project.project_id,
                                                      sampleid=sample.name,
                                                      libprepid=libprep.name,
                                                      qc=qc)
                        LOG.info(('Project/sample/libprep "{}/{}/{}" updated in '
                                  'Charon').format(project, sample, libprep))
                    else:
                        LOG.debug(e)
                        LOG.info('Project "{}" / sample "{}" / libprep "{}" already '
                                 'exists; moving to libpreps'.format(project, sample, libprep))
                else:
                    update_failed=True
                    LOG.error(e)
                    continue
            for seqrun in libprep:
                if delete_existing:
                    LOG.warn('Deleting existing seqrun "{}"'.format(seqrun))
                    try:
                        charon_session.seqrun_delete(projectid=project.project_id,
                                                     sampleid=sample.name,
                                                     libprepid=libprep.name,
                                                     seqrunid=seqrun.name)
                    except CharonError as e:
                        update_failed=True
                        LOG.error('Could not delete seqrun "{}": {}'.format(seqrun, e))
                try:
                    alignment_status="NOT_RUNNING"
                    LOG.info('Creating seqrun "{}" with alignment_status "{}"'.format(seqrun, alignment_status))
                    charon_session.seqrun_create(projectid=project.project_id,
                                                 sampleid=sample.name,
                                                 libprepid=libprep.name,
                                                 seqrunid=seqrun.name,
                                                 alignment_status=alignment_status,
                                                 total_reads=0,
                                                 mean_autosomal_coverage=0)
                    LOG.info(('Project/sample/libprep/seqrun "{}/{}/{}/{}" '
                              'created in Charon').format(project, sample,
                                                          libprep, seqrun))
                except CharonError as e:
                    if e.status_code == 400:
                        if force_overwrite:
                            LOG.warn('Overwriting data for project "{}" / '
                                     'sample "{}" / libprep "{}" / '
                                     'seqrun "{}"'.format(project, sample,
                                                          libprep, seqrun))
                            charon_session.seqrun_update(projectid=project.project_id,
                                                         sampleid=sample.name,
                                                         libprepid=libprep.name,
                                                         seqrunid=seqrun.name,
                                                         alignment_status=alignment_status,
                                                         total_reads=0,
                                                         mean_autosomal_coverage=0)
                            LOG.info(('Project/sample/libprep/seqrun "{}/{}/{}/{}" '
                                      'updated in Charon').format(project, sample,
                                                                  libprep, seqrun))
                        else:
                            LOG.info('Project "{}" / sample "{}" / libprep "{}" / '
                                     'seqrun "{}" already exists; next...'.format(project, sample,
                                                                                  libprep, seqrun))
                    else:
                        update_failed=True
                        LOG.error(e)
                        continue

    if update_failed :
        if retry_on_fail:
            create_charon_entries_from_project(project, best_practice_analysis=best_practice_analysis,
                                       sequencing_facility=sequencing_facility,
                                       force_overwrite=force_overwrite, delete_existing=delete_existing,
                                       retry_on_fail=False)
        else:
            raise CharonError("A network error blocks Charon updating.")
开发者ID:Galithil,项目名称:ngi_pipeline,代码行数:104,代码来源:filesystem.py


注:本文中的ngi_pipeline.database.classes.CharonSession.seqrun_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。