Beispiel #1
0
    def build_report(self, params, reads_refs, alignments, alignment_set=None):
        """
        Builds and uploads the HISAT2 report.
        """
        report_client = KBaseReport(self.callback_url)
        report_text = None
        created_objects = list()
        for k in alignments:
            created_objects.append({
                "ref":
                alignments[k]["ref"],
                "description":
                "Reads {} aligned to Genome {}".format(k, params["genome_ref"])
            })
        if alignment_set is not None:
            created_objects.append({
                "ref": alignment_set,
                "description": "Set of all new alignments"
            })

        report_text = "Created {} alignments from the given alignment set.".format(
            len(alignments))

        qm = kb_QualiMap(self.callback_url, service_ver='dev')
        qc_ref = alignment_set
        if qc_ref is None:  # then there's only one alignment...
            qc_ref = alignments[alignments.keys()[0]]["ref"]
        bamqc_params = {"create_report": 0, "input_ref": qc_ref}
        result = qm.run_bamqc(bamqc_params)
        index_file = None
        for f in os.listdir(result["qc_result_folder_path"]):
            if f.endswith(".html"):
                index_file = f
        if index_file is None:
            raise RuntimeError(
                "QualiMap failed - no HTML file was found in the generated output."
            )
        html_zipped = package_directory(self.callback_url,
                                        result["qc_result_folder_path"],
                                        index_file, 'QualiMap Results')
        report_params = {
            "message": report_text,
            "direct_html_link_index": 0,
            "html_links": [html_zipped],
            "report_object_name": "QualiMap-" + str(uuid.uuid4()),
            "workspace_name": params["ws_name"],
            "objects_created": created_objects
        }

        report_info = report_client.create_extended_report(report_params)
        return report_info
Beispiel #2
0
 def __init__(self, config):
     self.ws_url = config["workspace-url"]
     self.callback_url = config['SDK_CALLBACK_URL']
     self.token = config['KB_AUTH_TOKEN']
     self.shock_url = config['shock-url']
     self.scratch = config['scratch']
     self.srv_wiz_url = config['srv-wiz-url']
     self.ws = Workspace(self.ws_url, token=self.token)
     self.bt = kb_Bowtie2(self.callback_url)
     self.rau = ReadsAlignmentUtils(self.callback_url)
     self.qualimap = kb_QualiMap(self.callback_url)
     self.ru = ReadsUtils(self.callback_url)
     self.dfu = DataFileUtil(self.callback_url)
     self.set_client = SetAPI(self.srv_wiz_url)
Beispiel #3
0
    def __init__(self, scratch_dir, workspace_url, callback_url, srv_wiz_url, provenance):
        self.workspace_url = workspace_url
        self.callback_url = callback_url
        self.srv_wiz_url = srv_wiz_url
        self.au = AssemblyUtil(self.callback_url)
        self.dfu = DataFileUtil(self.callback_url, service_ver='beta')
        self.scratch = scratch_dir
        self.working_dir = scratch_dir
        self.prog_runner = Program_Runner(self.STAR_BIN, self.scratch)
        self.provenance = provenance
        self.ws_client = Workspace(self.workspace_url)

        self.parallel_runner = KBParallel(self.callback_url)
        self.qualimap = kb_QualiMap(self.callback_url, service_ver='dev')
        self.set_api_client = SetAPI(self.srv_wiz_url, service_ver='dev')
        self.eu = ExpressionUtils(self.callback_url, service_ver='beta')
    def __init__(self, scratch_dir, workspace_url, callback_url, srv_wiz_url, provenance):
        self.scratch_dir = scratch_dir
        self.workspace_url = workspace_url
        self.callback_url = callback_url
        self.srv_wiz_url = srv_wiz_url
        self.provenance = provenance

        # from the provenance, extract out the version to run by exact hash if possible
        self.my_version = 'release'
        if len(provenance) > 0:
            if 'subactions' in provenance[0]:
                self.my_version = self.get_version_from_subactions('kb_Bowtie2', provenance[0]['subactions'])
        print('Running kb_Bowtie2 version = ' + self.my_version)

        self.ws = Workspace(self.workspace_url)
        self.bowtie2 = Bowtie2Runner(self.scratch_dir)
        self.parallel_runner = KBParallel(self.callback_url)
        self.qualimap = kb_QualiMap(self.callback_url)
Beispiel #5
0
    def __init__(self, config, provenance):
        self.config = config
        self.workspace_url = config['workspace-url']
        self.callback_url = os.environ['SDK_CALLBACK_URL']
        self.scratch = config['scratch']
        self.srv_wiz_url = config['srv-wiz-url']
        self.parallel_runner = KBParallel(self.callback_url)
        self.provenance = provenance
        self.star_utils = STARUtils(self.scratch, self.workspace_url,
                                    self.callback_url, self.srv_wiz_url,
                                    provenance)
        self.set_api_client = SetAPI(self.srv_wiz_url, service_ver='dev')
        self.qualimap = kb_QualiMap(self.callback_url, service_ver='dev')
        self.star_idx_dir = None
        self.star_out_dir = None

        # from the provenance, extract out the version to run by exact hash if possible
        self.my_version = 'release'
        if len(provenance) > 0:
            if 'subactions' in provenance[0]:
                self.my_version = self.get_version_from_subactions(
                    'kb_STAR', provenance[0]['subactions'])
        print('Running kb_STAR version = ' + self.my_version)