def create_cases(config_data, jsons): '''Create cases from list of jsons.''' print("== Create cases from new json format ==") case_objs = progress_bar("Create cases")(lambda json_file: case.Case( json_file, vcf_path=config_data.input["vcf"]))(jsons) print("Correcting transcripts with mutalyzer") case_objs = multiprocess("Fetch hgvs", touch_hgvs, case_objs) MUTALYZER_INST.correct_reference_transcripts(case_objs) print("Creating pickle.") if config_data.dump_intermediate: with open('case_cleaned.p', 'wb') as pfile: pickler.CasePickler(pfile).dump(case_objs, ) return case_objs
def save_vcfs(config_data, qc_cases): '''Create VCF files from genetic information and create a config.yml listing all vcf files. ''' simulated = config_data.output["simulated_vcf_path"] realvcf = config_data.output["real_vcf_path"] config_path = config_data.output["vcf_config_file"] progress_bar("Generate VCF")( lambda x: x.put_hgvs_vcf(simulated, recreate=False))( [case for (valid, _), case in qc_cases if valid]) print("Pickling vcf cases") if config_data.dump_intermediate: with open('qc_case_with_simulated_vcf.p', 'wb') as pfile: pickler.CasePickler(pfile).dump(qc_cases) create_config(config_path, simulated, realvcf) return qc_cases