Ejemplo n.º 1
0
          "metadata":metadata,
          "metadata_labels":metadata_labels,
          "picard":args.input_picard,
          "picard_ext":args.input_picard_extension}


# listing all expected input files
input_desc+=files.SixteenS.list_file_path_description("",input_files)


if not args.exclude_workflow_info:
    templates += [utilities.get_package_file("workflow_info")]


# add the document to the workflow
doc_task=workflow.add_document(
    templates=templates,
    depends=methoddepends, 
    targets=workflow.name_output_files("16S_report."+args.format),
    vars=methodvars,
    table_of_contents=True)

# add an archive of the document and figures, removing the log file
# the archive will have the same name and location as the output folder
workflow.add_archive(
    depends=[args.output,doc_task],
    targets=args.output+".zip",
    remove_log=True)

# start the workflow
workflow.go()
Ejemplo n.º 2
0
templates = [
    utilities.get_package_file("header"),
    utilities.get_package_file("stats")
]

# add the document to the workflow
doc_task = workflow.add_document(
    templates=templates,
    depends=maaslin_tasks + stratified_plots_tasks + [taxonomic_profile] +
    additional_stats_tasks,
    targets=workflow.name_output_files("stats_report." + args.format),
    vars={
        "title": "Stats Report",
        "project": args.project_name,
        "introduction_text": args.introduction_text,
        "taxonomic_profile": taxonomic_profile,
        "maaslin_tasks_info": maaslin_tasks_info,
        "bypass_maaslin": args.bypass_maaslin,
        "stratified_pathways_plots": stratified_pathways_plots,
        "permanova_plots": permanova_plots,
        "beta_diversity_plots": beta_diversity_plots,
        "covariate_equation": covariate_equation,
        "format": args.format
    },
    table_of_contents=True)

# add an archive of the document and figures, removing the log file
# the archive will have the same name and location as the output folder
workflow.add_archive(depends=[args.output, doc_task],
                     targets=args.output + ".zip",
                     remove_log=True)
doc_task = workflow.add_document(
    templates=templates,
    depends=[wmgx_qc_counts, wmtx_qc_counts, taxonomic_profile, pathabundance],
    targets=workflow.name_output_files("wmgx_wmtx_report." + args.format),
    vars={
        "title":
        "Metagenome and Metatranscriptome Report",
        "project":
        args.project_name,
        "introduction_text":
        args.introduction_text,
        "dna_read_counts":
        wmgx_qc_counts,
        "rna_read_counts":
        wmtx_qc_counts,
        "dna_aligned_read_counts":
        files.ShotGun.path("humann2_read_counts",
                           wmgx_input_folder,
                           none_if_not_found=True),
        "rna_aligned_read_counts":
        files.ShotGun.path("humann2_read_counts",
                           wmtx_input_folder,
                           none_if_not_found=True),
        "dna_feature_counts":
        files.ShotGun.path("feature_counts",
                           wmgx_input_folder,
                           none_if_not_found=True),
        "rna_feature_counts":
        files.ShotGun.path("feature_counts",
                           wmtx_input_folder,
                           none_if_not_found=True),
        "taxonomic_profile":
        taxonomic_profile,
        "dna_pathabundance":
        pathabundance,
        "genefamilies_norm_ratio":
        files.ShotGun.path("genefamilies_norm_ratio",
                           args.input,
                           none_if_not_found=True),
        "ecs_norm_ratio":
        files.ShotGun.path("ecs_norm_ratio",
                           args.input,
                           none_if_not_found=True),
        "paths_norm_ratio":
        files.ShotGun.path("paths_norm_ratio",
                           args.input,
                           none_if_not_found=True),
        "format":
        args.format,
        "log":
        log_file
    },
    table_of_contents=True)
Ejemplo n.º 4
0
    os.path.join(args.output, 'data', os.path.basename(files + "_backup"))
    for files in multiple_input_files
]
workflow.add_task_group(
    "cp [depends[0]] [targets[0]]",  #Command 
    depends=[multiple_input_files],  #Tracking executable dependencies
    targets=output_files)  #Output target directory


# private python function definition
def remove_end_tabs_function(task):
    with open(task.targets[0].name, 'w') as file_handle_out:
        for line in open(task.depends[0].name):
            file_handle_out.write(line.rstrip() + "\n")


# Task4 add_task  - AnADAMA2 example to usage of python task function
workflow.add_task(
    remove_end_tabs_function,  #Calling the python function  
    depends=args.input,  #Tracking executable dependencies
    targets=args.output + "/data/data.tsv.notabs",  #Target output
    name="remove_end_tabs")

#Task5 Add the document to the workflow
pdf_report = os.path.join(os.getcwd(), args.output, "pdfReport.pdf")
workflow.add_document(templates="doc/template.py",
                      targets=pdf_report,
                      vars={"introduction_text": "Demo Title"})

# Run the workflow
workflow.go()
Ejemplo n.º 5
0
    templates += [utilities.get_package_file("workflow_info")]
    log_file = files.Workflow.path("log", args.input, error_if_not_found=True)

# add the document to the workflow
doc_task = workflow.add_document(
    templates=templates,
    depends=[
        qc_counts, taxonomic_profile, pathabundance, read_counts,
        feature_counts
    ],
    targets=workflow.name_output_files("wmgx_report." + args.format),
    vars={
        "title": "Metagenome Report",
        "project": args.project_name,
        "introduction_text": args.introduction_text,
        "dna_read_counts": qc_counts,
        "taxonomic_profile": taxonomic_profile,
        "dna_pathabundance": pathabundance,
        "dna_ecabundance": ecsabundance,
        "read_counts": read_counts,
        "feature_counts": feature_counts,
        "format": args.format,
        "log": log_file,
        "metadata": metadata,
        "metadata_labels": metadata_labels
    },
    table_of_contents=True)

# add an archive of the document and figures, removing the log file
# the archive will have the same name and location as the output folder
workflow.add_archive(depends=[args.output, doc_task],