def args_runner(args): # UNTESTED -- and needs update for DAZZ_DB -- but never used anyway log.info("Starting {f}".format(f=os.path.basename(__file__))) filtered_subreads = args.filtered_subreads_fasta filtered_longreads = args.filtered_longreads_fasta #??? corrected_reads = args.corrected_reads length_cutoff = args.length_cutoff genome_length = args.genome_length output_json = args.output_json cfg = { 'length_cutoff': length_cutoff, } report_dict = stats_preassembly.make_dict( corrected_reads, filtered_subreads, genome_length, length_cutoff, ) report = produce_report(**report_dict) log.info(report) with open(output_json, 'w') as f: log.info("Writing report to {!r}.".format(output_json)) f.write(report) return 0
def for_task( i_length_cutoff_fn, i_json_config_fn, i_preads_fofn_fn, i_raw_reads_db_fn, # maybe symlinked o_json_fn, ): """This is used by HGAP4, run_report_preassembly_yield(). See pbfalcon.tusks """ tasks_dir = os.path.dirname(os.path.dirname(i_json_config_fn)) cfg = _get_cfg(i_json_config_fn, i_length_cutoff_fn) genome_length = int(cfg.get('genome_size', 0)) # different name in falcon length_cutoff = cfg['length_cutoff'] i_raw_reads_db_fn = os.path.realpath(i_raw_reads_db_fn) report_dict = stats_preassembly.calc_dict( i_preads_fofn_fn, i_raw_reads_db_fn, genome_length, length_cutoff, ) report = produce_report(**report_dict) with open(o_json_fn, 'w') as ofs: log.info("Writing report to {!r}:\n{}".format(o_json_fn, report)) ofs.write(report)
def args_runner(args): # UNTESTED -- and needs update for DAZZ_DB -- but never used anyway log.info("Starting {f}".format(f=os.path.basename(__file__))) filtered_subreads = args.filtered_subreads_fasta filtered_longreads = args.filtered_longreads_fasta #??? corrected_reads = args.corrected_reads length_cutoff = args.length_cutoff genome_length = args.genome_length output_json = args.output_json cfg = { 'length_cutoff': length_cutoff, } report_dict = falcon_polish.stats_preassembly.make_dict( corrected_reads, filtered_subreads, genome_length, length_cutoff, ) report = produce_report(**report_dict) log.info(report) with open(output_json, 'w') as f: log.info("Writing report to {!r}.".format(output_json)) f.write(report) return 0
def for_task( i_json_config_fn, i_preads_fofn_fn, i_raw_reads_db_fn, # maybe symlinked o_json_fn, ): """This is used by HGAP4, run_report_preassembly_yield(). See pbfalcon.tusks """ tasks_dir = os.path.dirname(os.path.dirname(i_json_config_fn)) i_length_cutoff_fn = os.path.join(tasks_dir, 'falcon_ns.tasks.task_falcon0_build_rdb-0', 'length_cutoff') cfg = _get_cfg(i_json_config_fn, i_length_cutoff_fn) genome_length = int(cfg.get('genome_size', 0)) # different name in falcon length_cutoff = cfg['length_cutoff'] i_raw_reads_db_fn = os.path.realpath(i_raw_reads_db_fn) report_dict = stats_preassembly.calc_dict( i_preads_fofn_fn, i_raw_reads_db_fn, genome_length, length_cutoff, ) report = produce_report(**report_dict) with open(o_json_fn, 'w') as ofs: log.info("Writing report to {!r}:\n{}".format(o_json_fn, report)) ofs.write(report)
def write_report_from_stats(stats_ifs, report_ofs): """This is used by HGAP5, task_run_hgap.py. """ stats = json.loads(stricter_json(stats_ifs.read())) report = produce_report(**stats) report_ofs.write(report)