示例#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)
    def test_create_charon_entries_from_project(self):
        # Create the NGIObjects
        project_obj = NGIProject(name=self.p_name,
                                 dirname=self.p_name,
                                 project_id=self.p_id,
                                 base_path=self.p_bp)
        sample_obj = project_obj.add_sample(name=self.s_id, dirname=self.s_id)
        libprep_obj = sample_obj.add_libprep(name=self.l_id, dirname=self.l_id)
        seqrun_obj = libprep_obj.add_seqrun(name=self.sr_id,
                                            dirname=self.sr_id)

        try:
            # Create them in the db
            create_charon_entries_from_project(project_obj)
        finally:
            charon_session = CharonSession()
            charon_session.project_delete(project_obj.project_id)
示例#3
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)
示例#4
0
    def test_create_charon_entries_from_project(self):
        # Create the NGIObjects
        project_obj = NGIProject(name=self.p_name,
                                 dirname=self.p_name,
                                 project_id=self.p_id,
                                 base_path=self.p_bp)
        sample_obj = project_obj.add_sample(name=self.s_id,
                                            dirname=self.s_id)
        libprep_obj = sample_obj.add_libprep(name=self.l_id,
                                             dirname=self.l_id)
        seqrun_obj = libprep_obj.add_seqrun(name=self.sr_id,
                                            dirname=self.sr_id)

        try:
        # Create them in the db
            create_charon_entries_from_project(project_obj)
        finally:
            charon_session = CharonSession()
            charon_session.project_delete(project_obj.project_id)