def test_simple(self): file = "/Users/franklinmichael/source/janis/janis/examples/echo.py" engine = Toil("simple-test") env = Environment("toil-local", engine, LocalFileScheme()) fromjanis( file, env=env, # dryrun=True, hints=None, validation_reqs=None, )
def test_whole_genome_germline_pmac(self): file = "/Users/franklinmichael/janis-search-path/wg-germline-30x-pmac.py" print( fromjanis( file, validation_reqs=ValidationRequirements( truthVCF= "/researchers/jiaan.yu/WGS_pipeline/germline/GIAB_NA12878/high_conf_calls/normalised_files/high_conf.norm.vcf", intervals= "/researchers/jiaan.yu/WGS_pipeline/germline/GIAB_NA12878/test_cases/test2_WGS_30X/other_files/WGS_30X.bed", reference= "/bioinf_core/Proj/hg38_testing/Resources/Gatk_Resource_Bundle_hg38/hg38_contigs_renamed/Homo_sapiens_assembly38.fasta", fields=[ "variants_gatk", "variants_vardict", "variants_strelka", "combinedVariants", ], ), env="pmac", hints={CaptureType.key(): CaptureType.THIRTYX}, dryrun=True, # inputs="/Users/franklinmichael/janis-search-path/wgs-30x-additional-inputs.json", watch=False, ))
def test_somatic(self): file = "/Users/franklinmichael/source/janis-examplepipelines/workflows/somatic_pipeline.py" fromjanis( file, validation_reqs=None, # validation_reqs=ValidationRequirements( # truthVCF="/researchers/jiaan.yu/WGS_pipeline/germline/GIAB_NA12878/high_conf_calls/normalised_files/high_conf.norm.vcf", # intervals="/researchers/jiaan.yu/WGS_pipeline/germline/GIAB_NA12878/test_cases/test2_WGS_30X/other_files/WGS_30X.bed", # reference="/bioinf_core/Proj/hg38_testing/Resources/Gatk_Resource_Bundle_hg38/hg38_contigs_renamed/Homo_sapiens_assembly38.fasta", # fields=["variants_gatk", "variants_vardict", "variants_strelka", "combinedVariants"] # ), env="local-connect", hints={CaptureType.key(): CaptureType.TARGETED}, # dryrun=True, # inputs="wgs-30x-additional-inputs.json" )
def test_whole_genome_germline_gcp(self): file = "/Users/franklinmichael/janis-search-path/wg-germline-30x-gcp.py" print( fromjanis( file, validation_reqs=ValidationRequirements( truthVCF="gs://peter-mac-cromwell/reference/gold.vcf", intervals="gs://peter-mac-cromwell/reference/WGS_30X.bed", reference= "gs://peter-mac-cromwell/reference/assembly_contigs_renamed/Homo_sapiens_assembly38.fasta", fields=["variants_gatk"], ), env="gcp", hints={CaptureType.key(): CaptureType.THIRTYX}, dryrun=True, inputs= "/Users/franklinmichael/janis-search-path/wgs-30x-additional-inputs.json", watch=False, ))
def do_run(args): jc = JanisConfiguration.initial_configuration(args.config) validation_reqs, batchrun_reqs = None, None if args.validation_fields: Logger.info("Will prepare validation") validation_reqs = ValidationRequirements( truthVCF=args.validation_truth_vcf, reference=args.validation_reference, fields=args.validation_fields, intervals=args.validation_intervals, ) if args.batchrun: Logger.info("Will prepare batch run") batchrun_reqs = BatchRunRequirements(fields=args.batchrun_fields, groupby=args.batchrun_groupby) hints = { k[5:]: v for k, v in vars(args).items() if k.startswith("hint_") and v is not None } # the args.extra_inputs parameter are inputs that we MUST match # we'll need to parse them manually and then pass them to fromjanis as requiring a match required_inputs = parse_additional_arguments(args.extra_inputs) inputs = args.inputs or [] # we'll manually suck "inputs" out of the extra parms, otherwise it's actually really # annoying if you forget to put the inputs before the workflow positional argument. # TBH, we could automatically do this for all params, but it's a little trickier if "inputs" in required_inputs: ins = required_inputs.pop("inputs") inputs.extend(ins if isinstance(ins, list) else [ins]) if "i" in required_inputs: ins = required_inputs.pop("i") inputs.extend(ins if isinstance(ins, list) else [ins]) keep_intermediate_files = args.keep_intermediate_files is True db_config = jc.cromwell.get_database_config_helper() if args.mysql: db_config.should_manage_mysql = True if args.no_database: db_config.skip_database = True if args.development: # no change for using mysql, as a database is the default keep_intermediate_files = True JanisConfiguration.manager().cromwell.call_caching_enabled = True wid = fromjanis( args.workflow, name=args.name, validation_reqs=validation_reqs, batchrun_reqs=batchrun_reqs, engine=args.engine, filescheme=args.filescheme, hints=hints, output_dir=args.output_dir, inputs=inputs, required_inputs=required_inputs, filescheme_ssh_binding=args.filescheme_ssh_binding, cromwell_url=args.cromwell_url, watch=args.progress, max_cores=args.max_cores, max_mem=args.max_memory, force=args.no_cache, recipes=args.recipe, keep_intermediate_files=keep_intermediate_files, run_in_background=(args.background is True), run_in_foreground=(args.foreground is True), dbconfig=db_config, only_toolbox=args.toolbox, no_store=args.no_store, allow_empty_container=args.allow_empty_container, check_files=not args.skip_file_check, container_override=parse_container_override_format( args.container_override), ) Logger.info("Exiting") raise SystemExit