def process_sample(data): """Finalize processing for a sample, potentially multiplexed. """ if data["config"]["algorithm"]["snpcall"]: logger.info("Finalizing variant calls: %s" % str(data["name"])) data["vrn_file"] = finalize_genotyper(data["vrn_file"], data["work_bam"], data["sam_ref"], data["config"]) logger.info("Calculating variation effects for %s" % str(data["name"])) ann_vrn_file, effects_file = variation_effects(data["vrn_file"], data["sam_ref"], data["genome_build"], data["config"]) if ann_vrn_file: data["vrn_file"] = ann_vrn_file data["effects_file"] = effects_file if data["config"]["algorithm"].get("transcript_assemble", False): data["tx_file"] = assemble_transcripts(data["work_bam"], data["sam_ref"], data["config"]) if data["sam_ref"] is not None: logger.info("Generating summary files: %s" % str(data["name"])) generate_align_summary(data["work_bam"], data["fastq2"] is not None, data["sam_ref"], data["name"], data["config"], data["dirs"]) return [[data]]
def postprocess_variants(data): """Provide post-processing of variant calls. """ if data["config"]["algorithm"]["snpcall"]: logger.info("Finalizing variant calls: %s" % str(data["name"])) data["vrn_file"] = finalize_genotyper(data["vrn_file"], data["work_bam"], data["sam_ref"], data["config"]) logger.info("Calculating variation effects for %s" % str(data["name"])) ann_vrn_file = variation_effects(data["vrn_file"], data["sam_ref"], data["genome_build"], data["config"]) if ann_vrn_file: data["vrn_file"] = ann_vrn_file return [[data]]