Repository: assemblerflow/flowcraft Branch: master Commit: 66cef2555892 Files: 328 Total size: 1.0 MB Directory structure: gitextract_0fzlskug/ ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── changelog.md ├── docker/ │ └── Dockerfile ├── docs/ │ ├── Makefile │ ├── _static/ │ │ └── custom.css │ ├── about/ │ │ └── about.rst │ ├── conf.py │ ├── dev/ │ │ ├── containers.rst │ │ ├── create_process.rst │ │ ├── create_recipe.rst │ │ ├── create_recipes.rst │ │ ├── create_template.rst │ │ ├── general_orientation.rst │ │ ├── pipeline_reporting.rst │ │ ├── process_dotfiles.rst │ │ └── reports.rst │ ├── flowcraft.flowcraft.rst │ ├── flowcraft.generator.components.annotation.rst │ ├── flowcraft.generator.components.assembly.rst │ ├── flowcraft.generator.components.assembly_processing.rst │ ├── flowcraft.generator.components.distance_estimation.rst │ ├── flowcraft.generator.components.downloads.rst │ ├── flowcraft.generator.components.metagenomics.rst │ ├── flowcraft.generator.components.mlst.rst │ ├── flowcraft.generator.components.patlas_mapping.rst │ ├── flowcraft.generator.components.reads_quality_control.rst │ ├── flowcraft.generator.components.rst │ ├── flowcraft.generator.components.typing.rst │ ├── flowcraft.generator.engine.rst │ ├── flowcraft.generator.error_handling.rst │ ├── flowcraft.generator.footer_skeleton.rst │ ├── flowcraft.generator.header_skeleton.rst │ ├── flowcraft.generator.inspect.rst │ ├── flowcraft.generator.pipeline_parser.rst │ ├── flowcraft.generator.process.rst │ ├── flowcraft.generator.process_details.rst │ ├── flowcraft.generator.recipe.rst │ ├── flowcraft.generator.rst │ ├── flowcraft.rst │ ├── flowcraft.templates.assembly_report.rst │ ├── flowcraft.templates.fastqc.rst │ ├── flowcraft.templates.fastqc_report.rst │ ├── flowcraft.templates.flowcraft_utils.flowcraft_base.rst │ ├── flowcraft.templates.flowcraft_utils.rst │ ├── flowcraft.templates.integrity_coverage.rst │ ├── flowcraft.templates.mapping2json.rst │ ├── flowcraft.templates.mashdist2json.rst │ ├── flowcraft.templates.mashscreen2json.rst │ ├── flowcraft.templates.megahit.rst │ ├── flowcraft.templates.metaspades.rst │ ├── flowcraft.templates.pATLAS_consensus_json.rst │ ├── flowcraft.templates.pipeline_status.rst │ ├── flowcraft.templates.process_abricate.rst │ ├── flowcraft.templates.process_assembly.rst │ ├── flowcraft.templates.process_assembly_mapping.rst │ ├── flowcraft.templates.rst │ ├── flowcraft.templates.skesa.rst │ ├── flowcraft.templates.spades.rst │ ├── flowcraft.templates.trimmomatic.rst │ ├── flowcraft.templates.trimmomatic_report.rst │ ├── flowcraft.tests.data_pipelines.rst │ ├── flowcraft.tests.rst │ ├── flowcraft.tests.test_assemblerflow.rst │ ├── flowcraft.tests.test_engine.rst │ ├── flowcraft.tests.test_pipeline_parser.rst │ ├── flowcraft.tests.test_process_details.rst │ ├── flowcraft.tests.test_processes.rst │ ├── flowcraft.tests.test_sanity.rst │ ├── getting_started/ │ │ ├── installation.rst │ │ └── overview.rst │ ├── index.rst │ ├── make.bat │ ├── setup.rst │ └── user/ │ ├── available_components.rst │ ├── basic_usage.rst │ ├── components/ │ │ ├── abricate.rst │ │ ├── assembly_mapping.rst │ │ ├── bowtie.rst │ │ ├── card_rgi.rst │ │ ├── check_coverage.rst │ │ ├── chewbbaca.rst │ │ ├── diamond.rst │ │ ├── downsample_fastq.rst │ │ ├── fast_ani.rst │ │ ├── fasterq_dump.rst │ │ ├── fastqc.rst │ │ ├── fastqc_trimmomatic.rst │ │ ├── filter_poly.rst │ │ ├── integrity_coverage.rst │ │ ├── kraken.rst │ │ ├── kraken2.rst │ │ ├── mapping_patlas.rst │ │ ├── mash_dist.rst │ │ ├── mash_screen.rst │ │ ├── mash_sketch_fasta.rst │ │ ├── mash_sketch_fastq.rst │ │ ├── maxbin2.rst │ │ ├── megahit.rst │ │ ├── metamlst.rst │ │ ├── metaspades.rst │ │ ├── midas_species.rst │ │ ├── mlst.rst │ │ ├── momps.rst │ │ ├── patho_typing.rst │ │ ├── pilon.rst │ │ ├── process_skesa.rst │ │ ├── process_spades.rst │ │ ├── prokka.rst │ │ ├── reads_download.rst │ │ ├── remove_host.rst │ │ ├── retrieve_mapped.rst │ │ ├── seq_typing.rst │ │ ├── sistr.rst │ │ ├── skesa.rst │ │ ├── spades.rst │ │ └── trimmomatic.rst │ ├── pipeline_building.rst │ ├── pipeline_configuration.rst │ ├── pipeline_inspect.rst │ ├── pipeline_reports.rst │ └── reports/ │ ├── abricate.rst │ ├── assembly_mapping.rst │ ├── check_coverage.rst │ ├── chewbbaca.rst │ ├── dengue_typing.rst │ ├── fastqc.rst │ ├── fastqc_trimmomatic.rst │ ├── integrity_coverage.rst │ ├── mash_dist.rst │ ├── maxbin2.rst │ ├── mlst.rst │ ├── patho_typing.rst │ ├── pilon.rst │ ├── process_mapping.rst │ ├── process_newick.rst │ ├── process_skesa.rst │ ├── process_spades.rst │ ├── process_viral_assembly.rst │ ├── seq_typing.rst │ ├── sistr.rst │ ├── trimmomatic.rst │ └── true_coverage.rst ├── flowcraft/ │ ├── __init__.py │ ├── bin/ │ │ ├── final_POST.sh │ │ ├── merge_json.py │ │ ├── metadata_POST.sh │ │ ├── parse_fasta.py │ │ ├── parse_true_coverage.py │ │ ├── prepare_reports.py │ │ ├── renamePE_samtoolsFASTQ.py │ │ ├── report_POST.sh │ │ ├── set_dotfiles.sh │ │ └── startup_POST.sh │ ├── flowcraft.py │ ├── generator/ │ │ ├── __init__.py │ │ ├── components/ │ │ │ ├── __init__.py │ │ │ ├── alignment.py │ │ │ ├── annotation.py │ │ │ ├── assembly.py │ │ │ ├── assembly_processing.py │ │ │ ├── distance_estimation.py │ │ │ ├── downloads.py │ │ │ ├── mapping.py │ │ │ ├── metagenomics.py │ │ │ ├── mlst.py │ │ │ ├── patlas_mapping.py │ │ │ ├── phylogeny.py │ │ │ ├── reads_quality_control.py │ │ │ ├── typing.py │ │ │ └── variant_calling.py │ │ ├── engine.py │ │ ├── error_handling.py │ │ ├── footer_skeleton.py │ │ ├── header_skeleton.py │ │ ├── inspect.py │ │ ├── pipeline_parser.py │ │ ├── process.py │ │ ├── process_collector.py │ │ ├── process_details.py │ │ ├── recipe.py │ │ ├── recipes/ │ │ │ ├── __init__.py │ │ │ ├── denim.py │ │ │ ├── innuca.py │ │ │ └── plasmids.py │ │ ├── report.py │ │ ├── templates/ │ │ │ ├── Helper.groovy │ │ │ ├── abricate.nf │ │ │ ├── abyss.nf │ │ │ ├── assembly_mapping.nf │ │ │ ├── bandage.nf │ │ │ ├── base_recalibrator.nf │ │ │ ├── bcalm.nf │ │ │ ├── bowtie.nf │ │ │ ├── bwa.nf │ │ │ ├── card_rgi.nf │ │ │ ├── check_coverage.nf │ │ │ ├── chewbbaca.nf │ │ │ ├── compiler_channels.txt │ │ │ ├── concoct.nf │ │ │ ├── containers.config │ │ │ ├── dengue_typing.nf │ │ │ ├── diamond.nf │ │ │ ├── downsample_fastq.nf │ │ │ ├── fast_ani.nf │ │ │ ├── fasterq_dump.nf │ │ │ ├── fastqc.nf │ │ │ ├── fastqc_trimmomatic.nf │ │ │ ├── filter_poly.nf │ │ │ ├── haplotypecaller.nf │ │ │ ├── init.nf │ │ │ ├── integrity_coverage.nf │ │ │ ├── kraken.nf │ │ │ ├── kraken2.nf │ │ │ ├── mafft.nf │ │ │ ├── mapping_patlas.nf │ │ │ ├── mark_duplicates.nf │ │ │ ├── mash_dist.nf │ │ │ ├── mash_screen.nf │ │ │ ├── mash_sketch_fasta.nf │ │ │ ├── mash_sketch_fastq.nf │ │ │ ├── maxbin2.nf │ │ │ ├── megahit.nf │ │ │ ├── metabat2.nf │ │ │ ├── metamlst.nf │ │ │ ├── metaprob.nf │ │ │ ├── metaspades.nf │ │ │ ├── midas_species.nf │ │ │ ├── mlst.nf │ │ │ ├── momps.nf │ │ │ ├── nextflow.config │ │ │ ├── params.config │ │ │ ├── patho_typing.nf │ │ │ ├── patlas_consensus.nf │ │ │ ├── pilon.nf │ │ │ ├── pipeline_graph.html │ │ │ ├── post.txt │ │ │ ├── process_skesa.nf │ │ │ ├── process_spades.nf │ │ │ ├── progressive_mauve.nf │ │ │ ├── prokka.nf │ │ │ ├── quast.nf │ │ │ ├── raxml.nf │ │ │ ├── reads_download.nf │ │ │ ├── remove_host.nf │ │ │ ├── report_compiler.nf │ │ │ ├── report_post.txt │ │ │ ├── resources.config │ │ │ ├── retrieve_mapped.nf │ │ │ ├── seq_typing.nf │ │ │ ├── seroba.nf │ │ │ ├── sistr.nf │ │ │ ├── skesa.nf │ │ │ ├── spades.nf │ │ │ ├── split_assembly.nf │ │ │ ├── status_compiler.nf │ │ │ ├── trace_compiler.nf │ │ │ ├── trimmomatic.nf │ │ │ ├── true_coverage.nf │ │ │ ├── unicycler.nf │ │ │ ├── user.config │ │ │ └── viral_assembly.nf │ │ └── utils.py │ ├── lib/ │ │ └── CheckParams.groovy │ ├── profiles.config │ ├── templates/ │ │ ├── README.md │ │ ├── __init__.py │ │ ├── assembly_report.py │ │ ├── compile_reports.py │ │ ├── dengue_typing_assembly.py │ │ ├── dengue_typing_reads.py │ │ ├── downsample_fastq.py │ │ ├── fasta_spliter.py │ │ ├── fastqc.py │ │ ├── fastqc_report.py │ │ ├── flowcraft_utils/ │ │ │ ├── __init__.py │ │ │ └── flowcraft_base.py │ │ ├── integrity_coverage.py │ │ ├── mapping2json.py │ │ ├── mashdist2json.py │ │ ├── mashscreen2json.py │ │ ├── megahit.py │ │ ├── metaspades.py │ │ ├── pATLAS_consensus_json.py │ │ ├── pipeline_status.py │ │ ├── process_abricate.py │ │ ├── process_assembly.py │ │ ├── process_assembly_mapping.py │ │ ├── process_concoct.py │ │ ├── process_mapping.py │ │ ├── process_metabat.py │ │ ├── process_newick.py │ │ ├── process_tsv.py │ │ ├── process_viral_assembly.py │ │ ├── skesa.py │ │ ├── spades.py │ │ ├── split_fasta.py │ │ ├── trimmomatic.py │ │ └── trimmomatic_report.py │ └── tests/ │ ├── __init__.py │ ├── broadcast_tests/ │ │ ├── empty_log.txt │ │ ├── log_with_command.txt │ │ ├── log_with_command_regex.txt │ │ └── log_without_command.txt │ ├── data_pipelines.py │ ├── pipeline_tests/ │ │ ├── pipe1.txt │ │ ├── pipe2.txt │ │ ├── pipe3.txt │ │ ├── pipe4.txt │ │ ├── pipe5.txt │ │ ├── pipe6.txt │ │ ├── pipe7.txt │ │ └── pipe8.txt │ ├── test_assemblerflow.py │ ├── test_broadcast.py │ ├── test_engine.py │ ├── test_pipeline_parser.py │ ├── test_process_details.py │ ├── test_processes.py │ ├── test_recipes.py │ └── test_sanity.py ├── requirements.txt └── setup.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # ignore ide folders .idea/ .vscode/ # ignore python generated files *.pyc ================================================ FILE: .gitmodules ================================================ ================================================ FILE: .travis.yml ================================================ language: python python: - "3.6" install: - pip install pytest - pip install coverage - pip install pytest-cov - python setup.py install script: - py.test --cov=./ after_success: - bash <(curl -s https://codecov.io/bash) ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at odiogosilva@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing to Assemblerflow Thank you for your interest in contributing to Assemblerflow. All kinds of contributions are welcome :tada:! ## Issues Feel free to [submit issues](https://github.com/assemblerflow/assemblerflow/issues) and enhancement requests. ## Git branch convention Contributions with new code (not documentation), should follow this standard procedure: >> dev >> master 1. Create a new branch for the new feature/bug fix. 2. One the new code is finished and **passes all automated tests**, it will be merged into the `dev` branch. This branch is where all the new code lives and serves as an incubator stage while field tests are performed to ensure that everything is working correctly. 3. Merging the `dev` code into `master` is associated with a new release. Therefore, the `master` branch is basically the same of the latest official release in PyPI. ## Contributing In general, we follow the "fork-and-pull" Git workflow. 1. **Fork** the repo on GitHub 2. **Clone** the project to your own machine 3. **Commit** changes to your own branch 4. **Push** your work back up to your fork 5. Submit a **Pull request** so that we can review your changes. Pull requests will be merged first into the `dev` branch to perform some field tests before being merged into `master` NOTE: Be sure to merge the latest from "upstream" before making a pull request! ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ # FlowCraft :whale2::package: ![Nextflow version](https://img.shields.io/badge/nextflow->0.27.0-brightgreen.svg) ![Python version](https://img.shields.io/badge/python-3.6-brightgreen.svg) [![Build Status](https://travis-ci.org/assemblerflow/flowcraft.svg?branch=master)](https://travis-ci.org/assemblerflow/flowcraft) [![codecov](https://codecov.io/gh/assemblerflow/flowcraft/branch/master/graph/badge.svg)](https://codecov.io/gh/assemblerflow/flowcraft) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f518854f780b41a08ca2fb1c14e360f0)](https://www.codacy.com/app/o.diogosilva/assemblerflow?utm_source=github.com&utm_medium=referral&utm_content=ODiogoSilva/assemblerflow&utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/flowcraft/badge/?version=latest)](http://flowcraft.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/flowcraft.svg)](https://badge.fury.io/py/flowcraft) [![Anaconda-Server Badge](https://anaconda.org/bioconda/flowcraft/badges/version.svg)](https://anaconda.org/bioconda/flowcraft) [![Gitter](https://badges.gitter.im/flowcraft-community/community.svg)](https://gitter.im/flowcraft-community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

