def _create_mapping_stats_gmap_report(self):
        """
        Creates and returns a Mapping Stats gmap report
        """
        from pbreports.report.mapping_stats import to_report, bas_fofn_to_bas_files
        from test_pbreports_report_mapping_stats import _GMAP_DATA_DIR as datadir

        log.info(
            'Creating Mapping Stats gmap report using datadir {d}'.format(d=datadir))

        _to_p = lambda x: os.path.join(datadir, x)

        filtered_regions_fofn = _to_p('filtered_regions.fofn')
        filtered_summary = _to_p('filtered_summary.csv')
        input_fofn = _to_p('input.fofn')
        aligned_reads_cmph5 = _to_p('aligned_reads.cmp.h5')

        mode = "external"
        report_json = 'mapping_report.json'
        output_json = os.path.join(self._output_dir, 'mapping_report.json')
        bas_files = bas_fofn_to_bas_files(input_fofn)
        region_files = bas_fofn_to_bas_files(filtered_regions_fofn)

        report = to_report(bas_files, region_files,
                           aligned_reads_cmph5, report_json,
                           self._output_dir,
                           filter_summary_csv=filtered_summary,
                           mode=mode)

        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)
Beispiel #2
0
    def _create_mapping_stats_gmap_report(self):
        """
        Creates and returns a Mapping Stats gmap report
        """
        from pbreports.report.mapping_stats import to_report
        from test_pbreports_report_mapping_stats import _GMAP_DATA_DIR as datadir

        log.info('Creating Mapping Stats gmap report using datadir {d}'.format(
            d=datadir))

        _to_p = lambda x: os.path.join(datadir, x)

        filtered_regions_fofn = _to_p('filtered_regions.fofn')
        filtered_summary = _to_p('filtered_summary.csv')
        input_fofn = _to_p('input.fofn')
        aligned_reads_cmph5 = _to_p('aligned_reads.cmp.h5')

        mode = "external"
        report_json = 'mapping_report.json'
        output_json = os.path.join(self._output_dir, 'mapping_report.json')
        bas_files = fofn_to_files(input_fofn)
        region_files = fofn_to_files(filtered_regions_fofn)

        report = to_report(bas_files,
                           region_files,
                           aligned_reads_cmph5,
                           report_json,
                           self._output_dir,
                           filter_summary_csv=filtered_summary,
                           mode=mode)

        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)
    def _create_reads_of_insert_report(self):
        """
        Creates and returns a Reads of Insert report.
        """
        from pbreports.report.reads_of_insert import fofn_to_files, to_report
        from test_pbreports_report_reads_of_insert import _DATA_DIR as datadir
        log.info(
            'Creating reads_of_insert report using datadir {d}'.format(d=datadir))

        bas_files = fofn_to_files(os.path.join(datadir, 'reads_of_insert.fofn'))
        output_json = os.path.join(self._output_dir, 'reads_of_insert.json')
        report = to_report(bas_files, self._output_dir)
        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)
Beispiel #4
0
    def _create_reads_of_insert_report(self):
        """
        Creates and returns a Reads of Insert report.
        """
        from pbreports.report.reads_of_insert import to_report
        from test_pbreports_report_reads_of_insert import _DATA_DIR as datadir
        log.info('Creating reads_of_insert report using datadir {d}'.format(
            d=datadir))

        bas_files = fofn_to_files(os.path.join(datadir,
                                               'reads_of_insert.fofn'))
        output_json = os.path.join(self._output_dir, 'reads_of_insert.json')
        report = to_report(bas_files, self._output_dir)
        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)
Beispiel #5
0
    def _create_filter_subread_report(self):
        """
        Creates and returns a Filter Subreads report
        """
        from pbreports.report.filter_subread import to_report
        from test_pbreports_report_filter_subread import ROOT_DATA_DIR, _DATA_DIR_NAME
        datadir = os.path.join(ROOT_DATA_DIR, _DATA_DIR_NAME)
        log.info('Creating Filter subreads report using datadir {d}'.format(
            d=datadir))

        output_name = 'filter_subread.json'
        filtered_summary = os.path.join(datadir,
                                        'filtered_subread_summary.csv')
        output_json = os.path.join(self._output_dir, output_name)
        report = to_report(filtered_summary, self._output_dir)
        pformat(report)
        report.write_json(output_json)
        return self._deserialize_report(output_json)
    def _create_filter_subread_report(self):
        """
        Creates and returns a Filter Subreads report
        """
        from pbreports.report.filter_subread import to_report
        from test_pbreports_report_filter_subread import ROOT_DATA_DIR, _DATA_DIR_NAME
        datadir = os.path.join(ROOT_DATA_DIR, _DATA_DIR_NAME)
        log.info(
            'Creating Filter subreads report using datadir {d}'.format(d=datadir))

        output_name = 'filter_subread.json'
        filtered_summary = os.path.join(
            datadir, 'filtered_subread_summary.csv')
        output_json = os.path.join(self._output_dir, output_name)
        report = to_report(filtered_summary, self._output_dir)
        pformat(report)
        report.write_json(output_json)
        return self._deserialize_report(output_json)
    def _create_preassembly_report(self):
        """
        Creates and returns a Preassembly report.
        """
        from pbreports.report.preassembly import to_report
        from test_pbreports_report_preassembler import _DATA_DIR as datadir
        log.info(
            'Creating preassembly report using datadir {d}'.format(d=datadir))

        filtered_reads = os.path.join(datadir, 'filtered_subreads.fasta')
        filtered_longreads = os.path.join(datadir, 'filtered_longreads.fasta')
        corrected_reads = os.path.join(datadir, 'corrected.fasta')
        output_json = os.path.join(self._output_dir, 'preassembly_report.json')

        length_cutoff = 6000

        report = to_report(
            filtered_reads, filtered_longreads, corrected_reads, length_cutoff=None)
        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)
Beispiel #8
0
    def _create_preassembly_report(self):
        """
        Creates and returns a Preassembly report.
        """
        from pbreports.report.preassembly import to_report
        from test_pbreports_report_preassembler import _DATA_DIR as datadir
        log.info(
            'Creating preassembly report using datadir {d}'.format(d=datadir))

        filtered_reads = os.path.join(datadir, 'filtered_subreads.fasta')
        filtered_longreads = os.path.join(datadir, 'filtered_longreads.fasta')
        corrected_reads = os.path.join(datadir, 'corrected.fasta')
        output_json = os.path.join(self._output_dir, 'preassembly_report.json')

        length_cutoff = 6000

        report = to_report(filtered_reads,
                           filtered_longreads,
                           corrected_reads,
                           length_cutoff=None)
        pformat(report.to_dict())
        report.write_json(output_json)

        return self._deserialize_report(output_json)