Ejemplo n.º 1
0
    def test_workflows(self):
        config_file_path = locate_ngi_config()
        config = load_yaml_config(config_file_path)

        for workflow_name, workflow_dict in config.get("test_data", {}).get(
                "workflows", {}).iteritems():
            # Load and rewrite config file as needed
            customize_config_dict = workflow_dict.get("customize_config")
            if customize_config_dict:
                config = update_dict(config, customize_config_dict)

            #self._install_test_files(workflow_dict)
            LOG.info(
                'Starting test analysis pipeline for workflow "{}"'.format(
                    workflow_name))
            try:
                local_files = workflow_dict["local_files"]
            except KeyError:
                raise ValueError(
                    "Required paths to input files for testing do not"
                    "exist in config file (test_data.workflows."
                    "{}.local_files); cannot proceed.".format(workflow_name))
            try:
                flowcell_path = local_files["flowcell"]
            except KeyError:
                raise ValueError(
                    "Path to flowcell is required and not specified "
                    "in configuration file (test_data.workflows."
                    "{}.local_files.flowcell); cannot proceed.".format(
                        workflow_name))
            try:
                test_project = workflow_dict["test_project"]
                test_proj_id = test_project["project_id"]
                test_proj_name = test_project["project_name"]
                test_proj_bpa = test_project["bpa"]
            except KeyError as e:
                raise ValueError(
                    "Test project information is missing from config "
                    "file (under test_data.workflows.{}.test_project "
                    "({}); cannot proceed.".format(workflow_name, e.msg))
            charon_session = CharonSession(config=config)
            try:
                charon_session.project_delete(projectid=test_proj_id)
            except CharonError:
                pass
            charon_session.project_create(projectid=test_proj_id,
                                          name=test_proj_name,
                                          status="OPEN",
                                          best_practice_analysis=test_proj_bpa)

            process_demultiplexed_flowcells([flowcell_path],
                                            fallback_libprep="A",
                                            config=config)
Ejemplo n.º 2
0
    def test_workflows(self):
        config_file_path = locate_ngi_config()
        config = load_yaml_config(config_file_path)

        for workflow_name, workflow_dict in config.get("test_data", {}).get("workflows", {}).iteritems():
            # Load and rewrite config file as needed
            customize_config_dict = workflow_dict.get("customize_config")
            if customize_config_dict:
                config = update_dict(config, customize_config_dict)

            #self._install_test_files(workflow_dict)
            LOG.info('Starting test analysis pipeline for workflow "{}"'.format(workflow_name))
            try:
                local_files = workflow_dict["local_files"]
            except KeyError:
                raise ValueError("Required paths to input files for testing do not"
                                 "exist in config file (test_data.workflows."
                                 "{}.local_files); cannot proceed.".format(workflow_name))
            try:
                flowcell_path = local_files["flowcell"]
            except KeyError:
                raise ValueError("Path to flowcell is required and not specified "
                                 "in configuration file (test_data.workflows."
                                 "{}.local_files.flowcell); cannot proceed.".format(workflow_name))
            try:
                test_project = workflow_dict["test_project"]
                test_proj_id = test_project["project_id"]
                test_proj_name = test_project["project_name"]
                test_proj_bpa = test_project["bpa"]
            except KeyError as e:
                raise ValueError("Test project information is missing from config "
                                 "file (under test_data.workflows.{}.test_project "
                                 "({}); cannot proceed.".format(workflow_name, e.msg))
            charon_session = CharonSession(config=config)
            try:
                charon_session.project_delete(projectid=test_proj_id)
            except CharonError:
                pass
            charon_session.project_create(projectid=test_proj_id, name=test_proj_name,
                                          status="OPEN", best_practice_analysis=test_proj_bpa)

            process_demultiplexed_flowcells([flowcell_path], fallback_libprep="A",
                                            config=config)
    # Finally execute corresponding functions

    ## Analyze Flowcell
    if "analyze_fc_dirs" in args:
        LOG.info(
            "Starting flowcell analysis of flowcell {} "
            "{}".format(inflector.plural("directory", len(args.analyze_fc_dirs)), ", ".join(args.analyze_fc_dirs))
        )
        flowcell.process_demultiplexed_flowcells(
            args.analyze_fc_dirs,
            args.restrict_to_projects,
            args.restrict_to_samples,
            args.restart_failed_jobs,
            args.restart_finished_jobs,
            args.restart_running_jobs,
            keep_existing_data=args.keep_existing_data,
            no_qc=args.no_qc,
            quiet=args.quiet,
            manual=True,
            generate_bqsr_bam=args.generate_bqsr_bam,
        )

    ## Analyze Project
    elif "analyze_project_dirs" in args:
        for analyze_project_dir in args.analyze_project_dirs:
            try:
                project_dir = locate_project(analyze_project_dir)
            except ValueError as e:
                LOG.error(e)
                continue
Ejemplo n.º 4
0
                validate_dangerous_user_thing("delete existing data in Charon")


    # Finally execute corresponding functions

    ## Analyze Flowcell
    if 'analyze_fc_dirs' in args:
        LOG.info('Starting flowcell analysis of flowcell {} '
                 '{}'.format(inflector.plural("directory", len(args.analyze_fc_dirs)),
                             ", ".join(args.analyze_fc_dirs)))
        flowcell.process_demultiplexed_flowcells(args.analyze_fc_dirs,
                                                 args.restrict_to_projects,
                                                 args.restrict_to_samples,
                                                 args.restart_failed_jobs,
                                                 args.restart_finished_jobs,
                                                 args.restart_running_jobs,
                                                 keep_existing_data=args.keep_existing_data,
                                                 no_qc=args.no_qc,
                                                 quiet=args.quiet,
                                                 manual=True,
                                                 generate_bqsr_bam=args.generate_bqsr_bam)

    ## Analyze Project
    elif 'analyze_project_dirs' in args:
        for analyze_project_dir in args.analyze_project_dirs:
            try:
                project_dir = locate_project(analyze_project_dir)
            except ValueError as e:
                LOG.error(e)
                continue
            project_obj = \