nextflow_logo

A [Nextflow](https://www.nextflow.io/) pipeline assembler for genomics. Pick your modules. Assemble them. Run the pipeline. (Previously known as Assemblerflow) ## The premisse #### Build a pipeline What if building your own genomics pipeline would be as simple as: ``` flowcraft.py build -t "trimmomatic fastqc skesa pilon" -o my_pipeline.nf ``` Seems pretty simple right? What if we could run this pipeline with a single command on any linux machine or cluster by leveraging the awesomeness of [nextflow](https://www.nextflow.io/) and [docker](https://www.docker.com/)/[singularity](http://singularity.lbl.gov/) containers without having to install any of the pipeline dependencies? #### Run the pipeline ``` nextflow run my_pipeline.nf --fastq path/to/fastq N E X T F L O W ~ version 0.30.1 Launching `my_pipeline.nf` [admiring_lamarck] - revision: 82cc9cd2ed ============================================================ M Y P I P E L I N E ============================================================ Built using flowcraft v1.2.1 Input FastQ : 2 Input samples : 1 Reports are found in : ./reports Results are found in : ./results Profile : standard Starting pipeline at Tue Jun 12 19:38:26 WEST 2018 [warm up] executor > local [7c/eb5f2f] Submitted process > integrity_coverage_1_1 (02AR0553) (...) [31/7d90a1] Submitted process > compile_pilon_report_1_6 Completed at: Tue Jun 12 19:58:32 WEST 2018 Duration : 20m 6s Success : true Exit status : 0 ``` Congratulations! You just built and executed your own pipeline with only two commands! :tada: ## Installation FlowCraft is available as a bioconda package, which already brings nextflow: ``` conda install flowcraft ``` #### Container engines Pipelines built with FlowCraft require at least one container engine to be installed, among `docker`, `singularity` or `shifter`. If you already have any one of these installed, you're good to go. If not, we recommend installing singularity, though it should be installed with root privileges and accessible in all compute nodes. ## How to use it The complete user guide of FlowCraft can be found on [readthedocs.org](http://flowcraft.readthedocs.io/en/latest/?badge=latest). For a quick and dirty demonstration, see below. ### Quick guide #### Building a pipeline FlowCraft comes with a number of [ready-to-use components](http://flowcraft.readthedocs.io/en/latest/user/available_components.html) to build your own pipeline. Following some basic rules, such as the output type of one process must match the input type of the next process, assembling a pipeline is done using the `build` mode and the `-t` option: ``` flowcraft build -t "trimmomatic spades abricate" -o my_pipeline.nf -n "assembly pipe" ``` This command will generate everything that is necessary to run the pipeline automatically, but the main pipeline executable file will be `my_pipeline.nf`. This file will contain a nextflow pipeline for genome assembly starts with `trimmomatic` and finishes with anti-microbial gene annotation using `abricate`. #### Wait... what about the software parameters? Each component in the pipeline has its own set of parameters that can be modified before or when executing the pipeline. These parameters are described in the documentation of each process and you can check the options of your particular pipeline using the `help` option: ``` $ nextflow run my_pipeline.nf --help N E X T F L O W ~ version 0.30.1 Launching `my_pipeline.nf` [prickly_picasso] - revision: 2e1a226e6d ============================================================ F L O W C R A F T ============================================================ Built using flowcraft v1.2.1 Usage: nextflow run my_pipeline.nf --fastq Path expression to paired-end fastq files. (default: fastq/*_{1,2}.*) (default: 'fastq/*_{1,2}.*') Component 'INTEGRITY_COVERAGE_1_1' ---------------------------------- --genomeSize_1_1 Genome size estimate for the samples in Mb. It is used to estimate the coverage and other assembly parameters andchecks (default: 1) --minCoverage_1_1 Minimum coverage for a sample to proceed. By default it's setto 0 to allow any coverage (default: 0) Component 'TRIMMOMATIC_1_2' --------------------------- --adapters_1_2 Path to adapters files, if any. (default: 'None') --trimSlidingWindow_1_2 Perform sliding window trimming, cutting once the average quality within the window falls below a threshold (default: '5:20') --trimLeading_1_2 Cut bases off the start of a read, if below a threshold quality (default: 3) --trimTrailing_1_2 Cut bases of the end of a read, if below a threshold quality (default: 3) --trimMinLength_1_2 Drop the read if it is below a specified length (default: 55) Component 'FASTQC_1_3' ---------------------- --adapters_1_3 Path to adapters files, if any. (default: 'None') Component 'ASSEMBLY_MAPPING_1_5' -------------------------------- --minAssemblyCoverage_1_5 In auto, the default minimum coverage for each assembled contig is 1/3 of the assembly mean coverage or 10x, if the mean coverage is below 10x (default: 'auto') --AMaxContigs_1_5 A warning is issued if the number of contigs is overthis threshold. (default: 100) --genomeSize_1_5 Genome size estimate for the samples. It is used to check the ratio of contig number per genome MB (default: 2.1) ``` This help message is dynamically generated depending on the pipeline you build. Since this pipeline starts with `trimmomatic`, which receives fastq files as input, `--fastq` is the default parameter for providing paired-end fastq files. #### Running a pipeline Now that we have our nextflow pipeline built, we are ready to executed it by providing input data. By default, FlowCraft pipelines will run locally and use `singularity` to run the containers of each component. This can be changed in multiple ways, but for convenience FlowCraft has already defined profiles for most configurations of `executors` and `container` engines. Running a pipeline locally with `singularity` can be done with: ``` # Pattern for paired-end fastq is '_1.fastq.gz _2.fastq.gz' nextflow run my_pipeline --fastq "path/to/fastq/*_{1,2}.*" ``` If you want to run a pipeline in a cluster with SLURM and singularity, just use the appropriate profile: ``` nextflow run my_pipeline --fastq "path/to/fastq/*_{1,2}.*" -profile slurm_sing ``` During the execution of the pipeline, the results and reports for each component are continuously saved to the `results` and `reports` directory, respectively. #### Inspecting a pipeline progress Since version 1.2.0, it is possible to inspect the progress of a nextflow pipeline using the `flowcraft inspect` mode. To check the progress in a terminal, simply type: ``` flowcraft inspect ``` On the directory where the pipeline is running. Alternatively, you can view the progress in FlowCraft's web service by using the ``broadcast`` option: ``` flowcraft inspect -m broadcast ``` ## Why not just write a Nextflow pipeline? In many cases, building a static nextflow pipeline is sufficient for our goals. However, when building our own pipelines, we often felt the need to add dynamism to this process, particularly if we take into account how fast new tools arise and existing ones change. Our biological goals also change over time and we might need different pipelines to answer different questions. FlowCraft makes this very easy, by having a set of pre-made and ready-to-use components that can be freely assembled. For instance, changing the assembly software in a genome assembly pipeline becomes as easy as: ``` # Use spades trimmomatic spades pilon # Use skesa trimmomatic skesa pilon ``` ![example1](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_3.png) If you are interested in having some sort of genome annotation, simply add those components at the end, using a fork syntax: ``` # Run prokka and abricate at the end of the assembly trimmomatic spades pilon (prokka | abricate) ``` ![example2](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_1.png) On the other hand, if you are interest in just perform allele calling for wgMLST, simply add `chewbbaca`: ``` trimmomatic spades pilon chewbbaca ``` ![example3](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_2.png) Since nextflow handles parallelism of large sets of data so well, simple pipelines of two components are also useful to build: ``` trimmomatic fastqc ``` As the number of existing components grow, so does your freedom to build pipelines. ## Roadmap You can see what we're planning next on our [roadmap guide](https://github.com/assemblerflow/flowcraft/wiki/Roadmap). ## Developer guide ### Adding new components Is there a missing component that you would like to see included? We would love to expand! You could make a component request in our [issue tracker](https://github.com/assemblerflow/flowcraft/issues). If you want to be part of the team, you can contribute with the code as well. Each component in FlowCraft can be independently added without having to worry about the rest of the code base. You'll just need to have some knowledge of python and nextflow. [Check the developer documentation for how-to guides](http://assemblerflow.readthedocs.io/en/latest/) ================================================ FILE: changelog.md ================================================ # Changelog ## 1.4.2 ### New components - `Bwa`: align short paired-end sequencing reads to long reference sequences - `MarkDuplicates`: Identifies duplicate reads - `BaseRecalibrator`: Detects systematic errors in base quality scores - `Haplotypecaller`: Call germline SNPs and indels via local re-assembly of haplotypes - `Seroba`: Serotyping of *Streptococcus pneumoniae* sequencing data (FastQ) - `Concoct`: Clustering metagenomic assembled comtigs with coverage and composition - `MetaBAT2`: A robust statistical framework for reconstructing genomes from metagenomic data ### Minor/Other changes - added manifest information to the `nextflow.config` file to allow for remote execution - Added checks for the DAG's dot files in the compile_reports component ## 1.4.1 ### New features - Added support for the report system to: - `maxbin2` - Added new `manifest.config` with the pipeline metadata ### New components - `Kraken2`: Taxonomic identification on FastQ files ### Bug fixes - Fix bug in `momps`component related to added in the introduction of the clear input parameter - Fixed bug with the `-ft` parameters not retrieving the dockerhub tags for all the components. - Fixed bug in the `megahit` process where the fastg mode would break the process - Fix inspect and report mode to fetch the nextflow file independently of its position in the `nextflow run` command inside the .nextflow.log file. - Fix parsing of .nextflow.log file when searching for `nextflow run` command. - Fixed bug between mash_sketch_fasta and mash_dist. ### Minor/Other changes - Added option to `dengue_typing` to retrieve closest reference sequence and link it with a secondary channel into `mafft` - New version of DEN-IM recipe - Now prints an ordered list of components - Moved taxonomy results from `results/annotation/` to `results/taxonomy/` ## 1.4.0 ### New features - Added new `recipe` system to flowcraft along with 6 starting recipes. Recipes are pre-made and curated pipelines that address specific questions. To create a recipe, the `-r ` can be used. To list available recipes, the `--recipe-list` and `--recipe-list-short` options were added. - Added `-ft` or `--fetch-tags` which allows to retrieve all DockerHub container tags. - Added function to collect all the components from the components classes, replacing the current process_map dictionary implementation. Now, it will be generated from the engine rather than hardcoded into the dict. ### Components changes - Added new `disableRR` param in the `spades` component that disables repeat resolution - The `abyss` and `spades` components emit GFA in a secondary channel. - The new `bandage` component can accept either FASTA from a primary channel or GFA from a secondary channel. - Updated skesa to version 2.3.0. - Updated mash based components for the latest version - 1.6.0-1. ### New components - Added component `abyss`. - Added component `bandage`. - Added component `unicycler`. - Added component `prokka`. - Added component `bcalm`. - Added component `diamond`. ### Minor/Other changes - Added removal of duplicate IDs from `reads_download` component input. - Added seed parameter to `downsample_fastq` component. - Added bacmet database to `abricate` component. - Added default docker option to avoid docker permission errors. - Changed the default URL generated by inspect and report commands. - Changed the default URL generated by inspect and report commands. - Added directives to `-L` parameter of build module. ### Bug fixes - Fixed forks with same source process name. - Fixed `inspect` issue when tasks took more than a day in duration. - Added hardware address to `inpsect` and `report` hash. ## 1.3.1 ### Features - Added a new `clearInput` parameter to components that change their input. The aim of this option is to allow the controlled removal of temporary files, which is particularly useful in very large workflows. ### Components changes - Updated images for components `mash_dist`, `mash_screen` and `mapping_patlas`. ### New components - Added component `fast_ani`. ### Minor/Other changes - Added `--export-directives` option to `build` mode to export component's directives in JSON format to standard output. - Added more date information in `inspect` mode, including the year and the locale of the executing system. ## 1.3.0 ### Features - Added `report` run mode to Flowcraft that displays the report of any given pipeline in the Flowcraft's web application. The `report` mode can be executed after a pipeline ended or during the pipeline execution using the `--watch` option. - Added standalone report HTML at the end of the pipeline execution. - Components with support for the new report system: - `abricate` - `assembly_mapping` - `check_coverage` - `chewbbaca` - `dengue_typing` - `fastqc` - `fastqc_trimmomatic` - `integrity_coverage` - `mlst` - `patho_typing` - `pilon` - `process_mapping` - `process_newick` - `process_skesa` - `process_spades` - `process_viral_assembly` - `seq_typing` - `trimmomatic` - `true_coverage` ### Minor/Other changes - Refactored report json for components `mash_dist`, `mash_screen` and `mapping_patlas` ### Bug fixes - Fixed issue where `seq_typing` and `patho_typing` processes were not feeding report data to report compiler. - Fixed fail messages for `process_assembly` and `process_viral_assembly` components ## 1.2.2 ### Components changes - `mapping_patlas`: refactored to remove temporary files used to create sam and bam files and added data to .report.json. Updated databases to pATLAS version 1.5.2. - `mash_screen` and `mash_dist`: added data to .report.json. Updated databases to pATLAS version 1.5.2. - Added new options to `abricate` componente. Users can now provide custom database directories, minimum coverage and minimum identity parameters. ### New components - Added component `fasterq_dump` - Added component `mash_sketch_fasta` - Added component `mash_sketch_fastq` - Added component `downsample_fastq` for FastQ read sub sampling using seqtk - Added component `momps` for typing of Legionella pneumophila - Added component `split_assembly` - Added component `mafft` - Added component `raxml` - Added component `viral_assembly` - Added component `progressive_mauve` - Added component `dengue_typing` ### Minor/Other changes - Added check for `params.accessions` that enables to report a proper error when it is set to `null`. - Added `build` option to export component parameters information in JSON format. - Fixed minor issue preventing the `maxbin2` and `split_assembly` components from being used multiples times in a pipeline - Added a catch to the `filter_poly` process for cases where the input file is empty. - spades template now reports the exit code of spades' execution ### Bug fixes - Removed the need for the nf process templates to have an empty line at the beginning of the template files. - Fixed issue when the `inspect` mode was executed on a pipeline directory with failed processes but with the work directory removed (the log files where no longer available). - Fixed issue when the `inspect` mode was executed on a pipeline without the memory directory defined. - Fixed issue in the `inspect` mode, where there is a rare race condition between tags in the log and trace files. - Fixed bug on `midas_species` process where the output file was not being linked correctly, causing the process to fail - Fixed bug on `bowtie` where the reference parameter was missing the pid - Fixed bug on `filter_poly` where the tag was missing ## 1.2.1 ### Improvements - The parameter system has been revamped, and parameters are now component-specific and independent by default. This allows a better fine-tuning of the parameters and also the execution of the same component multiple times (for instance in a fork) with different parameters. The old parameter system that merged identical parameters is still available by using the `--merge-params` flag when building the pipeline. - Added a global `--clearAtCheckpoint` parameter that, when set to true, will remove temporary files that are no longer necessary for downstream steps of the pipeline from the work directory. This option is currently supported for the `trimmomatic`, `fastqc_trimmomatic`, `skesa` and `spades` components. ### New components - `maxbin2`: An automatic tool for binning metagenomic sequences. - `bowtie2`: Align short paired-end sequencing reads to long reference sequences. - `retrieve_mapped`: Retrieves the mapped reads of a previous bowtie2 mapping process. ### New recipes - `plasmids`: A recipe to perform mapping, mash screen on reads and also mash dist for assembly based approaches (all to detect plasmids). This also includes annotation with abricate for the assembly. - `plasmids_mapping`: A recipe to perform mapping for plasmids. - `plasmids_mash`: A recipe to perform mash screen for plasmids. - `plasmids_assembly`: A recipe to perform mash dist for plasmid assemblies. ### Minor/Other changes - Added "smart" check when the user provides a typo in pipeline string for a given process, outputting some "educated" guesses to the terminal. - Added "-cr" option to show current recipe `pipeline_string`. - Changed the way recipes were being parsed by `proc_collector` for the usage of `-l` and `-L` options. - Added check for non-ascii characters in colored_print. - Fixed log when a file with the pipeline is provided to -t option instead of a string. ### Bug fixes - Fixed pipeline names that contain new line characters. - Fixed pipeline generation when automatic dependencies were added right after a fork - **Template: sistr.nf**: Fixed comparison that determined process status. - Fixed issue with `--version` option. ## 1.2.0 ### New components - `card_rgi`: Anti-microbial resistance gene screening for assemblies - `filter_poly`: Runs PrinSeq on paired-end FastQ files to remove low complexity sequences - `kraken`: Taxonomic identification on FastQ files - `megahit`: Metagenomic assembler for paired-end FastQ files - `metaprob`: Performs read binning on metagenomic FastQ files - `metamlst`: Checks the Sequence Type of metagenomic FastQ reads using Multilocus Sequence Typing - `metaspades`: Metagenomic assembler for paired-end FastQ files - `midas_species`: Taxonomic identification on FastQ files at the species level - `remove host`: Read mapping with Bowtie2 against the target host genome (default hg19) and removes the mapping reads - `sistr`: Salmonella *in silico* typing component for assemblies. ### Features - Added `inspect` run mode to flowcraft for displaying the progress overview during a nextflow run. This run mode has `overview` and `broadcast` options for viewing the progress of a pipeline. ### Minor/Other changes - Changed `mapping_patlas` docker container tag and variable (PR [#76](https://github.com/assemblerflow/assemblerflow/pull/76)). - The `env` scope of nextflow.config now extends the `PYTHONPATH` environmental variable. - Updated indexes for both `mapping_patlas` and `mash` based processes. - New logo! ### Bug Fixes - **Template: fastqc_report.py**: Added fix to trim range evaluation. - **Script: merge_json.py**: Fixed chewbbaca JSON merge function. ================================================ FILE: docker/Dockerfile ================================================ FROM python:3.6-alpine3.7 MAINTAINER Bruno Gonçalves RUN apk add --no-cache git WORKDIR /flowcraft # Clone FlowCraft RUN git clone https://github.com/assemblerflow/flowcraft.git WORKDIR ./flowcraft # Install flowcraft RUN python setup.py install WORKDIR /flowcraft # Remove unnecessary packages RUN apk del git ================================================ FILE: docs/Makefile ================================================ # Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build PAPER ?= BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_elements.papersize=a4 PAPEROPT_letter = -D latex_elements.papersize=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and an HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " epub3 to make an epub3" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " lualatexpdf to make LaTeX files and run them through lualatex" @echo " xelatexpdf to make LaTeX files and run them through xelatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." .PHONY: qthelp qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Templates.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Templates.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Templates" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Templates" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: epub3 epub3: $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 @echo @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: lualatexpdf lualatexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through lualatex..." $(MAKE) PDFLATEX=lualatex -C $(BUILDDIR)/latex all-pdf @echo "lualatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: xelatexpdf xelatexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through xelatex..." $(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." .PHONY: info info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." .PHONY: dummy dummy: $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy @echo @echo "Build finished. Dummy builder generates no files." ================================================ FILE: docs/_static/custom.css ================================================ div.wy-side-nav-search, div.wy-nav-top { background: #5c6bc0; } .wy-menu > .caption > .caption-text { color: #5c6bc0; } .wy-nav-content { max-width: 100% } ================================================ FILE: docs/about/about.rst ================================================ About ===== FlowCraft is developed by the Molecular `Microbiology and Infection Unit (UMMI) `_ at the `Instituto de Medicina Molecular Joao Antunes `_. This project is licensed under the `GPLv3 license `_. The source code of FlowCraft is available at ``_ and the webservice is available at ``_. ================================================ FILE: docs/conf.py ================================================ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Templates documentation build configuration file, created by # sphinx-quickstart on Mon Feb 5 14:24:12 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path.insert(0, os.path.abspath("..")) sys.path.insert(0, os.path.abspath("../flowcraft/templates")) import flowcraft # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', 'numpydoc', 'sphinx.ext.autosummary', 'sphinx.ext.mathjax' ] autodoc_member_order = 'bysource' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'FlowCraft' copyright = '2018, FlowCraft team' author = 'Diogo N. Silva, Tiago F. Jesus, Ines Mendes, Bruno Ribeiro-Goncalves' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = flowcraft.__version__ # The full version, including alpha/beta/rc tags. release = '1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {"collapse_navigation": True} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'Templatesdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'Templates.tex', 'Templates Documentation', 'Diogo N. Silva', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'templates', 'Templates Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'Templates', 'Templates Documentation', author, 'Templates', 'One line description of project.', 'Miscellaneous'), ] # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. epub_title = project epub_author = author epub_publisher = author epub_copyright = copyright # The unique identifier of the text. This can be a ISBN number # or the project homepage. # # epub_identifier = '' # A unique identification for the text. # # epub_uid = '' # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] def setup(app): app.add_stylesheet('custom.css') ================================================ FILE: docs/dev/containers.rst ================================================ Docker containers guidelines ============================ All FlowCraft components require a docker container in order to be executed, thus if a new component is added, a docker image should be added as well and uploaded to .. _docker hub: https://hub.docker.com/ in order to be available to pull in other machines. Although this can be done in any personal repository, we recommend that this docker images are added to an already existing .. _FlowCraft github repository: https://github.com/assemblerflow/docker-imgs (called here ``Official``) so that docker builds can be automated with github integration. Also, the centralization of all images will allow other contributors to easily access and edit these containers instead of forking from one side to another every time a container needs to be changed/updated. Official FlowCraft Docker images -------------------------------- Writing docker images ::::::::::::::::::::: Official FlowCraft Docker images are available in .. _this github repository: https://github.com/assemblerflow/docker-imgs . If you want to add your image to this repository please fork it and make a Pull Request (PR) with the requested new image or create an issue asking to be added to the organization as a contributor. Building docker images :::::::::::::::::::::: Then, after the image has been added to the FlowCraft .. _docker-imgs https://github.com/assemblerflow/docker-imgs github repository, they can be built through .. _FlowCraft docker hub https://hub.docker.com/u/flowcraft/dashboard/ . Tag naming ^^^^^^^^^^ Each time a docker image is built using the automated build of docker hub it should follow this nomenclature: ``version-patch``. This is used to avoid the override of previous builds for the same images, allowing for instance users to use different version of the same software using the same docker image but with different tags. - ``Version``: Is a string with tree letters like this: ``1.1.1``. Versions should change every time a new software is added the container. - ``Patch``: Is a number that follows a ``-`` after the version. Patches should change every time a change does not affect the software inside it. For example, updates to database related files required by some of the software inside the container. Unofficial FlowCraft Docker images ---------------------------------- Although we **strongly** recommend that all images are stored in FlowCraft .. _docker-imgs https://github.com/assemblerflow/docker-imgs github repo, it is not mandatory to do it. Images can be built in another github repo and also use another docker hub repository to build the images. However, do make sure that you define it correctly in the directives of the process as explained in :ref:`DirectivesAnchor`. ================================================ FILE: docs/dev/create_process.rst ================================================ Process creation guidelines =========================== Basic process creation ---------------------- The addition of a new process to FlowCraft requires three main steps: #. `Create process template`_: Create a jinja2 template in ``flowcraft.generator.templates`` with the nextflow code. #. `Create Process class`_: Create a :class:`~flowcraft.generator.process.Process` subclass in :class:`flowcraft.generator.process` with information about the process (e.g., expected input/output, secondary inputs, etc.). .. _create-process: Create process template ::::::::::::::::::::::: First, create the nextflow template that will be integrated into the pipeline as a process. This file must be placed in ``flowcraft.generator.templates`` and have the ``.nf`` extension. In order to allow the template to be dynamically added to a pipeline file, we use the jinja2_ template language to substitute key variables in the process, such as input/output channels. An example created as a ``my_process.nf`` file is as follows:: some_channel_{{ pid }} = Channel.value(params.param1{{ param_id}}) other_channel_{{ pid }} = Channel.fromPath(params.param2{{ param_id}}) process myProcess_{{ pid }} { {% include "post.txt" ignore missing %} publishDir "results/myProcess_{{ pid }}", pattern: "*.tsv" input: set sample_id, from {{ input_channel }} val x from some_channel_{{ pid }} file y from other_channel_{{ pid }} val direct_from_parms from Channel.value(params.param3{{param_id}} // The output is optional output: set sample_id, into {{ output_channel }} {% with task_name="abricate" %} {%- include "compiler_channels.txt" ignore missing -%} {% endwith %} """ """ } {{ forks }} The fields surrounded by curly brackets are jinja placeholders that will be dynamically substituted when building the pipeline. They will ensure that the processes and potential forks correctly link with each other and that channels are unique and correctly linked. This example contains all placeholder variables that are currently supported by FlowCraft. {{pid}} ^^^^^^^ Used as a unique process identifier that prevent issues from process and channel duplication in the pipeline. Therefore, is should be appended to each process and channel name as ``_{{ pid }}`` (note the underscore):: some_channel_{{ pid }} process myProcess_{{ pid }} {{param_id}} ^^^^^^^^^^^^ Same as the **{{ pid }}**, but sets the identified for nextflow ``params``. It should be appended to each ``param`` as ``{{ param_id }}``. This will allow parameters to be specific to each component in the pipeline:: Channel.value(params.param1{{ param_id}}) Note that the parameters used in the template, should also be defined in the Process class params attribute (see `Parameters`_). {% include "post.txt" %} ^^^^^^^^^^^^^^^^^^^^^^^^ Inserts ``beforeScript`` and ``afterScript`` statements to the process that sets environmental variables and a series of *dotfiles* for the process to log their status, warnings, fails and reports (see :ref:`dotfiles` for more information). It also includes scripts for sending requests to REST APIs (only when certain pipeline parameters are used). {{input_channel}} ^^^^^^^^^^^^^^^^^ All processes must include **one and only one** input channel. In most cases, this channel should be defined with a two element tuple that contains the sample ID and then the actual data file/stream. We suggest the sample ID variable to be named ``sample_id`` as a standard. If other name variable name is specified and you include the ``compiler_channels.txt`` in the process, you'll need to change the sample ID variable (see `Sample ID variable`_). {{output_channel}} ^^^^^^^^^^^^^^^^^^ Terminal processes may skip the output channel entirely. However, if you want to link the main output of this process with subsequent ones, this placeholder must be used **only once**. Like in the input channel, this channel should be defined with a two element tuple with the sample ID and the data. The sample ID must match the one specified in the ``input_channel``. .. _compiler: {% include "compiler_channels.txt %} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This will include the special channels that will compile the status/logging of the processes throughout the pipeline. **You must include the whole block** (see `Status channels`_):: {% with task_name="abricate" %} {%- include "compiler_channels.txt" ignore missing -%} {% endwith %} {{forks}} ^^^^^^^^^ Inserts potential forks of the main output channel. It is **mandatory** if the ``output_channel`` is set. Complete example ^^^^^^^^^^^^^^^^ As an example of a complete process, this is the template of ``spades.nf``:: IN_spades_opts_{{ pid }} = Channel.value([params.spadesMinCoverage{{ param_id }},params.spadesMinKmerCoverage{{ param_id }}]) IN_spades_kmers_{{pid}} = Channel.value(params.spadesKmers{{ param_id }}) process spades_{{ pid }} { // Send POST request to platform {% include "post.txt" ignore missing %} tag { fastq_id + " getStats" } publishDir 'results/assembly/spades/', pattern: '*_spades.assembly.fasta', mode: 'copy' input: set fastq_id, file(fastq_pair), max_len from {{ input_channel }}.join(SIDE_max_len_{{ pid }}) val opts from IN_spades_opts_{{ pid }} val kmers from IN_spades_kmers_{{ pid }} output: set fastq_id, file('*_spades.assembly.fasta') optional true into {{ output_channel }} set fastq_id, val("spades"), file(".status"), file(".warning"), file(".fail") into STATUS_{{ pid }} file ".report.json" script: template "spades.py" } {{ forks }} Create Process class :::::::::::::::::::: The process class will contain the information that FlowCraft will use to build the pipeline and assess potential conflicts/dependencies between process. This class should be created in one the category files in the :mod:`flowcraft.generator.components` module (e.g.: ``assembly.py``). If the new component does not fit in any of the existing categories, create a new one that imports :mod:`flowcraft.generator.process.Process` and add your new class. This class should inherit from the :class:`~flowcraft.generator.process.Process` base class:: class MyProcess(Process): def __init__(self, **kwargs): super().__init__(**kwargs) self.input_type = "fastq" self.output_type = "fasta" This is the simplest working example of a process class, which basically needs to inherit the parent class attributes (the ``super`` part). Then we only need to define the expected input and output types of the process. There are no limitations to the input/output types. However, a pipeline will only build successfully when all processes correctly link the output with the input type. Depending on the process, other attributes may be required: - `Parameters`_: Parameters provided by the user to be used in the process. - `Secondary inputs`_: Channels created from parameters provided by the user. - Secondary `Link start`_ and `Link end`_: Secondary links that connect secondary information between two processes. - `Dependencies`_: List of other processes that may be required for the current process. - `Directives`_: Default information for RAM/CPU/Container directives and more. Add to available components :::::::::::::::::::::::::: Contrary to previous implementation (version <= 1.3.1), the available components are now retrieved automatically by FlowCraft and there is no need to add the process to any dictionary (previous ``process_map``). In order for the component to be accessible to ``flowcraft build`` the process template name in ``snake_case`` must match the process class in ``CamelCase``. For instance, if the process template is named ``my_process.nf``, the process class must be ``MyProcess``, then the FlowCraft will be able to automatically add it to the list of available components. .. note:: Note that the template string does not include the ``.nf`` extension. Process attributes ------------------ This section describes the main attributes of the :mod:`~flowcraft.generator.process.Process` class: what they do and how do they impact the pipeline generation. Input/Output types :::::::::::::::::: The :attr:`~flowcraft.generator.process.Process.input_type` and :attr:`~flowcraft.generator.process.Process.output_type` attributes set the expected type of input and output of the process. There are no limitations to the type of input/output that are provided. However, processes will only link when the output of one process matches the input of the subsequent process (unless the :attr:`~flowcraft.generator.process.Process.ignore_type` attribute is set to ``True``). Otherwise, FlowCraft will raise an exception stating that two processes could not be linked. .. note:: The input/ouput types that are currently used are ``fastq``, ``fasta``. Parameters :::::::::: The :attr:`~flowcraft.generator.process.Process.params` attribute sets the parameters that can be used by the process. For each parameter, a default value and a description should be provided. The default value will be set in the ``params.config`` file in the pipeline directory and the description will be used to generated the custom help message of the pipeline:: self.params = { "genomeSize": { "default": 2.1, "description": "Expected genome size (default: params.genomeSiz) }, "minCoverage": { "default": 15, "description": "Minimum coverage to proceed (default: params.minCoverage)" } } These parameters can be simple values that are not feed into any channel, or can be automatically set to a secondary input channel via `Secondary inputs`_ (see below). They can be specified when running the pipeline like any nextflow parameter (e.g.: ``--genomeSize 5``) and used in the nextflow process as usual (e.g.: ``params.genomeSize``). .. note:: These pairs are then used to populate the ``params.config`` file that is generated in the pipeline directory. Note that the values are replaced literally in the config file. For instance, ``"genomeSize": 2.1,`` will appear as ``genomeSize = 2.1``, whereas ``"adapters": "'None'"`` will appear as ``adapters = 'None'``. If you want a value to appear as a string, the double and single quotes are necessary. Secondary inputs :::::::::::::::: .. warning:: The ``secondary_inputs`` attribute has been deprecated since **v1.2.1.** Instead, specify the secondary channels directly in the nextflow template files. Any process can receive one or more input channels in addition to the main channel. These are particularly useful when the process needs to receive additional options from the ``parameters`` scope of nextflow. These additional inputs can be specified via the :attr:`~flowcraft.generator.process.Process.secondary_inputs` attribute, which should store a list of dictionaries (a dictionary for each input). Each dictionary should contains a key:value pair with the name of the parameter (``params``) and the definition of the nextflow channel (``channel``). Consider the example below:: self.secondary_inputs = [ { "params": "genomeSize", "channel": "IN_genome_size = Channel.value(params.genomeSize)" }, { "params": "minCoverage", "channel": "IN_min_coverage = Channel.value(params.minCoverage)" } ] This process will receive two secondary inputs that are given by the ``genomeSize`` and ``minCoverage`` parameters. These should be also specified in the :attr:`~flowcraft.generator.process.Process.params` attribute (See `Parameters`_ above). For each of these parameters, the dictionary also stores how the channel should be defined at the beginning of the pipeline file. Note that this channel definition mentions the parameters (e.g. ``params.genomeSize``). An additional best practice for channel definition is to include one or more sanity checks to ensure that the provided arguments are correct. These checks can be added in the nextflow template file, or literally in the ``channel`` string:: self.secondary_inputs = [ { "params": "genomeSize", "channel": "IN_genome_size = Channel.value(params.genomeSize)" "map{it -> it.toString().isNumber() ? it : exit(1, \"The genomeSize parameter must be a number or a float. Provided value: '${params.genomeSize}'\")}" } Extra input ::::::::::: The :attr:`~flowcraft.generator.process.Process.extra_input` attribute is mostly a user specified directive that allows the injection of additional input data from a parameter into the main input channel of the process. When a pipeline is defined as:: process1 process2={'extra_input':'var'} FlowCraft will expose a new ``var`` parameter, setup an extra input channel and mix it with ``process2`` main input channel. A more detailed explanation follows below. First, FlowCraft will create a nextflow channel from the parameter name provided via the ``extra_input`` directive. The channel string will depend on the input type of the process (this string is fetched from the :attr:`~flowcraft.generator.process.Process.RAW_MAPPING` attribute). For instance, if the input type of ``process2`` is ``fastq``, the new extra channel will be:: IN_var_extraInput = Channel.fromFilePairs(params.var) Since the same extra input parameter may be used by more than one process, the ``IN_var_extraInput`` channel will be automatically forked into the final destination channels:: // When there is a single destination channel IN_var_extraInput.set{ EXTRA_process2_1_2 } // When there are multiple destination channels for the same parameter IN_var_extraInput.into{ EXTRA_process2_1_2; EXTRA_process3_1_3 } The destination channels are the ones that will be actually mixed with the main input channels:: process process2 { input: (...) main_channel.mix(EXTRA_process2_1_2) } In these cases, the processes that receive the extra input will process the data provided by the preceding channel **AND** by the parameter. The data provided via the extra input parameter does not have to wait for the ``main_channel``, which means that they can run in parallel, if there are enough resources. Compiler :::::::: The :attr:`~flowcraft.generator.process.Process.compiler` attribute allows one or more channels of the process to be fed into a compiler process (See `Compiler processes`_). These are special processes that collect information from one or more processes to execute a given task. Therefore, this parameter can only be used when there is an appropriate compiler process available (the available compiler processes are set in the :attr:`~flowcraft.generator.engine.NextflowGenerator.compilers` dictionary). In order to provide one or more channels to a compiler process, simply add a key:value to the attribute, where the key is the id of the compiler process present in the :attr:`~flowcraft.generator.engine.NextflowGenerator.compilers` dictionary and the value is the list of channels:: self.compiler["patlas_consensus"] = ["mappingOutputChannel"] Link start :::::::::: The :attr:`~flowcraft.generator.process.Process.link_start` attribute stores a list of strings of channel names that can be used as secondary channels in the pipeline (See the `Secondary links between process`_ section). By default, this attribute contains the main output channel, which means that every process can fork the main channel to one or more receiving processes. Link end :::::::: The :attr:`~flowcraft.generator.process.Process.link_end` attribute stores a list of dictionaries with channel names that are meant to be received by the process as secondary channel **if** the corresponding `Link start`_ exists in the pipeline. Each dictionary in this list will define one secondary channel and requires two key:value pairs:: self.link_end({ "link": "SomeChannel", "alias": "OtherChannel") }) If another process exists in the pipeline with ``self.link_start.extend(["SomeChannel"])``, FlowCraft will automatically establish a secondary channel between the two processes. If there are multiple processes receiving from a single one, the channel from the later will for into any number of receiving processes. Dependencies :::::::::::: If a process depends on the presence of one or more processes upstream in the pipeline, these can be specific via the :attr:`~flowcraft.generator.process.Process.dependencies` attribute. When building the pipeline if at least one of the dependencies is absent, FlowCraft will raise an exception informing of a missing dependency. .. _DirectivesAnchor: Directives :::::::::: The :attr:`~flowcraft.generator.process.Process.directives` attribute allows for information about cpu/RAM usage and container to be specified for each nextflow process in the template file. For instance, considering the case where a ``Process`` has a template with two nextflow processes:: process proc_A_{{ pid }} { // stuff } process proc_B_{{ pid }} { // stuff } Then, information about each process can be specified individually in the :attr:`~flowcraft.generator.process.Process.directives` attribute:: class myProcess(Process): (...) self.directives = { "proc_A": { "cpus": 1 "memory": "4GB" }, "proc_B": { "cpus": 4 "container": "my/container" "version": "1.0.0" } } The information in this attribute will then be used to build the ``resources.config`` (containing the information about cpu/RAM) and ``containers.config`` (containing the container images) files. Whenever a directive is missing, such as the ``container`` and ``version`` from ``proc_A`` and ``memory`` from ``proc_B``, nothing about them will be written into the config files and they will use the **default pipeline values**: - ``cpus``: ``1`` - ``memory``: ``1GB`` - ``container``: `flowcraft_base`_ image .. _flowcraft_base: https://hub.docker.com/r/ummidock/assemblerflow_base/~/dockerfile/ Ignore type ::::::::::: The :attr:`~flowcraft.generator.process.Process.ignore_type` attribute, controls whether a match between the input of the current process and the output of the previous one is enforced or not. When there are multiple terminal processes that fork from the main channel, there is no need to enforce the type match and in that case this attribute can be set to ``False``. Process ID :::::::::: The process ID, set via the :attr:`~flowcraft.generator.process.Process.pid` attribute, is an arbitrarily and incremental number that is awarded to each process depending on its position in the pipeline. It is mainly used to ensure that there are no duplicated channels even when the same process is used multiple times in the same pipeline. Template :::::::: The :attr:`~flowcraft.generator.process.Process.template` attribute is used to fetch the jinja2 template file that corresponds to the current process. The path to the template file is determined as follows:: join(