├── .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 ├── resources │ ├── example_1.png │ ├── example_2.png │ ├── example_3.png │ ├── flowcraft_inspect_broadcast.png │ ├── flowcraft_inspect_terminal.png │ ├── flowcraft_report.png │ ├── flowcraft_report_watch.png │ ├── fork_1.png │ ├── fork_2.png │ ├── fork_3.png │ ├── fork_4.png │ ├── logo.png │ ├── logo_background.png │ ├── logo_large.png │ ├── logo_white.png │ └── reports │ │ ├── abricate_table.png │ │ ├── assembly_table_skesa.png │ │ ├── assembly_table_spades.png │ │ ├── assembly_table_viral_assembly.png │ │ ├── binning.png │ │ ├── chewbbaca_table.png │ │ ├── contig_size_distribution.png │ │ ├── fastqc_base_gc_content.png │ │ ├── fastqc_base_sequence_quality.png │ │ ├── fastqc_missing_data.png │ │ ├── fastqc_per_base_sequence_quality.png │ │ ├── fastqc_sequence_length.png │ │ ├── mash_dist_table.png │ │ ├── phylogenetic_tree.png │ │ ├── quality_control_table.png │ │ ├── read_mapping_remove_host.png │ │ ├── sliding_window_amr.png │ │ ├── sliding_window_mash_dist.png │ │ ├── sparkline.png │ │ ├── typing_table.png │ │ └── typing_table_dengue.png ├── 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 ├── resources │ └── main.js.zip ├── 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 /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore ide folders 2 | .idea/ 3 | .vscode/ 4 | 5 | # ignore python generated files 6 | *.pyc 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/.gitmodules -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "3.6" 5 | 6 | install: 7 | - pip install pytest 8 | - pip install coverage 9 | - pip install pytest-cov 10 | - python setup.py install 11 | 12 | script: 13 | - py.test --cov=./ 14 | 15 | after_success: 16 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Assemblerflow 2 | 3 | Thank you for your interest in contributing to Assemblerflow. All kinds of 4 | contributions are welcome :tada:! 5 | 6 | ## Issues 7 | 8 | Feel free to [submit issues](https://github.com/assemblerflow/assemblerflow/issues) 9 | and enhancement requests. 10 | 11 | ## Git branch convention 12 | 13 | Contributions with new code (not documentation), should follow this standard procedure: 14 | 15 | >> dev >> master 16 | 17 | 1. Create a new branch for the new feature/bug fix. 18 | 2. One the new code is finished and **passes all automated tests**, it will be 19 | merged into the `dev` branch. This branch is where all the new code lives and 20 | serves as an incubator stage while field tests are performed to ensure that everything 21 | is working correctly. 22 | 3. Merging the `dev` code into `master` is associated with a new release. Therefore, 23 | the `master` branch is basically the same of the latest official release in PyPI. 24 | 25 | ## Contributing 26 | 27 | In general, we follow the "fork-and-pull" Git workflow. 28 | 29 | 1. **Fork** the repo on GitHub 30 | 2. **Clone** the project to your own machine 31 | 3. **Commit** changes to your own branch 32 | 4. **Push** your work back up to your fork 33 | 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` 34 | 35 | NOTE: Be sure to merge the latest from "upstream" before making a pull request! 36 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6-alpine3.7 2 | MAINTAINER Bruno Gonçalves 3 | 4 | RUN apk add --no-cache git 5 | 6 | WORKDIR /flowcraft 7 | 8 | # Clone FlowCraft 9 | RUN git clone https://github.com/assemblerflow/flowcraft.git 10 | WORKDIR ./flowcraft 11 | 12 | # Install flowcraft 13 | RUN python setup.py install 14 | 15 | WORKDIR /flowcraft 16 | 17 | # Remove unnecessary packages 18 | RUN apk del git -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div.wy-side-nav-search, div.wy-nav-top { 2 | background: #5c6bc0; 3 | } 4 | 5 | .wy-menu > .caption > .caption-text { 6 | color: #5c6bc0; 7 | } 8 | 9 | .wy-nav-content { 10 | max-width: 100% 11 | } -------------------------------------------------------------------------------- /docs/about/about.rst: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | FlowCraft is developed by the Molecular `Microbiology and Infection Unit (UMMI) `_ 5 | at the `Instituto de Medicina Molecular Joao Antunes `_. 6 | 7 | This project is licensed under the `GPLv3 license `_. 8 | The source code of FlowCraft is available at ``_ and the 9 | webservice is available at ``_. -------------------------------------------------------------------------------- /docs/dev/create_recipes.rst: -------------------------------------------------------------------------------- 1 | Recipe creation guidelines 2 | ========================== 3 | 4 | Under construction. -------------------------------------------------------------------------------- /docs/dev/general_orientation.rst: -------------------------------------------------------------------------------- 1 | General orientation 2 | =================== 3 | 4 | Codebase structure 5 | ------------------ 6 | 7 | The most important elements of FlowCraft's directory structure are: 8 | 9 | - ``generator``: 10 | - ``components``: Contains the ``Process`` classes for each component 11 | - ``templates``: Contains the nextflow jinja template files for each component 12 | - ``engine.py``: The engine of FlowCraft that builds the pipeline 13 | - ``process.py``: Contains the abstract ``Process`` class that is inherited 14 | - by all component classes 15 | - ``pipeline_parser.py``: Functions that parse and check the pipeline string 16 | - ``recipe.py``: Class responsible for creating recipes 17 | - ``templates``: A git submodule of the `templates`_ repository that contain 18 | the template scripts for the components. 19 | 20 | .. _templates: https://github.com/ODiogoSilva/templates 21 | 22 | 23 | Code style 24 | ---------- 25 | 26 | - **Style**: the code base of flowcraft should adhere (the best it can) to 27 | the `PEP8`_ style guidelines. 28 | - **Docstrings**: code should be generally well documented following the 29 | `numpy docstring`_ style. 30 | - **Quality**: there is also an integration with the `codacy`_ service to 31 | evaluate code quality, which is useful for detecting several coding 32 | issues that may appear. 33 | 34 | 35 | Testing 36 | ------- 37 | 38 | Tests are performed using `pytest`_ and the source files are stored in the 39 | ``flowcraft/tests`` directory. Tests must be executed on the root directory 40 | of the repository 41 | 42 | Documentation 43 | ------------- 44 | 45 | Documentation source files are stored in the ``docs`` directory. The general 46 | configuration file is found in ``docs/conf.py`` and the entry 47 | point to the documentation is ``docs/index.html``. 48 | 49 | 50 | .. _pytest: https://docs.pytest.org/en/latest/ 51 | .. _PEP8: https://www.python.org/dev/peps/pep-0008/ 52 | .. _numpy docstring: https://numpydoc.readthedocs.io/en/latest/format.html 53 | .. _codacy: https://app.codacy.com/app/o.diogosilva/assemblerflow/dashboard -------------------------------------------------------------------------------- /docs/flowcraft.flowcraft.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.flowcraft module 2 | =========================== 3 | 4 | .. automodule:: flowcraft.flowcraft 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.annotation.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.annotation module 2 | =================================================== 3 | 4 | .. automodule:: flowcraft.generator.components.annotation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.assembly.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.assembly module 2 | ================================================= 3 | 4 | .. automodule:: flowcraft.generator.components.assembly 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.assembly_processing.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.assembly\_processing module 2 | ============================================================= 3 | 4 | .. automodule:: flowcraft.generator.components.assembly_processing 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.distance_estimation.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.distance\_estimation module 2 | ============================================================= 3 | 4 | .. automodule:: flowcraft.generator.components.distance_estimation 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.downloads.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.downloads module 2 | ================================================== 3 | 4 | .. automodule:: flowcraft.generator.components.downloads 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.metagenomics.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.metagenomics module 2 | ===================================================== 3 | 4 | .. automodule:: flowcraft.generator.components.metagenomics 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.mlst.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.mlst module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.generator.components.mlst 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.patlas_mapping.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.patlas\_mapping module 2 | ======================================================== 3 | 4 | .. automodule:: flowcraft.generator.components.patlas_mapping 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.reads_quality_control.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.reads\_quality\_control module 2 | ================================================================ 3 | 4 | .. automodule:: flowcraft.generator.components.reads_quality_control 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components package 2 | ======================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.generator.components.annotation 10 | flowcraft.generator.components.assembly 11 | flowcraft.generator.components.assembly_processing 12 | flowcraft.generator.components.distance_estimation 13 | flowcraft.generator.components.downloads 14 | flowcraft.generator.components.metagenomics 15 | flowcraft.generator.components.mlst 16 | flowcraft.generator.components.patlas_mapping 17 | flowcraft.generator.components.reads_quality_control 18 | flowcraft.generator.components.typing 19 | 20 | Module contents 21 | --------------- 22 | 23 | .. automodule:: flowcraft.generator.components 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.components.typing.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.components\.typing module 2 | =============================================== 3 | 4 | .. automodule:: flowcraft.generator.components.typing 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.engine.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.engine module 2 | =================================== 3 | 4 | .. automodule:: flowcraft.generator.engine 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.error_handling.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.error\_handling module 2 | ============================================ 3 | 4 | .. automodule:: flowcraft.generator.error_handling 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.footer_skeleton.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.footer\_skeleton module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.generator.footer_skeleton 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.header_skeleton.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.header\_skeleton module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.generator.header_skeleton 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.inspect.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.inspect module 2 | ==================================== 3 | 4 | .. automodule:: flowcraft.generator.inspect 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.pipeline_parser.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.pipeline\_parser module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.generator.pipeline_parser 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.process.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.process module 2 | ==================================== 3 | 4 | .. automodule:: flowcraft.generator.process 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.process_details.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.process\_details module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.generator.process_details 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.recipe.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator\.recipe module 2 | =================================== 3 | 4 | .. automodule:: flowcraft.generator.recipe 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.generator.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.generator package 2 | ============================ 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.generator.components 10 | 11 | Submodules 12 | ---------- 13 | 14 | .. toctree:: 15 | 16 | flowcraft.generator.engine 17 | flowcraft.generator.error_handling 18 | flowcraft.generator.footer_skeleton 19 | flowcraft.generator.header_skeleton 20 | flowcraft.generator.inspect 21 | flowcraft.generator.pipeline_parser 22 | flowcraft.generator.process 23 | flowcraft.generator.process_details 24 | flowcraft.generator.recipe 25 | 26 | Module contents 27 | --------------- 28 | 29 | .. automodule:: flowcraft.generator 30 | :members: 31 | :undoc-members: 32 | :show-inheritance: 33 | -------------------------------------------------------------------------------- /docs/flowcraft.rst: -------------------------------------------------------------------------------- 1 | flowcraft package 2 | ================= 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.generator 10 | flowcraft.templates 11 | flowcraft.tests 12 | 13 | Submodules 14 | ---------- 15 | 16 | .. toctree:: 17 | 18 | flowcraft.flowcraft 19 | 20 | Module contents 21 | --------------- 22 | 23 | .. automodule:: flowcraft 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.assembly_report.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.assembly\_report module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.templates.assembly_report 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.fastqc.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.fastqc module 2 | =================================== 3 | 4 | .. automodule:: flowcraft.templates.fastqc 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.fastqc_report.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.fastqc\_report module 2 | =========================================== 3 | 4 | .. automodule:: flowcraft.templates.fastqc_report 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.flowcraft_utils.flowcraft_base.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.flowcraft\_utils\.flowcraft\_base module 2 | ============================================================== 3 | 4 | .. automodule:: flowcraft.templates.flowcraft_utils.flowcraft_base 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.flowcraft_utils.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.flowcraft\_utils package 2 | ============================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.templates.flowcraft_utils.flowcraft_base 10 | 11 | Module contents 12 | --------------- 13 | 14 | .. automodule:: flowcraft.templates.flowcraft_utils 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.integrity_coverage.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.integrity\_coverage module 2 | ================================================ 3 | 4 | .. automodule:: flowcraft.templates.integrity_coverage 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.mapping2json.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.mapping2json module 2 | ========================================= 3 | 4 | .. automodule:: flowcraft.templates.mapping2json 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.mashdist2json.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.mashdist2json module 2 | ========================================== 3 | 4 | .. automodule:: flowcraft.templates.mashdist2json 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.mashscreen2json.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.mashscreen2json module 2 | ============================================ 3 | 4 | .. automodule:: flowcraft.templates.mashscreen2json 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.megahit.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.megahit module 2 | ==================================== 3 | 4 | .. automodule:: flowcraft.templates.megahit 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.metaspades.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.metaspades module 2 | ======================================= 3 | 4 | .. automodule:: flowcraft.templates.metaspades 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.pATLAS_consensus_json.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.pATLAS\_consensus\_json module 2 | ==================================================== 3 | 4 | .. automodule:: flowcraft.templates.pATLAS_consensus_json 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.pipeline_status.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.pipeline\_status module 2 | ============================================= 3 | 4 | .. automodule:: flowcraft.templates.pipeline_status 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.process_abricate.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.process\_abricate module 2 | ============================================== 3 | 4 | .. automodule:: flowcraft.templates.process_abricate 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.process_assembly.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.process\_assembly module 2 | ============================================== 3 | 4 | .. automodule:: flowcraft.templates.process_assembly 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.process_assembly_mapping.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.process\_assembly\_mapping module 2 | ======================================================= 3 | 4 | .. automodule:: flowcraft.templates.process_assembly_mapping 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates package 2 | ============================ 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.templates.flowcraft_utils 10 | 11 | Submodules 12 | ---------- 13 | 14 | .. toctree:: 15 | 16 | flowcraft.templates.assembly_report 17 | flowcraft.templates.fastqc 18 | flowcraft.templates.fastqc_report 19 | flowcraft.templates.integrity_coverage 20 | flowcraft.templates.mapping2json 21 | flowcraft.templates.mashdist2json 22 | flowcraft.templates.mashscreen2json 23 | flowcraft.templates.megahit 24 | flowcraft.templates.metaspades 25 | flowcraft.templates.pATLAS_consensus_json 26 | flowcraft.templates.pipeline_status 27 | flowcraft.templates.process_abricate 28 | flowcraft.templates.process_assembly 29 | flowcraft.templates.process_assembly_mapping 30 | flowcraft.templates.skesa 31 | flowcraft.templates.spades 32 | flowcraft.templates.trimmomatic 33 | flowcraft.templates.trimmomatic_report 34 | 35 | Module contents 36 | --------------- 37 | 38 | .. automodule:: flowcraft.templates 39 | :members: 40 | :undoc-members: 41 | :show-inheritance: 42 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.skesa.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.skesa module 2 | ================================== 3 | 4 | .. automodule:: flowcraft.templates.skesa 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.spades.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.spades module 2 | =================================== 3 | 4 | .. automodule:: flowcraft.templates.spades 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.trimmomatic.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.trimmomatic module 2 | ======================================== 3 | 4 | .. automodule:: flowcraft.templates.trimmomatic 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.templates.trimmomatic_report.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.templates\.trimmomatic\_report module 2 | ================================================ 3 | 4 | .. automodule:: flowcraft.templates.trimmomatic_report 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.data_pipelines.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.data\_pipelines module 2 | ======================================== 3 | 4 | .. automodule:: flowcraft.tests.data_pipelines 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests package 2 | ======================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | .. toctree:: 8 | 9 | flowcraft.tests.data_pipelines 10 | flowcraft.tests.test_assemblerflow 11 | flowcraft.tests.test_engine 12 | flowcraft.tests.test_pipeline_parser 13 | flowcraft.tests.test_process_details 14 | flowcraft.tests.test_processes 15 | flowcraft.tests.test_sanity 16 | 17 | Module contents 18 | --------------- 19 | 20 | .. automodule:: flowcraft.tests 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_assemblerflow.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_assemblerflow module 2 | ============================================ 3 | 4 | .. automodule:: flowcraft.tests.test_assemblerflow 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_engine.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_engine module 2 | ===================================== 3 | 4 | .. automodule:: flowcraft.tests.test_engine 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_pipeline_parser.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_pipeline\_parser module 2 | =============================================== 3 | 4 | .. automodule:: flowcraft.tests.test_pipeline_parser 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_process_details.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_process\_details module 2 | =============================================== 3 | 4 | .. automodule:: flowcraft.tests.test_process_details 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_processes.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_processes module 2 | ======================================== 3 | 4 | .. automodule:: flowcraft.tests.test_processes 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/flowcraft.tests.test_sanity.rst: -------------------------------------------------------------------------------- 1 | flowcraft\.tests\.test\_sanity module 2 | ===================================== 3 | 4 | .. automodule:: flowcraft.tests.test_sanity 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. Templates documentation master file, created by 2 | sphinx-quickstart on Thu Feb 8 09:51:21 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | FlowCraft 7 | ========= 8 | 9 | .. image:: resources/logo_large.png 10 | :scale: 20 % 11 | :align: center 12 | 13 | A NextFlow pipeline assembler for genomics. 14 | 15 | .. _Getting Started: 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | :caption: Getting Started 20 | 21 | getting_started/overview 22 | getting_started/installation 23 | about/about 24 | 25 | .. _User Guide: 26 | 27 | .. toctree:: 28 | :maxdepth: 1 29 | :caption: User Guide 30 | 31 | user/basic_usage 32 | user/pipeline_building 33 | user/pipeline_configuration 34 | user/pipeline_inspect 35 | user/pipeline_reports 36 | user/available_components 37 | 38 | .. _Developer Guide: 39 | 40 | .. toctree:: 41 | :maxdepth: 1 42 | :caption: Developer Guide 43 | 44 | dev/general_orientation 45 | dev/create_process 46 | dev/create_template 47 | dev/create_recipe 48 | dev/containers 49 | dev/process_dotfiles 50 | dev/pipeline_reporting 51 | dev/reports 52 | 53 | .. _Source API: 54 | 55 | .. toctree:: 56 | :maxdepth: 2 57 | :caption: Source API 58 | 59 | flowcraft -------------------------------------------------------------------------------- /docs/resources/example_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/example_1.png -------------------------------------------------------------------------------- /docs/resources/example_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/example_2.png -------------------------------------------------------------------------------- /docs/resources/example_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/example_3.png -------------------------------------------------------------------------------- /docs/resources/flowcraft_inspect_broadcast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/flowcraft_inspect_broadcast.png -------------------------------------------------------------------------------- /docs/resources/flowcraft_inspect_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/flowcraft_inspect_terminal.png -------------------------------------------------------------------------------- /docs/resources/flowcraft_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/flowcraft_report.png -------------------------------------------------------------------------------- /docs/resources/flowcraft_report_watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/flowcraft_report_watch.png -------------------------------------------------------------------------------- /docs/resources/fork_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/fork_1.png -------------------------------------------------------------------------------- /docs/resources/fork_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/fork_2.png -------------------------------------------------------------------------------- /docs/resources/fork_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/fork_3.png -------------------------------------------------------------------------------- /docs/resources/fork_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/fork_4.png -------------------------------------------------------------------------------- /docs/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/logo.png -------------------------------------------------------------------------------- /docs/resources/logo_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/logo_background.png -------------------------------------------------------------------------------- /docs/resources/logo_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/logo_large.png -------------------------------------------------------------------------------- /docs/resources/logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/logo_white.png -------------------------------------------------------------------------------- /docs/resources/reports/abricate_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/abricate_table.png -------------------------------------------------------------------------------- /docs/resources/reports/assembly_table_skesa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/assembly_table_skesa.png -------------------------------------------------------------------------------- /docs/resources/reports/assembly_table_spades.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/assembly_table_spades.png -------------------------------------------------------------------------------- /docs/resources/reports/assembly_table_viral_assembly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/assembly_table_viral_assembly.png -------------------------------------------------------------------------------- /docs/resources/reports/binning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/binning.png -------------------------------------------------------------------------------- /docs/resources/reports/chewbbaca_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/chewbbaca_table.png -------------------------------------------------------------------------------- /docs/resources/reports/contig_size_distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/contig_size_distribution.png -------------------------------------------------------------------------------- /docs/resources/reports/fastqc_base_gc_content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/fastqc_base_gc_content.png -------------------------------------------------------------------------------- /docs/resources/reports/fastqc_base_sequence_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/fastqc_base_sequence_quality.png -------------------------------------------------------------------------------- /docs/resources/reports/fastqc_missing_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/fastqc_missing_data.png -------------------------------------------------------------------------------- /docs/resources/reports/fastqc_per_base_sequence_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/fastqc_per_base_sequence_quality.png -------------------------------------------------------------------------------- /docs/resources/reports/fastqc_sequence_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/fastqc_sequence_length.png -------------------------------------------------------------------------------- /docs/resources/reports/mash_dist_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/mash_dist_table.png -------------------------------------------------------------------------------- /docs/resources/reports/phylogenetic_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/phylogenetic_tree.png -------------------------------------------------------------------------------- /docs/resources/reports/quality_control_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/quality_control_table.png -------------------------------------------------------------------------------- /docs/resources/reports/read_mapping_remove_host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/read_mapping_remove_host.png -------------------------------------------------------------------------------- /docs/resources/reports/sliding_window_amr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/sliding_window_amr.png -------------------------------------------------------------------------------- /docs/resources/reports/sliding_window_mash_dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/sliding_window_mash_dist.png -------------------------------------------------------------------------------- /docs/resources/reports/sparkline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/sparkline.png -------------------------------------------------------------------------------- /docs/resources/reports/typing_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/typing_table.png -------------------------------------------------------------------------------- /docs/resources/reports/typing_table_dengue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/docs/resources/reports/typing_table_dengue.png -------------------------------------------------------------------------------- /docs/setup.rst: -------------------------------------------------------------------------------- 1 | setup module 2 | ============ 3 | 4 | .. automodule:: setup 5 | :members: 6 | :undoc-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/user/components/abricate.rst: -------------------------------------------------------------------------------- 1 | abricate 2 | ======== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs anti-microbial gene screening using abricate. It 8 | includes the default databases plus the ``virulencefinder`` database. 9 | 10 | .. note:: 11 | Software page: https://github.com/tseemann/abricate 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``Fasta`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fasta data is ``--fasta``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``abricateDatabases``: Specify the databases for abricate. 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/annotation/abricate``: Stores the results of the abricate screening 31 | for each sample and for each specified database. 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``abricate``: 42 | - ``container``: ummidock/abricate 43 | - ``version``: 0.8.0-1 44 | - ``process_assembly_mapping``: 45 | - ``container``: ummidock/abricate 46 | - ``version``: 0.8.0-1 47 | 48 | Advanced 49 | -------- 50 | 51 | Template 52 | ^^^^^^^^ 53 | 54 | :mod:`flowcraft.templates.process_abricate` 55 | 56 | 57 | Reports JSON 58 | ^^^^^^^^^^^^ 59 | 60 | ``tableRow``: 61 | - ````: List of gene names 62 | ``plotData``: 63 | - ````: 64 | - ``contig``: Contig ID 65 | - ``seqRange``: Genomic range of the contig 66 | - ``gene``: Gene name 67 | - ``accession``: Accession number 68 | - ``coverage``: Coverage of the match 69 | - ``identity``: Identity of the match -------------------------------------------------------------------------------- /docs/user/components/assembly_mapping.rst: -------------------------------------------------------------------------------- 1 | assembly_mapping 2 | ================ 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs a mapping procedure of FastQ files using their assembly 8 | as reference. The procedure is carried out with bowtie2 and samtools and aims 9 | to filter the assembly based on quality criteria of read coverage 10 | and expected genome size. 11 | 12 | .. note:: 13 | - bowtie2 documentation can be found `here `_. 14 | - samtools documentation can be found `here `_. 15 | 16 | Input/Output type 17 | ------------------ 18 | 19 | - Input type: ``Fasta`` and ``FastQ`` 20 | - Output type: ``Fasta`` 21 | 22 | .. note:: 23 | The default input parameter for fasta data is ``--fasta``. 24 | 25 | Parameters 26 | ---------- 27 | 28 | - ``minAssemblyCoverage``: In auto, the default minimum coverage for each 29 | assembled contig is 1/3 of the assembly mean coverage or 10x, if the mean 30 | coverage is below 10x. 31 | - ``AMaxContigs``: A warning is issues if the number of contigs is over 32 | this threshold. 33 | - ``genomeSize``: Genome size estimate for the samples. It is used to check 34 | the ratio of contig number per genome MB. 35 | 36 | Published results 37 | ----------------- 38 | 39 | None. 40 | 41 | Published reports 42 | ----------------- 43 | 44 | None. 45 | 46 | Default directives 47 | ------------------ 48 | 49 | - ``assembly_mapping``: 50 | - ``cpus``: 4 51 | - ``memory``: 5GB (dynamically increased on retry) 52 | - ``container``: ummidock/bowtie2_samtools 53 | - ``version``: 1.0.0-2 54 | - ``process_assembly_mapping``: 55 | - ``cpus``: 1 56 | - ``memory``: 5GB (dynamically increased on retry) 57 | - ``container``: ummidock/bowtie2_samtools 58 | - ``version``: 1.0.0-2 59 | 60 | Advanced 61 | -------- 62 | 63 | Template 64 | ^^^^^^^^ 65 | 66 | :mod:`flowcraft.templates.process_assembly_mapping` 67 | 68 | Reports JSON 69 | ^^^^^^^^^^^^ 70 | 71 | ``plotData``: 72 | - ``sparkline``: Total number of base pairs. 73 | ``warnings``: 74 | - When the number of contigs exceeds a provided threshold. 75 | ``fail``: 76 | - When the genome size is below 80% or above 150% of the expected genome size. -------------------------------------------------------------------------------- /docs/user/components/bowtie.rst: -------------------------------------------------------------------------------- 1 | bowtie 2 | ====== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs a mapping procedure of FastQ files with a given reference. 8 | The procedure is carried out with Bowtie2. 9 | The reference can a set of Bowtie2 index files or a Fasta file. In the latter, the 10 | necessary index will be created with Bowtie2-build and passed through to Bowtie2. 11 | 12 | .. note:: 13 | - Bowtie2 documentation can be found `here `_. 14 | - Software page: http://bowtie-bio.sourceforge.net/bowtie2/index.shtml 15 | 16 | Input/Output type 17 | ------------------ 18 | 19 | - Input type: ``FastQ`` 20 | - Output type: ``Bam`` 21 | 22 | .. note:: 23 | The default input parameter for Fastq data is ``--fastq``. 24 | 25 | Parameters 26 | ---------- 27 | 28 | - ``reference``: Specifies the reference genome to be provided to to bowtie2-build. 29 | - ``index``: Specifies the reference indexes to be provided to bowtie2. 30 | 31 | .. note:: 32 | An ``index`` OR a ``reference`` fasta file must be provided 33 | 34 | Published results 35 | ----------------- 36 | 37 | - ``results/mapping/bowtie``: Stores the results of the mapping for each sample. 38 | 39 | Published reports 40 | ----------------- 41 | 42 | None. 43 | 44 | Default directives 45 | ------------------ 46 | 47 | - ``bowtie_build``: 48 | - ``cpus``: 1 49 | - ``memory``: 5GB (dynamically increased on retry) 50 | - ``container``: flowcraft/bowtie2_samtools 51 | - ``version``: 1.0.0-1 52 | - ``bowtie``: 53 | - ``cpus``: 4 54 | - ``memory``: 5GB (dynamically increased on retry) 55 | - ``container``:flowcraft/bowtie2_samtools 56 | - ``version``: 1.0.0-1 57 | -------------------------------------------------------------------------------- /docs/user/components/card_rgi.rst: -------------------------------------------------------------------------------- 1 | card_rgi 2 | ======== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs anti-microbial gene screening using CARD rgi. 8 | It uses data from CARD database. 9 | 10 | .. note:: 11 | Software page: https://github.com/arpcard/rgi 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``Fasta`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fasta data is ``--fasta``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``alignmentTool``: Specifies the alignment tool. Options: DIAMOND or BLAST 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/annotation/card_rgi``: Stores the results of the screening 31 | for each sample. 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``container``: flowcraft/card_rgi 42 | - ``version``: 4.0.2-0.1 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/user/components/check_coverage.rst: -------------------------------------------------------------------------------- 1 | check_coverage 2 | ============== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components estimates the coverage of a given sample based on the number 8 | of base pairs in the FastQ files of a sample and on the expected genome size: 9 | 10 | .. math:: 11 | \frac{\text{number of base pairs}}{(\text{genome size} \times 1e^{6})} 12 | 13 | If the estimated coverage of a given sample falls bellow the provided 14 | minimum coverage threshold, the sample is filtered and does not proceed in the 15 | pipeline. 16 | 17 | Input/Output type 18 | ------------------ 19 | 20 | - Input type: ``FastQ`` 21 | - Output type: ``FastQ`` 22 | 23 | .. note:: 24 | The default input parameter for FastQ data is ``--fastq``. You can change 25 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 26 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 27 | 28 | Parameters 29 | ---------- 30 | 31 | - ``genomeSize``: Genome size estimate for the samples. It is used to 32 | estimate the coverage and other assembly parameters and 33 | checks. 34 | - ``minCoverage``: Minimum coverage for a sample to proceed. Can be set to 35 | 0 to allow any coverage. 36 | 37 | Published results 38 | ----------------- 39 | 40 | None. 41 | 42 | Published reports 43 | ----------------- 44 | 45 | - ``reports/coverage``: CSV table with estimated sequencing coverage for 46 | each sample. 47 | 48 | Default directives 49 | ------------------ 50 | 51 | None. 52 | 53 | Advanced 54 | -------- 55 | 56 | Template 57 | ^^^^^^^^ 58 | 59 | :mod:`flowcraft.templates.integrity_coverage` 60 | 61 | Reports JSON 62 | ^^^^^^^^^^^^ 63 | 64 | ``tableRow``: 65 | - ``Coverage``: Estimated coverage. 66 | ``fail``: 67 | - When estimated coverage is below the provided threshold. -------------------------------------------------------------------------------- /docs/user/components/chewbbaca.rst: -------------------------------------------------------------------------------- 1 | chewbbaca 2 | ========= 3 | 4 | Purpose 5 | ------- 6 | 7 | This components runs the allele calling operation of ChewBBACA on a set 8 | of fasta samples to perform a cg/wgMLST analysis 9 | 10 | .. note:: 11 | Software page: https://github.com/B-UMMI/chewBBACA 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``Fasta`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fasta data is ``--fasta``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``chewbbacaQueue``: Specifiy a queue/partition for chewbbaca. This option 26 | is only used for grid schedulers. 27 | - ``chewbbacaTraining``: Specify the full path to the prodigal training file 28 | of the corresponding species. 29 | - ``schemaPath``: The path to the chewbbaca schema directory. 30 | - ``schemaSelectedLoci``: The path to the selection of loci in the schema 31 | directory to be used. If not specified, all loci in the schema will be used. 32 | - ``chewbbacaJson``: If set to True, chewbbaca's allele call output will be 33 | set to JSON format. 34 | - ``chewbbacaToPhyloviz``: If set to True, the ExtractCgMLST module of 35 | chewbbaca will be executed after the allele calling. 36 | - ``chewbbacaProfilePercentage``: Specifies the proportion of samples that 37 | must be present in a locus to save the profile. 38 | - ``chewbbacaBatch``: Specifies whther a chewbbaca run will be performed on 39 | the complete input batch (all at the same time) or one by one. 40 | 41 | Published results 42 | ----------------- 43 | 44 | - ``results/chewbbaca_alleleCall``: The results of the allelecall for each 45 | sample. 46 | - ``results/chewbbaca``: The cg/wgMLST schema prepared for phyloviz. 47 | 48 | Published reports 49 | ----------------- 50 | 51 | None. 52 | 53 | Default directives 54 | ------------------ 55 | 56 | - ``chewbbaca``: 57 | - ``cpus``: 4 58 | - ``container``: mickaelsilva/chewbbaca_py3 59 | - ``version``: latest 60 | - ``chewbbaca_batch``: 61 | - ``cpus``: 4 62 | - ``container``: mickaelsilva/chewbbaca_py3 63 | - ``version``: latest 64 | - ``chewbbacaExtractMLST``: 65 | - ``container``: mickaelsilva/chewbbaca_py3 66 | - ``version``: latest 67 | -------------------------------------------------------------------------------- /docs/user/components/diamond.rst: -------------------------------------------------------------------------------- 1 | diamond 2 | ======= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs ``blastx`` or ``blastp`` with diamond. The database 8 | used by diamond can be provided from the local disk or generated in the process. 9 | This component uses the same output type as abricate with the same blast output 10 | fields. 11 | 12 | .. note:: 13 | Software page: https://github.com/bbuchfink/diamond 14 | 15 | 16 | Input/Output type 17 | ----------------- 18 | 19 | - Input type: ``Fasta`` 20 | - Output type: None 21 | 22 | .. note:: 23 | The default input parameter for fasta data is ``--fasta``. 24 | 25 | Parameters 26 | ---------- 27 | 28 | - ``pathToDb``: Provide full path for the diamond database. If none is provided 29 | then will try to fetch from the previous process. Default: None 30 | 31 | - ``fastaToDb``: Provide the full path for the fasta to construct a diamond 32 | database. Default: None 33 | 34 | - ``blastType``: Defines the type of blast that diamond will do. Can wither be 35 | blastx or blastp. Default: blastx 36 | 37 | Published results 38 | ----------------- 39 | 40 | - ``results/annotation/diamond*``: Stores the results of the abricate screening 41 | for each sample and for each specified database. 42 | 43 | Published reports 44 | ----------------- 45 | 46 | None. 47 | 48 | Default directives 49 | ------------------ 50 | 51 | - ``diamond``: 52 | - ``container``: flowcraft/diamond 53 | - ``version``: 0.9.22-1 54 | - ``memory``: { 4.GB * task.attempt } 55 | - ``cpus``: 2 -------------------------------------------------------------------------------- /docs/user/components/downsample_fastq.rst: -------------------------------------------------------------------------------- 1 | downsample_fastq 2 | ================ 3 | 4 | Purpose 5 | ------- 6 | 7 | downsample_fastq uses seqtk to subsample fastq read data to a target coverage depth 8 | if the estimated coverage is higher than the provided target depth. When 9 | no subsample is required, it outputs the original FastQ files. 10 | 11 | .. note:: 12 | Software page: https://github.com/lh3/seqtk 13 | 14 | Input/Output type 15 | ------------------ 16 | 17 | - Input type: ``fastq`` 18 | - Output type: ``fastq`` 19 | 20 | Parameters 21 | ---------- 22 | 23 | - ``genomeSize``: Genome size estimate for the samples. It is used to 24 | estimate the coverage. 25 | - ``depth``: The target depth to which the reads should be subsampled. 26 | - ``seed``: The seed number for seqtk. By default it is 100. 27 | 28 | Published results 29 | ----------------- 30 | 31 | - ``results/sample_fastq``: Stores the subsampled FastQ files 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``cpus``: 1 42 | - ``memory``: 4GB 43 | - ``container``: flowcraft/seqtk 44 | - ``version``: 1.3.0-3 45 | 46 | Advanced 47 | -------- 48 | 49 | Reports JSON 50 | ^^^^^^^^^^^^ 51 | 52 | ``tableRow``: 53 | - ``Coverage``: Estimated coverage. -------------------------------------------------------------------------------- /docs/user/components/fast_ani.rst: -------------------------------------------------------------------------------- 1 | fast_ani 2 | ======== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs pairwise comparisons between fastas, 8 | given a multifasta as input for fastANI. It will split the multifasta into 9 | single fastas that will then be provided as a matrix. The output will be the 10 | all pairwise comparisons that pass the minimum of 50 aligned sequences with a 11 | default length of 200 bp. 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``fasta`` 17 | - Output type: ``None`` 18 | 19 | 20 | Parameters 21 | ---------- 22 | 23 | - ``fragLen``: Sets the minimum size of the fragment to be passed to 24 | `--fragLen` argument of fastANI. 25 | 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/fast_ani/``: A text file with the extension `.out`, which has all 31 | the pairwise comparisons between sequences, reporting ANI. 32 | 33 | 34 | Published reports 35 | ----------------- 36 | 37 | None. 38 | 39 | 40 | Default directives 41 | ------------------ 42 | 43 | - ``fastAniMatrix``: 44 | - ``container``: flowcraft/fast_ani 45 | - ``version``: 1.1.0-2 46 | - ``cpus``: 20 47 | - ``memory``: { 30.GB * task.attempt } -------------------------------------------------------------------------------- /docs/user/components/fasterq_dump.rst: -------------------------------------------------------------------------------- 1 | fasterq_dump 2 | ============ 3 | 4 | Purpose 5 | ------- 6 | 7 | This component downloads reads from the SRA public databases from a 8 | list of accessions. This component uses ``fasterq-dump`` from 9 | `NCBI sra-tools `_. ``fasterq-dump`` 10 | increases the download speed in comparison from ``fastq-dump`` by 11 | **multi-threading** the extraction of FASTQ from SRA-accessions. 12 | The reads for each accession are then emitted through 13 | the main output of this component to any other component (or components) that 14 | receive FastQ data. 15 | 16 | Input/Output type 17 | ------------------ 18 | 19 | - Input type: ``accessions`` 20 | - Output type: ``fastq`` 21 | 22 | .. note:: 23 | The default input parameter for Accessions data is ``--accessions``. 24 | 25 | Parameters 26 | ---------- 27 | 28 | - ``option_file``: This options enables the *option-file* parameter of 29 | ``fasterq-dump``, allowing parameters to be passed. 30 | - ``compress_fastq``: This options allows users to disable the compression of 31 | the fastq files resulting from this component. The default (``true``) behavior 32 | compresses the fastq files to *fastq.gz*. 33 | 34 | Published results 35 | ----------------- 36 | 37 | - ``reads/``: Stores the reads for each provided accession. 38 | 39 | Published reports 40 | ----------------- 41 | 42 | None. 43 | 44 | Default directives 45 | ------------------ 46 | 47 | - ``cpus``: 1 48 | - ``memory``: 1GB 49 | - ``container``: flowcraft/sra-tools 50 | - ``version``: 2.9.1-1 51 | -------------------------------------------------------------------------------- /docs/user/components/fastqc.rst: -------------------------------------------------------------------------------- 1 | fastqc 2 | ====== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components runs FastQC on paired-end FastQ files. 8 | 9 | .. note:: 10 | Software page: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: ``FastQ`` 17 | 18 | .. note:: 19 | The default input parameter for FastQ data is ``--fastq``. You can change 20 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 21 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``adapters``: Provide a non-default fasta file containing the adapter 27 | sequences to screen overrepresented sequences against. 28 | 29 | Published results 30 | ----------------- 31 | 32 | None. 33 | 34 | Published reports 35 | ----------------- 36 | 37 | - ``reports/fastqc``: Stores the FastQC HTML reports for each sample. 38 | - ``reports/fastqc/run_2/``: Stores the summary text files with the category 39 | results of FastQC for each sample. 40 | 41 | Default directives 42 | ------------------ 43 | 44 | - ``cpus``: 2 45 | - ``memory``: 4GB 46 | - ``container``: ummidock/fastqc 47 | - ``version``: 0.11.7-1 48 | 49 | Advanced 50 | -------- 51 | 52 | Template 53 | ^^^^^^^^ 54 | 55 | :mod:`flowcraft.templates.fastqc_report` 56 | 57 | Reports JSON 58 | ^^^^^^^^^^^^ 59 | 60 | ``plotData``: 61 | - ``base_sequence_quality``: Per base sequence quality data 62 | - (This structure is repeated for the other entries) 63 | - ``status``: Status of the category (PASS, WARN, etc) 64 | - ``data``: Plot data 65 | - ``sequence_quality``: Per sequence quality data 66 | - ``base_gc_content``: GC content distribution 67 | - ``base_n_content``: Per base N content 68 | - ``sequence_length_dist``: Distribution of sequence read length 69 | - ``per_base_sequence_content``: Per base sequence content 70 | ``warnings``: 71 | - List of failures or warnings for some non-sensitive FastQC categories 72 | ``fail``: 73 | - Failure message when sensitive FastQC categories fail or do not pass. 74 | -------------------------------------------------------------------------------- /docs/user/components/filter_poly.rst: -------------------------------------------------------------------------------- 1 | filter_poly 2 | =========== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component removes low complexity sequence from read data 8 | using PrinSeq. 9 | 10 | .. note:: 11 | Software page: http://prinseq.sourceforge.net/ 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``FastQ`` 17 | - Output type: ``FastQ` 18 | 19 | .. note:: 20 | The default input parameter for fastq data is ``--fastq``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``adapter``: Pattern to filter the reads. Please separate parameter values with a space 26 | and separate new parameter sets with semicolon (;). Parameters are defined by two values: 27 | the pattern (any combination of the letters ATCGN), and the number of repeats or percentage 28 | of occurence. Default: A 50%; T 50%; N 50% 29 | 30 | Published results 31 | ----------------- 32 | 33 | None. 34 | 35 | Published reports 36 | ----------------- 37 | 38 | None. 39 | 40 | Default directives 41 | ------------------ 42 | 43 | - ``container``: flowcraft/prinseq 44 | - ``version``: 0.20.4-1 45 | - ``memory``: 4.GB * task.attempt 46 | - ``cpus``: 1 47 | 48 | 49 | -------------------------------------------------------------------------------- /docs/user/components/kraken.rst: -------------------------------------------------------------------------------- 1 | kraken 2 | ====== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs Kraken to assign taxonomic labels to short DNA 8 | sequences, usually obtained through metagenomic studies. 9 | 10 | .. note:: 11 | Software page: https://ccb.jhu.edu/software/kraken/ 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``FastQ`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fastq data is ``--fastq``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``krakenDB``: Specifies kraken database. Default: minikraken_20171013_4GB (in path) 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/taxonomy/kraken``: Stores the results of the screening 31 | for each sample. 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``container``: flowcraft/kraken 42 | - ``version``: 1.0-0.1 -------------------------------------------------------------------------------- /docs/user/components/kraken2.rst: -------------------------------------------------------------------------------- 1 | kraken2 2 | ======= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs Kraken2 to assign taxonomic labels to short DNA 8 | sequences, usually obtained through metagenomic studies. 9 | 10 | .. note:: 11 | Software page: https://ccb.jhu.edu/software/kraken2/ 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``FastQ`` 17 | - Output type: txt 18 | 19 | .. note:: 20 | The default input parameter for fastq data is ``--fastq``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``kraken2DB``: Specifies kraken2 database. Default: minikraken2_v1_8GB (in path inside the 26 | default container) 27 | 28 | Published results 29 | ----------------- 30 | 31 | - ``results/taxonomy/kraken2``: Stores the results of the screening 32 | for each sample. 33 | 34 | Published reports 35 | ----------------- 36 | 37 | None. 38 | 39 | Default directives 40 | ------------------ 41 | 42 | - ``container``: flowcraft/kraken2 43 | - ``version``: 2.0.7-1 44 | - ``cpus``: 3 45 | - ``memory``: 5GB (dynamically increased on retry) 46 | -------------------------------------------------------------------------------- /docs/user/components/mash_screen.rst: -------------------------------------------------------------------------------- 1 | mash_screen 2 | =========== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performes mash screen to find plasmids 8 | contained in high throughout sequencing data, using as inputs read files 9 | (FastQ files). Then, the resulting file can 10 | be imported into `pATLAS `_. 11 | This component searches for containment of a given sequence in read sequencing 12 | data. 13 | However, this process can be user for other purposes, by providing a different 14 | database than the default that is intended for plasmid searches. 15 | 16 | .. note:: 17 | - pATLAs documentation can be found `here `_. 18 | - MASH documentation can be found `here `_. 19 | 20 | 21 | Input/Output type 22 | ------------------ 23 | 24 | - Input type: ``fastq`` 25 | - Output type: ``json`` 26 | 27 | 28 | Parameters 29 | ---------- 30 | 31 | - ``noWinner``: A variable that enables the use of -w option for mash screen. 32 | Default: false. 33 | 34 | - ``pValue``: P-value cutoff for the distance estimation between two sequences to 35 | be included in the output. Default: 0.05. 36 | 37 | - ``identity``: The percentage of identity between the reads input and the 38 | reference sequence. Default: 0.9. 39 | 40 | - ``refFile``: "Specifies the reference file to be provided to mash. It can 41 | either be a fastq or a .msh reference sketch generated by mash. 42 | Default: '/ngstools/data/patlas.msh'. If the component ``mash_sketch_fastq`` 43 | is executed before this component, this parameter will be ignored and instead 44 | the secondary link between the two processes will be used to feed this 45 | component with the reference sketch. 46 | 47 | 48 | Published results 49 | ----------------- 50 | 51 | - ``results/mashscreen/``: A `JSON` file that can be imported to `pATLAS `_ 52 | with the results from mash screen. 53 | 54 | 55 | Published reports 56 | ----------------- 57 | 58 | None. 59 | 60 | 61 | Default directives 62 | ------------------ 63 | 64 | - ``mashScreen``: 65 | - ``container``: flowcraft/mash-patlas 66 | - ``version``: 1.6.0-1 67 | - ``mashOutputJson``: 68 | - ``container``: flowcraft/mash-patlas 69 | - ``version``: 1.6.0-1 70 | -------------------------------------------------------------------------------- /docs/user/components/mash_sketch_fasta.rst: -------------------------------------------------------------------------------- 1 | mash_sketch_fasta 2 | ================= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs mash sketch for fasta input files. 8 | 9 | .. note:: 10 | - MASH documentation can be found `here `_. 11 | 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``fasta`` 17 | - Output type: ``msh`` 18 | 19 | 20 | Parameters 21 | ---------- 22 | 23 | - ``kmerSize``: Parameter to set the kmer size for hashing. Default: 21. 24 | Default: false. 25 | 26 | - ``sketchSize``: Parameter to set the number of hashes per sketch. 27 | Default: 1000. 28 | 29 | 30 | Published results 31 | ----------------- 32 | 33 | None. 34 | 35 | 36 | Published reports 37 | ----------------- 38 | 39 | None. 40 | 41 | 42 | Default directives 43 | ------------------ 44 | 45 | - ``mashSketchFasta``: 46 | - ``container``: flowcraft/mash-patlas 47 | - ``version``: 1.6.0-1 48 | -------------------------------------------------------------------------------- /docs/user/components/mash_sketch_fastq.rst: -------------------------------------------------------------------------------- 1 | mash_sketch_fastq 2 | ================= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs mash sketch for fastq input files. These sketches can 8 | be used by ``mash_dist`` and ``mash_screen`` components to fetch the 9 | reference file for mash. 10 | 11 | .. note:: 12 | - MASH documentation can be found `here `_. 13 | 14 | 15 | Input/Output type 16 | ------------------ 17 | 18 | - Input type: ``fastq`` 19 | - Output type: ``msh`` 20 | 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``kmerSize``: Parameter to set the kmer size for hashing. Default: 21. 26 | Default: false. 27 | 28 | - ``sketchSize``: Parameter to set the number of hashes per sketch. 29 | Default: 1000. 30 | 31 | - ``minKmer``: Minimum copies of each k-mer required to pass noise filter for 32 | reads. Default: 1. 33 | 34 | - ``genomeSize``: Genome size (raw bases or with K/M/G/T). If specified, will 35 | be used for p-value calculation instead of an estimated size from k-mer 36 | content. Default: *false*, meaning that it won't be used. If you want to use 37 | it pass a number to this parameter. 38 | 39 | 40 | Published results 41 | ----------------- 42 | 43 | None. 44 | 45 | 46 | Published reports 47 | ----------------- 48 | 49 | None. 50 | 51 | 52 | Default directives 53 | ------------------ 54 | 55 | - ``mashSketchFastq``: 56 | - ``container``: flowcraft/mash-patlas 57 | - ``version``: 1.6.0-1 58 | -------------------------------------------------------------------------------- /docs/user/components/maxbin2.rst: -------------------------------------------------------------------------------- 1 | maxbin2 2 | ======= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component is an automated binning algorithm to recover genomes from multiple metagenomic datasets 8 | 9 | .. note:: 10 | Software page: https://sourceforge.net/projects/maxbin2/ 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``Fasta`` and ``FastQ`` 16 | - Output type: ``Fasta`` 17 | 18 | .. note:: 19 | The default input parameter for fasta is ``--fasta``. This process also requires FastQ files. 20 | If the FastQ files are input to any upstream process, those will be provided to maxbin2 automatically, 21 | if not, they can be provided with the parameter ``--fastq``. 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``min_contig_lenght``: Minimum contig length. Default: 1000 27 | 28 | - ``max_iteration``: Maximum Expectation-Maximization algorithm iteration number. Default: 50 29 | 30 | - ``prob_threshold``: Probability threshold for EM final classification. Default: 0.9 31 | 32 | Published results 33 | ----------------- 34 | 35 | - ``results/maxbin2/``: Stores the results of the binning in a folder 36 | for each sample. 37 | 38 | Published reports 39 | ----------------- 40 | 41 | None. 42 | 43 | Default directives 44 | ------------------ 45 | 46 | - ``container``: flowcraft/maxbin2 47 | - ``version``: 2.2.4-1 48 | - ``cpus``: 4 49 | - ``memory``: 8.GB (dynamically increased on retry) 50 | 51 | 52 | Template 53 | ^^^^^^^^ 54 | 55 | :mod:`assemblerflow.templates.maxbin2` -------------------------------------------------------------------------------- /docs/user/components/megahit.rst: -------------------------------------------------------------------------------- 1 | megahit 2 | ======= 3 | 4 | Purpose 5 | ------- 6 | 7 | This components assembles metagenomic paired-end FastQ files using the megahit assembler. 8 | 9 | .. note:: 10 | Software page: https://github.com/voutcn/megahit 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: ``Fasta`` 17 | 18 | .. note:: 19 | The default input parameter for FastQ data is ``--fastq``. You can change 20 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 21 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``megahitKmers``: If 'auto' the megahit k-mer lengths will be determined 27 | from the maximum read length of each assembly. If 'default', megahit will 28 | use the default k-mer lengths. 29 | 30 | - ``fastg``: When true, it converts megahit intermediate contigs into fastg. 31 | Default: False 32 | 33 | 34 | 35 | Published results 36 | ----------------- 37 | 38 | - ``results/assembly/megahit``: Stores the fasta assemblies for each sample. 39 | 40 | Published reports 41 | ----------------- 42 | 43 | None. 44 | 45 | Default directives 46 | ------------------ 47 | 48 | - ``cpus``: 4 49 | - ``memory``: 5GB (dynamically increased on retry) 50 | - ``container``: cimendes/megahit 51 | - ``version``: v1.1.3-0.1 52 | - ``scratch``: true 53 | 54 | Advanced 55 | -------- 56 | 57 | Template 58 | ^^^^^^^^ 59 | 60 | :mod:`assemblerflow.templates.megahit` -------------------------------------------------------------------------------- /docs/user/components/metamlst.rst: -------------------------------------------------------------------------------- 1 | metamlst 2 | ======== 3 | 4 | Purpose 5 | ------- 6 | 7 | Checks the ST of metagenomic reads using mlst. 8 | 9 | .. note:: 10 | Software page: https://bitbucket.org/CibioCM/metamlst 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: None 17 | 18 | .. note:: 19 | The default input parameter for fastq data is ``--fastq``. 20 | 21 | Parameters 22 | ---------- 23 | 24 | - ``metamlstDB``: Specifiy the metamlst database (full path) for MLST checking 25 | 26 | - ``metamlstDB_index``: Specifiy the Bowtie2 metamlst database index (full path) for MLST checking 27 | 28 | Published results 29 | ----------------- 30 | 31 | - ``results/annotation/metamlst``: Stores the results of the ST for each sample. 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``container``: flowcraft/metamlst 42 | - ``version``: 1.1-1 43 | - ``memory``: 4.Gb * task.attempt 44 | 45 | -------------------------------------------------------------------------------- /docs/user/components/metaspades.rst: -------------------------------------------------------------------------------- 1 | metaspades 2 | ========== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components assembles metagenomic paired-end FastQ files using the metaSPAdes assembler. 8 | 9 | .. note:: 10 | Software page: http://bioinf.spbau.ru/spades 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: ``Fasta`` 17 | 18 | .. note:: 19 | The default input parameter for FastQ data is ``--fastq``. You can change 20 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 21 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``metaspadesKmers``: If 'auto' the metaSPAdes k-mer lengths will be determined 27 | from the maximum read length of each assembly. If 'default', metaSPAdes will 28 | use the default k-mer lengths. 29 | 30 | Published results 31 | ----------------- 32 | 33 | - ``results/assembly/metaspades``: Stores the fasta assemblies for each sample. 34 | 35 | Published reports 36 | ----------------- 37 | 38 | None. 39 | 40 | Default directives 41 | ------------------ 42 | 43 | - ``cpus``: 4 44 | - ``memory``: 5GB (dynamically increased on retry) 45 | - ``container``: ummidock/spades 46 | - ``version``: 3.11.1-1 47 | - ``scratch``: true 48 | 49 | Advanced 50 | -------- 51 | 52 | Template 53 | ^^^^^^^^ 54 | 55 | :mod:`assemblerflow.templates.metaspades` -------------------------------------------------------------------------------- /docs/user/components/midas_species.rst: -------------------------------------------------------------------------------- 1 | midas_species 2 | ============= 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs MIDAS to assign taxonomic labels fro species to short DNA 8 | sequences, usually obtained through metagenomic studies. 9 | 10 | .. note:: 11 | Software page: https://github.com/snayfach/MIDAS 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``FastQ`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fastq data is ``--fastq``. 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``midasDB``: Specifies MIDAS database. Default: /MidasDB/midas_db_v1.2 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/taxonomy/midas``: Stores the results of the screening 31 | for each sample. 32 | 33 | Published reports 34 | ----------------- 35 | 36 | None. 37 | 38 | Default directives 39 | ------------------ 40 | 41 | - ``container``: flowcraft/midas 42 | - ``version``: 1.3.2-0.1 43 | - ``memory``: 2.Gb*task.attempt 44 | - ``cpus``: 3 -------------------------------------------------------------------------------- /docs/user/components/mlst.rst: -------------------------------------------------------------------------------- 1 | mlst 2 | ==== 3 | 4 | Purpose 5 | ------- 6 | 7 | Checks the ST of an assembly using mlst. 8 | 9 | .. note:: 10 | Software page: https://github.com/tseemann/mlst 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``Fasta`` 16 | - Output type: None 17 | 18 | .. note:: 19 | The default input parameter for fasta data is ``--fasta``. 20 | 21 | Parameters 22 | ---------- 23 | 24 | - ``mlstSpecies``: Specifiy the expected species for MLST. 25 | 26 | Published results 27 | ----------------- 28 | 29 | - ``results/annotation/mlst``: Stores the results of the ST for each sample. 30 | 31 | Published reports 32 | ----------------- 33 | 34 | None. 35 | 36 | Default directives 37 | ------------------ 38 | 39 | - ``container``: ummidock/mlst 40 | 41 | 42 | Advanced 43 | -------- 44 | 45 | Reports JSON 46 | ^^^^^^^^^^^^ 47 | 48 | ``tableRow``: 49 | - ``mlst``: Predicted species. 50 | ``expectedSpecies``: Name of the expected species. 51 | 52 | ``species``: Name of inferred species. 53 | 54 | -------------------------------------------------------------------------------- /docs/user/components/momps.rst: -------------------------------------------------------------------------------- 1 | momps 2 | ======== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs Multi-Locus Sequence Typing (MLST) on Legionella pneumophila 8 | from reads and assemblies. 9 | 10 | .. note:: 11 | Software page: https://github.com/bioinfo-core-BGU/mompS 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``fasta`` 17 | - Output type: None 18 | 19 | .. note:: 20 | The default input parameter for fasta data is ``--fasta``. This process 21 | also requires FastQ reads provided via the ``--fastq`` parameter. 22 | 23 | Parameters 24 | ---------- 25 | 26 | None. 27 | 28 | Published results 29 | ----------------- 30 | 31 | - ``results/typing/momps``: Stores TSV files with the ST and allelic profiles 32 | for each strain. 33 | 34 | Published reports 35 | ----------------- 36 | 37 | None. 38 | 39 | Default directives 40 | ------------------ 41 | 42 | - ``momps``: 43 | - ``container``: flowcraft/momps 44 | - ``version``: 0.1.0-4 45 | 46 | Advanced 47 | -------- 48 | 49 | Reports JSON 50 | ^^^^^^^^^^^^ 51 | 52 | ``typing``: 53 | - ``momps``: -------------------------------------------------------------------------------- /docs/user/components/patho_typing.rst: -------------------------------------------------------------------------------- 1 | patho_typing 2 | ========== 3 | 4 | Purpose 5 | ------- 6 | 7 | Patho_typing is a software for *in silico* pathogenic typing 8 | directly from raw Illumina reads. 9 | 10 | .. note:: 11 | Software page: https://github.com/B-UMMI/patho_typing 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``FastQ`` 17 | - Output type: None 18 | 19 | Parameters 20 | ---------- 21 | 22 | - ``species``: Species name. Must be the complete species name with genus 23 | and species, e.g.: 'Yersinia enterocolitica'. 24 | 25 | Published results 26 | ----------------- 27 | 28 | - ``results/pathotyping/``: Stores the results of patho_typing in 29 | text and tabular format. 30 | 31 | Published reports 32 | ----------------- 33 | 34 | None. 35 | 36 | Default directives 37 | ------------------ 38 | 39 | - ``cpus``: 4 40 | - ``memory``: 4GB 41 | - ``container``: ummidock/patho_typing 42 | - ``version``: 0.3.0-1 43 | 44 | Advanced 45 | -------- 46 | 47 | Reports JSON 48 | ^^^^^^^^^^^^ 49 | 50 | ``typing``: 51 | - ``pathotyping``: -------------------------------------------------------------------------------- /docs/user/components/pilon.rst: -------------------------------------------------------------------------------- 1 | pilon 2 | ===== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components Performs a mapping procedure of FastQ files into a their 8 | assembly and performs filtering based on quality criteria of read coverage 9 | and genome size. 10 | 11 | .. note:: 12 | Software page: https://github.com/broadinstitute/pilon 13 | 14 | Input/Output type 15 | ------------------ 16 | 17 | - Input type: ``Fasta`` and ``FastQ`` 18 | - Output type: ``Fasta`` 19 | 20 | .. note:: 21 | The default input parameter for fasta data is ``--fasta``. 22 | 23 | Parameters 24 | ---------- 25 | 26 | None. 27 | 28 | Published results 29 | ----------------- 30 | 31 | - ``results/assembly/pilon``: Stores the polished fasta assemblies for each 32 | sample. 33 | 34 | Published reports 35 | ----------------- 36 | 37 | - ``reports/assembly/pilon``: Table with several summary statistics about the 38 | assembly for each sample. 39 | 40 | Default directives 41 | ------------------ 42 | 43 | - ``pilon``: 44 | - ``cpus``: 4 45 | - ``memory``: 7GB (dynamically increased on retry) 46 | - ``container``: ummidock/pilon 47 | - ``version``: 1.22.0-2 48 | - ``process_assembly_mapping``: 49 | - ``cpus``: 1 50 | - ``memory``: 7GB (dynamically increased on retry) 51 | - ``container``: ummidock/pilon 52 | - ``version``: 1.22.0-2 53 | 54 | Advanced 55 | -------- 56 | 57 | Template 58 | ^^^^^^^^ 59 | 60 | :mod:`flowcraft.templates.assembly_report` 61 | 62 | Reports JSON 63 | ^^^^^^^^^^^^ 64 | ``tableRow``: 65 | - ``Contigs``: Number of contigs. 66 | - ``Assembled BP``: Number of assembled base pairs. 67 | ``plotData``: 68 | - ``size_dist``: Distribution of contig size. 69 | - ``sparkline``: Number of assembled base pairs. 70 | - ``genomeSliding``: 71 | - ``gcData``: Genome sliding window of GC content. 72 | - ``covData``: Genome sliding window of read coverage depth. 73 | - ``window``: Size of sliding window 74 | - ``xbars``: Position of contigs along the genome sliding window. 75 | - ``assemblyFile``: Name of the input assembly file. 76 | ``warnings``: 77 | - When the number of contigs exceeds a given threshold. 78 | ``fail``: 79 | - When the genome size is below 80% or above 150% of the expected genome size. 80 | 81 | -------------------------------------------------------------------------------- /docs/user/components/process_skesa.rst: -------------------------------------------------------------------------------- 1 | process_skesa 2 | ============== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components processes the assembly resulting from the Skesa software and, 8 | optionally, filters contigs based on user-provide parameters. 9 | 10 | Input/Output type 11 | ------------------ 12 | 13 | - Input type: ``Fasta`` 14 | - Output type: ``Fasta`` 15 | 16 | .. note:: 17 | The default input parameter for fasta data is ``--fasta``. 18 | 19 | Parameters 20 | ---------- 21 | 22 | - ``skesaMinKmerCoverage``: Minimum contigs K-mer coverage. After assembly 23 | only keep contigs with reported k-mer coverage equal or above this value. 24 | - ``skesaMinContigLen``: Filter contigs for length greater or equal than 25 | this value. 26 | - ``skesaMaxContigs``: Maximum number of contigs per 1.5 Mb of expected 27 | genome size. 28 | 29 | Published results 30 | ----------------- 31 | 32 | None. 33 | 34 | Published reports 35 | ----------------- 36 | 37 | - ``reports/assembly/skesa_filter``: The filter status for each contig and 38 | each sample. If any contig does not pass the filters, it reports which 39 | filter type it failed and the corresponding value. 40 | 41 | Default directives 42 | ------------------ 43 | 44 | - ``container``: ummidock/skesa 45 | - ``version``: 0.2.0-3 46 | 47 | Advanced 48 | -------- 49 | 50 | Template 51 | ^^^^^^^^ 52 | 53 | :mod:`flowcraft.templates.process_assembly` 54 | 55 | Reports JSON 56 | ^^^^^^^^^^^^ 57 | 58 | ``tableRow``: 59 | - ``Contigs ()``: Number of contigs. 60 | - ``Assembled BP ()``: Number of assembled base pairs. 61 | ``warnings``: 62 | - When the number of contigs exceeds a given threshold. 63 | ``fail``: 64 | - When the genome size is below 80% or above 150% of the expected genome size. 65 | -------------------------------------------------------------------------------- /docs/user/components/process_spades.rst: -------------------------------------------------------------------------------- 1 | process_spades 2 | ============== 3 | 4 | 5 | Purpose 6 | ------- 7 | 8 | This components processes the assembly resulting from the Spades software and, 9 | optionally, filters contigs based on user-provide parameters. 10 | 11 | Input/Output type 12 | ------------------ 13 | 14 | - Input type: ``Fasta`` 15 | - Output type: ``Fasta`` 16 | 17 | .. note:: 18 | The default input parameter for fasta data is ``--fasta``. 19 | 20 | Parameters 21 | ---------- 22 | 23 | - ``spadesMinKmerCoverage``: Minimum contigs K-mer coverage. After assembly 24 | only keep contigs with reported k-mer coverage equal or above this value. 25 | - ``spadesMinContigLen``: Filter contigs for length greater or equal than 26 | this value. 27 | - ``spadesMaxContigs``: Maximum number of contigs per 1.5 Mb of expected 28 | genome size. 29 | 30 | Published results 31 | ----------------- 32 | 33 | None. 34 | 35 | Published reports 36 | ----------------- 37 | 38 | - ``reports/assembly/spades_filter``: The filter status for each contig and 39 | each sample. If any contig does not pass the filters, it reports which 40 | filter type it failed and the corresponding value. 41 | 42 | Default directives 43 | ------------------ 44 | 45 | - ``container``: ummidock/spades 46 | - ``version``: 3.11.1-1 47 | 48 | Advanced 49 | -------- 50 | 51 | Template 52 | ^^^^^^^^ 53 | 54 | :mod:`flowcraft.templates.process_assembly` 55 | 56 | Reports JSON 57 | ^^^^^^^^^^^^ 58 | 59 | ``tableRow``: 60 | - ``Contigs ()``: Number of contigs. 61 | - ``Assembled BP ()``: Number of assembled base pairs. 62 | ``warnings``: 63 | - When the number of contigs exceeds a given threshold. 64 | ``fail``: 65 | - When the genome size is below 80% or above 150% of the expected genome size. 66 | ``process_assembly``: Failure messages -------------------------------------------------------------------------------- /docs/user/components/prokka.rst: -------------------------------------------------------------------------------- 1 | prokka 2 | ====== 3 | 4 | 5 | Purpose 6 | ------- 7 | 8 | This component performs annotations using the annotations available in 9 | `prokka `_. 10 | 11 | 12 | Input/Output type 13 | ----------------- 14 | 15 | - Input type: ``fasta`` 16 | - Output type: ``None`` 17 | 18 | .. note:: 19 | - Although the component doesn't have an output channel it writes the results into the ``publishDir``. 20 | 21 | 22 | Parameters 23 | ---------- 24 | 25 | - ``centre``: sets the center to which the sequencing center id. 26 | Default: 'UMMI'. 27 | 28 | - ``kingdom``: Selects the annotation mode between Archaea, Bacteria, 29 | Mitochondria, Viruses. Default: Bacteria). 30 | 31 | - ``genus``: Allows user to select a genus name. Default: 'Genus' (same 32 | as prokka). This also adds the use of the --usegenus flag to prokka. 33 | 34 | 35 | Published results 36 | ----------------- 37 | 38 | - ``results/annotation/prokka_/``: All the outputs from prokka 39 | will be available in these directories. 40 | 41 | 42 | Published reports 43 | ----------------- 44 | 45 | None. 46 | 47 | 48 | Default directives 49 | ------------------ 50 | 51 | - ``prokka``: 52 | - ``cpus``: 2 53 | - ``container``: ummidock/prokka 54 | - ``version``: 1.12 55 | -------------------------------------------------------------------------------- /docs/user/components/reads_download.rst: -------------------------------------------------------------------------------- 1 | reads_download 2 | ============== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component downloads reads from the SRA/ENA public databases from a 8 | list of accessions. First, it tries to use `aspera connect`_ to download 9 | reads, if a valid aspera key is provided. Otherwise it uses curl, which is 10 | substantially slower. The reads for each accession are then emitted through 11 | the main output of this component to any other component (or components) that 12 | receive FastQ data. 13 | 14 | .. _aspera connect: http://asperasoft.com/download_connect/ 15 | 16 | Input/Output type 17 | ------------------ 18 | 19 | - Input type: ``accessions`` 20 | - Output type: ``fastq`` 21 | 22 | .. note:: 23 | The default input parameter for Accessions data is ``--accessions``. 24 | 25 | Parameters 26 | ---------- 27 | 28 | - ``asperaKey``: Downloads fastq accessions using Aspera Connect 29 | by providing the private-key file 'asperaweb_id_dsa.openssh' normally found 30 | in ~/.aspera/connect/etc/asperaweb_id_dsa.openssh after the installation. 31 | 32 | Published results 33 | ----------------- 34 | 35 | - ``reads/``: Stores the reads for each provided accession. 36 | 37 | Published reports 38 | ----------------- 39 | 40 | None. 41 | 42 | Default directives 43 | ------------------ 44 | 45 | - ``cpus``: 1 46 | - ``memory``: 1GB 47 | - ``container``: flowcraft/getseqena 48 | - ``version``: 0.4.0-2 49 | -------------------------------------------------------------------------------- /docs/user/components/remove_host.rst: -------------------------------------------------------------------------------- 1 | remove_host 2 | =========== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component performs a mapping procedure of FastQ files using a host 8 | genome as referece (default: hg19). The procedure is carried out with 9 | bowtie2 and samtools and aims to filter the reads that map to host genome. 10 | 11 | .. note:: 12 | - bowtie2 documentation can be found `here `_. 13 | - samtools documentation can be found `here `_. 14 | 15 | Input/Output type 16 | ------------------ 17 | 18 | - Input type: ``FastQ`` 19 | - Output type: ``FastQ`` 20 | 21 | .. note:: 22 | The default input parameter for fastq data is ``--fastq``. 23 | 24 | Parameters 25 | ---------- 26 | 27 | - ``refIndex``: Specifies the reference indexes to be provided to bowtie2. 28 | Default: '/index_hg19/hg19' (from docker image). 29 | 30 | 31 | Published results 32 | ----------------- 33 | 34 | - ``results/mapping/``: A `txt` file from bowtie2 with the mapping statistics. 35 | 36 | Published reports 37 | ----------------- 38 | 39 | None. 40 | 41 | Default directives 42 | ------------------ 43 | 44 | - ``remove_host``: 45 | - ``cpus``: 3 46 | - ``memory``: 5GB (dynamically increased on retry) 47 | - ``container``: flowcraft/remove_host 48 | - ``version``: 2-0.1 49 | 50 | 51 | Advanced 52 | -------- 53 | 54 | Template 55 | ^^^^^^^^ 56 | 57 | :mod:`assemblerflow.templates.remove_host` 58 | -------------------------------------------------------------------------------- /docs/user/components/retrieve_mapped.rst: -------------------------------------------------------------------------------- 1 | retrieve_mapped 2 | =============== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component retrieves the mapping reads of a previous bowtie mapping process. 8 | The procedure is carried out with samtools and aims to retrieve the reads that map to target reference. 9 | 10 | .. note:: 11 | - samtools documentation can be found `here `_. 12 | 13 | Input/Output type 14 | ------------------ 15 | 16 | - Input type: ``bam`` 17 | - Output type: ``FastQ`` 18 | 19 | .. note:: 20 | This process has the ``bowtie2`` process as a dependency. 21 | 22 | Parameters 23 | ---------- 24 | 25 | None 26 | 27 | Published results 28 | ----------------- 29 | 30 | - ``results/mapping/retrieve_mapped``: Contains the resulting ``FastQ`` files. 31 | 32 | Published reports 33 | ----------------- 34 | 35 | None. 36 | 37 | Default directives 38 | ------------------ 39 | 40 | - ``remove_host``: 41 | - ``cpus``: 2 42 | - ``memory``: 5GB (dynamically increased on retry) 43 | - ``container``: flowcraft/bowtie2_samtools 44 | - ``version``: 1.0.0-1 45 | 46 | -------------------------------------------------------------------------------- /docs/user/components/seq_typing.rst: -------------------------------------------------------------------------------- 1 | seq_typing 2 | ========== 3 | 4 | Purpose 5 | ------- 6 | 7 | Seq_typing is a software that determines the type of a given sample using a 8 | read mapping approach against a set of reference sequences. Sample's reads 9 | are mapped to the given reference sequences and, based on the length of the 10 | sequence covered and it's depth of coverage, seq_typing decides which reference 11 | sequence is more likely to be present and returns the type associated with 12 | such sequences. 13 | 14 | .. note:: 15 | Software page: https://github.com/B-UMMI/seq_typing 16 | 17 | Input/Output type 18 | ------------------ 19 | 20 | - Input type: ``FastQ`` 21 | - Output type: None 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``referenceFileO``: Fasta file containing reference sequences. If more 27 | than one file is passed via the 'referenceFileH parameter, a reference 28 | sequence for each file will be determined. 29 | - ``referenceFileH``: Fasta file containing reference sequences. If more 30 | than one file is passed via the 'referenceFileO parameter, a reference 31 | sequence for each file will be determined. 32 | 33 | Published results 34 | ----------------- 35 | 36 | - ``results/seqtyping/``: Stores the results of seq_typing in 37 | text and tabular format. 38 | 39 | Published reports 40 | ----------------- 41 | 42 | None. 43 | 44 | Default directives 45 | ------------------ 46 | 47 | - ``cpus``: 4 48 | - ``memory``: 4GB 49 | - ``container``: ummidock/seq_typing 50 | - ``version``: 0.1.0-1 51 | 52 | Advanced 53 | -------- 54 | 55 | Reports JSON 56 | ^^^^^^^^^^^^ 57 | 58 | ``typing``: 59 | - ``seqtyping``: -------------------------------------------------------------------------------- /docs/user/components/sistr.rst: -------------------------------------------------------------------------------- 1 | sistr 2 | ===== 3 | 4 | Purpose 5 | ------- 6 | 7 | Sistr (Salmonella In Silico Typing Resource) is a software for Serovar 8 | predictions from whole-genome sequence assemblies by determination 9 | of antigen gene and cgMLST gene alleles using BLAST. Mash MinHash can also be 10 | used for serovar prediction. 11 | 12 | .. note:: 13 | Software page: https://github.com/peterk87/sistr_cmd 14 | 15 | Input/Output type 16 | ------------------ 17 | 18 | - Input type: ``Fasta`` 19 | - Output type: None 20 | 21 | .. note:: 22 | The default input parameter for fasta data is ``--fasta``. 23 | 24 | Parameters 25 | ---------- 26 | 27 | None 28 | 29 | Published results 30 | ----------------- 31 | 32 | - ``results/typing/sistr``: Stores the results of sistr in a tab file 33 | 34 | Published reports 35 | ----------------- 36 | 37 | None. 38 | 39 | Default directives 40 | ------------------ 41 | 42 | - ``cpus``: 4 43 | - ``memory``: 4GB 44 | - ``container``: ummidock/sistr_cmd 45 | - ``version``: 1.0.2 46 | -------------------------------------------------------------------------------- /docs/user/components/skesa.rst: -------------------------------------------------------------------------------- 1 | skesa 2 | ===== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components assembles paired-end FastQ files using the Skesa assembler. 8 | 9 | Input/Output type 10 | ------------------ 11 | 12 | - Input type: ``FastQ`` 13 | - Output type: ``Fasta`` 14 | 15 | .. note:: 16 | The default input parameter for FastQ data is ``--fastq``. You can change 17 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 18 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 19 | 20 | Parameters 21 | ---------- 22 | 23 | None. 24 | 25 | Published results 26 | ----------------- 27 | 28 | - ``results/assembly/skesa``: Stores the fasta assemblies for each sample. 29 | 30 | Published reports 31 | ----------------- 32 | 33 | None. 34 | 35 | Default directives 36 | ------------------ 37 | 38 | - ``cpus``: 4 39 | - ``memory``: 5GB (dynamically increased on retry) 40 | - ``container``: flowcraft/skesa 41 | - ``version``: 2.3.0-1 42 | - ``scratch``: true 43 | 44 | Advanced 45 | -------- 46 | 47 | Template 48 | ^^^^^^^^ 49 | 50 | :mod:`flowcraft.templates.skesa` -------------------------------------------------------------------------------- /docs/user/components/spades.rst: -------------------------------------------------------------------------------- 1 | spades 2 | ====== 3 | 4 | Purpose 5 | ------- 6 | 7 | This components assembles paired-end FastQ files using the Spades assembler. 8 | 9 | .. note:: 10 | Software page: http://bioinf.spbau.ru/spades 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: ``Fasta`` 17 | 18 | .. note:: 19 | The default input parameter for FastQ data is ``--fastq``. You can change 20 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 21 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``spadesMinCoverage``: The minimum number of reads to consider an edge in 27 | the de Bruijn graph during the assembly 28 | - ``spadesMinKmerCoverage``: Minimum contigs K-mer coverage. After assembly 29 | only keep contigs with reported k-mer coverage equal or above this value 30 | - ``spadesKmers``: If 'auto' the SPAdes k-mer lengths will be determined 31 | from the maximum read length of each assembly. If 'default', SPAdes will 32 | use the default k-mer lengths. 33 | 34 | Published results 35 | ----------------- 36 | 37 | - ``results/assembly/spades``: Stores the fasta assemblies for each sample. 38 | 39 | Published reports 40 | ----------------- 41 | 42 | None. 43 | 44 | Default directives 45 | ------------------ 46 | 47 | - ``cpus``: 4 48 | - ``memory``: 5GB (dynamically increased on retry) 49 | - ``container``: ummidock/spades 50 | - ``version``: 3.13.0-1 51 | - ``scratch``: true 52 | 53 | Advanced 54 | -------- 55 | 56 | Template 57 | ^^^^^^^^ 58 | 59 | :mod:`flowcraft.templates.spades` 60 | -------------------------------------------------------------------------------- /docs/user/components/trimmomatic.rst: -------------------------------------------------------------------------------- 1 | trimmomatic 2 | =========== 3 | 4 | Purpose 5 | ------- 6 | 7 | This component runs Trimmomatic on paired-end FastQ files. 8 | 9 | .. note:: 10 | Software page: http://www.usadellab.org/cms/?page=trimmomatic 11 | 12 | Input/Output type 13 | ------------------ 14 | 15 | - Input type: ``FastQ`` 16 | - Output type: ``FastQ`` 17 | 18 | .. note:: 19 | The default input parameter for FastQ data is ``--fastq``. You can change 20 | the ``--fastq`` parameter default pattern (``fastq/*_{1,2}.*``) according 21 | to input file names (e.g.: ``--fastq "path/to/fastq/*R{1,2}.*"``). 22 | 23 | Parameters 24 | ---------- 25 | 26 | - ``adapters``: Provide a non-default fasta file containing the adapter 27 | sequences used to filter the FastQ files. 28 | - ``trimSlidingWindow``: Perform sliding window trimming, cutting once the 29 | average quality within the window falls below a threshold. 30 | - ``trimLeading``: Cut bases off the start of a read, if below a threshold 31 | quality. 32 | - ``trimTrailing``: Cut bases of the end of a read, if below a threshold 33 | quality. 34 | - ``trimMinLength``: Drop the read if it is below a specified length. 35 | 36 | Published results 37 | ----------------- 38 | 39 | - ``results/trimmomatic``: The trimmed FastQ files for each sample. 40 | 41 | Published reports 42 | ----------------- 43 | 44 | - ``reports/fastqc``: Stores the FastQC HTML reports for each sample. 45 | - ``reports/fastqc/run_2/``: Stores the summary text files with the category 46 | results of FastQC for each sample. 47 | 48 | Default directives 49 | ------------------ 50 | 51 | - ``cpus``: 2 52 | - ``memory``: 4GB (dynamically increased on retry) 53 | - ``container``: ummidock/trimmomatic 54 | - ``version``: 0.36-2 55 | 56 | 57 | Advanced 58 | -------- 59 | 60 | Template 61 | ^^^^^^^^ 62 | 63 | :mod:`flowcraft.templates.trimmomatic` 64 | :mod:`flowcraft.templates.trimmomatic_report` 65 | 66 | Reports JSON 67 | ^^^^^^^^^^^^ 68 | 69 | ``tableRow``: 70 | ``Trimmed (%)``: Percentage of trimmed nucleotides 71 | ``plotData``: 72 | ``sparkline``: Number of nucleotides after trimming 73 | ``badReads``: Number of discarded reads -------------------------------------------------------------------------------- /docs/user/pipeline_configuration.rst: -------------------------------------------------------------------------------- 1 | Pipeline configuration 2 | ====================== 3 | 4 | When a nextflow pipeline is built with FlowCraft, a number of configuration 5 | files are automatically generated in the same directory. They are all imported 6 | at the end of the ``nextflow.config`` file and are sorted by their configuration 7 | role. All configuration files are overwritten if you build another pipeline 8 | in the same directory, with the exception of the ``user.config`` file, which 9 | is meant to be a persistent configuration file. 10 | 11 | Parameters 12 | ---------- 13 | 14 | The ``params.config`` file includes all available paramenters for the pipeline 15 | and their respective default values. Most of these parameters already contain 16 | sensible defaults. 17 | 18 | Resources 19 | --------- 20 | 21 | The ``resources.config`` file includes the majority of the directives provided 22 | for each process, including ``cpus`` and ``memory``. You'll note that each 23 | process name has a suffix like ``_1_1``, which is a unique process identifier 24 | composed of ``_``. This ensures that even when the same 25 | component is specified multiple times in a pipeline, you'll still be able to 26 | set directives for each one individually. 27 | 28 | Containers 29 | ---------- 30 | 31 | The ``containers.config`` file includes the container directive for each 32 | process in the pipeline. These containers are retrieved from dockerhub, if they 33 | do not exist locally yet. You can change the container string to any other 34 | value, but it should point to an image that exist on dockerhub or locally. 35 | 36 | Profiles 37 | -------- 38 | 39 | The ``profiles.config`` file includes a set of pre-made profiles with all 40 | possible combinations of executors and container engines. You can add new ones 41 | or modify existing one. 42 | 43 | User configutations 44 | ------------------- 45 | 46 | The ``user.config`` file is configuration file that is not overwritten when a 47 | new pipeline is build in the same directory. It can contain any configuration 48 | that is supported by nextflow and will overwrite all other configuration files. -------------------------------------------------------------------------------- /docs/user/pipeline_reports.rst: -------------------------------------------------------------------------------- 1 | Pipeline reports 2 | ================ 3 | 4 | .. include:: reports/abricate.rst 5 | .. include:: reports/assembly_mapping.rst 6 | .. include:: reports/check_coverage.rst 7 | .. include:: reports/chewbbaca.rst 8 | .. include:: reports/dengue_typing.rst 9 | .. include:: reports/fastqc.rst 10 | .. include:: reports/fastqc_trimmomatic.rst 11 | .. include:: reports/integrity_coverage.rst 12 | .. include:: reports/mash_dist.rst 13 | .. include:: reports/mlst.rst 14 | .. include:: reports/patho_typing.rst 15 | .. include:: reports/pilon.rst 16 | .. include:: reports/process_mapping.rst 17 | .. include:: reports/process_newick.rst 18 | .. include:: reports/process_skesa.rst 19 | .. include:: reports/process_spades.rst 20 | .. include:: reports/process_viral_assembly.rst 21 | .. include:: reports/seq_typing.rst 22 | .. include:: reports/sistr.rst 23 | .. include:: reports/trimmomatic.rst 24 | .. include:: reports/true_coverage.rst 25 | 26 | -------------------------------------------------------------------------------- /docs/user/reports/abricate.rst: -------------------------------------------------------------------------------- 1 | abricate 2 | -------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | AMR table: 8 | - ****: Number of hits for a particular given database 9 | 10 | .. image:: ../resources/reports/abricate_table.png 11 | :align: center 12 | 13 | Plot data 14 | ^^^^^^^^^ 15 | 16 | - **Sliding window AMR annotation**: Provides annotation of Abricate hits for 17 | each database along the genome. This report component is only available when 18 | the ``pilon`` component was used downstream of ``abricate``. 19 | 20 | .. image:: ../resources/reports/sliding_window_amr.png -------------------------------------------------------------------------------- /docs/user/reports/assembly_mapping.rst: -------------------------------------------------------------------------------- 1 | assembly_mapping 2 | ---------------- 3 | 4 | Plot data 5 | ^^^^^^^^^ 6 | 7 | - **Data loss chart**: Gives a trend of the data loss 8 | (in total number of base pairs) across components that may filter this data. 9 | 10 | .. image:: ../resources/reports/sparkline.png 11 | 12 | Warnings 13 | ^^^^^^^^ 14 | 15 | Assembly table: 16 | - When the number of contigs exceeds the threshold of 100 contigs per 1.5Mb. 17 | 18 | Fails 19 | ^^^^^ 20 | 21 | Assembly table: 22 | - When the assembly size if smaller than 80% or larger than 150% of the 23 | expected genome size. -------------------------------------------------------------------------------- /docs/user/reports/check_coverage.rst: -------------------------------------------------------------------------------- 1 | check_coverage 2 | -------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Coverage**: Estimated coverage based on the number of base pairs and the expected 9 | genome size. 10 | 11 | .. image:: ../resources/reports/quality_control_table.png 12 | :align: center 13 | 14 | Warnings 15 | ^^^^^^^^ 16 | 17 | Quality control table: 18 | - When the enconding and phred score cannot be guessed from the FastQ file(s). 19 | 20 | Fails 21 | ^^^^^ 22 | 23 | Quality control table: 24 | - When the sample has lower estimated coverage than the provided coverage threshold. -------------------------------------------------------------------------------- /docs/user/reports/chewbbaca.rst: -------------------------------------------------------------------------------- 1 | chewbbaca 2 | --------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Chewbbaca table: 8 | - Table with the summary statistics of ChewBBACA allele calling, including 9 | the number of exact matches, inferred loci, loci not found, etc. 10 | 11 | .. image:: ../resources/reports/chewbbaca_table.png 12 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/dengue_typing.rst: -------------------------------------------------------------------------------- 1 | dengue_typing 2 | ------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Typing table: 8 | - **seqtyping**: The sequence typing result (serotypy-genotype). 9 | 10 | .. image:: ../resources/reports/typing_table_dengue.png 11 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/fastqc.rst: -------------------------------------------------------------------------------- 1 | fastqc 2 | ------ 3 | 4 | Plot data 5 | ^^^^^^^^^ 6 | 7 | - **Base sequence quality**: The average quality score across the read length. 8 | 9 | .. image:: ../resources/reports/fastqc_base_sequence_quality.png 10 | 11 | - **Sequence quality**: Distribution of the mean sequence quality score. 12 | 13 | .. image:: ../resources/reports/fastqc_per_base_sequence_quality.png 14 | 15 | - **Base GC content**: Distribution of the GC content of each sequence. 16 | 17 | .. image:: ../resources/reports/fastqc_base_gc_content.png 18 | 19 | - **Sequence length**: Distribution of the read sequence length. 20 | 21 | .. image:: ../resources/reports/fastqc_sequence_length.png 22 | 23 | - **Missing data**: Normalized count of missing data across the read length. 24 | 25 | .. image:: ../resources/reports/fastqc_missing_data.png 26 | 27 | 28 | Warnings 29 | ^^^^^^^^ 30 | 31 | The following FastQC categories will issue a warning when they have a ``WARN`` flag: 32 | - Per base sequence quality. 33 | - Overrepresented sequences. 34 | 35 | The following FastQC categories will issue a warning when do not have a ``PASS`` flag: 36 | - Per base sequence content. 37 | 38 | Fails 39 | ^^^^^ 40 | 41 | The following FastQC categories will issue a fail when they have a ``FAIL`` flag: 42 | - Per base sequence quality. 43 | - Overrepresented sequences. 44 | - Sequence length distribution. 45 | - Per sequence GC content. 46 | 47 | The following FastQC categories will issue a fail when the do not have a ``PASS`` flag: 48 | - Per base N content. 49 | - Adapter content. 50 | -------------------------------------------------------------------------------- /docs/user/reports/fastqc_trimmomatic.rst: -------------------------------------------------------------------------------- 1 | fastqc_trimmomatic 2 | ------------------ 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Trimmed (%)**: Percentage of trimmed base pairs. 9 | 10 | .. image:: ../resources/reports/quality_control_table.png 11 | :scale: 80 % 12 | :align: center 13 | 14 | Plot data 15 | ^^^^^^^^^ 16 | 17 | - **Data loss chart**: Gives a trend of the data loss 18 | (in total number of base pairs) across components that may filter this data. 19 | 20 | .. image:: ../resources/reports/sparkline.png 21 | 22 | -------------------------------------------------------------------------------- /docs/user/reports/integrity_coverage.rst: -------------------------------------------------------------------------------- 1 | integrity_coverage 2 | ------------------ 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Raw BP**: Number of raw base pairs from the FastQ file(s). 9 | - **Reads**: Number of reads in the FastQ file(s) 10 | - **Coverage**: Estimated coverage based on the number of base pairs and the expected 11 | genome size. 12 | 13 | .. image:: ../resources/reports/quality_control_table.png 14 | :align: center 15 | 16 | Plot data 17 | ^^^^^^^^^ 18 | 19 | - **Data loss chart**: Gives a trend of the data loss 20 | (in total number of base pairs) across components that may filter this data. 21 | 22 | .. image:: ../resources/reports/sparkline.png 23 | 24 | Warnings 25 | ^^^^^^^^ 26 | 27 | Quality control table: 28 | - When the enconding and phred score cannot be guessed from the FastQ file(s). 29 | 30 | Fails 31 | ^^^^^ 32 | 33 | Quality control table: 34 | - When the sample has lower estimated coverage than the provided coverage threshold. -------------------------------------------------------------------------------- /docs/user/reports/mash_dist.rst: -------------------------------------------------------------------------------- 1 | mash_dist 2 | --------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Plasmids table: 8 | - **Mash Dist**: Number of plasmid hits 9 | 10 | .. image:: ../resources/reports/mash_dist_table.png 11 | :align: center 12 | 13 | Plot data 14 | ^^^^^^^^^ 15 | 16 | - **Sliding window Plasmid annotation**: Provides annotation of plasmid 17 | hits along the genome assembly. This report component is only available 18 | when the ``mash_dist`` component is used. 19 | 20 | .. image:: ../resources/reports/sliding_window_mash_dist.png -------------------------------------------------------------------------------- /docs/user/reports/maxbin2.rst: -------------------------------------------------------------------------------- 1 | maxbin2 2 | ---- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Metagenomic Binning (sample specific): 8 | - **Bin name**: The number of bin. 9 | - **Completness**: Estimation of completion of genome in bin (% of Single copy genes present) 10 | - **Genome size**: Total size of the bin 11 | - **GC content**: Percentage of GC in the bin 12 | 13 | .. image:: ../resources/reports/binning.png 14 | :scale: 80 % 15 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/mlst.rst: -------------------------------------------------------------------------------- 1 | mlst 2 | ---- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Typing table: 8 | - **MLST species**: The inferred species name. 9 | - **MLST ST**: The inferred sequence type. 10 | 11 | .. image:: ../resources/reports/typing_table.png 12 | :scale: 80 % 13 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/patho_typing.rst: -------------------------------------------------------------------------------- 1 | patho_typing 2 | ------------ 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Typing table: 8 | - **Patho_typing**: The pathotyping result. 9 | 10 | .. image:: ../resources/reports/typing_table.png 11 | :scale: 80 % 12 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/pilon.rst: -------------------------------------------------------------------------------- 1 | pilon 2 | ----- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Contigs**: Number of assembled contigs. 9 | - **Assembled BP**: Total number of assembled base pairs. 10 | 11 | .. image:: ../resources/reports/assembly_table_skesa.png 12 | :scale: 80 % 13 | :align: center 14 | 15 | Plot data 16 | ^^^^^^^^^ 17 | 18 | - **Contig size distribution**: Distribution of the size of each assembled contig. 19 | 20 | .. image:: ../resources/reports/contig_size_distribution.png 21 | 22 | - **Sliding window coverage and GC content**: Provides coverage and GC content 23 | metrics along the genome using a sliding window approach and two synchronised 24 | charts. 25 | 26 | .. image:: ../resources/reports/sliding_window_amr.png 27 | 28 | Warnings 29 | ^^^^^^^^ 30 | 31 | Quality control table: 32 | - When the enconding and phred score cannot be guessed from the FastQ file(s). 33 | 34 | Fails 35 | ^^^^^ 36 | 37 | Quality control table: 38 | - When the sample has lower estimated coverage than the provided coverage threshold. -------------------------------------------------------------------------------- /docs/user/reports/process_mapping.rst: -------------------------------------------------------------------------------- 1 | process_mapping 2 | --------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Read mapping table: 8 | - **Reads**: Number reads in the the FastQ file(s). 9 | - **Unmapped**: Number of unmapped reads 10 | - **Mapped 1x**: Number of reads that aligned, concordantly and discordantly, exactly 1 time 11 | - **Mapped >1x**: Number of reads that aligned, concordantly or disconrdantly, more than 1 times 12 | - **Overall alignment rate (%)**: Overall alignment rate 13 | 14 | .. image:: ../resources/reports/read_mapping_remove_host.png 15 | :align: center 16 | -------------------------------------------------------------------------------- /docs/user/reports/process_newick.rst: -------------------------------------------------------------------------------- 1 | process_newick 2 | -------------- 3 | 4 | Tree data 5 | ^^^^^^^^^^ 6 | 7 | Phylogenetic reconstruction with bootstrap values for the provided tree. 8 | 9 | 10 | .. image:: ../resources/reports/phylogenetic_tree.png 11 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/process_skesa.rst: -------------------------------------------------------------------------------- 1 | process_skesa 2 | ------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Contigs (skesa)**: Number of assembled contigs. 9 | - **Assembled BP**: Total number of assembled base pairs. 10 | 11 | .. image:: ../resources/reports/assembly_table_skesa.png 12 | :scale: 80 % 13 | :align: center 14 | 15 | Warnings 16 | ^^^^^^^^ 17 | 18 | Assembly table: 19 | - When the number of contigs exceeds the threshold of 100 contigs per 1.5Mb. 20 | 21 | Fails 22 | ^^^^^ 23 | 24 | Assembly table: 25 | - When the assembly size if smaller than 80% or larger than 150% of the 26 | expected genome size. 27 | -------------------------------------------------------------------------------- /docs/user/reports/process_spades.rst: -------------------------------------------------------------------------------- 1 | process_spades 2 | ------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Contigs (spades)**: Number of assembled contigs. 9 | - **Assembled BP**: Total number of assembled base pairs. 10 | 11 | .. image:: ../resources/reports/assembly_table_spades.png 12 | :scale: 80 % 13 | :align: center 14 | 15 | Warnings 16 | ^^^^^^^^ 17 | 18 | Assembly table: 19 | - When the number of contigs exceeds the threshold of 100 contigs per 1.5Mb. 20 | 21 | Fails 22 | ^^^^^ 23 | 24 | Assembly table: 25 | - When the assembly size if smaller than 80% or larger than 150% of the 26 | expected genome size. 27 | -------------------------------------------------------------------------------- /docs/user/reports/process_viral_assembly.rst: -------------------------------------------------------------------------------- 1 | process_viral_assembly 2 | ---------------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Contigs (SPAdes)**: Number of assembled contigs. 9 | - **Assembled BP (SPAdes)**: Total number of assembled base pairs. 10 | - **ORFs**: Number of complete ORFs in the assembly. 11 | - **Contigs (MEGAHIT)**: Number of assembled contigs. 12 | - **Assembled BP (MEGAHIT)**: Total number of assembled base pairs. 13 | 14 | 15 | .. image:: ../resources/reports/assembly_table_viral_assembly.png 16 | :align: center 17 | 18 | Fails 19 | ^^^^^ 20 | 21 | Assembly table: 22 | - When the assembly size if smaller than 80% or larger than 150% of the 23 | expected genome size. 24 | -------------------------------------------------------------------------------- /docs/user/reports/seq_typing.rst: -------------------------------------------------------------------------------- 1 | seq_typing 2 | ---------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Typing table: 8 | - **seqtyping**: The sequence typing result. 9 | 10 | .. image:: ../resources/reports/typing_table.png 11 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/sistr.rst: -------------------------------------------------------------------------------- 1 | sistr 2 | ----- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Typing table: 8 | - **sistr**: The sequence typing result. 9 | 10 | .. image:: ../resources/reports/typing_table.png 11 | :align: center -------------------------------------------------------------------------------- /docs/user/reports/trimmomatic.rst: -------------------------------------------------------------------------------- 1 | trimmomatic 2 | ----------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **Trimmed (%)**: Percentage of trimmed base pairs. 9 | 10 | .. image:: ../resources/reports/quality_control_table.png 11 | :align: center 12 | 13 | Plot data 14 | ^^^^^^^^^ 15 | 16 | - **Data loss chart**: Gives a trend of the data loss 17 | (in total number of base pairs) across components that may filter this data. 18 | 19 | .. image:: ../resources/reports/sparkline.png 20 | 21 | -------------------------------------------------------------------------------- /docs/user/reports/true_coverage.rst: -------------------------------------------------------------------------------- 1 | true_coverage 2 | ------------- 3 | 4 | Table data 5 | ^^^^^^^^^^ 6 | 7 | Quality control table: 8 | - **True Coverage**: Estimated coverage based on read mapping on MLST genes. 9 | 10 | .. image:: ../resources/reports/quality_control_table.png 11 | :align: center 12 | 13 | Fails 14 | ^^^^^ 15 | 16 | Quality control table: 17 | - When the sample has lower estimated coverage than the provided coverage threshold. -------------------------------------------------------------------------------- /flowcraft/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | __version__ = "1.4.2" 3 | __build__ = "18062019" 4 | __author__ = "Diogo N. Silva, Tiago F. Jesus, Ines Mendes, Bruno Ribeiro-Goncalves" 5 | __copyright__ = "Diogo N. Silva" 6 | __license__ = "GPL3" 7 | __maintainer__ = "Diogo N. Silva" 8 | __email__ = "o.diogosilva@gmail.com" -------------------------------------------------------------------------------- /flowcraft/bin/final_POST.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | st=$(cat $(pwd)/.status) 4 | 5 | json="{'project_id':'$1','pipeline_id':'$2','process_id':'$3','run_info':'None','run_output':'None','warnings':'$(pwd)/.warning','log_file':'$(pwd)/.command.log','status':'$st','type':'output'}" 6 | 7 | { 8 | curl -H "Content-Type: application/json" -L -X POST -d \"$json\" $4 > /dev/null 9 | } || { 10 | echo Curl request failed 11 | } -------------------------------------------------------------------------------- /flowcraft/bin/metadata_POST.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -ex 4 | 5 | projectid=$1 6 | pipelineid=$2 7 | processid=$3 8 | sample=$4 9 | url=$5 10 | username=$6 11 | userid=$7 12 | task=$8 13 | species=$9 14 | 15 | metadata_str="{}" 16 | 17 | # If a .report.json file was populated, set the json_str variable 18 | if [ -s .metadata.json ]; 19 | then 20 | metadata_str=$(cat $(pwd)/.metadata.json | sed 's/ /%20/g' | sed s/\"/\'/g) 21 | fi 22 | 23 | # If a .versions OR .report.json file was populated send the request 24 | if [ ! "$metadata_str" = "{}" ]; 25 | then 26 | workdir=$(pwd) 27 | json="{'projectid':'$projectid','pipelineId':'$pipelineid','processId':'nfMetadata','sample_name':'$sample','nfMetadata':$metadata_str,'username':'$username','userId':'$userid','workdir':'$workdir','task':'nfMetadata','processName':'nfMetadata','species':'$species','overwrite':'false'}" 28 | echo \"${json}\" > .final.json 29 | { 30 | cat .final.json | curl -H "Content-Type: application/json" -k -L -X POST -d @- $url > /dev/null 31 | } || { 32 | echo Curl request failed 33 | } 34 | 35 | fi 36 | -------------------------------------------------------------------------------- /flowcraft/bin/parse_fasta.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | import argparse 5 | from itertools import groupby 6 | import os 7 | 8 | 9 | def replace_char(text): 10 | for ch in ['/', '`', '*', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '$', ':']: 11 | text = text.replace(ch, "_") 12 | return text 13 | 14 | def getSequence(ref, fasta): 15 | 16 | entry = (x[1] for x in groupby(fasta, lambda line: line[0] == ">")) 17 | 18 | for header in entry: 19 | headerStr = header.__next__()[1:].strip() 20 | seq = "".join(s.strip() for s in entry.__next__()) 21 | 22 | if ref == headerStr.replace('>',''): 23 | filename = os.path.join(os.getcwd(), ref.replace('/','_').split('|')[0]) 24 | fasta_header = replace_char(headerStr) 25 | output_file = open(filename + '.fa', "w") 26 | output_file.write(">" + fasta_header + "\n" + seq.upper() + "\n") 27 | output_file.close() 28 | header_file = open("header.txt", "w") 29 | header_file.write(fasta_header) 30 | header_file.close() 31 | 32 | def main(): 33 | 34 | parser = argparse.ArgumentParser(prog='parse_fasta.py', description="Parse FASTA files for a specific header", formatter_class=argparse.ArgumentDefaultsHelpFormatter) 35 | parser.add_argument('--version', help='Version information', action='version', version=str('%(prog)s v0.1')) 36 | 37 | parser_required = parser.add_argument_group('Required options') 38 | parser_required.add_argument('-t', type=str, metavar='header of sequence to be retrieved', 39 | help='Uncompressed fastq file containing mate 1 reads', required=True) 40 | parser_required.add_argument('-f', type=argparse.FileType('r'), metavar='/path/to/input/file.fasta', 41 | help='Fasta with the sequences', required=True) 42 | 43 | args = parser.parse_args() 44 | 45 | getSequence(args.t, args.f) 46 | 47 | 48 | 49 | if __name__ == "__main__": 50 | main() -------------------------------------------------------------------------------- /flowcraft/bin/parse_true_coverage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import json 5 | 6 | 7 | def parse_true_coverage(report_json, fail_json=None): 8 | 9 | with open(report_json) as fh: 10 | res = json.load(fh) 11 | print("Report JSON: {}".format(res)) 12 | 13 | with open(".report.json", "w") as report_fh: 14 | 15 | json_dic = { 16 | "tableRow": [ 17 | {"header": "True Coverage", 18 | "value": res["mean_sample_coverage"], 19 | "table": "assembly", 20 | "columnBar": True}, 21 | ] 22 | } 23 | 24 | if fail_json: 25 | with open(fail_json) as fail_fh: 26 | fail = json.load(fail_fh) 27 | print("Fail JSON: {}".format(fail)) 28 | 29 | json_dic["fail"] = { 30 | "process": "true_coverage", 31 | "value": [] 32 | } 33 | 34 | for v in fail.values(): 35 | json_dic["fail"]["value"].append(v) 36 | 37 | report_fh.write(json.dumps(json_dic, separators=(",", ":"))) 38 | 39 | 40 | def main(): 41 | 42 | args = sys.argv[1:] 43 | report_json = args[0] 44 | try: 45 | fail_json = args[1] 46 | except IndexError: 47 | fail_json = None 48 | 49 | print("Parsing report {} and fail {}".format(report_json, fail_json)) 50 | 51 | parse_true_coverage(report_json, fail_json) 52 | 53 | 54 | main() 55 | -------------------------------------------------------------------------------- /flowcraft/bin/report_POST.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -ex 4 | 5 | projectid=$1 6 | pipelineid=$2 7 | processid=$3 8 | sample=$4 9 | url=$5 10 | username=$6 11 | userid=$7 12 | task=$8 13 | species=$9 14 | overwrite=${10} 15 | 16 | json_str="{}" 17 | version_str="[]" 18 | trace_str="" 19 | 20 | # If a .report.json file was populated, set the json_str variable 21 | if [ -s .report.json ]; 22 | then 23 | 24 | # Modification of the JSON string should be different for chewbbaca 25 | # output 26 | if [ $task = "chewbbaca" ]; 27 | then 28 | json_str=$(cat $(pwd)/.report.json | sed 's/ //g' | sed s/\"/\'/g) 29 | else 30 | json_str=$(cat $(pwd)/.report.json | sed 's/ /%20/g' | sed s/\"/\'/g) 31 | fi 32 | fi 33 | 34 | # If a .versions file was populated, set the version_str variable 35 | if [ -s .versions ]; 36 | then 37 | version_str=$(< $(pwd)/.versions sed 's/ /%20/g' | sed s/\"/\'/g) 38 | fi 39 | 40 | if [ -s .command.trace ]; 41 | then 42 | trace_str="$(< $(pwd)/.command.trace tr "\n" ";")" 43 | fi 44 | 45 | # If a .versions OR .report.json file was populated send the request 46 | if [ ! "$json_str" = "{}" ] || [ ! "$version_str" = "[]" ] || [ ! "$trace_str" = "" ]; 47 | then 48 | workdir=$(pwd) 49 | json="{'projectid':'$projectid','pipelineId':'$pipelineid','processId':'$processid','sample_name':'$sample','reportJson':$json_str,'username':'$username','userId':'$userid','workdir':'$workdir','task':'$task','processName':'$task','species':'$species','versions':$version_str,'trace':'$trace_str', 'overwrite': '$overwrite'}" 50 | echo \"${json}\" > .final.json 51 | { 52 | cat .final.json | curl -H "Content-Type: application/json" -k -L -X POST -d @- $url > /dev/null 53 | } || { 54 | echo Curl request failed 55 | } 56 | 57 | fi 58 | -------------------------------------------------------------------------------- /flowcraft/bin/set_dotfiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | touch .status .warning .fail .report.json .versions -------------------------------------------------------------------------------- /flowcraft/bin/startup_POST.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | json="{'project_id':'$1','pipeline_id':'$2','process_id':'$3','run_property':'log_file,status','run_property_value':'$(pwd)/.command.log,running','type':'output'}" 4 | 5 | { 6 | curl -H "Content-Type: application/json" -L -X PUT -d \"$json\" $4 > /dev/null 7 | } || { 8 | echo Curl request failed 9 | } -------------------------------------------------------------------------------- /flowcraft/generator/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Placeholder for Process creation docs 3 | """ -------------------------------------------------------------------------------- /flowcraft/generator/components/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/generator/components/__init__.py -------------------------------------------------------------------------------- /flowcraft/generator/components/alignment.py: -------------------------------------------------------------------------------- 1 | try: 2 | from generator.process import Process 3 | except ImportError: 4 | from flowcraft.generator.process import Process 5 | 6 | 7 | class Mafft(Process): 8 | """mafft to align sequences 9 | 10 | This process is set with: 11 | 12 | - ``input_type``: fasta 13 | - ``output_type``: align 14 | - ``ptype``: sequence alignment 15 | 16 | """ 17 | 18 | def __init__(self, **kwargs): 19 | 20 | super().__init__(**kwargs) 21 | 22 | self.input_type = "fasta" 23 | self.output_type = "align" 24 | 25 | self.params = { 26 | } 27 | 28 | self.link_end.append({"link": "_ref_seqTyping", "alias": "_ref_seqTyping"}) 29 | 30 | 31 | self.directives = { 32 | "mafft": { 33 | "container": "flowcraft/mafft", 34 | "version": "7.402-1", 35 | "cpus": 4, 36 | "memory": "{ 4.GB * task.attempt }" 37 | } 38 | } 39 | 40 | self.status_channels = [ 41 | "mafft" 42 | ] 43 | 44 | 45 | class ProgressiveMauve(Process): 46 | """Mauve to align sequences 47 | 48 | This process is set with: 49 | 50 | - ``input_type``: fasta 51 | - ``output_type``: align 52 | - ``ptype``: sequence alignment 53 | 54 | """ 55 | 56 | def __init__(self, **kwargs): 57 | 58 | super().__init__(**kwargs) 59 | 60 | self.input_type = "fasta" 61 | self.output_type = "align" 62 | 63 | self.params = { 64 | } 65 | 66 | self.directives = { 67 | "progressive_mauve": { 68 | "container": "flowcraft/mauve", 69 | "version": "2015.02.13-1", 70 | "cpus": 4, 71 | "memory": "{ 4.GB * task.attempt }" 72 | } 73 | } 74 | 75 | self.status_channels = [ 76 | "progressive_mauve" 77 | ] -------------------------------------------------------------------------------- /flowcraft/generator/components/phylogeny.py: -------------------------------------------------------------------------------- 1 | try: 2 | from generator.process import Process 3 | except ImportError: 4 | from flowcraft.generator.process import Process 5 | 6 | 7 | class Raxml(Process): 8 | """mafft to align sequences 9 | 10 | This process is set with: 11 | 12 | - ``input_type``: align 13 | - ``output_type``: .tree 14 | - ``ptype``: tree 15 | 16 | """ 17 | 18 | def __init__(self, **kwargs): 19 | 20 | super().__init__(**kwargs) 21 | 22 | self.input_type = "align" 23 | self.output_type = ".tree" 24 | 25 | self.params = { 26 | "substitutionModel": { 27 | "default": "'GTRGAMMA'", 28 | "description": "Substitution model. Option: GTRCAT, GTRCATI, ASC_GTRCAT, GTRGAMMA, ASC_GTRGAMMA etc " 29 | }, 30 | "seedNumber": { 31 | "default": "12345", 32 | "description": "Specify an integer number (random seed) and turn on rapid bootstrapping" 33 | }, 34 | "bootstrap": { 35 | "default": "500", 36 | "description": "Specify the number of alternative runs on distinct starting trees" 37 | }, 38 | "simpleLabel": { 39 | "default": "true", 40 | "description": "Simplify the labels in the newick tree (for interactive report only)" 41 | } 42 | } 43 | 44 | self.directives = { 45 | "raxml": { 46 | "container": "flowcraft/raxml", 47 | "version": "8.2.11-2", 48 | "cpus": 4, 49 | "memory": "{ 4.GB * task.attempt }" 50 | }, 51 | "report_raxml": { 52 | "container": "flowcraft/raxml", 53 | "version": "8.2.11-2" 54 | } 55 | } 56 | 57 | self.status_channels = [ 58 | "raxml", 59 | "report_raxml" 60 | ] 61 | 62 | 63 | -------------------------------------------------------------------------------- /flowcraft/generator/components/variant_calling.py: -------------------------------------------------------------------------------- 1 | try: 2 | from generator.process import Process 3 | except ImportError: 4 | from flowcraft.generator.process import Process 5 | 6 | 7 | class Haplotypecaller(Process): 8 | """Call germline SNPs and indels via local re-assembly of haplotypes 9 | 10 | This process is set with: 11 | 12 | - ``input_type``: bam 13 | - ``output_type``: vcf 14 | - ``ptype``: varaint calling 15 | 16 | """ 17 | 18 | def __init__(self, **kwargs): 19 | 20 | super().__init__(**kwargs) 21 | 22 | self.input_type = "bam" 23 | 24 | self.params = { 25 | "reference": { 26 | "default": "null", 27 | "description": "Specifies the reference genome to be provided " 28 | "to GATK HaplotypeCaller." 29 | }, 30 | "intervals": { 31 | "default": "null", 32 | "description": "Interval list file to specify the regions to call variants." 33 | } 34 | } 35 | 36 | self.directives = { 37 | "haplotypecaller": { 38 | "container": "broadinstitute/gatk", 39 | "memory": "{2.Gb*task.attempt}", 40 | "cpus": 4, 41 | }, 42 | "merge_vcfs": { 43 | "container": "broadinstitute/gatk", 44 | "memory": "{5.Gb*task.attempt}", 45 | "cpus": 4, 46 | } 47 | } 48 | 49 | self.status_channels = [ 50 | "haplotypecaller", 51 | "merge_vcfs" 52 | ] -------------------------------------------------------------------------------- /flowcraft/generator/error_handling.py: -------------------------------------------------------------------------------- 1 | class ProcessError(Exception): 2 | def __init__(self, value): 3 | self.value = value 4 | 5 | def __str__(self): 6 | return repr(self.value) 7 | 8 | 9 | class SanityError(Exception): 10 | """ 11 | Class to raise a custom error for sanity checks 12 | """ 13 | def __init__(self, value): 14 | self.value = "inSANITY ERROR: {}".format(value) 15 | 16 | # def __str__(self): 17 | # return repr(self.value) 18 | 19 | 20 | class InspectionError(Exception): 21 | def __init__(self, value): 22 | self.value = "Inspection ERROR: {}".format(value) 23 | 24 | 25 | class ReportError(Exception): 26 | def __init__(self, value): 27 | self.value = "Reports ERROR: {}".format(value) 28 | 29 | 30 | class RecipeError(Exception): 31 | def __init__(self, value): 32 | self.value = "Recipe ERROR: {}".format(value) 33 | 34 | # def __str__(self): 35 | # return repr(self.value) 36 | 37 | class LogError(Exception): 38 | def __init__(self, value): 39 | self.value = "Log ERROR: {}".format(value) 40 | -------------------------------------------------------------------------------- /flowcraft/generator/footer_skeleton.py: -------------------------------------------------------------------------------- 1 | footer = """ 2 | workflow.onComplete { 3 | // Display complete message 4 | log.info "Completed at: " + workflow.complete 5 | log.info "Duration : " + workflow.duration 6 | log.info "Success : " + workflow.success 7 | log.info "Exit status : " + workflow.exitStatus 8 | } 9 | 10 | workflow.onError { 11 | // Display error message 12 | log.info "Workflow execution stopped with the following message:" 13 | log.info " " + workflow.errorMessage 14 | } 15 | """ -------------------------------------------------------------------------------- /flowcraft/generator/header_skeleton.py: -------------------------------------------------------------------------------- 1 | header = """#!/usr/bin/env nextflow 2 | 3 | import Helper 4 | import CollectInitialMetadata 5 | 6 | // Pipeline version 7 | if (workflow.commitId){ 8 | version = "0.1 $workflow.revision" 9 | } else { 10 | version = "0.1 (local version)" 11 | } 12 | 13 | params.help = false 14 | if (params.help){ 15 | Help.print_help(params) 16 | exit 0 17 | } 18 | 19 | def infoMap = [:] 20 | if (params.containsKey("fastq")){ 21 | infoMap.put("fastq", file(params.fastq).size()) 22 | } 23 | if (params.containsKey("fasta")){ 24 | if (file(params.fasta) instanceof LinkedList){ 25 | infoMap.put("fasta", file(params.fasta).size()) 26 | } else { 27 | infoMap.put("fasta", 1) 28 | } 29 | } 30 | if (params.containsKey("accessions")){ 31 | // checks if params.accessions is different from null 32 | if (params.accessions) { 33 | BufferedReader reader = new BufferedReader(new FileReader(params.accessions)); 34 | int lines = 0; 35 | while (reader.readLine() != null) lines++; 36 | reader.close(); 37 | infoMap.put("accessions", lines) 38 | } 39 | } 40 | 41 | Help.start_info(infoMap, "$workflow.start", "$workflow.profile") 42 | CollectInitialMetadata.print_metadata(workflow) 43 | """ -------------------------------------------------------------------------------- /flowcraft/generator/process_collector.py: -------------------------------------------------------------------------------- 1 | import re 2 | import pkgutil 3 | 4 | try: 5 | from generator import components 6 | except ImportError: 7 | from flowcraft.generator import components 8 | 9 | 10 | def convert_camel_case(name): 11 | """Convers a CamelCase string into a snake_case one 12 | 13 | Parameters 14 | ---------- 15 | name : str 16 | An arbitrary string that may be CamelCase 17 | 18 | Returns 19 | ------- 20 | str 21 | The input string converted into snake_case 22 | 23 | """ 24 | s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) 25 | return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() 26 | 27 | 28 | def collect_process_map(): 29 | """Collects Process classes and return dict mapping templates to classes 30 | 31 | This function crawls through the components module and retrieves all 32 | classes that inherit from the Process class. Then, it converts the name 33 | of the classes (which should be CamelCase) to snake_case, which is used 34 | as the template name. 35 | 36 | Returns 37 | ------- 38 | dict 39 | Dictionary mapping the template name (snake_case) to the corresponding 40 | process class. 41 | """ 42 | 43 | process_map = {} 44 | 45 | prefix = "{}.".format(components.__name__) 46 | for importer, modname, _ in pkgutil.iter_modules(components.__path__, 47 | prefix): 48 | 49 | _module = importer.find_module(modname).load_module(modname) 50 | 51 | _component_classes = [ 52 | cls for cls in _module.__dict__.values() if 53 | isinstance(cls, type) and cls.__name__ != "Process" 54 | ] 55 | 56 | for cls in _component_classes: 57 | process_map[convert_camel_case(cls.__name__)] = cls 58 | 59 | return process_map 60 | -------------------------------------------------------------------------------- /flowcraft/generator/recipes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/generator/recipes/__init__.py -------------------------------------------------------------------------------- /flowcraft/generator/recipes/denim.py: -------------------------------------------------------------------------------- 1 | try: 2 | from generator.recipe import Recipe 3 | except ImportError: 4 | from flowcraft.generator.recipe import Recipe 5 | 6 | 7 | class Denim(Recipe): 8 | """ 9 | DEN-IM: Dengue Virus Identification from Metagenomic and Targeted Sequencing 10 | Standalone version available at https://github.com/assemblerflow/DEN-IM 11 | """ 12 | 13 | def __init__(self): 14 | 15 | self.name = "denim" 16 | 17 | self.pipeline_str = "integrity_coverage " \ 18 | "fastqc_trimmomatic " \ 19 | "filter_poly " \ 20 | "bowtie " \ 21 | "retrieve_mapped " \ 22 | "check_coverage " \ 23 | "viral_assembly " \ 24 | "assembly_mapping " \ 25 | "pilon " \ 26 | "split_assembly " \ 27 | "dengue_typing " \ 28 | "mafft " \ 29 | "raxml" 30 | 31 | # Recipe parameters and directives 32 | self.directives = { 33 | "integrity_coverage": { 34 | "params": {"genomeSize": "0.012", "minCoverage": "15"} 35 | }, 36 | "check_coverage": { 37 | "params": {"genomeSize": "0.012", "minCoverage": "15"} 38 | }, 39 | "bowtie": { 40 | "directives": {"container": "flowcraft/bowtie_dengue", 41 | "version": "2-1"}, 42 | "params": { 43 | "reference": "\"ref/1_GenotypesDENV_14-05-18.fasta\""} 44 | }, 45 | "assembly_mapping": { 46 | "params": {"AMaxContigs": "1000", "genomeSize": "0.01"} 47 | }, 48 | "split_assembly": { 49 | "params": {"size": "10000"} 50 | } 51 | } -------------------------------------------------------------------------------- /flowcraft/generator/recipes/innuca.py: -------------------------------------------------------------------------------- 1 | try: 2 | from generator.recipe import Recipe 3 | except ImportError: 4 | from flowcraft.generator.recipe import Recipe 5 | 6 | 7 | class Innuca(Recipe): 8 | """ 9 | Bacterial genome assembly pipeline based on the SPAdes assembler and using 10 | pre-assembly quality control and read trimming and post-assembly polishing 11 | with Pilon 12 | """ 13 | 14 | def __init__(self): 15 | super().__init__() 16 | 17 | # Recipe name 18 | self.name = "innuca" 19 | 20 | # Recipe pipeline 21 | self.pipeline_str = "integrity_coverage " \ 22 | "fastqc_trimmomatic " \ 23 | "fastqc " \ 24 | "check_coverage " \ 25 | "true_coverage " \ 26 | "spades " \ 27 | "process_spades " \ 28 | "pilon " \ 29 | "mlst " 30 | 31 | # Recipe parameters and directives 32 | self.directives = { 33 | "integrity_coverage": { 34 | "directives": {"cpus": "1", "memory": "\"2GB\""}, 35 | "params": {"genomeSize": "1", "minCoverage": "15"} 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/abyss.nf: -------------------------------------------------------------------------------- 1 | process abyss_{{ pid }} { 2 | {% include "post.txt" ignore missing %} 3 | 4 | tag { sample_id } 5 | publishDir 'results/assembly/abyss_{{ pid }}/', pattern: '*-scaffolds.fa' 6 | publishDir 'results/assembly/abyss_{{ pid }}/', pattern: '*-scaffolds.gfa' 7 | 8 | input: 9 | set sample_id, file(fastq_pair) from {{ input_channel }} 10 | val k from Channel.value(params.abyssKmer{{ param_id }}) 11 | 12 | output: 13 | set sample_id, file('*-scaffolds.fa') into {{ output_channel }} 14 | file "*-scaffolds.gfa" into gfa1_{{ pid }} 15 | {% with task_name="abyss" %} 16 | {%- include "compiler_channels.txt" ignore missing -%} 17 | {% endwith %} 18 | 19 | script: 20 | "abyss-pe name=${sample_id} graph=gfa k=${k} v=-v in=\"${fastq_pair[0]} ${fastq_pair[1]}\"" 21 | } 22 | 23 | {{ forks }} 24 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/bandage.nf: -------------------------------------------------------------------------------- 1 | // True when a GFA secondary channel is connected to this component. 2 | has_gfa1_{{pid}} = binding.hasVariable('gfa1_{{pid}}') 3 | 4 | process bandage_{{pid}} { 5 | {% include "post.txt" ignore missing %} 6 | 7 | tag { sample_id } 8 | publishDir "reports/assembly/bandage_{{pid}}/$sample_id" 9 | 10 | input: 11 | set sample_id, file(fasta) from {{input_channel}} 12 | file gfa1 from has_gfa1_{{pid}} ? gfa1_{{pid}} : Channel.value("NA") 13 | file reference from params.reference{{param_id}} ? 14 | Channel.fromPath(params.reference{{param_id}}) : 15 | Channel.value("NA") 16 | 17 | output: 18 | file "*.png" 19 | file "*.svg" 20 | {% with task_name="bandage" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | script: 25 | // Use the GFA assembly when available and FASTA otherwise. 26 | assembly = has_gfa1_{{pid}} ? gfa1 : fasta 27 | command = 28 | """ 29 | time Bandage image $assembly ${assembly}.png >>.command.log 2>&1 30 | time Bandage image $assembly ${assembly}.svg >>.command.log 2>&1 31 | """ 32 | if (params.reference{{param_id}}) 33 | command += 34 | """ 35 | time Bandage image $assembly ${assembly}.ref.png --query $reference >>.command.log 2>&1 36 | time Bandage image $assembly ${assembly}.ref.svg --query $reference >>.command.log 2>&1 37 | """ 38 | command 39 | } 40 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/bcalm.nf: -------------------------------------------------------------------------------- 1 | // Check parameter 2 | if ( !params.bcalmKmerSize{{ param_id }}.toString().isNumber() ){ 3 | exit 1, "'bcalmKmerSize{{ param_id }}' parameter must be a number. Provided value: '${params.bcalmKmes%rSize{{ param_id }}}'" 4 | } 5 | 6 | // Clear 7 | clear = params.clearInput{{ param_id }} ? "true" : "false" 8 | checkpointClear_{{ pid }} = Channel.value(clear) 9 | 10 | process bcalm_{{ pid }} { 11 | {% include "post.txt" ignore missing %} 12 | 13 | tag { sample_id } 14 | publishDir "reports/assembly/quast_{{pid}}/$sample_id" 15 | 16 | input: 17 | set sample_id, file(fastq) from {{input_channel}} 18 | val KmerSize from Channel.value(params.bcalmKmerSize{{param_id}}) 19 | 20 | output: 21 | file "*.unitig.fa" 22 | {% with task_name="bcalm" %} 23 | {%- include "compiler_channels.txt" ignore missing -%} 24 | {% endwith %} 25 | 26 | script: 27 | """ 28 | { 29 | bcalm -in $fastq -out unitig -kmer-size $KmerSize" 30 | 31 | if [ "$clear" = "true" ]; 32 | then 33 | find . -type f -print | egrep "work/.*(h5)|(glue)" | xargs -L 1 rm 34 | fi 35 | } 36 | """ 37 | } 38 | 39 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/bwa.nf: -------------------------------------------------------------------------------- 1 | bwaIndexId_{{ pid }} = Channel.value(params.bwaIndex{{ param_id }}.split("/").last()) 2 | bwaIndex_{{ pid }} = Channel.fromPath("${params.bwaIndex{{ param_id }}}.*").collect().toList() 3 | 4 | process bwa_{{ pid }} { 5 | 6 | {% include "post.txt" ignore missing %} 7 | 8 | publishDir "results/mapping/bwa_{{ pid }}" 9 | 10 | input: 11 | set sample_id, file(fastq_pair) from {{ input_channel }} 12 | each index from bwaIndexId_{{pid}} 13 | each file(index_file) from bwaIndex_{{pid}} 14 | 15 | output: 16 | set sample_id, file("${sample_id}.bam"), file("${sample_id}.bam.bai") into {{ output_channel }} 17 | {% with task_name="bwa" %} 18 | {%- include "compiler_channels.txt" ignore missing -%} 19 | {% endwith %} 20 | 21 | """ 22 | bwa mem -M -R '@RG\\tID:${sample_id}\\tSM:${sample_id}\\tPL:Illumina' -t $task.cpus $index $fastq_pair > ${sample_id}.sam 23 | samtools sort -o ${sample_id}.bam -O BAM ${sample_id}.sam 24 | samtools index ${sample_id}.bam 25 | """ 26 | } 27 | 28 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/card_rgi.nf: -------------------------------------------------------------------------------- 1 | IN_alignment_tool_{{ pid }} = Channel.value(params.alignmentTool{{ param_id }}) 2 | 3 | 4 | process card_rgi_{{ pid }} { 5 | 6 | // Send POST request to platform 7 | {% include "post.txt" ignore missing %} 8 | 9 | tag { sample_id } 10 | 11 | publishDir "results/annotation/card_rgi/", pattern: "*.txt" 12 | 13 | input: 14 | set sample_id, file(assembly) from {{ input_channel }} 15 | val alignmetTool from IN_alignment_tool_{{ pid }} 16 | 17 | output: 18 | file("${sample_id}_card_rgi.txt") 19 | {% with task_name="card_rgi" %} 20 | {%- include "compiler_channels.txt" ignore missing -%} 21 | {% endwith %} 22 | 23 | script: 24 | """ 25 | # Place card_rgi source in a read/write location for shifter container 26 | mkdir card_temp && cp -r /usr/local/lib/python3.5/dist-packages/app/ card_temp 27 | export PYTHONPATH="\$(pwd)/card_temp:\$PATH" 28 | 29 | rgi main --input_sequence ${assembly} --output_file ${sample_id}_card_rgi --input_type contig --alignment_tool ${alignmetTool} --low_quality --include_loose -d wgs --clean 30 | """ 31 | } 32 | 33 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/check_coverage.nf: -------------------------------------------------------------------------------- 1 | IN_genome_size_{{ pid }} = Channel.value(params.genomeSize{{ param_id }}) 2 | .map{it -> it.toString().isNumber() ? it : exit (1, "The genomeSize parameter must be a number or a float. Provided value: '${params.genomeSize{{ param_id }}}'")} 3 | IN_min_coverage_{{ pid }} = Channel.value(params.minCoverage{{ param_id }}) 4 | .map{it -> it.toString().isNumber() ? it : exit (1, "The minCoverage parameter must be a number or a float. Provided value: '${params.minCoverage{{ param_id }}}'")} 5 | 6 | process integrity_coverage2_{{ pid }} { 7 | 8 | // Send POST request to platform 9 | {% include "post.txt" ignore missing %} 10 | 11 | tag { sample_id } 12 | cpus 1 13 | 14 | input: 15 | set sample_id, file(fastq_pair) from {{ input_channel }} 16 | val gsize from IN_genome_size_{{ pid }} 17 | val cov from IN_min_coverage_{{ pid }} 18 | // Use -e option for skipping encoding guess 19 | val opts from Channel.value('-e') 20 | 21 | output: 22 | set sample_id, 23 | file(fastq_pair), 24 | file('*_coverage'), 25 | file('*_max_len') optional true into MAIN_integrity_{{ pid }} 26 | file('*_report') into LOG_report_coverage_{{ pid }} 27 | {% with task_name="check_coverage" %} 28 | {%- include "compiler_channels.txt" ignore missing -%} 29 | {% endwith %} 30 | 31 | script: 32 | template "integrity_coverage.py" 33 | } 34 | 35 | {{ output_channel }} = Channel.create() 36 | SIDE_max_len_{{ pid }} = Channel.create() 37 | 38 | MAIN_integrity_{{ pid }} 39 | .filter{ it[2].text != "fail" } 40 | .separate({{ output_channel }}, SIDE_max_len_{{ pid }}){ 41 | a -> [ [a[0], a[1]], [a[0], a[3].text]] 42 | } 43 | 44 | 45 | process report_coverage2_{{ pid }} { 46 | 47 | // This process can only use a single CPU 48 | cpus 1 49 | publishDir 'reports/coverage_{{ pid }}/' 50 | 51 | input: 52 | file(report) from LOG_report_coverage_{{ pid }}.filter{ it.text != "corrupt" }.collect() 53 | 54 | output: 55 | file 'estimated_coverage_second.csv' 56 | 57 | """ 58 | echo Sample,Estimated coverage,Status >> estimated_coverage_second.csv 59 | cat $report >> estimated_coverage_second.csv 60 | """ 61 | } 62 | 63 | {{ forks }} 64 | 65 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/compiler_channels.txt: -------------------------------------------------------------------------------- 1 | set {{ sample_id|default("sample_id") }}, val("{{ pid }}_{{ task_name }}{{ suffix }}"), file(".status"), file(".warning"), file(".fail"), file(".command.log") into STATUS_{{task_name}}_{{ pid }} 2 | set {{ sample_id|default("sample_id") }}, val("{{ task_name }}_{{ pid }}{{ suffix }}"), val("{{ pid }}"), file(".report.json"), file(".versions"), file(".command.trace") into REPORT_{{task_name}}_{{ pid }} 3 | file ".versions" -------------------------------------------------------------------------------- /flowcraft/generator/templates/containers.config: -------------------------------------------------------------------------------- 1 | process { 2 | {{ container_info }} 3 | 4 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/downsample_fastq.nf: -------------------------------------------------------------------------------- 1 | 2 | IN_genome_size_{{ pid }} = Channel.value(params.genomeSize{{ param_id }}) 3 | .map{it -> it.toString().isNumber() ? it : exit(1, "The genomeSize parameter must be a number or a float. Provided value: '${params.genomeSize{{ param_id }}}'")} 4 | 5 | IN_depth_{{ pid }} = Channel.value(params.depth{{ param_id }}) 6 | .map{it -> it.toString().isNumber() ? it : exit(1, "The depth parameter must be a number or a float. Provided value: '${params.depth{{ param_id }}}'")} 7 | 8 | IN_seed_{{ pid }} = Channel.value(params.seed{{ param_id }}) 9 | .map{it -> it.toString().isNumber() ? it : exit(1, "The seed parameter must be a number or a float. Provided value: '${params.seed{{ param_id }}}'")} 10 | 11 | clear = params.clearInput{{ param_id }} ? "true" : "false" 12 | checkpointClear_{{ pid }} = Channel.value(clear) 13 | 14 | process downsample_fastq_{{ pid }} { 15 | 16 | // Send POST request to platform 17 | {% include "post.txt" ignore missing %} 18 | 19 | tag { "${sample_id}" } 20 | publishDir "results/downsample_fastq_{{ pid }}/", pattern: "_ss.*" 21 | 22 | input: 23 | set sample_id, file(fastq_pair) from {{ input_channel }} 24 | val gsize from IN_genome_size_{{ pid }} 25 | val depth from IN_depth_{{ pid }} 26 | val seed from IN_seed_{{ pid }} 27 | val clear from checkpointClear_{{ pid }} 28 | 29 | output: 30 | set sample_id, file('*_ss.*') into {{ output_channel }} 31 | {% with task_name="downsample_fastq" %} 32 | {%- include "compiler_channels.txt" ignore missing -%} 33 | {% endwith %} 34 | 35 | script: 36 | template "downsample_fastq.py" 37 | 38 | } 39 | 40 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/fast_ani.nf: -------------------------------------------------------------------------------- 1 | IN_fragLen_{{ pid }} = Channel.value(params.fragLen{{ param_id }}) 2 | 3 | // runs fast ani for multiple comparisons (many to many mode) 4 | process fastAniMatrix_{{ pid }} { 5 | 6 | {% include "post.txt" ignore missing %} 7 | 8 | tag { sample_id } 9 | 10 | publishDir 'results/fast_ani/fast_ani_{{ pid }}/', 11 | 12 | input: 13 | set sample_id, file(fasta) from {{ input_channel }} 14 | val fragLenValue from IN_fragLen_{{ pid }} 15 | 16 | output: 17 | set sample_id, fasta, file("*.out") 18 | {% with task_name="fastAniMatrix", sample_id="sample_id" %} 19 | {%- include "compiler_channels.txt" ignore missing -%} 20 | {% endwith %} 21 | 22 | """ 23 | mkdir fasta_store 24 | fasta_spliter.py ${fasta} 25 | fastANI --ql files_fastani.txt --rl files_fastani.txt \ 26 | -t ${task.cpus} --fragLen ${fragLenValue} \ 27 | -o ${sample_id.take(sample_id.lastIndexOf("."))}_fastani.out 28 | """ 29 | 30 | } 31 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/fasterq_dump.nf: -------------------------------------------------------------------------------- 1 | // check if option file is provided or not 2 | optionFile = (params.option_file{{ param_id }} == false) ? "" : 3 | "--option-file ${params.option_file{{ param_id }}}" 4 | 5 | // process to run fasterq-dump from sra-tools 6 | process fasterqDump_{{ pid }} { 7 | 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { accession_id } 11 | publishDir "reads/${accession_id}/", pattern: "*.fastq*" 12 | maxRetries 1 13 | 14 | input: 15 | val accession_id from {{ input_channel }}.splitText(){ it.trim() }.filter{ it.trim() != "" } 16 | 17 | output: 18 | set accession_id, file("*.fastq*") optional true into {{ output_channel }} 19 | {% with task_name="fasterqDump", sample_id="accession_id" %} 20 | {%- include "compiler_channels.txt" ignore missing -%} 21 | {% endwith %} 22 | 23 | script: 24 | """ 25 | { 26 | echo "Downloading the following accession: ${accession_id}" 27 | fasterq-dump ${accession_id} -e ${task.cpus} -p ${optionFile} 28 | if [ ${params.compress_fastq{{ param_id }}} = true ] 29 | then 30 | echo "Compressing FastQ files..." 31 | if [ -f ${accession_id}_1.fastq ] 32 | then 33 | pigz -p ${task.cpus} ${accession_id}_1.fastq ${accession_id}_2.fastq 34 | elif [ -f ${accession_id}_3.fastq ] 35 | then 36 | echo "No paired end reads were found to compress." 37 | pigz -p ${task.cpus} ${accession_id}_3.fastq 38 | else 39 | echo "FastQ files weren't compressed. Check if FastQ files were downloaded." 40 | fi 41 | else 42 | echo "FastQ files won't be compressed because compress_fastq options was set to: '${params.compress_fastq{{ param_id }}}.'" 43 | fi 44 | } || { 45 | # If exit code other than 0 46 | if [ \$? -eq 0 ] 47 | then 48 | echo "pass" > .status 49 | else 50 | echo "fail" > .status 51 | echo "Could not download accession $accession_id" > .fail 52 | fi 53 | } 54 | """ 55 | } 56 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/filter_poly.nf: -------------------------------------------------------------------------------- 1 | IN_adapter_{{ pid }} = Channel.value(params.adapter{{ param_id }}) 2 | 3 | clear = params.clearInput{{ param_id }} ? "true" : "false" 4 | checkpointClear_{{ pid }} = Channel.value(clear) 5 | 6 | process filter_poly_{{ pid }} { 7 | 8 | // Send POST request to platform 9 | {% include "post.txt" ignore missing %} 10 | 11 | tag { sample_id } 12 | echo true 13 | 14 | errorStrategy { task.exitStatus == 120 ? 'ignore' : 'retry' } 15 | 16 | input: 17 | set sample_id, file(fastq_pair) from {{ input_channel }} 18 | val adapter from IN_adapter_{{ pid }} 19 | val clear from checkpointClear_{{ pid }} 20 | 21 | output: 22 | set sample_id , file("${sample_id}_filtered_{1,2}.fastq.gz") into {{ output_channel }} 23 | {% with task_name="filter_poly" %} 24 | {%- include "compiler_channels.txt" ignore missing -%} 25 | {% endwith %} 26 | 27 | script: 28 | """ 29 | gunzip -c ${fastq_pair[0]} > ${sample_id}_1.fq 30 | gunzip -c ${fastq_pair[1]} > ${sample_id}_2.fq 31 | 32 | for seqfile in *.fq; 33 | do if [ ! -s \$seqfile ] 34 | then 35 | echo \$seqfile is empty && exit 120 36 | fi 37 | done 38 | 39 | prinseq-lite.pl --fastq ${sample_id}_1.fq --fastq2 ${sample_id}_2.fq --custom_params "${adapter}" -out_format 3 -out_good ${sample_id}_filtered 40 | 41 | gzip ${sample_id}_filtered_*.fastq 42 | 43 | #rm *.fq *.fastq 44 | 45 | if [ "$clear" = "true" ]; 46 | then 47 | work_regex=".*/work/.{2}/.{30}/.*" 48 | file_source1=\$(readlink -f \$(pwd)/${fastq_pair[0]}) 49 | file_source2=\$(readlink -f \$(pwd)/${fastq_pair[1]}) 50 | if [[ "\$file_source1" =~ \$work_regex ]]; then 51 | rm \$file_source1 \$file_source2 52 | fi 53 | fi 54 | 55 | """ 56 | } 57 | 58 | {{ forks }} 59 | 60 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/init.nf: -------------------------------------------------------------------------------- 1 | 2 | // Placeholder for main input channels 3 | {{ main_inputs }} 4 | 5 | // Placeholder for secondary input channels 6 | {{ secondary_inputs }} 7 | 8 | // Placeholder for extra input channels 9 | {{ extra_inputs }} 10 | 11 | // Placeholder to fork the raw input channel 12 | {{ forks }} 13 | 14 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/kraken.nf: -------------------------------------------------------------------------------- 1 | IN_kraken_DB_{{ pid }} = Channel.value(params.krakenDB{{ param_id }}) 2 | 3 | 4 | //Process to run Kraken 5 | process kraken_{{ pid }} { 6 | 7 | // Send POST request to platform 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { sample_id } 11 | 12 | publishDir "results/taxonomy/kraken/", pattern: "*.txt" 13 | 14 | input: 15 | set sample_id, file(fastq_pair) from {{ input_channel }} 16 | val krakenDB from IN_kraken_DB_{{ pid }} 17 | 18 | output: 19 | file("${sample_id}_kraken_report.txt") 20 | {% with task_name="kraken" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | script: 25 | """ 26 | kraken --preload --fastq-input --db ${krakenDB} --threads $task.cpus --output ${sample_id}_kraken.txt --paired --gzip-compressed ${fastq_pair[0]} ${fastq_pair[1]} 27 | 28 | kraken-report --db ${krakenDB} ${sample_id}_kraken.txt > ${sample_id}_kraken_report.txt 29 | """ 30 | } 31 | 32 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/kraken2.nf: -------------------------------------------------------------------------------- 1 | IN_kraken2_DB_{{ pid }} = Channel.value(params.kraken2DB{{ param_id }}) 2 | 3 | 4 | //Process to run Kraken2 5 | process kraken2_{{ pid }} { 6 | 7 | // Send POST request to platform 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { sample_id } 11 | 12 | publishDir "results/taxonomy/kraken2/", pattern: "*.txt" 13 | 14 | input: 15 | set sample_id, file(fastq_pair) from {{ input_channel }} 16 | val krakenDB from IN_kraken2_DB_{{ pid }} 17 | 18 | output: 19 | file("${sample_id}_kraken_report.txt") 20 | {% with task_name="kraken2" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | script: 25 | """ 26 | kraken2 --memory-mapping --threads $task.cpus --report ${sample_id}_kraken_report.txt --db ${krakenDB} --paired \ 27 | --gzip-compressed ${fastq_pair[0]} ${fastq_pair[1]} 28 | """ 29 | } 30 | 31 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/mafft.nf: -------------------------------------------------------------------------------- 1 | // True when a dengue_typing secondary channel is connected 2 | has_ref_{{pid}} = binding.hasVariable('_ref_seqTyping_{{ pid }}') 3 | 4 | if ( has_ref_{{pid}} ){ 5 | {{ input_channel }}.map{ it[1] }.collect().mix(_ref_seqTyping_{{pid}}.unique{it.name}).set{mafft_input} 6 | } else { 7 | {{ input_channel }}.map{ it[1] }.collect().set{mafft_input} 8 | } 9 | 10 | //{{ input_channel }}.map{ it[1] }.mix(_ref_seqTyping_{{ pid }}.unique()).set{mafft_input} 11 | 12 | process mafft_{{ pid }} { 13 | 14 | {% include "post.txt" ignore missing %} 15 | 16 | tag { 'mafft' } 17 | 18 | publishDir "results/alignment/mafft_{{ pid }}/" 19 | 20 | input: 21 | file(assembly) from mafft_input.collect() 22 | 23 | output: 24 | file ("*.align") into {{ output_channel }} 25 | {% with task_name="mafft", sample_id="val('single')" %} 26 | {%- include "compiler_channels.txt" ignore missing -%} 27 | {% endwith %} 28 | 29 | script: 30 | """ 31 | cat ${assembly} > all_assemblies.fasta 32 | 33 | mafft --adjustdirection --thread $task.cpus --auto all_assemblies.fasta > ${workflow.scriptName}.align 34 | """ 35 | 36 | } 37 | 38 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/mark_duplicates.nf: -------------------------------------------------------------------------------- 1 | process mark_duplicates_{{ pid }} { 2 | 3 | {% include "post.txt" ignore missing %} 4 | 5 | input: 6 | set sample_id, file(bam), file(bai) from {{ input_channel }} 7 | 8 | output: 9 | set val(sample_id), file("${sample_id}_mark_dup.bam"), file("${sample_id}_mark_dup.bai") into {{ output_channel }} 10 | set file("metrics.txt") into markDupMultiQC_{{pid}} 11 | {% with task_name="mark_duplicates" %} 12 | {%- include "compiler_channels.txt" ignore missing -%} 13 | {% endwith %} 14 | 15 | """ 16 | gatk MarkDuplicates \ 17 | -I $bam \ 18 | -M metrics.txt \ 19 | -O ${sample_id}_mark_dup.bam \ 20 | --CREATE_INDEX 21 | """ 22 | } 23 | 24 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/mash_dist.nf: -------------------------------------------------------------------------------- 1 | IN_shared_hashes_{{ pid }} = Channel.value(params.shared_hashes{{ param_id }}) 2 | 3 | IN_mash_dist_input = Channel.create() 4 | // If the side channel with the sketch exists, join the corresponding .msh file 5 | // with the appropriate sample_id 6 | if (binding.hasVariable("SIDE_mashSketchOutChannel_{{ pid }}")){ 7 | {{ input_channel }} 8 | .join(SIDE_mashSketchOutChannel_{{ pid }}) 9 | .into(IN_mash_dist_input) 10 | // Otherwise, always use the .msh file provided in the docker image 11 | } else { 12 | {{ input_channel }} 13 | .map{ it -> [it[0], it[1], params.refFile{{ param_id }}] } 14 | .into(IN_mash_dist_input) 15 | } 16 | 17 | // runs mash dist 18 | process runMashDist_{{ pid }} { 19 | 20 | {% include "post.txt" ignore missing %} 21 | 22 | tag { sample_id } 23 | 24 | publishDir 'results/mashdist/mashdist_txt_{{ pid }}/' 25 | 26 | input: 27 | set sample_id, file(fasta), refFile from IN_mash_dist_input 28 | 29 | output: 30 | set sample_id, file(fasta), file("*_mashdist.txt") into mashDistOutChannel_{{ pid }} 31 | {% with task_name="runMashDist", sample_id="sample_id" %} 32 | {%- include "compiler_channels.txt" ignore missing -%} 33 | {% endwith %} 34 | 35 | """ 36 | mash dist -i -p ${task.cpus} -v ${params.pValue{{ param_id }}} \ 37 | -d ${params.mash_distance{{ param_id }}} ${refFile} ${fasta} > ${fasta}_mashdist.txt 38 | """ 39 | 40 | } 41 | 42 | // parses mash dist output to a json file that can be imported into pATLAS 43 | process mashDistOutputJson_{{ pid }} { 44 | 45 | {% include "post.txt" ignore missing %} 46 | 47 | tag { sample_id } 48 | 49 | publishDir 'results/mashdist/mashdist_json_{{ pid }}/' 50 | 51 | input: 52 | set sample_id, fasta, file(mashtxt) from mashDistOutChannel_{{ pid }} 53 | val shared_hashes from IN_shared_hashes_{{ pid }} 54 | 55 | output: 56 | set sample_id, file("*.json") optional true into {{ output_channel }} 57 | {% with task_name="mashDistOutputJson", sample_id="sample_id" %} 58 | {%- include "compiler_channels.txt" ignore missing -%} 59 | {% endwith %} 60 | 61 | script: 62 | template "mashdist2json.py" 63 | 64 | } 65 | 66 | {{ forks }} 67 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/mash_screen.nf: -------------------------------------------------------------------------------- 1 | if (binding.hasVariable("SIDE_mashSketchOutChannel_{{ pid }}")){ 2 | IN_reference_file_{{ pid }} = SIDE_mashSketchOutChannel_{{ pid }} 3 | } else { 4 | IN_reference_file_{{ pid }} = Channel.value(params.refFile{{ param_id }}) 5 | } 6 | 7 | // check if noWinner is provided or not 8 | winnerVar = (params.noWinner{{ param_id }} == false) ? "-w" : "" 9 | 10 | // process to run mashScreen and sort the output into 11 | // sortedMashScreenResults_{sampleId}.txt 12 | process mashScreen_{{ pid }} { 13 | 14 | {% include "post.txt" ignore missing %} 15 | 16 | tag { sample_id } 17 | 18 | input: 19 | set sample_id, file(reads) from {{ input_channel }} 20 | val refFile from IN_reference_file_{{ pid }} 21 | 22 | output: 23 | set sample_id, file("sortedMashScreenResults*.txt") into mashScreenResults_{{ pid }} 24 | {% with task_name="mashScreen", sample_id="sample_id" %} 25 | {%- include "compiler_channels.txt" ignore missing -%} 26 | {% endwith %} 27 | 28 | """ 29 | mash screen -i ${params.identity{{ param_id }}} -v ${params.pValue{{ param_id }}} -p \ 30 | ${task.cpus} ${winnerVar} ${refFile} ${reads} > mashScreenResults_${sample_id}.txt 31 | sort -gr mashScreenResults_${sample_id}.txt > sortedMashScreenResults_${sample_id}.txt 32 | """ 33 | } 34 | 35 | // process to parse the output to json format 36 | process mashOutputJson_{{ pid }} { 37 | 38 | {% include "post.txt" ignore missing %} 39 | 40 | tag { sample_id } 41 | 42 | publishDir 'results/mashscreen/mashscreen_json_{{ pid }}', mode: 'copy' 43 | 44 | input: 45 | set sample_id, file(mashtxt) from mashScreenResults_{{ pid }} 46 | 47 | output: 48 | set sample_id, file("sortedMashScreenResults*.json") optional true into mashScreenOutputChannel_{{ pid }} 49 | {% with task_name="mashOutputJson", sample_id="sample_id" %} 50 | {%- include "compiler_channels.txt" ignore missing -%} 51 | {% endwith %} 52 | 53 | script: 54 | template "mashscreen2json.py" 55 | } 56 | 57 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/mash_sketch_fasta.nf: -------------------------------------------------------------------------------- 1 | IN_kmerSize_{{ pid }} = Channel.value(params.kmerSize{{ param_id }}) 2 | IN_sketchSize_{{ pid }} = Channel.value(params.sketchSize{{ param_id }}) 3 | 4 | // runs mash sketch 5 | process mashSketchFasta_{{ pid }} { 6 | 7 | {% include "post.txt" ignore missing %} 8 | 9 | tag { sample_id } 10 | 11 | input: 12 | set sample_id, file(fasta) from {{ input_channel }} 13 | val kmer from IN_kmerSize_{{ pid }} 14 | val sketch from IN_sketchSize_{{ pid }} 15 | 16 | output: 17 | set sample_id, file(fasta) into {{ output_channel }} 18 | set sample_id, file("*.msh") into SIDE_mashSketchOutChannel_{{ pid }} 19 | {% with task_name="mashSketchFasta", sample_id="sample_id" %} 20 | {%- include "compiler_channels.txt" ignore missing -%} 21 | {% endwith %} 22 | 23 | """ 24 | mash sketch -i -k ${kmer} -s ${sketch} ${fasta} 25 | """ 26 | 27 | } 28 | 29 | {{ forks }} 30 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/mash_sketch_fastq.nf: -------------------------------------------------------------------------------- 1 | IN_kmerSize_{{ pid }} = Channel.value(params.kmerSize{{ param_id }}) 2 | IN_sketchSize_{{ pid }} = Channel.value(params.sketchSize{{ param_id }}) 3 | //IN_genomeSize_{{ pid }} = Channel.value(params.genomeSize{{ param_id }}) 4 | IN_minKmer_{{ pid }} = Channel.value(params.minKmer{{ param_id }}) 5 | 6 | 7 | // checks if genomeSize was provided 8 | genomeSize = (params.genomeSize{{ param_id }} == false) ? "" : "-g ${params.genomeSize{{ param_id }}}" 9 | 10 | // runs mash sketch 11 | process mashSketchFastq_{{ pid }} { 12 | 13 | {% include "post.txt" ignore missing %} 14 | 15 | tag { sample_id } 16 | 17 | input: 18 | set sample_id, file(fastq) from {{ input_channel }} 19 | val kmer from IN_kmerSize_{{ pid }} 20 | val sketch from IN_sketchSize_{{ pid }} 21 | val minKmer from IN_minKmer_{{ pid }} 22 | 23 | output: 24 | set sample_id, file(fastq) into {{ output_channel }} 25 | file("*.msh") into SIDE_mashSketchOutChannel_{{ pid }} 26 | {% with task_name="mashSketchFastq", sample_id="sample_id" %} 27 | {%- include "compiler_channels.txt" ignore missing -%} 28 | {% endwith %} 29 | 30 | """ 31 | mash sketch -r -k ${kmer} -s ${sketch} -m ${minKmer} ${genomeSize} ${fastq} 32 | """ 33 | 34 | } 35 | 36 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/metamlst.nf: -------------------------------------------------------------------------------- 1 | IN_metamlstDB_{{ pid }} = Channel.value(params.metamlstDB{{ param_id }}) 2 | IN_metamlstDB_index_{{ pid }} = Channel.value(params.metamlstDB_index{{ param_id }}) 3 | 4 | 5 | process metamlst_{{ pid }} { 6 | 7 | // Send POST request to platform 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { sample_id } 11 | publishDir "results/annotation/metamlst_{{ pid }}/${sample_id}", saveAs: { it.split("/").last() } 12 | 13 | input: 14 | set sample_id, file(fastq_pair) from {{ input_channel }} 15 | val metamlstDB from IN_metamlstDB_{{ pid }} 16 | val metamlstDB_index from IN_metamlstDB_index_{{ pid }} 17 | 18 | output: 19 | file 'out/merged/*.txt' optional true 20 | {% with task_name="metamlst" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | script: 25 | """ 26 | bowtie2 --very-sensitive-local -a --no-unal -x ${metamlstDB_index} -1 ${fastq_pair[0]} -2 ${fastq_pair[1]} | samtools view -bS - > ${sample_id}.bam 27 | 28 | metamlst.py -d ${metamlstDB} ${sample_id}.bam 29 | 30 | metamlst-merge.py -d ${metamlstDB} out/ 31 | """ 32 | 33 | } 34 | 35 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/metaprob.nf: -------------------------------------------------------------------------------- 1 | IN_feature_{{ pid }} = Channel.value(params.feature{{ param_id }}) 2 | IN_metaProbQMer_{{ pid }} = Channel.value(params.metaProbQMer{{ param_id }}) 3 | 4 | // runs metaProb 5 | process metaProb_{{ pid }} { 6 | 7 | {% include "post.txt" ignore missing %} 8 | 9 | tag { sample_id } 10 | 11 | publishDir 'results/metaprob/' 12 | 13 | input: 14 | set sample_id, file(fastq_pair) from {{ input_channel }} 15 | val feature from IN_feature_{{ pid }} 16 | val metaProbQMer from IN_metaProbQMer_{{ pid }} 17 | 18 | output: 19 | set sample_id, file("*clusters.csv") into metaProbOutChannel_{{ pid }} 20 | {% with task_name="metaProb", sample_id="sample_id" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | """ 25 | gunzip -c ${fastq_pair[0]} > ${sample_id}_read1.fastq 26 | gunzip -c ${fastq_pair[1]} > ${sample_id}_read2.fastq 27 | 28 | MetaProb -pi ${sample_id}_read1.fastq ${sample_id}_read2.fastq -feature ${feature} -m ${pmetaProbQMer} 29 | """ 30 | 31 | } 32 | 33 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/metaspades.nf: -------------------------------------------------------------------------------- 1 | if ( params.metaspadesKmers{{ param_id }}.toString().split(" ").size() <= 1 ){ 2 | if (params.metaspadesKmers{{ param_id }}.toString() != 'auto'){ 3 | exit 1, "'metaspadesKmers{{ param_id }}' parameter must be a sequence of space separated numbers or 'auto'. Provided value: ${params.metaspadesKmers{{ param_id }}}" 4 | } 5 | } 6 | IN_metaspades_kmers_{{pid}} = Channel.value(params.metaspadesKmers{{ param_id }}) 7 | 8 | clear = params.clearInput{{ param_id }} ? "true" : "false" 9 | checkpointClear_{{ pid }} = Channel.value(clear) 10 | 11 | process metaspades_{{ pid }} { 12 | 13 | // Send POST request to platform 14 | {% include "post.txt" ignore missing %} 15 | 16 | tag { sample_id } 17 | publishDir 'results/assembly/metaspades_{{ pid }}/', pattern: '*_metaspades*.fasta', mode: 'copy' 18 | 19 | input: 20 | set sample_id, file(fastq_pair), max_len from {{ input_channel }}.join(SIDE_max_len_{{ pid }}) 21 | val kmers from IN_metaspades_kmers_{{pid}} 22 | val clear from checkpointClear_{{ pid }} 23 | 24 | output: 25 | set sample_id, file('*_metaspades*.fasta') into {{ output_channel }} 26 | {% with task_name="metaspades" %} 27 | {%- include "compiler_channels.txt" ignore missing -%} 28 | {% endwith %} 29 | 30 | script: 31 | template "metaspades.py" 32 | 33 | } 34 | 35 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/midas_species.nf: -------------------------------------------------------------------------------- 1 | if (params.midasDB{{ param_id }} == null){ 2 | exit 1, "The path to the midas database must be provided with the 'midasDB{{ param_id }}' option." 3 | } 4 | 5 | IN_midas_DB_{{ pid }} = Channel.value(params.midasDB{{ param_id }}) 6 | 7 | process midas_species_{{ pid }} { 8 | 9 | // Send POST request to platform 10 | {% include "post.txt" ignore missing %} 11 | 12 | tag { sample_id } 13 | 14 | publishDir "results/taxonomy/midas/", pattern: "*.txt" 15 | 16 | input: 17 | set sample_id, file(fastq_pair) from {{ input_channel }} 18 | val midasDB from IN_midas_DB_{{ pid }} 19 | 20 | output: 21 | file("${sample_id}_midas_species_profile.txt") 22 | {% with task_name="midas_species" %} 23 | {%- include "compiler_channels.txt" ignore missing -%} 24 | {% endwith %} 25 | 26 | script: 27 | """ 28 | run_midas.py species midas/ -d ${midasDB} -t $task.cpus -1 ${fastq_pair[0]} -2 ${fastq_pair[1]} --remove_temp 29 | 30 | mv midas/species/species_profile.txt ./${sample_id}_midas_species_profile.txt 31 | """ 32 | } 33 | 34 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/mlst.nf: -------------------------------------------------------------------------------- 1 | 2 | process mlst_{{ pid }} { 3 | 4 | // Send POST request to platform 5 | {% include "post.txt" ignore missing %} 6 | 7 | tag { sample_id } 8 | // This process can only use a single CPU 9 | cpus 1 10 | 11 | input: 12 | set sample_id, file(assembly) from {{ input_channel }} 13 | 14 | output: 15 | file '*.mlst.txt' into LOG_mlst_{{ pid }} 16 | set sample_id, file(assembly), file(".status") into MAIN_mlst_out_{{ pid }} 17 | {% with task_name="mlst" %} 18 | {%- include "compiler_channels.txt" ignore missing -%} 19 | {% endwith %} 20 | 21 | script: 22 | """ 23 | { 24 | expectedSpecies=${params.mlstSpecies{{ param_id }}} 25 | mlst $assembly >> ${sample_id}.mlst.txt 26 | mlstSpecies=\$(cat *.mlst.txt | cut -f2) 27 | json_str="{'expectedSpecies':\'\$expectedSpecies\',\ 28 | 'species':'\$mlstSpecies',\ 29 | 'st':'\$(cat *.mlst.txt | cut -f3)',\ 30 | 'tableRow':[{'sample':'${sample_id}','data':[\ 31 | {'header':'MLST species','value':'\$mlstSpecies','table':'typing'},\ 32 | {'header':'MLST ST','value':'\$(cat *.mlst.txt | cut -f3)','table':'typing'}]}]}" 33 | echo \$json_str > .report.json 34 | 35 | if [ ! \$mlstSpecies = \$expectedSpecies ]; 36 | then 37 | printf fail > .status 38 | else 39 | printf pass > .status 40 | fi 41 | 42 | } || { 43 | printf fail > .status 44 | } 45 | """ 46 | } 47 | 48 | process compile_mlst_{{ pid }} { 49 | 50 | publishDir "results/annotation/mlst_{{ pid }}/" 51 | 52 | input: 53 | file res from LOG_mlst_{{ pid }}.collect() 54 | 55 | output: 56 | file "mlst_report.tsv" 57 | 58 | script: 59 | """ 60 | cat $res >> mlst_report.tsv 61 | """ 62 | } 63 | 64 | {{ output_channel }} = Channel.create() 65 | MAIN_mlst_out_{{ pid }} 66 | .filter{ it[2].text != "fail" } 67 | .map{ [it[0], it[1]] } 68 | .set{ {{output_channel}} } 69 | 70 | 71 | {{ forks }} 72 | 73 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/params.config: -------------------------------------------------------------------------------- 1 | params { 2 | 3 | {{ params_info }} 4 | 5 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/patlas_consensus.nf: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * A process that creates a consensus from all the outputted json files 4 | */ 5 | process fullConsensus { 6 | 7 | tag { sample_id } 8 | 9 | publishDir 'results/consensus_{{ pid }}/' 10 | 11 | input: 12 | set sample_id, file(infile_list) from {{ compile_channels }} 13 | 14 | output: 15 | file "consensus_*.json" 16 | 17 | script: 18 | template "pATLAS_consensus_json.py" 19 | 20 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/post.txt: -------------------------------------------------------------------------------- 1 | if ( params.platformHTTP != null ) { 2 | beforeScript "PATH=${workflow.projectDir}/bin:\$PATH; export PATH; set_dotfiles.sh; startup_POST.sh $params.projectId $params.pipelineId {{ pid }} $params.platformHTTP" 3 | afterScript "final_POST.sh $params.projectId $params.pipelineId {{ pid }} $params.platformHTTP; report_POST.sh $params.projectId $params.pipelineId {{ pid }} $params.sampleName $params.reportHTTP $params.currentUserName $params.currentUserId {{ template }}_{{ pid }} \"$params.platformSpecies\" {{ overwrite|default("true") }}" 4 | } else { 5 | beforeScript "PATH=${workflow.projectDir}/bin:\$PATH; set_dotfiles.sh" 6 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/process_skesa.nf: -------------------------------------------------------------------------------- 1 | if ( !params.skesaMinKmerCoverage{{ param_id }}.toString().isNumber() ){ 2 | exit 1, "'skesaMinKmerCoverage{{ param_id }}' parameter must be a number. Provided value: ${params.skesaMinKmerCoverage{{ param_id }}}" 3 | } 4 | if ( !params.skesaMinContigLen{{ param_id }}.toString().isNumber() ){ 5 | exit 1, "'skesaMinContigLen{{ param_id }}' parameter must be a number. Provided value: ${params.skesaMinContigLen{{ param_id }}}" 6 | } 7 | if ( !params.skesaMaxContigs{{ param_id }}.toString().isNumber() ){ 8 | exit 1, "'skesaMaxContigs{{ param_id }}' parameter must be a number. Provided value: ${params.skesaMaxContigs{{ param_id }}}" 9 | } 10 | 11 | IN_process_skesa_opts_{{ pid }} = Channel.value([params.skesaMinContigLen{{ param_id }},params.skesaMinKmerCoverage{{ param_id }},params.skesaMaxContigs{{ param_id }}]) 12 | IN_genome_size_{{ pid }} = Channel.value(params.genomeSize{{ param_id }}) 13 | 14 | process process_skesa_{{ pid }} { 15 | 16 | // Send POST request to platform 17 | {% include "post.txt" ignore missing %} 18 | 19 | tag { sample_id } 20 | // This process can only use a single CPU 21 | cpus 1 22 | publishDir "reports/assembly/skesa_filter_{{ pid }}", pattern: '*.report.csv', mode: 'copy' 23 | 24 | input: 25 | set sample_id, file(assembly) from {{ input_channel }} 26 | val opts from IN_process_skesa_opts_{{ pid }} 27 | val gsize from IN_genome_size_{{ pid }} 28 | val assembler from Channel.value("skesa") 29 | 30 | output: 31 | set sample_id, file('*.fasta') into {{ output_channel }} 32 | file '*.report.csv' optional true 33 | {% with task_name="process_skesa" %} 34 | {%- include "compiler_channels.txt" ignore missing -%} 35 | {% endwith %} 36 | 37 | script: 38 | template "process_assembly.py" 39 | 40 | } 41 | 42 | {{ forks }} 43 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/process_spades.nf: -------------------------------------------------------------------------------- 1 | if ( !params.spadesMinKmerCoverage{{ param_id }}.toString().isNumber()){ 2 | exit 1, "'spadesMinKmerCoverage' parameter must be a number. Provided value: ${params.spadesMinKmerCoverage{{ param_id }}}" 3 | } 4 | if ( !params.spadesMinContigLen{{ param_id }}.toString().isNumber() ){ 5 | exit 1, "'spadesMinContigLen' parameter must be a number. Provided value: ${params.spadesMinContigLen{{ param_id }}}" 6 | } 7 | if ( !params.spadesMaxContigs{{ param_id }}.toString().isNumber() ){ 8 | exit 1, "'spadesMaxContigs' parameter must be a number. Provided value: ${params.spadesMaxContigs{{ param_id }}}" 9 | } 10 | 11 | IN_process_spades_opts_{{ pid }} = Channel.value([params.spadesMinContigLen{{ param_id }}, params.spadesMinKmerCoverage{{ param_id }}, params.spadesMaxContigs{{ param_id }}]) 12 | IN_genome_size_{{ pid }} = Channel.value(params.genomeSize{{ param_id }}) 13 | 14 | process process_spades_{{ pid }} { 15 | 16 | // Send POST request to platform 17 | {% include "post.txt" ignore missing %} 18 | 19 | tag { sample_id } 20 | // This process can only use a single CPU 21 | cpus 1 22 | publishDir "reports/assembly/spades_filter_{{ pid }}", pattern: '*.report.csv', mode: 'copy' 23 | 24 | input: 25 | set sample_id, file(assembly) from {{ input_channel }} 26 | val opts from IN_process_spades_opts_{{ pid }} 27 | val gsize from IN_genome_size_{{ pid }} 28 | val assembler from Channel.value("spades") 29 | 30 | output: 31 | set sample_id, file('*.fasta') into {{ output_channel }} 32 | file '*.report.csv' optional true 33 | {% with task_name="process_spades" %} 34 | {%- include "compiler_channels.txt" ignore missing -%} 35 | {% endwith %} 36 | 37 | script: 38 | template "process_assembly.py" 39 | 40 | } 41 | 42 | {{ forks }} 43 | 44 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/progressive_mauve.nf: -------------------------------------------------------------------------------- 1 | process progressive_mauve_{{ pid }} { 2 | 3 | {% include "post.txt" ignore missing %} 4 | 5 | tag { 'progressive_mauve' } 6 | 7 | publishDir "results/alignment/progressive_mauve_{{ pid }}/", pattern: '*.align*', mode: 'copy' 8 | 9 | input: 10 | file(assembly) from {{ input_channel }}.map{ it[1] }.collect() 11 | 12 | output: 13 | file ("*.align") into {{ output_channel }} 14 | {% with task_name="progressive_mauve", sample_id="val('single')" %} 15 | {%- include "compiler_channels.txt" ignore missing -%} 16 | {% endwith %} 17 | 18 | script: 19 | """ 20 | progressiveMauve --output=${workflow.scriptName}.align --collinear ${assembly} 21 | """ 22 | 23 | } 24 | 25 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/prokka.nf: -------------------------------------------------------------------------------- 1 | 2 | IN_centre_{{ pid }} = Channel.value(params.centre{{ param_id }}) 3 | 4 | IN_kingdom_{{ pid }} = Channel.value(params.kingdom{{ param_id }}) 5 | 6 | // check if genus is provided or not 7 | genusVar = (params.genus{{ param_id }} == false) ? "" : "--usegenus --genus ${params.genus{{param_id}}} " 8 | 9 | process prokka_{{ pid }} { 10 | 11 | // Send POST request to platform 12 | {% include "post.txt" ignore missing %} 13 | 14 | tag { sample_id } 15 | publishDir "results/annotation/prokka_{{ pid }}/${sample_id}" 16 | 17 | input: 18 | set sample_id, file(assembly) from {{ input_channel }} 19 | val centre from IN_centre_{{ pid }} 20 | val kingdom from IN_kingdom_{{ pid }} 21 | 22 | output: 23 | file "${sample_id}/*" 24 | {% with task_name="prokka" %} 25 | {%- include "compiler_channels.txt" ignore missing -%} 26 | {% endwith %} 27 | 28 | script: 29 | """ 30 | { 31 | prokka --outdir $sample_id --cpus $task.cpus --centre ${centre} \ 32 | --compliant --kingdom ${kingdom} ${genusVar} --increment 10 $assembly 33 | echo pass > .status 34 | } || { 35 | echo fail > .status 36 | } 37 | """ 38 | 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/quast.nf: -------------------------------------------------------------------------------- 1 | if (params.reference{{param_id}} == null && params.genomeSizeBp{{param_id}} == null) 2 | exit 1, "Specify at least one of reference or genomeSizeBp" 3 | if (params.reference{{param_id}} != null && params.genomeSizeBp{{param_id}} != null) 4 | exit 1, "Specify only one of reference or genomeSizeBp" 5 | 6 | if (params.reference{{param_id}} != null) { 7 | process quast_{{pid}} { 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { sample_id } 11 | publishDir "results/assembly/quast_{{pid}}/$sample_id", pattern: "*.tsv" 12 | publishDir "reports/assembly/quast_{{pid}}/$sample_id" 13 | 14 | input: 15 | set sample_id, file(assembly) from {{input_channel}} 16 | file reference from Channel.fromPath(params.reference{{param_id}}) 17 | 18 | output: 19 | file "*" 20 | {% with task_name="quast" %} 21 | {%- include "compiler_channels.txt" ignore missing -%} 22 | {% endwith %} 23 | 24 | script: 25 | "/usr/bin/time -v quast -o . -r $reference -s $assembly -l $sample_id -t $task.cpus >> .command.log 2>&1" 26 | } 27 | } else if (params.genomeSizeBp{{param_id}} != null) { 28 | process quast_{{pid}} { 29 | {% include "post.txt" ignore missing %} 30 | 31 | tag { sample_id } 32 | publishDir "results/assembly/quast_{{pid}}/$sample_id", pattern: "*.tsv" 33 | publishDir "reports/assembly/quast_{{pid}}/$sample_id" 34 | 35 | input: 36 | set sample_id, file(assembly) from {{input_channel}} 37 | val genomeSizeBp from Channel.value(params.genomeSizeBp{{param_id}}) 38 | 39 | output: 40 | file "*" 41 | {% with task_name="quast" %} 42 | {%- include "compiler_channels.txt" ignore missing -%} 43 | {% endwith %} 44 | 45 | script: 46 | "/usr/bin/time -v quast -o . --est-ref-size=$genomeSizeBp -s $assembly -l $sample_id -t $task.cpus >> .command.log 2>&1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/raxml.nf: -------------------------------------------------------------------------------- 1 | IN_substitution_model_{{ pid }} = Channel.value(params.substitutionModel{{ param_id }}) 2 | IN_seed_number_{{ pid }} = Channel.value(params.seedNumber{{ param_id }}) 3 | IN_bootstrap_number_{{ pid }} = Channel.value(params.bootstrap{{ param_id }}) 4 | IN_simple_label_{{ pid}} = Channel.value(params.simpleLabel{{ param_id }}) 5 | 6 | process raxml_{{ pid }} { 7 | 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { 'raxml' } 11 | 12 | publishDir "results/phylogeny/raxml_{{ pid }}/" 13 | 14 | input: 15 | file(alignment) from {{ input_channel }} 16 | val substitution_model from IN_substitution_model_{{ pid }} 17 | val seednumber from IN_seed_number_{{ pid }} 18 | val bootstrapnumber from IN_bootstrap_number_{{ pid }} 19 | 20 | output: 21 | file ("RAxML_*") into {{ output_channel }} 22 | file ("RAxML_bipartitions.*.nf") into into_json_{{ pid }} 23 | {% with task_name="raxml", sample_id="val('single')" %} 24 | {%- include "compiler_channels.txt" ignore missing -%} 25 | {% endwith %} 26 | 27 | script: 28 | """ 29 | raxmlHPC -s ${alignment} -p 12345 -m ${substitution_model} -T $task.cpus -n $workflow.scriptName -f a -x ${seednumber} -N ${bootstrapnumber} 30 | 31 | # Add information to dotfiles 32 | version_str="[{'program':'raxmlHPC','version':'8.2.11'}]" 33 | echo \$version_str > .versions 34 | """ 35 | 36 | } 37 | 38 | process report_raxml_{{ pid }} { 39 | 40 | {% include "post.txt" ignore missing %} 41 | 42 | tag { 'raxml' } 43 | 44 | input: 45 | file(newick) from into_json_{{ pid }} 46 | val label from IN_simple_label_{{ pid}} 47 | 48 | output: 49 | {% with task_name="report_raxml", sample_id="val('single')" %} 50 | {%- include "compiler_channels.txt" ignore missing -%} 51 | {% endwith %} 52 | 53 | script: 54 | template "process_newick.py" 55 | 56 | } 57 | 58 | 59 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/report_compiler.nf: -------------------------------------------------------------------------------- 1 | 2 | /** Reports 3 | Compiles the reports from every process 4 | */ 5 | process report { 6 | 7 | tag { sample_id } 8 | 9 | input: 10 | set sample_id, 11 | task_name, 12 | pid, 13 | report_json, 14 | version_json, 15 | trace from {{ compile_channels }} 16 | 17 | output: 18 | file "*" optional true into master_report 19 | 20 | """ 21 | prepare_reports.py $report_json $version_json $trace $sample_id $task_name 1 $pid $workflow.scriptId $workflow.runName 22 | """ 23 | 24 | } 25 | 26 | File forkTree = new File("${workflow.projectDir}/.forkTree.json") 27 | File treeDag = new File("${workflow.projectDir}/.treeDag.json") 28 | File js = new File("${workflow.projectDir}/resources/main.js.zip") 29 | 30 | 31 | forks_channel = forkTree.exists() ? Channel.fromPath("${workflow.projectDir}/.forkTree.json") : Channel.value(null) 32 | dag_channel = forkTree.exists() ? Channel.fromPath("${workflow.projectDir}/.treeDag.json") : Channel.value(null) 33 | js_channel = forkTree.exists() ? Channel.fromPath("${workflow.projectDir}/resources/main.js.zip") : Channel.value(null) 34 | 35 | process compile_reports { 36 | 37 | publishDir "pipeline_report/", mode: "copy" 38 | 39 | if ( params.reportHTTP != null ){ 40 | beforeScript "PATH=${workflow.projectDir}/bin:\$PATH; export PATH;" 41 | afterScript "metadata_POST.sh $params.projectId $params.pipelineId 0 $params.sampleName $params.reportHTTP $params.currentUserName $params.currentUserId 0 \"$params.platformSpecies\"" 42 | } 43 | 44 | input: 45 | file report from master_report.collect() 46 | file forks from forks_channel 47 | file dag from dag_channel 48 | file js from js_channel 49 | 50 | output: 51 | file "pipeline_report.json" 52 | file "pipeline_report.html" 53 | file "src/main.js" 54 | 55 | script: 56 | template "compile_reports.py" 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/report_post.txt: -------------------------------------------------------------------------------- 1 | if ( params.platformHTTP != null ) { 2 | beforeScript "PATH=${workflow.projectDir}/bin:\$PATH; export PATH; set_dotfiles.sh" 3 | afterScript "report_POST.sh $params.projectId $params.pipelineId {{ pid }} $params.sampleName $params.reportHTTP $params.currentUserName $params.currentUserId {{ template }}_{{ pid }} \"$params.platformSpecies\" {{ overwrite|default("true") }}" 4 | } else { 5 | beforeScript "PATH=${workflow.projectDir}/bin:\$PATH; export PATH; set_dotfiles.sh" 6 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/resources.config: -------------------------------------------------------------------------------- 1 | process { 2 | {{ process_info }} 3 | 4 | } -------------------------------------------------------------------------------- /flowcraft/generator/templates/retrieve_mapped.nf: -------------------------------------------------------------------------------- 1 | process retrieve_mapped_{{ pid }} { 2 | 3 | // Send POST request to platform 4 | {% include "post.txt" ignore missing %} 5 | 6 | tag { sample_id } 7 | publishDir 'results/mapping/retrieve_mapped_{{ pid }}/' 8 | 9 | input: 10 | set sample_id, file(bam) from {{ input_channel }} 11 | 12 | output: 13 | set sample_id , file("*.headersRenamed_*.fq.gz") into {{ output_channel }} 14 | {% with task_name="retrieve_mapped" %} 15 | {%- include "compiler_channels.txt" ignore missing -%} 16 | {% endwith %} 17 | 18 | script: 19 | """ 20 | samtools view -buh -F 12 -o ${sample_id}_samtools.bam -@ $task.cpus ${bam} 21 | 22 | rm ${bam} 23 | 24 | samtools fastq -1 ${sample_id}_mapped_1.fq -2 ${sample_id}_mapped_2.fq ${sample_id}_samtools.bam 25 | 26 | rm ${sample_id}_samtools.bam 27 | 28 | renamePE_samtoolsFASTQ.py -1 ${sample_id}_mapped_1.fq -2 ${sample_id}_mapped_2.fq 29 | 30 | gzip *.headersRenamed_*.fq 31 | 32 | rm *.fq 33 | """ 34 | } 35 | 36 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/seroba.nf: -------------------------------------------------------------------------------- 1 | Coverage_{{ pid }} = Channel.value(params.coverage{{ param_id }}) 2 | 3 | process seroba_{{ pid }} { 4 | 5 | // Send POST request to platform 6 | {% include "post.txt" ignore missing %} 7 | 8 | tag { sample_id } 9 | 10 | input: 11 | set sample_id, file(fastq) from {{ input_channel }} 12 | val coverage from Coverage_{{ pid }} 13 | 14 | output: 15 | file("pred.tsv") into LOG_seroba_{{ pid }} 16 | {% with task_name="seroba" %} 17 | {%- include "compiler_channels.txt" ignore missing -%} 18 | {% endwith %} 19 | 20 | script: 21 | """ 22 | { 23 | # create a directory in /tmp to store the results 24 | mkdir /tmp/results 25 | #rename input files for seroba (avoid match error) 26 | mv ${fastq[0]} ${sample_id}_1.fq.gz 27 | mv ${fastq[1]} ${sample_id}_2.fq.gz 28 | # run seroba typing module 29 | seroba runSerotyping --coverage ${coverage} /seroba/database/ ${sample_id}_1.fq.gz ${sample_id}_2.fq.gz /tmp/results/${sample_id} 30 | 31 | # Get the ST for the sample 32 | if [ -f "/tmp/results/${sample_id}/pred.tsv" ]; 33 | then 34 | cp /tmp/results/${sample_id}/pred.tsv . 35 | sed -i -- 's|/tmp/results/||g' pred.tsv 36 | # Add ST information to report JSON 37 | json_str="{'tableRow':[{'sample':'${sample_id}','data':[{'header':'serotype','value':'\$(cat pred.tsv | cut -f2)','table':'typing'}]}]}" 38 | echo \$json_str > .report.json 39 | else 40 | echo fail > .status 41 | rm -r /tmp/results/ 42 | fi 43 | } || { 44 | echo fail > .status 45 | # Remove results directory 46 | rm -r /tmp/results/ 47 | } 48 | """ 49 | 50 | } 51 | 52 | process compile_seroba_{{ pid }} { 53 | 54 | publishDir "results/typing/seroba_{{ pid }}/" 55 | 56 | input: 57 | file res from LOG_seroba_{{ pid }}.collect() 58 | 59 | output: 60 | file "seroba_report.tsv" 61 | 62 | script: 63 | """ 64 | cat $res >> seroba_report.tsv 65 | """ 66 | } 67 | 68 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/sistr.nf: -------------------------------------------------------------------------------- 1 | 2 | process sistr_{{ pid }} { 3 | 4 | // Send POST request to platform 5 | {% include "post.txt" ignore missing %} 6 | 7 | tag { sample_id } 8 | publishDir 'results/typing/sistr_{{ pid }}', pattern: ".tab", mode: "copy" 9 | 10 | input: 11 | set sample_id, file(assembly) from {{ input_channel }} 12 | 13 | output: 14 | {% with task_name="sistr" %} 15 | {%- include "compiler_channels.txt" ignore missing -%} 16 | {% endwith %} 17 | 18 | script: 19 | """ 20 | { 21 | sistr --qc -vv -t $task.cpus -f tab -o ${sample_id}_sistr.tab ${assembly} 22 | json_str="{'tableRow':[{'sample':'${sample_id}','data':[{'header':'sistr','value':'\$(awk \"FNR == 2\" *.tab | cut -f14)','table':'typing'}]}]}" 23 | echo \$json_str > .report.json 24 | sistr_version=\$(sistr --version | cut -d" " -f2) 25 | version_str="[{'program':'sistr','version':'\$sistr_version'}]" 26 | echo \$version_str > .versions 27 | 28 | if [ -s ${sample_id}_sistr.tab ]; 29 | then 30 | echo pass > .status 31 | else 32 | echo fail > .status 33 | fi 34 | 35 | } || { 36 | echo fail > .status 37 | } 38 | """ 39 | } 40 | 41 | {{ forks }} 42 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/skesa.nf: -------------------------------------------------------------------------------- 1 | 2 | clear = params.clearInput{{ param_id }} ? "true" : "false" 3 | checkpointClear_{{ pid }} = Channel.value(clear) 4 | 5 | process skesa_{{ pid }} { 6 | 7 | // Send POST request to platform 8 | {% include "post.txt" ignore missing %} 9 | 10 | tag { sample_id } 11 | publishDir 'results/assembly/skesa_{{ pid }}', pattern: '*skesa*.fasta', mode: 'copy' 12 | 13 | input: 14 | set sample_id, file(fastq_pair) from {{ input_channel }} 15 | val clear from checkpointClear_{{ pid }} 16 | 17 | output: 18 | set sample_id, file('*.fasta') into {{ output_channel }} 19 | {% with task_name="skesa" %} 20 | {%- include "compiler_channels.txt" ignore missing -%} 21 | {% endwith %} 22 | 23 | script: 24 | template "skesa.py" 25 | 26 | } 27 | 28 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/split_assembly.nf: -------------------------------------------------------------------------------- 1 | // Check for the presence of absence of the minimum contig size parameter 2 | if (params.size{{ param_id }} == null){ 3 | exit 1, "A minimum contig size must be provided." 4 | } 5 | 6 | IN_min_contig_size_{{ pid }} = Channel.value(params.size{{ param_id }}) 7 | 8 | process split_assembly_{{ pid }} { 9 | 10 | {% include "post.txt" ignore missing %} 11 | 12 | tag { sample_id } 13 | 14 | publishDir "results/assembly/split_assembly_{{ pid }}/${sample_id}/" 15 | 16 | input: 17 | set sample_id, file(assembly) from {{ input_channel }} 18 | val min_contig_size from IN_min_contig_size_{{ pid }} 19 | 20 | output: 21 | file('*.fasta') into splitCh_{{ pid }} 22 | {% with task_name="split_assembly" %} 23 | {%- include "compiler_channels.txt" ignore missing -%} 24 | {% endwith %} 25 | 26 | script: 27 | template "split_fasta.py" 28 | 29 | 30 | } 31 | 32 | {{ output_channel }} = Channel.create() 33 | 34 | splitCh_{{ pid }}.flatMap().map{ it -> [it.toString().tokenize('/').last().tokenize('.')[0..-2].join('.'), it]}.into( {{ output_channel }} ) 35 | 36 | {{ forks }} -------------------------------------------------------------------------------- /flowcraft/generator/templates/status_compiler.nf: -------------------------------------------------------------------------------- 1 | 2 | /** STATUS 3 | Reports the status of a sample in any given process. 4 | */ 5 | process status { 6 | 7 | tag { sample_id } 8 | publishDir "pipeline_status/$task_name" 9 | 10 | input: 11 | set sample_id, task_name, status, warning, fail, file(log) from {{ compile_channels }} 12 | 13 | output: 14 | file '*.status' into master_status 15 | file '*.warning' into master_warning 16 | file '*.fail' into master_fail 17 | file '*.log' 18 | 19 | """ 20 | echo $sample_id, $task_name, \$(cat $status) > ${sample_id}_${task_name}.status 21 | echo $sample_id, $task_name, \$(cat $warning) > ${sample_id}_${task_name}.warning 22 | echo $sample_id, $task_name, \$(cat $fail) > ${sample_id}_${task_name}.fail 23 | echo "\$(cat .command.log)" > ${sample_id}_${task_name}.log 24 | """ 25 | } 26 | 27 | process compile_status_buffer { 28 | 29 | input: 30 | file status from master_status.buffer( size: 5000, remainder: true) 31 | file warning from master_warning.buffer( size: 5000, remainder: true) 32 | file fail from master_fail.buffer( size: 5000, remainder: true) 33 | 34 | output: 35 | file 'master_status_*.csv' into compile_status_buffer 36 | file 'master_warning_*.csv' into compile_warning_buffer 37 | file 'master_fail_*.csv' into compile_fail_buffer 38 | 39 | """ 40 | cat $status >> master_status_${task.index}.csv 41 | cat $warning >> master_warning_${task.index}.csv 42 | cat $fail >> master_fail_${task.index}.csv 43 | """ 44 | } 45 | 46 | process compile_status { 47 | 48 | publishDir 'reports/status' 49 | 50 | input: 51 | file status from compile_status_buffer.collect() 52 | file warning from compile_warning_buffer.collect() 53 | file fail from compile_fail_buffer.collect() 54 | 55 | output: 56 | file "*.csv" 57 | 58 | """ 59 | cat $status >> master_status.csv 60 | cat $warning >> master_warning.csv 61 | cat $fail >> master_fail.csv 62 | """ 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/trace_compiler.nf: -------------------------------------------------------------------------------- 1 | 2 | 3 | process compile_traces { 4 | 5 | // Send POST request to platform 6 | {% include "post.txt" ignore missing %} 7 | 8 | input: 9 | set sample_id, vals from {{ input_channel }} 10 | 11 | script: 12 | template "pipeline_status.py" 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/trimmomatic.nf: -------------------------------------------------------------------------------- 1 | // Check sliding window parameter 2 | if ( params.trimSlidingWindow{{ param_id }}.toString().split(":").size() != 2 ){ 3 | exit 1, "'trimSlidingWindow{{ param_id}}' parameter must contain two values separated by a ':'. Provided value: '${params.trimSlidingWindow{{ param_id}}}'" 4 | } 5 | if ( !params.trimLeading{{ param_id}}.toString().isNumber() ){ 6 | exit 1, "'trimLeading{{ param_id}}' parameter must be a number. Provide value: '${params.trimLeading_{{pid}}}'" 7 | } 8 | if ( !params.trimTrailing{{ param_id}}.toString().isNumber() ){ 9 | exit 1, "'trimTrailing{{ param_id}}' parameter must be a number. Provide value: '${params.trimTrailing{{ param_id}}}'" 10 | } 11 | if ( !params.trimMinLength{{ param_id}}.toString().isNumber() ){ 12 | exit 1, "'trimMinLength{{ param_id}}' parameter must be a number. Provide value: '${params.trimMinLength{{ param_id}}}'" 13 | } 14 | 15 | IN_trimmomatic_opts_{{ pid }} = Channel.value([params.trimSlidingWindow{{ param_id}},params.trimLeading{{ param_id}},params.trimTrailing{{ param_id}},params.trimMinLength{{ param_id}}]) 16 | IN_adapters_{{ pid }} = Channel.value(params.adapters{{ param_id}}) 17 | 18 | clear = params.clearInput{{ param_id }} ? "true" : "false" 19 | checkpointClear_{{ pid }} = Channel.value(clear) 20 | 21 | process trimmomatic_{{ pid }} { 22 | 23 | // Send POST request to platform 24 | {% include "post.txt" ignore missing %} 25 | 26 | publishDir "results/trimmomatic_{{ pid }}", pattern: "*.gz" 27 | 28 | tag { sample_id } 29 | 30 | input: 31 | set sample_id, file(fastq_pair), phred from {{ input_channel }}.join(SIDE_phred_{{ pid }}) 32 | val trim_range from Channel.value("None") 33 | val opts from IN_trimmomatic_opts_{{ pid }} 34 | val ad from IN_adapters_{{ pid }} 35 | val clear from checkpointClear_{{ pid }} 36 | 37 | output: 38 | set sample_id, "${sample_id}_*trim.fastq.gz" into {{ output_channel }} 39 | file 'trimmomatic_report.csv' 40 | {% with task_name="trimmomatic" %} 41 | {%- include "compiler_channels.txt" ignore missing -%} 42 | {% endwith %} 43 | 44 | script: 45 | template "trimmomatic.py" 46 | 47 | } 48 | 49 | {{ forks }} 50 | 51 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/true_coverage.nf: -------------------------------------------------------------------------------- 1 | if ( !params.species{{ param_id }}){ 2 | exit 1, "'species{{ param_id }}' parameter missing" 3 | } 4 | if ( params.species{{ param_id }}.toString().split(" ").size() != 2 ){ 5 | exit 1, "'species{{ param_id }}' parameter must contain two values (e.g.: 'escherichia coli').Provided value: '${params.species{{ param_id }}}'" 6 | } 7 | 8 | IN_pathoSpecies_{{ pid }} = Channel.value(params.species{{ param_id }}) 9 | 10 | process true_coverage_{{ pid }} { 11 | 12 | // Send POST request to platform 13 | {% include "post.txt" ignore missing %} 14 | 15 | tag { sample_id } 16 | 17 | input: 18 | set sample_id, file(fastq_pair) from {{ input_channel }} 19 | val species from IN_pathoSpecies_{{ pid }} 20 | 21 | output: 22 | set sample_id, file(fastq_pair) into {{ output_channel }} 23 | {% with task_name="true_coverage" %} 24 | {%- include "compiler_channels.txt" ignore missing -%} 25 | {% endwith %} 26 | 27 | """ 28 | { 29 | trueCoverage_rematch.py -f $fastq_pair --species $species \ 30 | -i /NGStools/true_coverage/data --json 31 | if ls failing* 1> /dev/null 2>&1; 32 | then 33 | parse_true_coverage.py sample_*.json failing*.json 34 | else 35 | parse_true_coverage.py sample_*.json 36 | fi 37 | echo pass > .status 38 | } || { 39 | echo fail > .status 40 | } 41 | """ 42 | 43 | } 44 | 45 | {{ forks }} 46 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/unicycler.nf: -------------------------------------------------------------------------------- 1 | process unicycler_{{pid}} { 2 | {% include "post.txt" ignore missing %} 3 | 4 | tag { sample_id } 5 | publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.fasta' 6 | publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.gfa' 7 | 8 | input: 9 | set sample_id, file(fastq_pair) from {{input_channel}} 10 | 11 | output: 12 | set sample_id, file('assembly.fasta') into {{output_channel}} 13 | file "assembly.gfa" into gfa1_{{pid}} 14 | {% with task_name="unicycler" %} 15 | {%- include "compiler_channels.txt" ignore missing -%} 16 | {% endwith %} 17 | 18 | script: 19 | "unicycler -t $task.cpus -o . --no_correct --no_pilon -1 ${fastq_pair[0]} -2 ${fastq_pair[1]}" 20 | } 21 | 22 | {{forks}} 23 | -------------------------------------------------------------------------------- /flowcraft/generator/templates/user.config: -------------------------------------------------------------------------------- 1 | // User configuration file that is not overwritten by flowcraft 2 | // Use this file to provide persistent configurations in the same pipeline 3 | // directory 4 | 5 | -------------------------------------------------------------------------------- /flowcraft/generator/utils.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | try: 4 | import generator.error_handling as eh 5 | except ImportError: 6 | import flowcraft.generator.error_handling as eh 7 | 8 | 9 | def get_nextflow_filepath(log_file): 10 | """Gets the nextflow file path from the nextflow log file. It searches for 11 | the nextflow run command throughout the file. 12 | 13 | Parameters 14 | ---------- 15 | log_file : str 16 | Path for the .nextflow.log file 17 | 18 | Returns 19 | ------- 20 | str 21 | Path for the nextflow file 22 | """ 23 | 24 | with open(log_file) as fh: 25 | # Searches for the first occurence of the nextflow pipeline 26 | # file name in the .nextflow.log file 27 | while 1: 28 | line = fh.readline() 29 | if not line: 30 | # file is empty 31 | raise eh.LogError("Nextflow command path could not be found - Is " 32 | ".nextflow.log empty?") 33 | try: 34 | # Regex supports absolute paths and relative paths 35 | pipeline_path = re.match(".*\s(.*.nf).*", line) \ 36 | .group(1) 37 | return pipeline_path 38 | except AttributeError: 39 | continue 40 | -------------------------------------------------------------------------------- /flowcraft/lib/CheckParams.groovy: -------------------------------------------------------------------------------- 1 | class Params { 2 | 3 | static void check(Map params) { 4 | 5 | // Checks genomeSize for type 6 | try { 7 | params.genomeSize as Double 8 | } catch (e) { 9 | print_error("The genomeSize option must be a number") 10 | } 11 | 12 | // Checks minCoverage for type 13 | try { 14 | params.minCoverage as Double 15 | } catch (e) { 16 | print_error("the minCoverage option must be a number") 17 | } 18 | 19 | // Check if fastqc adapters file exists 20 | if (!params.adapters.equalsIgnoreCase("none")) { 21 | File f = new File(params.adapters) 22 | if (!f.exists()) { 23 | print_error("The provided adapters file does " + 24 | "not exist ($params.adapters)") 25 | } 26 | } 27 | 28 | // Check for trimmomatic parameters 29 | try { 30 | params.trimLeading as Double 31 | params.trimTrailing as Double 32 | params.trimMinLength as Double 33 | } catch (e) { 34 | print_error("The trimLeading ($params.trimLeading), " + 35 | "trimTrailing ($params.trimTrailing) and " + 36 | "trimMinLength ($params.trimMinLength) " + 37 | "options must be numbers") 38 | } 39 | 40 | // Check for Spades parameters 41 | [ 42 | "spadesMincoverage": params.spadesMinCoverage, 43 | "spadesMinKmerCoverage": params.spadesMinKmerCoverage, 44 | "spadesMinContigLen": params.spadesMinContigLen, 45 | "spadesMaxContigs": params.spadesMaxContigs 46 | ].each { k, v -> 47 | try { 48 | v as Integer 49 | } catch (e) { 50 | print_error("The spades parameter $k ($v) must be an integer") 51 | } 52 | } 53 | 54 | } 55 | 56 | static def print_error(String msg) { 57 | 58 | println "\nERROR: $msg" 59 | System.exit(1) 60 | 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /flowcraft/resources/main.js.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/resources/main.js.zip -------------------------------------------------------------------------------- /flowcraft/templates/README.md: -------------------------------------------------------------------------------- 1 | # Templates 2 | 3 | A bunch of templates for processing HTS data. Particularly 4 | useful for using with nextflow pipelines. 5 | 6 | ## Quick reference 7 | 8 | * process_assembly_mapping.py - Processes the coverage report and checks 9 | assembly filters from the `assembly_mapping` process. [[changelog](https://github.com/ODiogoSilva/templates/wiki/process_assembly_mapping-changelog), [API](http://assemblerflow.readthedocs.io/en/doc_galore/assemblerflow.templates.process_assembly_mapping.html)] 10 | 11 | * mapping2json.py - exports results from a samtool depth file to a json 12 | file that contains a `key:value` such as `accession number:coverage` . 13 | 14 | * mashdist2json.py - exports results from `mash dist` to a json file 15 | that contains a `key:value` such as `accession number:distance` . 16 | 17 | * mashscreen2json.py - exports results from `mash screen` to a json 18 | file that contains a `key:[values]` such as `accession number:[copy number, identity]` . 19 | 20 | ## How to use as a submodule 21 | 22 | ### Add templates to your project 23 | 24 | ``` 25 | git submodule add https://github.com/ODiogoSilva/templates.git templates 26 | ``` 27 | 28 | ### Update templates on your project 29 | 30 | ``` 31 | git submodule foreach git pull origin master 32 | ``` -------------------------------------------------------------------------------- /flowcraft/templates/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Placeholder for template generation docs 3 | """ -------------------------------------------------------------------------------- /flowcraft/templates/fasta_spliter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | Purpose 5 | ------- 6 | 7 | This module is intended to split all fastas in a multifasta file into different 8 | fasta files. 9 | 10 | Code documentation 11 | ------------------ 12 | 13 | """ 14 | 15 | import os 16 | import sys 17 | 18 | 19 | def main(): 20 | 21 | cwd = os.getcwd() 22 | # a var to check if out_handle is started and if so it enables to control 23 | # how it should be closed 24 | out_handle = False 25 | # opens the input file of the process 26 | input_file = open(sys.argv[1]) 27 | # a file with the list of all paths to fasta files that will be used by 28 | # fastANI 29 | list_files = open("files_fastani.txt", "w") 30 | # iterates by each entry in the fasta file 31 | for line in input_file: 32 | if line.startswith(">"): 33 | if out_handle: 34 | out_handle.close() 35 | # writes the output to fasta store folder inside cwd, respective 36 | # workdir 37 | path_to_file = os.path.join(cwd, "fasta_store", 38 | "_".join(line.split("_")[0:3]) 39 | .replace(">", "") + ".fas") 40 | # writes to list of files 41 | list_files.write(path_to_file + "\n") 42 | out_handle = open(path_to_file, "w") 43 | out_handle.write(line) 44 | else: 45 | out_handle.write(line) 46 | 47 | out_handle.close() 48 | input_file.close() 49 | list_files.close() 50 | 51 | 52 | if __name__ == "__main__": 53 | main() 54 | -------------------------------------------------------------------------------- /flowcraft/templates/flowcraft_utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/templates/flowcraft_utils/__init__.py -------------------------------------------------------------------------------- /flowcraft/templates/process_tsv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | Purpose 5 | ------- 6 | This module is intended to process the output in tsv 7 | to generate a report in json format. 8 | 9 | Expected input 10 | -------------- 11 | The following variables are expected whether using NextFlow or the 12 | :py:func:`main` executor. 13 | - ``sample_id`` : Sample Identification string. 14 | - ``tsv``: tsv output. 15 | 16 | """ 17 | 18 | import json 19 | import csv 20 | import os 21 | 22 | from flowcraft_utils.flowcraft_base import get_logger, MainWrapper 23 | 24 | __version__ = "1.0.1" 25 | __build__ = "05.10.2018" 26 | __template__ = "maxbin2-nf" 27 | 28 | logger = get_logger(__file__) 29 | 30 | if __file__.endswith(".command.sh"): 31 | SAMPLE_ID = '$sample_id' 32 | FILE = '$tsv' 33 | logger.debug("Running {} with parameters:".format( 34 | os.path.basename(__file__))) 35 | logger.debug("SAMPLE_ID: {}".format(SAMPLE_ID)) 36 | logger.debug("FILE: {}".format(FILE)) 37 | 38 | @MainWrapper 39 | def main(sample_id, tsv_file): 40 | 41 | # this tsvData could be a single object since it only has one element 42 | # this data type expects full tables in tsv format 43 | report_json = { 44 | "tsvData": [{ 45 | "sample": sample_id, 46 | "data": {} 47 | }] 48 | } 49 | 50 | # web-app excepts a list with all the values in the table. 51 | # To expand this to other processes other than MaxBin2, this line needs to be reworked 52 | report_json["tsvData"][0]["data"]["MaxBin2"] = list(csv.reader(open(tsv_file), delimiter='\t')) 53 | 54 | with open(".report.json", "w") as k: 55 | k.write(json.dumps(report_json)) 56 | 57 | 58 | if __name__ == "__main__": 59 | main(SAMPLE_ID, FILE) 60 | -------------------------------------------------------------------------------- /flowcraft/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/tests/__init__.py -------------------------------------------------------------------------------- /flowcraft/tests/broadcast_tests/empty_log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemblerflow/flowcraft/66cef255589238b1c9afe6e80b6917e1225915e7/flowcraft/tests/broadcast_tests/empty_log.txt -------------------------------------------------------------------------------- /flowcraft/tests/broadcast_tests/log_with_command.txt: -------------------------------------------------------------------------------- 1 | Log with command 2 | nextflow run file.nf -profile docker -------------------------------------------------------------------------------- /flowcraft/tests/broadcast_tests/log_with_command_regex.txt: -------------------------------------------------------------------------------- 1 | Log with command - different chars in path 2 | /usr/local/bin/nextflow run /mnt/innuendo_storage/users/bgoncalves/jobs/2-3/test.nf -profile incd -resume -------------------------------------------------------------------------------- /flowcraft/tests/broadcast_tests/log_without_command.txt: -------------------------------------------------------------------------------- 1 | Test for log file without command -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe1.txt: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe2.txt: -------------------------------------------------------------------------------- 1 | A B -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe3.txt: -------------------------------------------------------------------------------- 1 | A B ( 2 | C | 3 | D) -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe4.txt: -------------------------------------------------------------------------------- 1 | A B ( 2 | C | 3 | D E F) -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe5.txt: -------------------------------------------------------------------------------- 1 | (A | B | C) -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe6.txt: -------------------------------------------------------------------------------- 1 | (A | B | C E 2 | (F | 3 | G)) -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe7.txt: -------------------------------------------------------------------------------- 1 | (A 2 | (Z | 3 | X)| 4 | B | C E 5 | (F | 6 | G)) -------------------------------------------------------------------------------- /flowcraft/tests/pipeline_tests/pipe8.txt: -------------------------------------------------------------------------------- 1 | (A ( 2 | Z | 3 | X)| 4 | B( 5 | Y| 6 | H A) | 7 | C E ( 8 | F | 9 | G)) -------------------------------------------------------------------------------- /flowcraft/tests/test_assemblerflow.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import shutil 4 | import pytest 5 | 6 | import flowcraft.flowcraft as af 7 | 8 | 9 | @pytest.fixture 10 | def tmp(): 11 | 12 | os.mkdir("temp") 13 | yield "temp" 14 | shutil.rmtree("temp") 15 | 16 | 17 | def test_check(): 18 | 19 | sys.argv.append(1) 20 | args = af.get_args(["build", "-t 'A B C'", "-c", "-o teste.nf"]) 21 | 22 | with pytest.raises(SystemExit): 23 | af.build(args) 24 | 25 | 26 | def test_check_invalid(): 27 | 28 | sys.argv.append(1) 29 | args = af.get_args(["build", "-t", "'A B C()'", "-c", "-o teste.nf"]) 30 | 31 | with pytest.raises(SystemExit): 32 | af.build(args) 33 | 34 | 35 | def test_build_file(tmp): 36 | 37 | p = os.path.join(os.path.abspath(tmp), "teste.nf") 38 | sys.argv.append(1) 39 | 40 | args = af.get_args(["build", "-t", "integrity_coverage fastqc", "-o", 41 | "{}".format(p)]) 42 | af.build(args) 43 | 44 | 45 | def test_build_file_2(tmp): 46 | 47 | sys.argv.append(1) 48 | p = os.path.join(os.path.abspath(tmp), "teste.nf") 49 | 50 | args = af.get_args(["build", "-t integrity_coverage fastqc", "-o", 51 | "{}".format(p), "--pipeline-only"]) 52 | af.build(args) 53 | 54 | assert sorted(os.listdir(tmp)) == [".forkTree.json", ".treeDag.json", 55 | "containers.config", 56 | "lib", "nextflow.config", "params.config", 57 | "resources.config", "teste.html", 58 | "teste.nf", "user.config"] 59 | 60 | 61 | def test_build_recipe(tmp): 62 | 63 | sys.argv.append(1) 64 | p = os.path.join(os.path.abspath(tmp), "teste.nf") 65 | 66 | args = af.get_args(["build", "-r", "innuca", "-o", 67 | "{}".format(p), "--pipeline-only"]) 68 | af.build(args) 69 | 70 | 71 | def test_build_recipe_innuendo(tmp): 72 | 73 | sys.argv.append(1) 74 | p = os.path.join(os.path.abspath(tmp), "teste.nf") 75 | 76 | args = af.get_args(["build", "-r", "innuendo", "-o", 77 | "{}".format(p), "--pipeline-only"]) 78 | af.build(args) 79 | -------------------------------------------------------------------------------- /flowcraft/tests/test_broadcast.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | 4 | import flowcraft.generator.utils as utils 5 | from flowcraft.generator.error_handling import LogError 6 | 7 | 8 | def test_empty_log(): 9 | with pytest.raises(LogError): 10 | utils.get_nextflow_filepath( 11 | os.path.join(os.getcwd(), "flowcraft/tests/broadcast_tests/empty_log.txt")) 12 | 13 | 14 | def test_no_path_in_log(): 15 | with pytest.raises(LogError): 16 | utils.get_nextflow_filepath( 17 | os.path.join(os.getcwd(), "flowcraft/tests/broadcast_tests/log_without_command.txt")) 18 | 19 | 20 | def test_path_in_log(): 21 | filepath = utils.get_nextflow_filepath( 22 | os.path.join(os.getcwd(), "flowcraft/tests/broadcast_tests/log_with_command.txt")) 23 | 24 | assert filepath != "" 25 | 26 | 27 | def test_regex_in_log(): 28 | filepath = utils.get_nextflow_filepath( 29 | os.path.join(os.getcwd(), "flowcraft/tests/broadcast_tests/log_with_command_regex.txt")) 30 | 31 | assert filepath != "" 32 | -------------------------------------------------------------------------------- /flowcraft/tests/test_process_details.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import flowcraft.generator.process_details as pd 4 | import flowcraft.flowcraft as af 5 | 6 | from flowcraft.generator.process_collector import collect_process_map 7 | from flowcraft.generator.process_details import COLORS 8 | 9 | process_map = collect_process_map() 10 | 11 | 12 | def test_color_print(): 13 | 14 | for c in COLORS: 15 | pd.colored_print("teste_msg", c) 16 | 17 | assert 1 18 | 19 | 20 | def test_long_list(): 21 | 22 | arguments = af.get_args(["build", "-L"]) 23 | 24 | pipeline_string = "fastqc trimmomatic" 25 | 26 | with pytest.raises(SystemExit): 27 | pd.proc_collector(process_map, arguments, pipeline_string) 28 | 29 | 30 | def test_short_list(): 31 | 32 | arguments = af.get_args(["build", "-l"]) 33 | 34 | pipeline_string = "fastqc trimmomatic" 35 | 36 | with pytest.raises(SystemExit): 37 | pd.proc_collector(process_map, arguments, pipeline_string) 38 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpydoc -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import flowcraft 2 | 3 | from setuptools import setup 4 | 5 | VERSION = flowcraft.__version__ 6 | 7 | with open("README.md") as fh: 8 | README = fh.read() 9 | 10 | setup( 11 | name="flowcraft", 12 | version="{}".format(VERSION), 13 | packages=["flowcraft", 14 | "flowcraft.templates", 15 | "flowcraft.templates.flowcraft_utils", 16 | "flowcraft.generator", 17 | "flowcraft.generator.components", 18 | "flowcraft.generator.recipes"], 19 | package_dir={"flowcraft": "flowcraft"}, 20 | package_data={"flowcraft": ["nextflow.config", 21 | "profiles.config", 22 | "bin/*", 23 | "lib/*", 24 | "resources/*", 25 | "generator/templates/*"]}, 26 | data_files=[("", ["LICENSE"])], 27 | install_requires=[ 28 | "pympler", 29 | "python-dateutil", 30 | "argparse", 31 | "jinja2", 32 | "requests" 33 | ], 34 | description="A Nextflow pipeline assembler for genomics. Pick your " 35 | "modules. Assemble them. Run the pipeline.", 36 | long_description=README, 37 | long_description_content_type="text/markdown", 38 | url="https://github.com/assemblerflow/flowcraft", 39 | author="Diogo N Silva", 40 | author_email="o.diogosilva@gmail.com", 41 | license="GPL3", 42 | entry_points={ 43 | "console_scripts": [ 44 | "flowcraft = flowcraft.flowcraft:main" 45 | ] 46 | } 47 | ) 48 | --------------------------------------------------------------------------------