Full Code of assemblerflow/flowcraft for AI

master 66cef2555892 cached
328 files
1.0 MB
260.6k tokens
662 symbols
1 requests
Download .txt
Showing preview only (1,145K chars total). Download the full file or copy to clipboard to get everything.
Repository: assemblerflow/flowcraft
Branch: master
Commit: 66cef2555892
Files: 328
Total size: 1.0 MB

Directory structure:
gitextract_0fzlskug/

├── .gitignore
├── .gitmodules
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── changelog.md
├── docker/
│   └── Dockerfile
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   └── custom.css
│   ├── about/
│   │   └── about.rst
│   ├── conf.py
│   ├── dev/
│   │   ├── containers.rst
│   │   ├── create_process.rst
│   │   ├── create_recipe.rst
│   │   ├── create_recipes.rst
│   │   ├── create_template.rst
│   │   ├── general_orientation.rst
│   │   ├── pipeline_reporting.rst
│   │   ├── process_dotfiles.rst
│   │   └── reports.rst
│   ├── flowcraft.flowcraft.rst
│   ├── flowcraft.generator.components.annotation.rst
│   ├── flowcraft.generator.components.assembly.rst
│   ├── flowcraft.generator.components.assembly_processing.rst
│   ├── flowcraft.generator.components.distance_estimation.rst
│   ├── flowcraft.generator.components.downloads.rst
│   ├── flowcraft.generator.components.metagenomics.rst
│   ├── flowcraft.generator.components.mlst.rst
│   ├── flowcraft.generator.components.patlas_mapping.rst
│   ├── flowcraft.generator.components.reads_quality_control.rst
│   ├── flowcraft.generator.components.rst
│   ├── flowcraft.generator.components.typing.rst
│   ├── flowcraft.generator.engine.rst
│   ├── flowcraft.generator.error_handling.rst
│   ├── flowcraft.generator.footer_skeleton.rst
│   ├── flowcraft.generator.header_skeleton.rst
│   ├── flowcraft.generator.inspect.rst
│   ├── flowcraft.generator.pipeline_parser.rst
│   ├── flowcraft.generator.process.rst
│   ├── flowcraft.generator.process_details.rst
│   ├── flowcraft.generator.recipe.rst
│   ├── flowcraft.generator.rst
│   ├── flowcraft.rst
│   ├── flowcraft.templates.assembly_report.rst
│   ├── flowcraft.templates.fastqc.rst
│   ├── flowcraft.templates.fastqc_report.rst
│   ├── flowcraft.templates.flowcraft_utils.flowcraft_base.rst
│   ├── flowcraft.templates.flowcraft_utils.rst
│   ├── flowcraft.templates.integrity_coverage.rst
│   ├── flowcraft.templates.mapping2json.rst
│   ├── flowcraft.templates.mashdist2json.rst
│   ├── flowcraft.templates.mashscreen2json.rst
│   ├── flowcraft.templates.megahit.rst
│   ├── flowcraft.templates.metaspades.rst
│   ├── flowcraft.templates.pATLAS_consensus_json.rst
│   ├── flowcraft.templates.pipeline_status.rst
│   ├── flowcraft.templates.process_abricate.rst
│   ├── flowcraft.templates.process_assembly.rst
│   ├── flowcraft.templates.process_assembly_mapping.rst
│   ├── flowcraft.templates.rst
│   ├── flowcraft.templates.skesa.rst
│   ├── flowcraft.templates.spades.rst
│   ├── flowcraft.templates.trimmomatic.rst
│   ├── flowcraft.templates.trimmomatic_report.rst
│   ├── flowcraft.tests.data_pipelines.rst
│   ├── flowcraft.tests.rst
│   ├── flowcraft.tests.test_assemblerflow.rst
│   ├── flowcraft.tests.test_engine.rst
│   ├── flowcraft.tests.test_pipeline_parser.rst
│   ├── flowcraft.tests.test_process_details.rst
│   ├── flowcraft.tests.test_processes.rst
│   ├── flowcraft.tests.test_sanity.rst
│   ├── getting_started/
│   │   ├── installation.rst
│   │   └── overview.rst
│   ├── index.rst
│   ├── make.bat
│   ├── setup.rst
│   └── user/
│       ├── available_components.rst
│       ├── basic_usage.rst
│       ├── components/
│       │   ├── abricate.rst
│       │   ├── assembly_mapping.rst
│       │   ├── bowtie.rst
│       │   ├── card_rgi.rst
│       │   ├── check_coverage.rst
│       │   ├── chewbbaca.rst
│       │   ├── diamond.rst
│       │   ├── downsample_fastq.rst
│       │   ├── fast_ani.rst
│       │   ├── fasterq_dump.rst
│       │   ├── fastqc.rst
│       │   ├── fastqc_trimmomatic.rst
│       │   ├── filter_poly.rst
│       │   ├── integrity_coverage.rst
│       │   ├── kraken.rst
│       │   ├── kraken2.rst
│       │   ├── mapping_patlas.rst
│       │   ├── mash_dist.rst
│       │   ├── mash_screen.rst
│       │   ├── mash_sketch_fasta.rst
│       │   ├── mash_sketch_fastq.rst
│       │   ├── maxbin2.rst
│       │   ├── megahit.rst
│       │   ├── metamlst.rst
│       │   ├── metaspades.rst
│       │   ├── midas_species.rst
│       │   ├── mlst.rst
│       │   ├── momps.rst
│       │   ├── patho_typing.rst
│       │   ├── pilon.rst
│       │   ├── process_skesa.rst
│       │   ├── process_spades.rst
│       │   ├── prokka.rst
│       │   ├── reads_download.rst
│       │   ├── remove_host.rst
│       │   ├── retrieve_mapped.rst
│       │   ├── seq_typing.rst
│       │   ├── sistr.rst
│       │   ├── skesa.rst
│       │   ├── spades.rst
│       │   └── trimmomatic.rst
│       ├── pipeline_building.rst
│       ├── pipeline_configuration.rst
│       ├── pipeline_inspect.rst
│       ├── pipeline_reports.rst
│       └── reports/
│           ├── abricate.rst
│           ├── assembly_mapping.rst
│           ├── check_coverage.rst
│           ├── chewbbaca.rst
│           ├── dengue_typing.rst
│           ├── fastqc.rst
│           ├── fastqc_trimmomatic.rst
│           ├── integrity_coverage.rst
│           ├── mash_dist.rst
│           ├── maxbin2.rst
│           ├── mlst.rst
│           ├── patho_typing.rst
│           ├── pilon.rst
│           ├── process_mapping.rst
│           ├── process_newick.rst
│           ├── process_skesa.rst
│           ├── process_spades.rst
│           ├── process_viral_assembly.rst
│           ├── seq_typing.rst
│           ├── sistr.rst
│           ├── trimmomatic.rst
│           └── true_coverage.rst
├── flowcraft/
│   ├── __init__.py
│   ├── bin/
│   │   ├── final_POST.sh
│   │   ├── merge_json.py
│   │   ├── metadata_POST.sh
│   │   ├── parse_fasta.py
│   │   ├── parse_true_coverage.py
│   │   ├── prepare_reports.py
│   │   ├── renamePE_samtoolsFASTQ.py
│   │   ├── report_POST.sh
│   │   ├── set_dotfiles.sh
│   │   └── startup_POST.sh
│   ├── flowcraft.py
│   ├── generator/
│   │   ├── __init__.py
│   │   ├── components/
│   │   │   ├── __init__.py
│   │   │   ├── alignment.py
│   │   │   ├── annotation.py
│   │   │   ├── assembly.py
│   │   │   ├── assembly_processing.py
│   │   │   ├── distance_estimation.py
│   │   │   ├── downloads.py
│   │   │   ├── mapping.py
│   │   │   ├── metagenomics.py
│   │   │   ├── mlst.py
│   │   │   ├── patlas_mapping.py
│   │   │   ├── phylogeny.py
│   │   │   ├── reads_quality_control.py
│   │   │   ├── typing.py
│   │   │   └── variant_calling.py
│   │   ├── engine.py
│   │   ├── error_handling.py
│   │   ├── footer_skeleton.py
│   │   ├── header_skeleton.py
│   │   ├── inspect.py
│   │   ├── pipeline_parser.py
│   │   ├── process.py
│   │   ├── process_collector.py
│   │   ├── process_details.py
│   │   ├── recipe.py
│   │   ├── recipes/
│   │   │   ├── __init__.py
│   │   │   ├── denim.py
│   │   │   ├── innuca.py
│   │   │   └── plasmids.py
│   │   ├── report.py
│   │   ├── templates/
│   │   │   ├── Helper.groovy
│   │   │   ├── abricate.nf
│   │   │   ├── abyss.nf
│   │   │   ├── assembly_mapping.nf
│   │   │   ├── bandage.nf
│   │   │   ├── base_recalibrator.nf
│   │   │   ├── bcalm.nf
│   │   │   ├── bowtie.nf
│   │   │   ├── bwa.nf
│   │   │   ├── card_rgi.nf
│   │   │   ├── check_coverage.nf
│   │   │   ├── chewbbaca.nf
│   │   │   ├── compiler_channels.txt
│   │   │   ├── concoct.nf
│   │   │   ├── containers.config
│   │   │   ├── dengue_typing.nf
│   │   │   ├── diamond.nf
│   │   │   ├── downsample_fastq.nf
│   │   │   ├── fast_ani.nf
│   │   │   ├── fasterq_dump.nf
│   │   │   ├── fastqc.nf
│   │   │   ├── fastqc_trimmomatic.nf
│   │   │   ├── filter_poly.nf
│   │   │   ├── haplotypecaller.nf
│   │   │   ├── init.nf
│   │   │   ├── integrity_coverage.nf
│   │   │   ├── kraken.nf
│   │   │   ├── kraken2.nf
│   │   │   ├── mafft.nf
│   │   │   ├── mapping_patlas.nf
│   │   │   ├── mark_duplicates.nf
│   │   │   ├── mash_dist.nf
│   │   │   ├── mash_screen.nf
│   │   │   ├── mash_sketch_fasta.nf
│   │   │   ├── mash_sketch_fastq.nf
│   │   │   ├── maxbin2.nf
│   │   │   ├── megahit.nf
│   │   │   ├── metabat2.nf
│   │   │   ├── metamlst.nf
│   │   │   ├── metaprob.nf
│   │   │   ├── metaspades.nf
│   │   │   ├── midas_species.nf
│   │   │   ├── mlst.nf
│   │   │   ├── momps.nf
│   │   │   ├── nextflow.config
│   │   │   ├── params.config
│   │   │   ├── patho_typing.nf
│   │   │   ├── patlas_consensus.nf
│   │   │   ├── pilon.nf
│   │   │   ├── pipeline_graph.html
│   │   │   ├── post.txt
│   │   │   ├── process_skesa.nf
│   │   │   ├── process_spades.nf
│   │   │   ├── progressive_mauve.nf
│   │   │   ├── prokka.nf
│   │   │   ├── quast.nf
│   │   │   ├── raxml.nf
│   │   │   ├── reads_download.nf
│   │   │   ├── remove_host.nf
│   │   │   ├── report_compiler.nf
│   │   │   ├── report_post.txt
│   │   │   ├── resources.config
│   │   │   ├── retrieve_mapped.nf
│   │   │   ├── seq_typing.nf
│   │   │   ├── seroba.nf
│   │   │   ├── sistr.nf
│   │   │   ├── skesa.nf
│   │   │   ├── spades.nf
│   │   │   ├── split_assembly.nf
│   │   │   ├── status_compiler.nf
│   │   │   ├── trace_compiler.nf
│   │   │   ├── trimmomatic.nf
│   │   │   ├── true_coverage.nf
│   │   │   ├── unicycler.nf
│   │   │   ├── user.config
│   │   │   └── viral_assembly.nf
│   │   └── utils.py
│   ├── lib/
│   │   └── CheckParams.groovy
│   ├── profiles.config
│   ├── templates/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── assembly_report.py
│   │   ├── compile_reports.py
│   │   ├── dengue_typing_assembly.py
│   │   ├── dengue_typing_reads.py
│   │   ├── downsample_fastq.py
│   │   ├── fasta_spliter.py
│   │   ├── fastqc.py
│   │   ├── fastqc_report.py
│   │   ├── flowcraft_utils/
│   │   │   ├── __init__.py
│   │   │   └── flowcraft_base.py
│   │   ├── integrity_coverage.py
│   │   ├── mapping2json.py
│   │   ├── mashdist2json.py
│   │   ├── mashscreen2json.py
│   │   ├── megahit.py
│   │   ├── metaspades.py
│   │   ├── pATLAS_consensus_json.py
│   │   ├── pipeline_status.py
│   │   ├── process_abricate.py
│   │   ├── process_assembly.py
│   │   ├── process_assembly_mapping.py
│   │   ├── process_concoct.py
│   │   ├── process_mapping.py
│   │   ├── process_metabat.py
│   │   ├── process_newick.py
│   │   ├── process_tsv.py
│   │   ├── process_viral_assembly.py
│   │   ├── skesa.py
│   │   ├── spades.py
│   │   ├── split_fasta.py
│   │   ├── trimmomatic.py
│   │   └── trimmomatic_report.py
│   └── tests/
│       ├── __init__.py
│       ├── broadcast_tests/
│       │   ├── empty_log.txt
│       │   ├── log_with_command.txt
│       │   ├── log_with_command_regex.txt
│       │   └── log_without_command.txt
│       ├── data_pipelines.py
│       ├── pipeline_tests/
│       │   ├── pipe1.txt
│       │   ├── pipe2.txt
│       │   ├── pipe3.txt
│       │   ├── pipe4.txt
│       │   ├── pipe5.txt
│       │   ├── pipe6.txt
│       │   ├── pipe7.txt
│       │   └── pipe8.txt
│       ├── test_assemblerflow.py
│       ├── test_broadcast.py
│       ├── test_engine.py
│       ├── test_pipeline_parser.py
│       ├── test_process_details.py
│       ├── test_processes.py
│       ├── test_recipes.py
│       └── test_sanity.py
├── requirements.txt
└── setup.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# ignore ide folders
.idea/
.vscode/

# ignore python generated files
*.pyc


================================================
FILE: .gitmodules
================================================


================================================
FILE: .travis.yml
================================================
language: python

python:
  - "3.6"

install:
  - pip install pytest
  - pip install coverage
  - pip install pytest-cov
  - python setup.py install

script:
  - py.test --cov=./

after_success:
  - bash <(curl -s https://codecov.io/bash)

================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
 advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
 address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
 professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at odiogosilva@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Assemblerflow

Thank you for your interest in contributing to Assemblerflow. All kinds of 
contributions are welcome :tada:!

## Issues

Feel free to [submit issues](https://github.com/assemblerflow/assemblerflow/issues)
and enhancement requests.

## Git branch convention

Contributions with new code (not documentation), should follow this standard procedure:

    <new_branch> >> dev >> master

1. Create a new branch for the new feature/bug fix.
2. One the new code is finished and **passes all automated tests**, it will be 
merged into the `dev` branch. This branch is where all the new code lives and 
serves as an incubator stage while field tests are performed to ensure that everything
is working correctly.
3. Merging the `dev` code into `master` is associated with a new release. Therefore, 
the `master` branch is basically the same of the latest official release in PyPI. 

## Contributing

In general, we follow the "fork-and-pull" Git workflow.

 1. **Fork** the repo on GitHub
 2. **Clone** the project to your own machine
 3. **Commit** changes to your own branch
 4. **Push** your work back up to your fork
 5. Submit a **Pull request** so that we can review your changes. Pull requests will be merged first into the `dev` branch to perform some field tests before being merged into `master` 

NOTE: Be sure to merge the latest from "upstream" before making a pull request!
  

================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
# FlowCraft :whale2::package:

![Nextflow version](https://img.shields.io/badge/nextflow->0.27.0-brightgreen.svg)
![Python version](https://img.shields.io/badge/python-3.6-brightgreen.svg)
[![Build Status](https://travis-ci.org/assemblerflow/flowcraft.svg?branch=master)](https://travis-ci.org/assemblerflow/flowcraft)
[![codecov](https://codecov.io/gh/assemblerflow/flowcraft/branch/master/graph/badge.svg)](https://codecov.io/gh/assemblerflow/flowcraft)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f518854f780b41a08ca2fb1c14e360f0)](https://www.codacy.com/app/o.diogosilva/assemblerflow?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ODiogoSilva/assemblerflow&amp;utm_campaign=Badge_Grade)
[![Documentation Status](https://readthedocs.org/projects/flowcraft/badge/?version=latest)](http://flowcraft.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/flowcraft.svg)](https://badge.fury.io/py/flowcraft)
[![Anaconda-Server Badge](https://anaconda.org/bioconda/flowcraft/badges/version.svg)](https://anaconda.org/bioconda/flowcraft)
[![Gitter](https://badges.gitter.im/flowcraft-community/community.svg)](https://gitter.im/flowcraft-community/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

<p align="center">
  <img width="360" src="docs/resources/logo_large.png" alt="nextflow_logo"/>
</p>

A [Nextflow](https://www.nextflow.io/) pipeline assembler for genomics.
Pick your modules. Assemble them. Run the pipeline.

(Previously known as Assemblerflow)

## The premisse

#### Build a pipeline

What if building your own genomics pipeline would be as simple as:

```
flowcraft.py build -t "trimmomatic fastqc skesa pilon" -o my_pipeline.nf
```

Seems pretty simple right? What if we could run this pipeline with a single command on any linux machine or cluster by leveraging
the awesomeness of [nextflow](https://www.nextflow.io/) and [docker](https://www.docker.com/)/[singularity](http://singularity.lbl.gov/)
containers without having to install any of the pipeline dependencies?

#### Run the pipeline

```
nextflow run my_pipeline.nf --fastq path/to/fastq

N E X T F L O W  ~  version 0.30.1
Launching `my_pipeline.nf` [admiring_lamarck] - revision: 82cc9cd2ed

============================================================
                M Y   P I P E L I N E
============================================================
Built using flowcraft v1.2.1

 Input FastQ                 : 2
 Input samples               : 1
 Reports are found in        : ./reports
 Results are found in        : ./results
 Profile                     : standard

Starting pipeline at Tue Jun 12 19:38:26 WEST 2018

[warm up] executor > local
[7c/eb5f2f] Submitted process > integrity_coverage_1_1 (02AR0553)
(...)
[31/7d90a1] Submitted process > compile_pilon_report_1_6

Completed at: Tue Jun 12 19:58:32 WEST 2018
Duration    : 20m 6s
Success     : true
Exit status : 0
```

Congratulations! You just built and executed your own pipeline with
only two commands! :tada:

## Installation

FlowCraft is available as a bioconda package, which already brings
nextflow:

```
conda install flowcraft
```

#### Container engines

Pipelines built with FlowCraft require at least one container
engine to be installed, among `docker`, `singularity` or `shifter`.
If you already have any one of these installed, you're good to go.
If not, we recommend installing singularity, though it should be installed with
root privileges and accessible in all compute nodes. 

## How to use it

The complete user guide of FlowCraft can be found on [readthedocs.org](http://flowcraft.readthedocs.io/en/latest/?badge=latest).
For a quick and dirty demonstration, see below.

### Quick guide

#### Building a pipeline

FlowCraft comes with a number of [ready-to-use components](http://flowcraft.readthedocs.io/en/latest/user/available_components.html) to build your
own pipeline. Following some basic rules, such as the output type of one process
must match the input type of the next process, assembling a pipeline is done
using the `build` mode and the `-t` option:

```
flowcraft build -t "trimmomatic spades abricate" -o my_pipeline.nf -n "assembly pipe"
```

This command will generate everything that is necessary to run the
pipeline automatically, but the main pipeline executable
file will be `my_pipeline.nf`. This file will contain a nextflow pipeline
for genome assembly starts with `trimmomatic` and finishes with anti-microbial
gene annotation using `abricate`.

#### Wait... what about the software parameters?

Each component in the pipeline has its own set of parameters that can be
modified before or when executing the pipeline. These parameters are
described in the documentation of each process and you can check the options
of your particular pipeline using the `help` option:

```
$ nextflow run my_pipeline.nf --help
N E X T F L O W  ~  version 0.30.1
Launching `my_pipeline.nf` [prickly_picasso] - revision: 2e1a226e6d

============================================================
                F L O W C R A F T
============================================================
Built using flowcraft v1.2.1


Usage: 
    nextflow run my_pipeline.nf

       --fastq                     Path expression to paired-end fastq files. (default: fastq/*_{1,2}.*) (default: 'fastq/*_{1,2}.*')
       
       Component 'INTEGRITY_COVERAGE_1_1'
       ----------------------------------
       --genomeSize_1_1            Genome size estimate for the samples in Mb. It is used to estimate the coverage and other assembly parameters andchecks (default: 1)
       --minCoverage_1_1           Minimum coverage for a sample to proceed. By default it's setto 0 to allow any coverage (default: 0)
       
       Component 'TRIMMOMATIC_1_2'
       ---------------------------
       --adapters_1_2              Path to adapters files, if any. (default: 'None')
       --trimSlidingWindow_1_2     Perform sliding window trimming, cutting once the average quality within the window falls below a threshold (default: '5:20')
       --trimLeading_1_2           Cut bases off the start of a read, if below a threshold quality (default: 3)
       --trimTrailing_1_2          Cut bases of the end of a read, if below a threshold quality (default: 3)
       --trimMinLength_1_2         Drop the read if it is below a specified length  (default: 55)
       
       Component 'FASTQC_1_3'
       ----------------------
       --adapters_1_3              Path to adapters files, if any. (default: 'None')
       
       Component 'ASSEMBLY_MAPPING_1_5'
       --------------------------------
       --minAssemblyCoverage_1_5   In auto, the default minimum coverage for each assembled contig is 1/3 of the assembly mean coverage or 10x, if the mean coverage is below 10x (default: 'auto')
       --AMaxContigs_1_5           A warning is issued if the number of contigs is overthis threshold. (default: 100)
       --genomeSize_1_5            Genome size estimate for the samples. It is used to check the ratio of contig number per genome MB (default: 2.1)
```

This help message is dynamically generated depending on the pipeline you build.
Since this pipeline starts with `trimmomatic`, which receives fastq files as input,
`--fastq` is the default parameter for providing paired-end fastq files.

#### Running a pipeline

Now that we have our nextflow pipeline built, we are ready to executed it by
providing input data. By default, FlowCraft pipelines will run locally and use
`singularity` to run the containers of each component. This can be
changed in multiple ways, but for convenience FlowCraft has already defined
profiles for most configurations of `executors` and `container` engines.

Running a pipeline locally with `singularity` can be done with:

```
# Pattern for paired-end fastq is '<sample>_1.fastq.gz <sample>_2.fastq.gz'
nextflow run my_pipeline --fastq "path/to/fastq/*_{1,2}.*"
```

If you want to run a pipeline in a cluster with SLURM and singularity, just use
the appropriate profile:

```
nextflow run my_pipeline --fastq "path/to/fastq/*_{1,2}.*" -profile slurm_sing
```

During the execution of the pipeline, the results and reports for each component
are continuously saved to the `results` and `reports` directory, respectively.

#### Inspecting a pipeline progress

Since version 1.2.0, it is possible to inspect the progress of a nextflow pipeline
using the `flowcraft inspect` mode. To check the progress in a terminal, simply
type:

```
flowcraft inspect
```

On the directory where the pipeline is running. Alternatively, you can view the progress
in FlowCraft's web service by using the ``broadcast`` option:

```
flowcraft inspect -m broadcast
```

<img src="https://github.com/assemblerflow/flowcraft-webapp/raw/master/flowcraft-webapp/frontend/resources/fc_short_demo.gif"/>

## Why not just write a Nextflow pipeline?

In many cases, building a static nextflow pipeline is sufficient for our goals.
However, when building our own pipelines, we often felt the need to add dynamism
to this process, particularly if we take into account how fast new tools arise
and existing ones change. Our biological goals also change over time and we
might need different pipelines to answer different questions. FlowCraft makes
this very easy, by having a set of pre-made and ready-to-use components that can
be freely assembled.

For instance, changing the assembly software in a genome assembly pipeline becomes
as easy as:

```
# Use spades
trimmomatic spades pilon
# Use skesa
trimmomatic skesa pilon
```

![example1](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_3.png)

If you are interested in having some sort of genome annotation, simply add those
components at the end, using a fork syntax:

```
# Run prokka and abricate at the end of the assembly
trimmomatic spades pilon (prokka | abricate)
```

![example2](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_1.png)

On the other hand, if you are interest in just perform allele calling for wgMLST,
simply add `chewbbaca`:

```
trimmomatic spades pilon chewbbaca
```

![example3](https://github.com/assemblerflow/flowcraft/raw/master/docs/resources/example_2.png)

Since nextflow handles parallelism of large sets of data so well, simple pipelines
of two components are also useful to build:

```
trimmomatic fastqc
```

As the number of existing components grow, so does your freedom to build pipelines.

## Roadmap

You can see what we're planning next on our [roadmap guide](https://github.com/assemblerflow/flowcraft/wiki/Roadmap).

## Developer guide

### Adding new components

Is there a missing component that you would like to see included? We would love
to expand! You could make a component request in our
[issue tracker](https://github.com/assemblerflow/flowcraft/issues).

If you want to be part of the team, you can contribute with the code as well. Each component
in FlowCraft can be independently added without having to worry about
the rest of the code base. You'll just need to have some knowledge of python
and nextflow. [Check the developer documentation for how-to guides](http://assemblerflow.readthedocs.io/en/latest/)


================================================
FILE: changelog.md
================================================
# Changelog

## 1.4.2

### New components

- `Bwa`: align short paired-end sequencing reads to long reference sequences
- `MarkDuplicates`: Identifies duplicate reads
- `BaseRecalibrator`: Detects systematic errors in base quality scores
- `Haplotypecaller`: Call germline SNPs and indels via local re-assembly of haplotypes

- `Seroba`: Serotyping of *Streptococcus pneumoniae* sequencing data (FastQ)
- `Concoct`: Clustering metagenomic assembled comtigs with coverage and composition
- `MetaBAT2`: A robust statistical framework for reconstructing genomes from metagenomic data

### Minor/Other changes

- added manifest information to the `nextflow.config` file to allow for remote execution
- Added checks for the DAG's dot files in the compile_reports component

## 1.4.1

### New features

- Added support for the report system to:
    - `maxbin2`
- Added new `manifest.config` with the pipeline metadata

### New components

- `Kraken2`: Taxonomic identification on FastQ files

### Bug fixes

- Fix bug in `momps`component related to added in the introduction of the clear input parameter
- Fixed bug with the `-ft` parameters not retrieving the dockerhub tags for 
all the components.
- Fixed bug in the `megahit` process where the fastg mode would break the process
- Fix inspect and report mode to fetch the nextflow file independently of its 
position in the `nextflow run` command inside the .nextflow.log file.
- Fix parsing of .nextflow.log file when searching for `nextflow run` command.
- Fixed bug between mash_sketch_fasta and mash_dist.

### Minor/Other changes

- Added option to `dengue_typing` to retrieve closest reference sequence and link it 
with a secondary channel into `mafft`
- New version of DEN-IM recipe
- Now prints an ordered list of components
- Moved taxonomy results from `results/annotation/` to `results/taxonomy/`


## 1.4.0

### New features

- Added new `recipe` system to flowcraft along with 6 starting recipes.
Recipes are pre-made and curated pipelines that address specific questions.
To create a recipe, the `-r <recipe_name>` can be used. To list available
recipes, the `--recipe-list` and `--recipe-list-short` options were added. 
- Added `-ft` or `--fetch-tags` which allows to retrieve all DockerHub 
container tags.
- Added function to collect all the components from the components classes,
replacing the current process_map dictionary implementation. Now, it will be
generated from the engine rather than hardcoded into the dict.

### Components changes

- Added new `disableRR` param in the `spades` component that disables repeat
resolution
- The `abyss` and `spades` components emit GFA in a secondary channel.
- The new `bandage` component can accept either FASTA from a primary channel
  or GFA from a secondary channel.
- Updated skesa to version 2.3.0.
- Updated mash based components for the latest version - 1.6.0-1.

### New components

- Added component `abyss`.
- Added component `bandage`.
- Added component `unicycler`.
- Added component `prokka`.
- Added component `bcalm`.
- Added component `diamond`.

### Minor/Other changes

- Added removal of duplicate IDs from `reads_download` component input.
- Added seed parameter to `downsample_fastq` component.
- Added bacmet database to `abricate` component.
- Added default docker option to avoid docker permission errors.
- Changed the default URL generated by inspect and report commands. 
- Changed the default URL generated by inspect and report commands.
- Added directives to `-L` parameter of build module.


### Bug fixes

- Fixed forks with same source process name.
- Fixed `inspect` issue when tasks took more than a day in duration.
- Added hardware address to `inpsect` and `report` hash.

## 1.3.1

### Features

- Added a new `clearInput` parameter to components that change their input.
The aim of this option is to allow the controlled removal of temporary files,
which is particularly useful in very large workflows.

### Components changes

- Updated images for components `mash_dist`, `mash_screen` and 
`mapping_patlas`.

### New components

- Added component `fast_ani`.

### Minor/Other changes

- Added `--export-directives` option to `build` mode to export component's 
directives in JSON format to standard output.
- Added more date information in `inspect` mode, including the year and the
locale of the executing system.

## 1.3.0

### Features
- Added `report` run mode to Flowcraft that displays the report of any given
pipeline in the Flowcraft's web application. The `report` mode can be executed
after a pipeline ended or during the pipeline execution using the `--watch`
option.
- Added standalone report HTML at the end of the pipeline execution.
- Components with support for the new report system:
    - `abricate`
    - `assembly_mapping`
    - `check_coverage`
    - `chewbbaca`
    - `dengue_typing`
    - `fastqc`
    - `fastqc_trimmomatic`
    - `integrity_coverage`
    - `mlst`
    - `patho_typing`
    - `pilon`
    - `process_mapping`
    - `process_newick`
    - `process_skesa`
    - `process_spades`
    - `process_viral_assembly`
    - `seq_typing`
    - `trimmomatic`
    - `true_coverage`

### Minor/Other changes

- Refactored report json for components `mash_dist`, `mash_screen` and 
`mapping_patlas`

### Bug fixes
- Fixed issue where `seq_typing` and `patho_typing` processes were not feeding
report data to report compiler.
- Fixed fail messages for `process_assembly` and `process_viral_assembly` 
components

## 1.2.2

### Components changes

- `mapping_patlas`: refactored to remove temporary files used to create
sam and bam files and added data to .report.json. Updated databases to pATLAS
version 1.5.2.
- `mash_screen` and `mash_dist`: added data to .report.json. Updated databases 
to pATLAS version 1.5.2.
- Added new options to `abricate` componente. Users can now provide custom database
directories, minimum coverage and minimum identity parameters.

### New components

- Added component `fasterq_dump`
- Added component `mash_sketch_fasta`
- Added component `mash_sketch_fastq`
- Added component `downsample_fastq` for FastQ read sub sampling using seqtk
- Added component `momps` for typing of Legionella pneumophila
- Added component `split_assembly`
- Added component `mafft`
- Added component `raxml`
- Added component `viral_assembly`
- Added component `progressive_mauve`
- Added component `dengue_typing`

### Minor/Other changes

- Added check for `params.accessions` that enables to report a proper
error when it is set to `null`.
- Added `build` option to export component parameters information in JSON format. 
- Fixed minor issue preventing the `maxbin2` and `split_assembly` components 
from being used multiples times in a pipeline
- Added a catch to the `filter_poly` process for cases where the input file is empty. 
- spades template now reports the exit code of spades' execution

### Bug fixes

- Removed the need for the nf process templates to have an empty line
at the beginning of the template files.
- Fixed issue when the `inspect` mode was executed on a pipeline directory
with failed processes but with the work directory removed (the log files
where no longer available).
- Fixed issue when the `inspect` mode was executed on a pipeline without the 
memory directory defined.
- Fixed issue in the `inspect` mode, where there is a rare race condition between
tags in the log and trace files.
- Fixed bug on `midas_species` process where the output file was not being 
linked correctly, causing the process to fail
- Fixed bug on `bowtie` where the reference parameter was missing the pid
- Fixed bug on `filter_poly` where the tag was missing

## 1.2.1

### Improvements

- The parameter system has been revamped, and parameters are now component-specific
and independent by default. This allows a better fine-tuning of the parameters
and also the execution of the same component multiple times (for instance in a fork)
with different parameters. The old parameter system that merged identical parameters
is still available by using the `--merge-params` flag when building the pipeline.
- Added a global `--clearAtCheckpoint` parameter that, when set to true, will remove
temporary files that are no longer necessary for downstream steps of the pipeline
from the work directory. This option is currently supported for the `trimmomatic`,
`fastqc_trimmomatic`, `skesa` and `spades` components. 

### New components

- `maxbin2`: An automatic tool for binning metagenomic sequences.
- `bowtie2`: Align short paired-end sequencing reads to long reference
sequences.
- `retrieve_mapped`: Retrieves the mapped reads of a previous bowtie2 mapping process.

### New recipes

- `plasmids`: A recipe to perform mapping, mash screen on reads
and also mash dist for assembly based approaches (all to detect
plasmids). This also includes annotation with abricate for the assembly.
- `plasmids_mapping`: A recipe to perform mapping for plasmids.
- `plasmids_mash`: A recipe to perform mash screen for plasmids.
- `plasmids_assembly`: A recipe to perform mash dist for plasmid
assemblies.

### Minor/Other changes

- Added "smart" check when the user provides a typo in pipeline string
for a given process, outputting some "educated" guesses to the
terminal.
- Added "-cr" option to show current recipe `pipeline_string`.
- Changed the way recipes were being parsed by `proc_collector` for the
usage of `-l` and `-L` options.
- Added check for non-ascii characters in colored_print.
- Fixed log when a file with the pipeline is provided to -t option
instead of a string.

### Bug fixes

- Fixed pipeline names that contain new line characters.
- Fixed pipeline generation when automatic dependencies were added right after a fork
- **Template: sistr.nf**: Fixed comparison that determined process status.
- Fixed issue with `--version` option.

## 1.2.0

### New components

- `card_rgi`: Anti-microbial resistance gene screening for assemblies
- `filter_poly`: Runs PrinSeq on paired-end FastQ files to remove low complexity sequences
- `kraken`: Taxonomic identification on FastQ files
- `megahit`: Metagenomic assembler for paired-end FastQ files
- `metaprob`: Performs read binning on metagenomic FastQ files
- `metamlst`: Checks the Sequence Type of metagenomic FastQ reads using Multilocus Sequence Typing
- `metaspades`: Metagenomic assembler for paired-end FastQ files
- `midas_species`: Taxonomic identification on FastQ files at the species level
- `remove host`: Read mapping with Bowtie2 against the target host genome (default hg19) and removes the mapping reads
- `sistr`: Salmonella *in silico* typing component for assemblies. 

### Features

- Added `inspect` run mode to flowcraft for displaying the progress overview
  during a nextflow run. This run mode has `overview` and `broadcast` options
  for viewing the progress of a pipeline.

### Minor/Other changes

- Changed `mapping_patlas` docker container tag and variable
(PR [#76](https://github.com/assemblerflow/assemblerflow/pull/76)).
- The `env` scope of nextflow.config now extends the `PYTHONPATH`
environmental variable.
- Updated indexes for both `mapping_patlas` and `mash` based processes.
- New logo!

### Bug Fixes

- **Template: fastqc_report.py**: Added fix to trim range evaluation.
- **Script: merge_json.py**: Fixed chewbbaca JSON merge function.


================================================
FILE: docker/Dockerfile
================================================
FROM python:3.6-alpine3.7
MAINTAINER Bruno Gonçalves <bfgoncalves@medicina.ulisboa.pt>

RUN apk add --no-cache git

WORKDIR /flowcraft

# Clone FlowCraft
RUN git clone https://github.com/assemblerflow/flowcraft.git
WORKDIR ./flowcraft

# Install flowcraft
RUN python setup.py install

WORKDIR /flowcraft

# Remove unnecessary packages
RUN apk del git

================================================
FILE: docs/Makefile
================================================
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS   ?=
SPHINXBUILD  ?= sphinx-build
PAPER        ?=
BUILDDIR      = _build

# Internal variables.
PAPEROPT_a4     = -D latex_elements.papersize=a4
PAPEROPT_letter = -D latex_elements.papersize=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help
help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html        to make standalone HTML files"
	@echo "  dirhtml     to make HTML files named index.html in directories"
	@echo "  singlehtml  to make a single large HTML file"
	@echo "  pickle      to make pickle files"
	@echo "  json        to make JSON files"
	@echo "  htmlhelp    to make HTML files and an HTML help project"
	@echo "  qthelp      to make HTML files and a qthelp project"
	@echo "  applehelp   to make an Apple Help Book"
	@echo "  devhelp     to make HTML files and a Devhelp project"
	@echo "  epub        to make an epub"
	@echo "  epub3       to make an epub3"
	@echo "  latex       to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  latexpdf    to make LaTeX files and run them through pdflatex"
	@echo "  latexpdfja  to make LaTeX files and run them through platex/dvipdfmx"
	@echo "  lualatexpdf to make LaTeX files and run them through lualatex"
	@echo "  xelatexpdf  to make LaTeX files and run them through xelatex"
	@echo "  text        to make text files"
	@echo "  man         to make manual pages"
	@echo "  texinfo     to make Texinfo files"
	@echo "  info        to make Texinfo files and run them through makeinfo"
	@echo "  gettext     to make PO message catalogs"
	@echo "  changes     to make an overview of all changed/added/deprecated items"
	@echo "  xml         to make Docutils-native XML files"
	@echo "  pseudoxml   to make pseudoxml-XML files for display purposes"
	@echo "  linkcheck   to check all external links for integrity"
	@echo "  doctest     to run all doctests embedded in the documentation (if enabled)"
	@echo "  coverage    to run coverage check of the documentation (if enabled)"
	@echo "  dummy       to check syntax errors of document sources"

.PHONY: clean
clean:
	rm -rf $(BUILDDIR)/*

.PHONY: html
html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

.PHONY: dirhtml
dirhtml:
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

.PHONY: singlehtml
singlehtml:
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
	@echo
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

.PHONY: pickle
pickle:
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

.PHONY: json
json:
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

.PHONY: htmlhelp
htmlhelp:
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

.PHONY: qthelp
qthelp:
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Templates.qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Templates.qhc"

.PHONY: applehelp
applehelp:
	$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
	@echo
	@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
	@echo "N.B. You won't be able to view it unless you put it in" \
	      "~/Library/Documentation/Help or install it in your application" \
	      "bundle."

.PHONY: devhelp
devhelp:
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
	@echo
	@echo "Build finished."
	@echo "To view the help file:"
	@echo "# mkdir -p $$HOME/.local/share/devhelp/Templates"
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Templates"
	@echo "# devhelp"

.PHONY: epub
epub:
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
	@echo
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

.PHONY: epub3
epub3:
	$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
	@echo
	@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."

.PHONY: latex
latex:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	      "(use \`make latexpdf' here to do that automatically)."

.PHONY: latexpdf
latexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through pdflatex..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: latexpdfja
latexpdfja:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through platex and dvipdfmx..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: lualatexpdf
lualatexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through lualatex..."
	$(MAKE) PDFLATEX=lualatex -C $(BUILDDIR)/latex all-pdf
	@echo "lualatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: xelatexpdf
xelatexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through xelatex..."
	$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf
	@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: text
text:
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
	@echo
	@echo "Build finished. The text files are in $(BUILDDIR)/text."

.PHONY: man
man:
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
	@echo
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

.PHONY: texinfo
texinfo:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo
	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
	@echo "Run \`make' in that directory to run these through makeinfo" \
	      "(use \`make info' here to do that automatically)."

.PHONY: info
info:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo "Running Texinfo files through makeinfo..."
	make -C $(BUILDDIR)/texinfo info
	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

.PHONY: gettext
gettext:
	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
	@echo
	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

.PHONY: changes
changes:
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

.PHONY: linkcheck
linkcheck:
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

.PHONY: doctest
doctest:
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."

.PHONY: coverage
coverage:
	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
	@echo "Testing of coverage in the sources finished, look at the " \
	      "results in $(BUILDDIR)/coverage/python.txt."

.PHONY: xml
xml:
	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
	@echo
	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

.PHONY: pseudoxml
pseudoxml:
	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
	@echo
	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

.PHONY: dummy
dummy:
	$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
	@echo
	@echo "Build finished. Dummy builder generates no files."


================================================
FILE: docs/_static/custom.css
================================================
div.wy-side-nav-search, div.wy-nav-top {
  background: #5c6bc0;
}

.wy-menu > .caption > .caption-text {
  color: #5c6bc0;
}

.wy-nav-content {
  max-width: 100%
}

================================================
FILE: docs/about/about.rst
================================================
About
=====

FlowCraft is developed by the Molecular `Microbiology and Infection Unit (UMMI) <http://darwin.phyloviz.net/wiki/doku.php>`_
at the `Instituto de Medicina Molecular Joao Antunes <https://imm.medicina.ulisboa.pt/en/>`_.

This project is licensed under the `GPLv3 license <https://github.com/assemblerflow/flowcraft/blob/master/LICENSE>`_.
The source code of FlowCraft is available at `<https://github.com/assemblerflow/flowcraft>`_ and the
webservice is available at `<https://github.com/assemblerflow/flowcraft-webapp>`_.

================================================
FILE: docs/conf.py
================================================
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Templates documentation build configuration file, created by
# sphinx-quickstart on Mon Feb  5 14:24:12 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../flowcraft/templates"))
import flowcraft

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.todo',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages',
    'numpydoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.mathjax'
]

autodoc_member_order = 'bysource'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'FlowCraft'
copyright = '2018, FlowCraft team'
author = 'Diogo N. Silva, Tiago F. Jesus, Ines Mendes, Bruno Ribeiro-Goncalves'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = flowcraft.__version__
# The full version, including alpha/beta/rc tags.
release = '1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {"collapse_navigation": True}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Templatesdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'Templates.tex', 'Templates Documentation',
     'Diogo N. Silva', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'templates', 'Templates Documentation',
     [author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'Templates', 'Templates Documentation',
     author, 'Templates', 'One line description of project.',
     'Miscellaneous'),
]

# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


def setup(app):
    app.add_stylesheet('custom.css')

================================================
FILE: docs/dev/containers.rst
================================================
Docker containers guidelines
============================

All FlowCraft components require a docker container in order to be executed,
thus if a new component is added, a docker image should be added as well and
uploaded to
.. _docker hub: https://hub.docker.com/ in order to be available to pull in
other machines. Although this can be done in any personal
repository, we recommend that this docker images are added to an already
existing .. _FlowCraft github repository: https://github.com/assemblerflow/docker-imgs
(called here ``Official``) so that docker builds can be automated with github
integration. Also, the centralization of all images will allow other
contributors to easily access and edit these containers instead of forking from
one side to another every time a container needs to be changed/updated.

Official FlowCraft Docker images
--------------------------------

Writing docker images
:::::::::::::::::::::

Official FlowCraft Docker images are available in
.. _this github repository: https://github.com/assemblerflow/docker-imgs .
If you want to add your image to this repository please fork it and make a
Pull Request (PR) with the requested new image or create an issue asking to be
added to the organization as a contributor.


Building docker images
::::::::::::::::::::::

Then, after the image has been added to the FlowCraft
.. _docker-imgs https://github.com/assemblerflow/docker-imgs
github repository, they can be built through
.. _FlowCraft docker hub https://hub.docker.com/u/flowcraft/dashboard/ .

Tag naming
^^^^^^^^^^

Each time a docker image is built using the automated build of docker hub it
should follow this nomenclature: ``version-patch``.
This is used to avoid the override of previous builds for the same images,
allowing for instance users to use different version of the same software using
the same docker image but with different tags.

- ``Version``: Is a string with tree letters like this: ``1.1.1``. Versions should
change every time a new software is added the container.

- ``Patch``: Is a number that follows a ``-`` after the version. Patches should
change every time a change does not affect
the software inside it. For example, updates to database related files required
by some of the software inside the container.

Unofficial FlowCraft Docker images
----------------------------------

Although we **strongly** recommend that all images are stored in FlowCraft
.. _docker-imgs https://github.com/assemblerflow/docker-imgs github repo, it is
not mandatory to do it. Images can be built in another github repo and
also use another docker hub repository to build the images.
However, do make sure that you define it correctly in the directives of the
process as explained in :ref:`DirectivesAnchor`.


================================================
FILE: docs/dev/create_process.rst
================================================
Process creation guidelines
===========================

Basic process creation
----------------------

The addition of a new process to FlowCraft requires three main steps:

#. `Create process template`_: Create a jinja2 template in ``flowcraft.generator.templates`` with the
   nextflow code.

#. `Create Process class`_: Create a :class:`~flowcraft.generator.process.Process` subclass in
   :class:`flowcraft.generator.process` with
   information about the process (e.g., expected input/output, secondary inputs,
   etc.).

.. _create-process:

Create process template
:::::::::::::::::::::::

First, create the nextflow template that will be integrated into the pipeline
as a process. This file must be placed in ``flowcraft.generator.templates``
and have the ``.nf`` extension. In order to allow the template to be
dynamically added to a pipeline file, we use the jinja2_ template language to
substitute key variables in the process, such as input/output channels.

An example created as a ``my_process.nf`` file is as follows::

    some_channel_{{ pid }} = Channel.value(params.param1{{ param_id}})
    other_channel_{{ pid }} = Channel.fromPath(params.param2{{ param_id}})

    process myProcess_{{ pid }} {

        {% include "post.txt" ignore missing %}

        publishDir "results/myProcess_{{ pid }}", pattern: "*.tsv"

        input:
        set sample_id, <data> from {{ input_channel }}
        val x from some_channel_{{ pid }}
        file y from other_channel_{{ pid }}
        val direct_from_parms from Channel.value(params.param3{{param_id}}

        // The output is optional
        output:
        set sample_id, <data> into {{ output_channel }}
        {% with task_name="abricate" %}
        {%- include "compiler_channels.txt" ignore missing -%}
        {% endwith %}

        """
        <process code/commands>
        """
    }

    {{ forks }}

The fields surrounded by curly brackets are jinja placeholders that will be
dynamically substituted when building the pipeline. They will ensure that the
processes and potential forks correctly link with each other and that
channels are unique and correctly linked. This example contains all
placeholder variables that are currently supported by FlowCraft.

{{pid}}
^^^^^^^

Used as a unique process identifier that prevent issues
from process and channel duplication in the pipeline. Therefore, is should be
appended to each process and channel name as ``_{{ pid }}`` (note the underscore)::

    some_channel_{{ pid }}
    process myProcess_{{ pid }}

{{param_id}}
^^^^^^^^^^^^

Same as the **{{ pid }}**, but sets the identified for nextflow ``params``. It should
be appended to each ``param`` as ``{{ param_id }}``. This will allow parameters
to be specific to each component in the pipeline::

    Channel.value(params.param1{{ param_id}})

Note that the parameters used in the template, should also be defined in the
Process class params attribute (see `Parameters`_).

{% include "post.txt" %}
^^^^^^^^^^^^^^^^^^^^^^^^

Inserts ``beforeScript`` and ``afterScript`` statements to the process that
sets environmental variables and a series of *dotfiles* for the process to
log their status, warnings, fails and reports (see :ref:`dotfiles` for
more information). It also includes scripts for sending requests to
REST APIs (only when certain pipeline parameters are used).

{{input_channel}}
^^^^^^^^^^^^^^^^^

All processes must include **one and only one** input channel. In most cases,
this channel should be defined with a two element tuple that contains the
sample ID and then the actual data file/stream. We suggest the sample ID
variable to be named ``sample_id`` as a standard. If other name variable name
is specified and you include the ``compiler_channels.txt`` in the process,
you'll need to change the sample ID variable (see `Sample ID variable`_).

{{output_channel}}
^^^^^^^^^^^^^^^^^^

Terminal processes may skip the output channel entirely. However, if you want
to link the main output of this process with subsequent ones, this placeholder
must be used **only once**. Like in the input channel, this channel should
be defined with a two element tuple with the sample ID and the data. The
sample ID must match the one specified in the ``input_channel``.

.. _compiler:

{% include "compiler_channels.txt %}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This will include the special channels that will compile the status/logging
of the processes throughout the pipeline. **You must include the whole
block** (see `Status channels`_)::

    {% with task_name="abricate" %}
    {%- include "compiler_channels.txt" ignore missing -%}
    {% endwith %}


{{forks}}
^^^^^^^^^

Inserts potential forks of the main output channel. It is **mandatory** if
the ``output_channel`` is set.

Complete example
^^^^^^^^^^^^^^^^

As an example of a complete process, this is the template of ``spades.nf``::

    IN_spades_opts_{{ pid }} = Channel.value([params.spadesMinCoverage{{ param_id }},params.spadesMinKmerCoverage{{ param_id }}])
    IN_spades_kmers_{{pid}} = Channel.value(params.spadesKmers{{ param_id }})

    process spades_{{ pid }} {

        // Send POST request to platform
        {% include "post.txt" ignore missing %}

        tag { fastq_id + " getStats" }
        publishDir 'results/assembly/spades/', pattern: '*_spades.assembly.fasta', mode: 'copy'

        input:
        set fastq_id, file(fastq_pair), max_len from {{ input_channel }}.join(SIDE_max_len_{{ pid }})
        val opts from IN_spades_opts_{{ pid }}
        val kmers from IN_spades_kmers_{{ pid }}

        output:
        set fastq_id, file('*_spades.assembly.fasta') optional true into {{ output_channel }}
        set fastq_id, val("spades"), file(".status"), file(".warning"), file(".fail") into STATUS_{{ pid }}
        file ".report.json"

        script:
        template "spades.py"
    }

    {{ forks }}


Create Process class
::::::::::::::::::::

The process class will contain the information that FlowCraft
will use to build the pipeline and assess potential conflicts/dependencies
between process. This class should be created in one the category files in the
:mod:`flowcraft.generator.components` module (e.g.: ``assembly.py``). If
the new component does not fit in any of the existing categories, create a
new one that imports :mod:`flowcraft.generator.process.Process` and add
your new class. This class should inherit from the
:class:`~flowcraft.generator.process.Process` base
class::

    class MyProcess(Process):

        def __init__(self, **kwargs):

            super().__init__(**kwargs)

            self.input_type = "fastq"
            self.output_type = "fasta"

This is the simplest working example of a process class, which basically needs
to inherit the parent class attributes (the ``super`` part).
Then we only need to define the expected input
and output types of the process. There are no limitations to the
input/output types.
However, a pipeline will only build successfully when all processes correctly
link the output with the input type.

Depending on the process, other attributes may be required:

    - `Parameters`_: Parameters provided by the user to be used in the process.
    - `Secondary inputs`_: Channels created from parameters provided by the
      user.
    - Secondary `Link start`_ and `Link end`_: Secondary links that connect
      secondary information between two processes.
    - `Dependencies`_: List of other processes that may be required for
      the current process.
    - `Directives`_: Default information for RAM/CPU/Container directives
      and more.

Add to available components
::::::::::::::::::::::::::

Contrary to previous implementation (version <= 1.3.1), the available components
are now retrieved automatically by FlowCraft and there is no need to add the
process to any dictionary (previous ``process_map``). In order for the component
to be accessible to ``flowcraft build`` the process template name in
``snake_case`` must match the process class in ``CamelCase``. For instance,
if the process template is named ``my_process.nf``, the process class must
be ``MyProcess``, then the FlowCraft will be able to automatically add it to the
list of available components.

.. note::
    Note that the template string does not include the ``.nf`` extension.

Process attributes
------------------

This section describes the main attributes of the
:mod:`~flowcraft.generator.process.Process` class: what they
do and how do they impact the pipeline generation.

Input/Output types
::::::::::::::::::

The :attr:`~flowcraft.generator.process.Process.input_type` and
:attr:`~flowcraft.generator.process.Process.output_type` attributes
set the expected type of input and output of the process. There are no
limitations to the type of input/output that are provided. However, processes
will only link when the output of one process matches the input of the
subsequent process (unless the
:attr:`~flowcraft.generator.process.Process.ignore_type` attribute is set
to ``True``). Otherwise, FlowCraft will raise an exception stating that
two processes could not be linked.

.. note::

    The input/ouput types that are currently used are ``fastq``, ``fasta``.

Parameters
::::::::::

The :attr:`~flowcraft.generator.process.Process.params` attribute sets
the parameters that can be used by the process. For each parameter, a default
value and a description should be provided. The default value will be set
in the ``params.config`` file in the pipeline directory and the description
will be used to generated the custom help message of the pipeline::

    self.params = {
        "genomeSize": {
            "default": 2.1,
            "description": "Expected genome size (default: params.genomeSiz)
        },
        "minCoverage": {
            "default": 15,
            "description": "Minimum coverage to proceed (default: params.minCoverage)"
        }
    }

These parameters can be simple values that are not feed into
any channel, or can be automatically set to a secondary input channel via
`Secondary inputs`_ (see below).

They can be specified when running the pipeline like any nextflow parameter
(e.g.: ``--genomeSize 5``) and used in the nextflow process as usual
(e.g.: ``params.genomeSize``).

.. note::
    These pairs are then used to populate the ``params.config`` file that is
    generated in the pipeline directory. Note that the values are replaced
    literally in the config file. For instance, ``"genomeSize": 2.1,`` will appear
    as ``genomeSize = 2.1``, whereas ``"adapters": "'None'"`` will appear as
    ``adapters = 'None'``. If you want a value to appear as a string, the double
    and single quotes are necessary.


Secondary inputs
::::::::::::::::

.. warning::
    The ``secondary_inputs`` attribute has been deprecated since **v1.2.1.**
    Instead, specify the secondary channels directly in the nextflow template
    files.

Any process can receive one or more input channels in addition to the main
channel. These are particularly useful when the process needs to receive
additional options from the ``parameters`` scope of nextflow.
These additional inputs can be specified via the
:attr:`~flowcraft.generator.process.Process.secondary_inputs` attribute,
which should store a list of dictionaries (a dictionary for each input). Each dictionary should
contains a key:value pair with the name of the parameter (``params``) and the
definition of the nextflow channel (``channel``). Consider the example below::

    self.secondary_inputs = [
            {
                "params": "genomeSize",
                "channel": "IN_genome_size = Channel.value(params.genomeSize)"
            },
            {
                "params": "minCoverage",
                "channel": "IN_min_coverage = Channel.value(params.minCoverage)"
            }
        ]

This process will receive two secondary inputs that are given by the
``genomeSize`` and ``minCoverage`` parameters. These should be also specified
in the :attr:`~flowcraft.generator.process.Process.params` attribute
(See `Parameters`_ above).

For each of these parameters, the dictionary
also stores how the channel should be defined at the beginning of the pipeline
file. Note that this channel definition mentions the parameters (e.g.
``params.genomeSize``). An additional best practice for channel definition
is to include one or more sanity checks to ensure that the provided arguments
are correct. These checks can be added in the nextflow template file, or
literally in the ``channel`` string::

    self.secondary_inputs = [
        {
            "params": "genomeSize",
            "channel":
                    "IN_genome_size = Channel.value(params.genomeSize)"
                    "map{it -> it.toString().isNumber() ? it : exit(1, \"The genomeSize parameter must be a number or a float. Provided value: '${params.genomeSize}'\")}"
            }

Extra input
:::::::::::

The :attr:`~flowcraft.generator.process.Process.extra_input` attribute
is mostly a user specified directive that allows the injection of additional
input data from a parameter into the main input channel of the process.
When a pipeline is defined as::

    process1 process2={'extra_input':'var'}

FlowCraft will expose a new ``var`` parameter, setup an extra input
channel and mix it with ``process2`` main input channel. A more detailed
explanation follows below.

First, FlowCraft will create a nextflow channel from the parameter name
provided via the ``extra_input`` directive. The channel string will depend
on the input type of the process (this string is fetched from the
:attr:`~flowcraft.generator.process.Process.RAW_MAPPING` attribute).
For instance, if the input type of
``process2`` is ``fastq``, the new extra channel will be::

    IN_var_extraInput = Channel.fromFilePairs(params.var)

Since the same extra input parameter may be used by more than one process,
the ``IN_var_extraInput`` channel will be automatically forked into the
final destination channels::

    // When there is a single destination channel
    IN_var_extraInput.set{ EXTRA_process2_1_2 }
    // When there are multiple destination channels for the same parameter
    IN_var_extraInput.into{ EXTRA_process2_1_2; EXTRA_process3_1_3 }

The destination channels are the ones that will be actually mixed with
the main input channels::

    process process2 {
        input:
        (...) main_channel.mix(EXTRA_process2_1_2)
    }

In these cases, the processes that receive the extra input will process the
data provided by the preceding channel **AND** by the parameter. The data
provided via the extra input parameter does not have to wait for the
``main_channel``, which means that they can run in parallel, if there are
enough resources.

Compiler
::::::::

The :attr:`~flowcraft.generator.process.Process.compiler` attribute
allows one or more channels of the process to be fed into a compiler process
(See `Compiler processes`_). These are special processes that collect
information from one or more processes to execute a given task. Therefore,
this parameter can only be used when there is an appropriate compiler process
available (the available compiler processes are set in the
:attr:`~flowcraft.generator.engine.NextflowGenerator.compilers` dictionary). In order to
provide one or more channels to a compiler process, simply add a key:value to the
attribute, where the key is the id of the compiler process present in the
:attr:`~flowcraft.generator.engine.NextflowGenerator.compilers` dictionary and the value
is the list of channels::

    self.compiler["patlas_consensus"] = ["mappingOutputChannel"]

Link start
::::::::::

The :attr:`~flowcraft.generator.process.Process.link_start` attribute
stores a list of strings of channel names that can be used as secondary
channels in the pipeline (See the `Secondary links between process`_ section).
By default, this attribute contains the main output channel, which means
that every process can fork the main channel to one or more receiving
processes.

Link end
::::::::

The :attr:`~flowcraft.generator.process.Process.link_end` attribute
stores a list of dictionaries with channel names that are meant to be
received by the process as secondary channel **if** the corresponding
`Link start`_ exists in the pipeline. Each dictionary in this list will define
one secondary channel and requires two key:value pairs::

    self.link_end({
        "link": "SomeChannel",
        "alias": "OtherChannel")
    })

If another process exists in the pipeline with
``self.link_start.extend(["SomeChannel"])``, FlowCraft will automatically
establish a secondary channel between the two processes. If there are multiple
processes receiving from a single one, the channel from the later will
for into any number of receiving processes.

Dependencies
::::::::::::

If a process depends on the presence of one or more processes upstream in the
pipeline, these can be specific via the
:attr:`~flowcraft.generator.process.Process.dependencies` attribute.
When building the pipeline if at least one of the dependencies is absent,
FlowCraft will raise an exception informing of a missing dependency.

.. _DirectivesAnchor:

Directives
::::::::::

The :attr:`~flowcraft.generator.process.Process.directives` attribute
allows for information about cpu/RAM usage and container to be specified
for each nextflow process in the template file. For instance, considering
the case where a ``Process`` has a template with two nextflow processes::

    process proc_A_{{ pid }} {
        // stuff
    }

    process proc_B_{{ pid }} {
        // stuff
    }

Then, information about each process can be specified individually in the
:attr:`~flowcraft.generator.process.Process.directives` attribute::


    class myProcess(Process):
        (...)
        self.directives = {
            "proc_A": {
                "cpus": 1
                "memory": "4GB"
            },
            "proc_B": {
                "cpus": 4
                "container": "my/container"
                "version": "1.0.0"
            }
        }

The information in this attribute will then be used to build the
``resources.config`` (containing the information about cpu/RAM) and
``containers.config`` (containing the container images) files. Whenever a
directive is missing, such as the ``container`` and ``version`` from ``proc_A``
and ``memory`` from ``proc_B``, nothing about them will be written into the
config files and they will use the **default pipeline values**:

- ``cpus``: ``1``
- ``memory``: ``1GB``
- ``container``: `flowcraft_base`_ image

.. _flowcraft_base: https://hub.docker.com/r/ummidock/assemblerflow_base/~/dockerfile/

Ignore type
:::::::::::

The :attr:`~flowcraft.generator.process.Process.ignore_type` attribute,
controls whether a match between the input of the current process and the
output of the previous one is enforced or not. When there are multiple
terminal processes that fork from the main channel, there is no need to
enforce the type match and in that case this attribute can be set to ``False``.

Process ID
::::::::::

The process ID, set via the
:attr:`~flowcraft.generator.process.Process.pid` attribute, is an
arbitrarily and incremental number that is awarded to each process depending
on its position in the pipeline. It is mainly used to ensure that there are
no duplicated channels even when the same process is used multiple times
in the same pipeline.

Template
::::::::

The :attr:`~flowcraft.generator.process.Process.template` attribute
is used to fetch the jinja2 template file that corresponds to the current
process. The path to the template file is determined as follows::

    join(<template directory>, template + ".nf")


Status channels
:::::::::::::::

The status channels are special channels dedicated to passing information
regarding the status, warnings, fails and logging from each process
(see :ref:`dotfiles` for more information). They are used only when the
nextflow template file contains the appropriate jinja2 placeholder::

    output:
    {% with task_name="<nextflow_template_name>" %}
    {%- include "compiler_channels.txt" ignore missing -%}
    {% endwith %}

By default,
every ``Process`` class contains a
:attr:`~flowcraft.generator.process.Process.status_channels` list
attribute that contains the
:attr:`~flowcraft.generator.process.Process.template` string::

    self.status_channels = ["STATUS_{}".format(template)]

If there is only one nextflow process in the template and the ``task_name``
variable in the template matches the
:attr:`~flowcraft.generator.process.Process.template` attribute, then
it's all automatically set up.

If the template file contains **more than one nextflow process**
definition, multiple placeholders can be provided in the template::

    process A {
        (...)
        output:
        {% with task_name="A" %}
        {%- include "compiler_channels.txt" ignore missing -%}
        {% endwith %}
    }

    process B {
        (...)
        output:
        {% with task_name="B" %}
        {%- include "compiler_channels.txt" ignore missing -%}
        {% endwith %}
    }

In this case, the
:attr:`~flowcraft.generator.process.Process.status_channels` attribute
would need to be changed to::

    self.status_channels = ["A", "B"]

Sample ID variable
^^^^^^^^^^^^^^^^^^

In case you change the standard nextflow variable that stores the sample ID
in the input of the process (``sample_id``), you also need to change it for
the ``compiler_channels`` placeholder::

    process A {

    input:
    set other_id, data from {{ input_channel }}

    output:
    {% with task_name="B", sample_id="other_id" %}
    {%- include "compiler_channels.txt" ignore missing -%}
    {% endwith %}

    }

Advanced use cases
------------------

Compiler processes
::::::::::::::::::

Compilers are special processes that collect data from one or more processes
and perform a given task with that compiled data. They are automatically
included in the pipeline when at least one of the source channels is present.
In the case there are multiple source channels, they are merged according
to a specified operator.

Creating a compiler process
^^^^^^^^^^^^^^^^^^^^^^^^^^^

The creation of the compiler process is simpler than that of a regular process
but follows the same three steps.

1. Create a nextflow template file in ``flowcraft.generator.templates``::

    process fullConsensus {

        input:
        set id, file(infile_list) from {{ compile_channels }}

        output:
        <output channels>

        script:
        """
        <commands/code/template>
        """

    }

The only requirement is the inclusion of a ``compiler_channels`` jinja
placeholder in the main input channel.

2. Create a Compiler class in the :mod:`flowcraft.generator.process`
   module::

    class PatlasConsensus(Compiler):

        def __init__(self, **kwargs):

            super().__init__(**kwargs)

This class must inherit from
:mod:`~flowcraft.generator.process.Compiler` and does not require any
more changes.

3. Map the compiler template file to the class in
:attr:`~flowcraft.generator.engine.NextflowGenerator.compilers` attribute::

        self.compilers = {
        "patlas_consensus": {
            "cls": pc.PatlasConsensus,
            "template": "patlas_consensus",
            "operator": "join"
            }
        }

Each compiler should contain a key:value entry. The key is the compiler
id that is then specified in the :attr:`~flowcraft.generator.process.Process.compiler`
attribute of the component classes. The value is a json/dict object that
species the compiler class in the ``cls`` key, the template string in the
``template`` string and the operator used to join the channels into the
compiler via the ``operator`` key.

How a compiler process works
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Consider the case where you have a compiler process named ``compiler_1`` and
two processes, ``process_1`` and ``process_2``, both of which feed a single
channel to ``compiler_1``. This means that the class definition of these
processes include::

    class Process_1(Process):
        (...)
        self.compiler["compiler_1"] = ["channel1"]

    class Process_2(Process):
        (...)
        self.compiler["compiler_1"] = ["channel2"]

If a pipeline is built with at least one of these process, the ``compiler_1``
process will be automatically included in the pipeline. If more than one
channel is provided to the compiler, they will be merged with the specified
operator::

    process compiler_1 {

        input:
        set sample_id, file(infile_list) from channel2.join(channel1)

    }

This will allow the output of multiple separate process to be processed by
a single process in the pipeline, and it automatically adjusts according
to the channels provided to the compiler.

Secondary links between process
:::::::::::::::::::::::::::::::

In some cases, it might be necessary to perform additional links between
two or more processes.
For example, the maximum read length might be gathered in one process, and
that information may be required by a subsequent process. These secondary
channels allow this information to be passed between theses channels.

These additional links are called secondary channels and
they may be explicitly or implicitly declared.

Explicit secondary channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^

To create an explicit secondary channel, the origin or source of this channel
must be declared in the nextflow process that sends it::

    // secondary channels can be created inside the process
    output:
    <main output> into {{ output_channel }}
    <secondary output> into SIDE_max_read_len_{{ pid }}

    // or outside
    SIDE_phred_{{ pid }} = Channel.create()

Then, we add the information that this process has a secondary channel start
via the ``link_start`` list attribute in the corresponding
``flowcraft.generator.process.Process`` class::

    class MyProcess(Process):

        (...)

        self.link_start.extend(["SIDE_max_read_len", "SIDE_phred"])

Notice that we extend the ``link_start`` list, instead of simply assigning.
This is because all processes already have the main channel as an implicit
link start (See `Implicit secondary channels`_).

**Now, any process that is executed after this one can receive this secondary
channel.**

For another process to receive this channel, it will be necessary to add this
information to the process class(es) via the ``link_end`` list attribute::

    class OtherProcess(Process):

        (...)

        self.link_end.append({
            "link": "SIDE_phred",
            "alias": "OtherName"
        })

Notice that now we append a dictionary with two key:values. The first, `link`
must match a string from the `link_start` list (in this case, `SIDE_phred`).
The second, `alias`, will be the channel name in the receiving process nextflow
template (which can be the same as the `link` value).

Now, we only need to add the secondary channel to the nextflow template, as in
the example below::

    input:
    <main_input> from {{ input_channel }}.mix(OtherName_{{ pid}})

Implicit secondary channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^

By default, the main output of the channels is declared as a secondary channel
start. This means that any process can receive the main output channel as a
a secondary channel of a subsequent process. This can be useful in situations
were a post-assembly process (has ``assembly`` as expected input and output)
needs to receive the last channel with fastq files::

    class AssemblyMapping(Process):

        (...)

        self.link_end.append({
            "link": "MAIN_fq",
            "alias": "_MAIN_assembly"
        })

In this example, the ``AssemblyMapping`` process will receive a secondary
channel with from the last process that output fastq files into a channel
called ``_MAIN_assembly``. Then, this channel is received in the nextflow
template like this::

    input:
    <main input> from {{ input_channel }}.join(_{{ input_channel }})

Implicit secondary channels can also be used to
fork the last output channel into multiple terminal processes::

    class Abricate(Process):

        (...)

        self.link_end.append({
            "link": "MAIN_assembly",
            "alias": "MAIN_assembly"
        })

In this case, since ``MAIN_assembly`` is already the prefix of the main
output channel of this process, there is no need for changes in the process
template::

    input:
    <main input> from {{ input_channel }}


.. _jinja2: http://jinja.pocoo.org/docs/2.10/


================================================
FILE: docs/dev/create_recipe.rst
================================================
Recipe creation guidelines
===========================

Recipes are pre-made pipeline strings that may be associated with specific
parameters and directives and are used to rapidly build a certain type of
pipeline.

Instead of building a pipeline like::

    -t "integrity_coverage fastqc_trimmomatic fastqc spades pilon"

The user simply can specific a recipe with that pipeline::

    -r assembly

Recipe creation
---------------

The creation of new recipes is a very simple and straightforward process.
You need to create a new file in the ``flowcraft/generator/recipes`` folder
with any name and create a basic class with three attributes::

    try:
        from generator.recipe import Recipe
    except ImportError:
        from flowcraft.generator.recipe import Recipe


    class Innuca(Recipe):

        def __init__(self):
            super().__init__()

            # Recipe name
            self.name = "innuca"

            # Recipe pipeline
            self.pipeline_str = <pipeline string>

            # Recipe parameters and directives
            self.directives = { <directives> }

And that's it! Now there is a new recipe available with the ``innuca`` name and
we can build this pipeline using the option ``-r innuca``.

Name
^^^^

This is the name of the recipe, which is used to make a match with the recipe
name provided by the user via the ``-r`` option.

Pipeline_str
^^^^^^^^^^^^

The pipeline string as if provided via the ``-t`` option.

Directives
^^^^^^^^^^

A dictionary containing the parameters and directives for each process in the
pipeline string. **Setting this attribute is optional and components
that are not specified here will assume their default values**. In general, each
element in this dictionary should have the following format::

    self.directives = {
        "component_name": {
            "params": {
                "paramA": "value"
            },
            "directives": {
                "directiveA": "value"
            }
        }
    }

This will set the provided parameters and directives to the component, but it is
possible to provide only one.

A more concrete example of a real component and directives follows::

    self.pipeline_str = "integrity_coverage fastqc"

    # Set parameters and directives only for integrity_coverage
    # and leave fastqc with the defaults
    self.directives = {
        "integrity_coverage": {
            "params": {
                "minCoverage": 20
            },
            "directives": {
                "memory": "1GB"
            }
        }
    }

Duplicate components
~~~~~~~~~~~~~~~~~~~~

In some cases, the same component may be present multiple times in the pipeline
string of a recipe. In these cases, directives can be assigned to each individual
component by adding a ``#<id>`` suffix to the component::

    self.pipeline_str = "integrity_coverage ( trimmomatic spades#1 | spades#2)"

    self.directives = {
        "spades#1": {
            "directives": {
                "memory": "10GB"
            }
        },
        "spades#2": {
            "directives": {
                "version": "3.7.0"
            }
        }
    }


================================================
FILE: docs/dev/create_recipes.rst
================================================
Recipe creation guidelines
==========================

Under construction.

================================================
FILE: docs/dev/create_template.rst
================================================
Template creation guidelines
============================

Though none of these guidelines are mandatory nor required, their usage is
highly recommended for several reasons:

- Consistency in the outputs of the templates throughout the pipeline,
  particularly the status and report dotfiles (see :ref:`dotfiles` section);
- Debugging purposes;
- Versioning;
- Proper documentation of the template scripts.

Preface header
--------------

After the script shebang, a header with a brief description of the purpose and
expected inputs and outputs should be provided. A complete example of such
description can be viewed in :mod:`flowcraft.templates.integrity_coverage`.

Purpose
^^^^^^^

Purpose section contains a brief description of the script's objective. E.g.::

    Purpose
    -------

    This module is intended parse the results of FastQC for paired end FastQ \
    samples.

Expected input
^^^^^^^^^^^^^^

Expected input section contains a description of the variables that are
provided to the main function of the template script. These variables are
defined in the input channels of the process in which the template is supposed
to be executed. E.g.::

    Expected input
    --------------

    The following variables are expected whether using NextFlow or the
    :py:func:`main` executor.

    - ``mash_output`` : String with the name of the mash screen output file.
        - e.g.: ``'sortedMashScreenResults_SampleA.txt'``

This means that the process that will execute this channel will have the input
defined as::

    input:
    file(mash_output) from <channel>

Generated output
^^^^^^^^^^^^^^^^

Generated output section contains a description of the output files that the
template script is intended to generated. E.g.::

    Generated output
    ----------------

    The generated output are output files that contain an object, usually a string.

    - ``fastqc_health`` : Stores the health check for the current sample. If it
        passes all checks, it contains only the string 'pass'. Otherwise, contains
        the summary categories and their respective results

These can then be passed to the output channel(s) in the nextflow process::

    output:
    file(fastqc_health) into <channel>

.. note ::

    Since templates can be re-used by multiple processes, not all generated
    outputs need to be passed to output channels. Depending on the job of
    the nextflow process, it may catch none or all of the output files
    generated by the template.


Versioning and logging
----------------------

FlowCraft has a specific ``logger``
(:func:`~flowcraft.templates.flowcraft_utils.flowcraft_base.get_logger`) and
versioning system that can be imported from
:mod:`flowcraft.templates.flowcraft_utils`: ::

    # the module that imports the logger and the decorator class for versioning
    # of the script itself and other software used in the script
    from flowcraft_utils.flowcraft_base import get_logger, MainWrapper



Logger
^^^^^^

A `logger` function is also required to add logs to the script. The logs
are written to the ``.command.log`` file in the work directory of each process.

First, the logger must be called, for example, after the **imports** as follows::

    logger = get_logger(__file__)

Then, it may be used at will, using the default `logging levels
<https://docs.python.org/3.6/library/logging.html#levels>`_ . E.g.::

    logger.debug("Information tha may be important for debugging")
    logger.info("Information related to the normal execution steps")
    logger.warning("Events that may require the attention of the developer")
    logger.error("Module exited unexpectedly with error:\\n{}".format(
                traceback.format_exc()))

MainWrapper decorator
^^^^^^^^^^^^^^^^^^^^^

This :class:`~flowcraft.templates.flowcraft_utils.flowcraft_base.MainWrapper`
class decorator allows the program to fetch information on the script version,
build and template name. For example::

    # This can also be declared after the imports
    __version__ = "1.0.0"
    __build__ = "15012018"
    __template__ = "process_abricate-nf"

The :class:`~flowcraft.templates.flowcraft_utils.flowcraft_base.MainWrapper`
should decorate the main function of the script.
E.g.::

    @MainWrapper
    def main():
        #some awesome code
        ...

Besides searching for the script's version, build and template name this decorator
will also search for a specific set of functions that start with the
substring ``__get_version``. For example::

    def __get_version_fastqc():

        try:

        cli = ["fastqc", "--version"]
        p = subprocess.Popen(cli, stdout=PIPE, stderr=PIPE)
        stdout, _ = p.communicate()

        version = stdout.strip().split()[1][1:].decode("utf8")

        except Exception as e:
            logger.debug(e)
            version = "undefined"

        # Note that it returns a dictionary that will then be written to the .versions
        # dotfile
        return {
            "program": "FastQC",
            "version": version,
            # some programs may also contain build.
        }

These functions are used to fetch the version, name and other relevant
information from third-party software and the only requirement is that they
return a dictionary with **at least** two key:value pairs:

- ``program``: String with the name of the program.
- ``version``: String with the version of the program.

For more information, refer to the
:func:`~flowcraft.templates.flowcraft_utils.flowcraft_base.MainWrapper.build_versions`
method.

Nextflow `.command.sh`
----------------------

When these templates are used as a  Nextflow `template <https://www.nextflow.io/docs/latest/process.html#template>`_
they are executed as a ``.command.sh`` file in the work directory of each
process. In this case, we recommended the inclusion of
an **if statement** to parse the arguments sent from nextflow to the python
template. For example, imagine we have a path to a file name to pass as
argument between nextflow and the required template::

    # code check for nextflow execution
    if __file__.endswith(".command.sh"):
        FILE_NAME = '$Nextflow_file_name'
        # logger output can also be included here, for example:
        logger.debug("Running {} with parameters:".format(
            os.path.basename(__file__)))
        logger.debug("FILE_NAME: {}".format(FILE_NAME))

Then, we could use this variable as the argument of a function, such as::

    def main(FILE_NAME):
        #some awesome code
        ...


This way, we can use this function with nextflow arguments or without them,
as is the case when the templates are used as standalone modules.

Use numpy docstrings
--------------------

``FlowCraft`` uses numpy docstrings to document code.
Use
`this link <http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html>`_
for reference.

================================================
FILE: docs/dev/general_orientation.rst
================================================
General orientation
===================

Codebase structure
------------------

The most important elements of FlowCraft's directory structure are:

- ``generator``:
    - ``components``: Contains the ``Process`` classes for each component
    - ``templates``: Contains the nextflow jinja template files for each component
    - ``engine.py``: The engine of FlowCraft that builds the pipeline
    - ``process.py``: Contains the abstract ``Process`` class that is inherited
    - by all component classes
    - ``pipeline_parser.py``: Functions that parse and check the pipeline string
    - ``recipe.py``: Class responsible for creating recipes
- ``templates``: A git submodule of the `templates`_ repository that contain
  the template scripts for the components.

.. _templates: https://github.com/ODiogoSilva/templates


Code style
----------

- **Style**:  the code base of flowcraft should adhere (the best it can) to
  the `PEP8`_ style guidelines.
- **Docstrings**: code should be generally well documented following the
  `numpy docstring`_ style.
- **Quality**: there is also an integration with the `codacy`_ service to
  evaluate code quality, which is useful for detecting several coding
  issues that may appear.


Testing
-------

Tests are performed using `pytest`_ and the source files are stored in the
``flowcraft/tests`` directory. Tests must be executed on the root directory
of the repository

Documentation
-------------

Documentation source files are stored in the ``docs`` directory. The general
configuration file is found in ``docs/conf.py`` and the entry
point to the documentation is ``docs/index.html``.


.. _pytest: https://docs.pytest.org/en/latest/
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
.. _numpy docstring: https://numpydoc.readthedocs.io/en/latest/format.html
.. _codacy: https://app.codacy.com/app/o.diogosilva/assemblerflow/dashboard

================================================
FILE: docs/dev/pipeline_reporting.rst
================================================
Pipeline reporting
==================

This section describes how the reports of a FlowCraft pipeline are generated
and collected at the end of a run. These reports can then be sent to the
`FlowCraft web application <https://github.com/assemblerflow/flowcraft-webapp>`_
where the results are visualized.

.. important::
    Note that if the nextflow process reports add new types of data, one or
    more React components need to be added to the web application for them
    to be rendered.

Data collection
---------------

The data for the pipeline reports is collected from three dotfiles in each nextflow
process (they should be present in each work sub directory):

- **.report.json**: Contains report data (See :ref:`report-json` for more information).
- **.versions**: Contains information about the versions of the software used
  (See :ref:`versions` for more information).
- **.command.trace**: Contains resource usage information.

The **.command.trace** file is generated by nextflow when the **trace** scope
is active. The **.report.json** and **.version** files are specific to
FlowCraft pipelines. 

Generation of dotfiles
^^^^^^^^^^^^^^^^^^^^^^

Both **report.json** and **.versions** empty dotfiles are automatically generated
by the ``{% include "post.txt" ignore missing %}`` placeholder, specified in the
:ref:`create-process` section. Using this placeholder in your processes is all
that is needed.

Collection of dotfiles
^^^^^^^^^^^^^^^^^^^^^^

The **.report.json**, **.versions** and **.command.trace** files are automatically
collected and sent to dedicated report channels in the pipeline by the
``{%- include "compiler_channels.txt" ignore missing -%}`` placeholder, specified
in the :ref:`process creation <compiler>` section. Placing this placeholder in your
processes will generate the following line in the output channel specification::

    set {{ sample_id|default("sample_id") }}, val("{{ task_name }}_{{ pid }}"), val("{{ pid }}"), file(".report.json"), file(".versions"), file(".command.trace") into REPORT_{{task_name}}_{{ pid }}

This line collects several metadata associated with the process along with the three
dotfiles.

Compilation of dotfiles
^^^^^^^^^^^^^^^^^^^^^^^

As mentioned in the previous section, the dotfiles and other relevant metadata
for are sent through special report channels to a FlowCraft component that is
responsible for compiling all the information and generate a single report
file at the end of each pipeline run.

This component is specified in ``flowcraft.generator.templates.report_compiler.nf``
and it consists of two nextflow processes:

- First, the **report** process receives the data from each executed process that
  sends report data and runs the ``flowcraft/bin/prepare_reports.py`` script
  on that data. This script will simply merge metadata and dotfiles information
  in a single JSON file. This file contains the following keys:

    - ``reportJson``: The data in **.report.json** file.
    - ``versions``: The data in **.versions** file.
    - ``trace``: The data in **.command.trace** file.
    - ``processId``: The process ID
    - ``pipelineId``: The pipeline ID that defaults to one, unless specified in
      the parameters.
    - ``projectid``: The project ID that defaults to one, unless specified in
      the parameters.
    - ``userId``: The user ID that defaults to one, unless specified in
      the parameters.
    - ``username``: The user name that defaults to *user*, unless specified in
      the parameters
    - ``processName``: The name of the flowcraft component.
    - ``workdir``: The work directory where the process was executed.

- Second, all JSON files created in the process above are merged
  and a single reports JSON file is created. This file will contains the
  following structure::

    reportJSON = {
        "data": {
            "results": [<array of report JSONs>]
        }
    }


================================================
FILE: docs/dev/process_dotfiles.rst
================================================
.. _dotfiles:

Dotfiles
========

Several dotfiles (files prefixed by a single ``.``, as in ``.status``) are
created at the beginning of every nextflow process that has the following
placeholder (see :ref:`create-process`): ::

    process myProcess {
        {% include "post.txt" ignore missing %}
        (...)
    }

The actual script that creates the dotfiles is found in
``flowcraft/bin``, is called ``set_dotfiles.sh`` and executes the
following command::

    touch .status .warning .fail .report.json .versions

Status
------

The ``.status`` file simply stores a string with the run status of the process.
The supported status are:

- ``pass``: The process finished successfully
- ``fail``: The process ran without unexpected issues but failed due to some
  quality control check
- ``error``: The process exited with an unexpected error.

Warning
-------

The ``.warning`` file stores any warnings that may occur during the execution
of the process. There is no particular format for the warning messages other
than that each individual warning should be in a separate line.

Fail
----

The ``.fail`` file stores any fail messages that may occur during the
execution of the process. When this occurs, the ``.status`` channel must have
the ``fail`` string as well. As in the warning dotfile, there is no
particular format for the fail message.

.. _report-json:

Report JSON
-----------

.. important::
    The general specification of the report JSON changed in version 1.2.2.
    See the `issue tracker <https://github.com/assemblerflow/flowcraft/issues/96>`_
    for details.

The ``.report.json`` file stores any information from a given process that is
deemed worthy of being reported and displayed at the end of the pipeline.
Any information can be stored in this file, as long as it is in JSON format,
but there are a couple of recommendations that are necessary to follow
for them to be processed by a reporting web app (Currently hosted at
`flowcraft-webapp <https://github.com/assemblerflow/flowcraft-webapp>`_). However, if
data processing will be performed with custom scripts, feel free to specify
your own format.

Information for tables
^^^^^^^^^^^^^^^^^^^^^^

Information meant to be displayed in tables should be in the following
format::

    json_dic = {
        "tableRow": [{
            "sample": "A",
            "data": [{
                "header": "Raw BP",
                "value": 123,
                "table": "qc"
            }, {
                "header": "Coverage",
                "value": 32,
                "table": "qc"
            }]
        }, {
            "sample": "B",
            "data": [{
                "header": "Coverage",
                "value": 35,
                "table": "qc"
            }]
        }]
    }

This provides table information for multiple samples in the same process. In
this case, data for two samples is provided. For each sample, values for
one or more headers can be provided. For instance, this report provides
information about the **Raw BP** and **Coverage** for sample **A** and this
information should go to the **qc** table. If any other information is relevant
to build the table, feel free to add more elements to the JSON.

Information for plots
^^^^^^^^^^^^^^^^^^^^^

Information meant to be displayed in plots should be in the following format::

    json_dic = {
        "plotData": [{
            "sample": "strainA",
            "data": {
                "sparkline": 23123,
                "otherplot": [1,2,3]
             }
        }],
    }

As in the table JSON, *plotData* should be an array with an entry for each
sample. The data for each sample should be another JSON where the keys are
the *plot signatures*, so that we know to which plot the data belongs. The
corresponding values are whatever data object you need.

Other information
^^^^^^^^^^^^^^^^^

Other than tables and plots, which have a somewhat predefined format, there
is not particular format for other information. They will simply store the
data of interest to report and it will be the job of a downstream report app
to process that data into an actual visual report.

.. _versions:

Versions
--------

The ``.version`` dotfile should contain a list of JSON objects with the
version information of the programs used in any given process. There are
only two required key:value pairs:

- ``program``: String with the name of the software/script/template
- ``version``: String with the version of said software.

As an example::

    version = {
        "program": "abricate"
        "version": "0.3.7"
    }

Key:value pairs with other metadata can be included at will for downstream
processing.

================================================
FILE: docs/dev/reports.rst
================================================
Reports
=======

Report JSON specification
-------------------------

The report JSON is quite flexibly on the information it can contain. Here are
some guidelines to promote consistency on the reports generated by each component.
In general, the reports file is an array of JSON objects that contain relevant
information for each executed process in the pipeline::

    reportFile = [{<processA/tagA reports>}, {<processB/tagB reports>}, ... ]


Nextflow metadata
^^^^^^^^^^^^^^^^^

The nextflow metada is automatically added to the reportFile as a single JSON entry
with the ``nfMetadata`` key that contains the following information::

        "nfMetadata": {
            "scriptId": "${workflow.scriptId}",
            "scriptName": "${workflow.scriptId}",
            "profile": "${workflow.profile}",
            "container": "${workflow.container}",
            "containerEngine": "${workflow.containerEngine}",
            "commandLine": "${workflow.commandLine}",
            "runName": "${workflow.runName}",
            "sessionId": "${workflow.sessionId}",
            "projectDir": "${workflow.projectDir}",
            "launchDir": "${workflow.launchDir}",
            "start_time": "${workflow.start}"
        }

.. note::
    Unlike the remaining JSON entries in the report file, which are generated for
    each process execution, the ``nfMetadata`` entry is generated only once per
    project execution.

Root
^^^^

The reports contained in the ``reports.json`` file for each process execution
are added to the root object::

    {
        "pipelineId": 1,
        "processId": pid,
        "processName": task_name,
        "projectid": RUN_NAME,
        "reportJson": reports,
        "runName": RUN_NAME,
        "scriptId": SCRIPT_ID,
        "versions": versions,
        "trace": trace,
        "userId": 1,
        "username": "user",
        "workdir": dirname(abspath(report_json))
    }

The other key:values are added automatically when the reports are compiled for each
process execution.

Versions
^^^^^^^^

Inside the root, the signature key for software version information is ``versions``::

    "versions": [{
        "program": "progA",
        "version": "1.0.0",
        "build": "1"
    }, {
        "program": "progB",
        "version": "2.1"
    }]

Only the ``program`` and ``version`` keys are mandatory.

ReportJson
^^^^^^^^^^

Table data
~~~~~~~~~~

Inside ``reportJson``, the signature key for table data is ``tableRow``::

    "reportJson": {
        "tableRow": [{
            "sample": "strainA",
            "data": [{
                "header": "Raw BP",
                "value": 123,
                "table": "qc",
            }, {
                "header": "Coverage",
                "value": 32,
                "table": "qc"
            }],
            "sample": "strainB",
            "data": [{
                "header": "Raw BP",
                "value": 321,
                "table": "qc",
            }, {
                "header": "Coverage",
                "value": 22,
                "table": "qc"
            }]
        }]
   }

``tableRow`` should contain an array of JSON for each sample with two key:value pairs:

    - ``sample``: Sample name
    - ``data``: Table data (see below).

``data`` should be an array of JSON with at least three key:value pairs:

    - ``header``: Column header
    - ``value``: The data value
    - ``table``: Informs to which table this data should go.

.. note::
    Available ``table`` keys: ``typing``, ``qc``, ``assembly``, ``abricate``,
    ``chewbbaca``.


Plot data
~~~~~~~~~

Inside ``reportJson``, the signature key for plot data is ``plotData``::

    "reportJson": {
        "plotData": [{
            "sample": "strainA",
            "data": {
                "sparkline": 23123,
                "otherplot": [1,2,3]
             }
        }],
    }

``plotData`` should contain an array of JSON for each sample with two key:value pairs:

    - ``sample``: Sample name
    - ``data``: Plot data (see below).

``data`` should contain a JSON object with the plot signatures as keys, and the relevant
plot data as value. This data can be any object (integer, float, array, JSON, etc).
**It will be up to the components in the flowcraft web application to parse this data
and generate the appropriate chart.**

Warnings and fails
~~~~~~~~~~~~~~~~~~

Inside ``reportJson``, the signature key for warnings is ``warnings`` and for
failures is ``fail``::

    "reportJson": {
        "warnings": [{
            "sample": "strainA",
            "table": "qc",
            "value": ["message 1", "message 2"]
        }],
        "fail": [{
            "sample": "strainA",
            "table": "assembly",
            "value": ["message 1"]
        }]
    }


``warnings``/``fail`` should contain an array of JSON for each sample with
two key:value pairs:

    - ``sample``: Sample name
    - ``value``: An array with one or more string messages.
    - ``table`` **[optional]**: If a table signature is provided, the warning/fail
      messages information will appear on that table. Otherwise, it will appear as
      a general warning/error that is associated to the sample but not to any particular
      table.


================================================
FILE: docs/flowcraft.flowcraft.rst
================================================
flowcraft\.flowcraft module
===========================

.. automodule:: flowcraft.flowcraft
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.annotation.rst
================================================
flowcraft\.generator\.components\.annotation module
===================================================

.. automodule:: flowcraft.generator.components.annotation
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.assembly.rst
================================================
flowcraft\.generator\.components\.assembly module
=================================================

.. automodule:: flowcraft.generator.components.assembly
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.assembly_processing.rst
================================================
flowcraft\.generator\.components\.assembly\_processing module
=============================================================

.. automodule:: flowcraft.generator.components.assembly_processing
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.distance_estimation.rst
================================================
flowcraft\.generator\.components\.distance\_estimation module
=============================================================

.. automodule:: flowcraft.generator.components.distance_estimation
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.downloads.rst
================================================
flowcraft\.generator\.components\.downloads module
==================================================

.. automodule:: flowcraft.generator.components.downloads
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.metagenomics.rst
================================================
flowcraft\.generator\.components\.metagenomics module
=====================================================

.. automodule:: flowcraft.generator.components.metagenomics
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.mlst.rst
================================================
flowcraft\.generator\.components\.mlst module
=============================================

.. automodule:: flowcraft.generator.components.mlst
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.patlas_mapping.rst
================================================
flowcraft\.generator\.components\.patlas\_mapping module
========================================================

.. automodule:: flowcraft.generator.components.patlas_mapping
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.reads_quality_control.rst
================================================
flowcraft\.generator\.components\.reads\_quality\_control module
================================================================

.. automodule:: flowcraft.generator.components.reads_quality_control
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.rst
================================================
flowcraft\.generator\.components package
========================================

Submodules
----------

.. toctree::

   flowcraft.generator.components.annotation
   flowcraft.generator.components.assembly
   flowcraft.generator.components.assembly_processing
   flowcraft.generator.components.distance_estimation
   flowcraft.generator.components.downloads
   flowcraft.generator.components.metagenomics
   flowcraft.generator.components.mlst
   flowcraft.generator.components.patlas_mapping
   flowcraft.generator.components.reads_quality_control
   flowcraft.generator.components.typing

Module contents
---------------

.. automodule:: flowcraft.generator.components
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.components.typing.rst
================================================
flowcraft\.generator\.components\.typing module
===============================================

.. automodule:: flowcraft.generator.components.typing
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.engine.rst
================================================
flowcraft\.generator\.engine module
===================================

.. automodule:: flowcraft.generator.engine
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.error_handling.rst
================================================
flowcraft\.generator\.error\_handling module
============================================

.. automodule:: flowcraft.generator.error_handling
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.footer_skeleton.rst
================================================
flowcraft\.generator\.footer\_skeleton module
=============================================

.. automodule:: flowcraft.generator.footer_skeleton
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.header_skeleton.rst
================================================
flowcraft\.generator\.header\_skeleton module
=============================================

.. automodule:: flowcraft.generator.header_skeleton
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.inspect.rst
================================================
flowcraft\.generator\.inspect module
====================================

.. automodule:: flowcraft.generator.inspect
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.pipeline_parser.rst
================================================
flowcraft\.generator\.pipeline\_parser module
=============================================

.. automodule:: flowcraft.generator.pipeline_parser
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.process.rst
================================================
flowcraft\.generator\.process module
====================================

.. automodule:: flowcraft.generator.process
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.process_details.rst
================================================
flowcraft\.generator\.process\_details module
=============================================

.. automodule:: flowcraft.generator.process_details
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.recipe.rst
================================================
flowcraft\.generator\.recipe module
===================================

.. automodule:: flowcraft.generator.recipe
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.generator.rst
================================================
flowcraft\.generator package
============================

Subpackages
-----------

.. toctree::

    flowcraft.generator.components

Submodules
----------

.. toctree::

   flowcraft.generator.engine
   flowcraft.generator.error_handling
   flowcraft.generator.footer_skeleton
   flowcraft.generator.header_skeleton
   flowcraft.generator.inspect
   flowcraft.generator.pipeline_parser
   flowcraft.generator.process
   flowcraft.generator.process_details
   flowcraft.generator.recipe

Module contents
---------------

.. automodule:: flowcraft.generator
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.rst
================================================
flowcraft package
=================

Subpackages
-----------

.. toctree::

    flowcraft.generator
    flowcraft.templates
    flowcraft.tests

Submodules
----------

.. toctree::

   flowcraft.flowcraft

Module contents
---------------

.. automodule:: flowcraft
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.assembly_report.rst
================================================
flowcraft\.templates\.assembly\_report module
=============================================

.. automodule:: flowcraft.templates.assembly_report
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.fastqc.rst
================================================
flowcraft\.templates\.fastqc module
===================================

.. automodule:: flowcraft.templates.fastqc
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.fastqc_report.rst
================================================
flowcraft\.templates\.fastqc\_report module
===========================================

.. automodule:: flowcraft.templates.fastqc_report
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.flowcraft_utils.flowcraft_base.rst
================================================
flowcraft\.templates\.flowcraft\_utils\.flowcraft\_base module
==============================================================

.. automodule:: flowcraft.templates.flowcraft_utils.flowcraft_base
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.flowcraft_utils.rst
================================================
flowcraft\.templates\.flowcraft\_utils package
==============================================

Submodules
----------

.. toctree::

   flowcraft.templates.flowcraft_utils.flowcraft_base

Module contents
---------------

.. automodule:: flowcraft.templates.flowcraft_utils
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.integrity_coverage.rst
================================================
flowcraft\.templates\.integrity\_coverage module
================================================

.. automodule:: flowcraft.templates.integrity_coverage
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.mapping2json.rst
================================================
flowcraft\.templates\.mapping2json module
=========================================

.. automodule:: flowcraft.templates.mapping2json
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.mashdist2json.rst
================================================
flowcraft\.templates\.mashdist2json module
==========================================

.. automodule:: flowcraft.templates.mashdist2json
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.mashscreen2json.rst
================================================
flowcraft\.templates\.mashscreen2json module
============================================

.. automodule:: flowcraft.templates.mashscreen2json
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.megahit.rst
================================================
flowcraft\.templates\.megahit module
====================================

.. automodule:: flowcraft.templates.megahit
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.metaspades.rst
================================================
flowcraft\.templates\.metaspades module
=======================================

.. automodule:: flowcraft.templates.metaspades
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.pATLAS_consensus_json.rst
================================================
flowcraft\.templates\.pATLAS\_consensus\_json module
====================================================

.. automodule:: flowcraft.templates.pATLAS_consensus_json
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.pipeline_status.rst
================================================
flowcraft\.templates\.pipeline\_status module
=============================================

.. automodule:: flowcraft.templates.pipeline_status
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.process_abricate.rst
================================================
flowcraft\.templates\.process\_abricate module
==============================================

.. automodule:: flowcraft.templates.process_abricate
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.process_assembly.rst
================================================
flowcraft\.templates\.process\_assembly module
==============================================

.. automodule:: flowcraft.templates.process_assembly
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.process_assembly_mapping.rst
================================================
flowcraft\.templates\.process\_assembly\_mapping module
=======================================================

.. automodule:: flowcraft.templates.process_assembly_mapping
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.rst
================================================
flowcraft\.templates package
============================

Subpackages
-----------

.. toctree::

    flowcraft.templates.flowcraft_utils

Submodules
----------

.. toctree::

   flowcraft.templates.assembly_report
   flowcraft.templates.fastqc
   flowcraft.templates.fastqc_report
   flowcraft.templates.integrity_coverage
   flowcraft.templates.mapping2json
   flowcraft.templates.mashdist2json
   flowcraft.templates.mashscreen2json
   flowcraft.templates.megahit
   flowcraft.templates.metaspades
   flowcraft.templates.pATLAS_consensus_json
   flowcraft.templates.pipeline_status
   flowcraft.templates.process_abricate
   flowcraft.templates.process_assembly
   flowcraft.templates.process_assembly_mapping
   flowcraft.templates.skesa
   flowcraft.templates.spades
   flowcraft.templates.trimmomatic
   flowcraft.templates.trimmomatic_report

Module contents
---------------

.. automodule:: flowcraft.templates
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.skesa.rst
================================================
flowcraft\.templates\.skesa module
==================================

.. automodule:: flowcraft.templates.skesa
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.spades.rst
================================================
flowcraft\.templates\.spades module
===================================

.. automodule:: flowcraft.templates.spades
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.trimmomatic.rst
================================================
flowcraft\.templates\.trimmomatic module
========================================

.. automodule:: flowcraft.templates.trimmomatic
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.templates.trimmomatic_report.rst
================================================
flowcraft\.templates\.trimmomatic\_report module
================================================

.. automodule:: flowcraft.templates.trimmomatic_report
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.data_pipelines.rst
================================================
flowcraft\.tests\.data\_pipelines module
========================================

.. automodule:: flowcraft.tests.data_pipelines
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.rst
================================================
flowcraft\.tests package
========================

Submodules
----------

.. toctree::

   flowcraft.tests.data_pipelines
   flowcraft.tests.test_assemblerflow
   flowcraft.tests.test_engine
   flowcraft.tests.test_pipeline_parser
   flowcraft.tests.test_process_details
   flowcraft.tests.test_processes
   flowcraft.tests.test_sanity

Module contents
---------------

.. automodule:: flowcraft.tests
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_assemblerflow.rst
================================================
flowcraft\.tests\.test\_assemblerflow module
============================================

.. automodule:: flowcraft.tests.test_assemblerflow
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_engine.rst
================================================
flowcraft\.tests\.test\_engine module
=====================================

.. automodule:: flowcraft.tests.test_engine
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_pipeline_parser.rst
================================================
flowcraft\.tests\.test\_pipeline\_parser module
===============================================

.. automodule:: flowcraft.tests.test_pipeline_parser
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_process_details.rst
================================================
flowcraft\.tests\.test\_process\_details module
===============================================

.. automodule:: flowcraft.tests.test_process_details
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_processes.rst
================================================
flowcraft\.tests\.test\_processes module
========================================

.. automodule:: flowcraft.tests.test_processes
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/flowcraft.tests.test_sanity.rst
================================================
flowcraft\.tests\.test\_sanity module
=====================================

.. automodule:: flowcraft.tests.test_sanity
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/getting_started/installation.rst
================================================
Installation
============

User installation
-----------------

FlowCraft is available as a bioconda package, which already comes with
nextflow::

    conda install flowcraft

Alternatively, you can install only FlowCraft, via pip::

    pip install flowcraft

You will also need a container engine (see `Container engine`_ below)

Container engine
----------------

All components of FlowCraft are executed in docker containers, which
means that you'll need to have a container engine installed. The container
engines available are the ones supported by Nextflow:

- `Docker`_,
- `Singularity`_
- Shifter (undocumented)

If you already have any one of these installed, you are good to go. If not,
you'll need to install one. We recommend singularity because it does not
require the processes to run on a separate root daemon.

Singularity
:::::::::::

Singularity is available to download and install `here <http://singularity.lbl.gov/install-linux>`_.
Make sure that you have singularity v2.5.x or higher.
Note that singularity should be installed as root and available on the machine(s) that
will be running the nextflow processes.

.. important::

    Singularity is available as a bioconda package. However, conda installs singularity
    in user space without root privileges, which may prevent singularity images from
    being correctly downloaded. **Therefore it is not recommended that you install
    singularity via bioconda**.

Docker
::::::

Docker can be installed following the instructions on the website:
https://www.docker.com/community-edition#/download.
To run docker as anon-root user, you'll need to following the instructions
on the website: https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user


Developer installation
----------------------

If you are looking to contribute to FlowCraft or simply interested in
tweaking it, clone the github repository and its submodule and then run
setup.py::

    git clone https://github.com/assemblerflow/flowcraft.git
    cd flowcraft
    python3 setup.py install


.. _Docker: https://www.nextflow.io/docs/latest/docker.html
.. _Singularity: https://www.nextflow.io/docs/latest/singularity.html



================================================
FILE: docs/getting_started/overview.rst
================================================
..    include:: <isonum.txt>

Overview
========

FlowCraft is an assembler of pipelines written in  nextflow_ for
analyses of genomic data. The premisse is simple:

Software are container blocks |rarr| Build your lego-like pipeline |rarr| Execute it (almost) anywhere.

What is Nextflow
::::::::::::::::

If you do not know nextflow, be sure to check it out. It's an awesome
framework based on the dataflow programming model used for building
parallelized, scalable and reproducible workflows using software containers.
It provides an abstraction layer between the execution and the logic of the
pipeline, which means that the same pipeline code can be executed on
multiple platforms, from a local laptop to clusters managed with SLURM, SGE,
etc. These are quite attractive features since genomic pipelines are
increasingly executed on large computer clusters to handle large volumes
of data and/or tasks. Moreover, portability and reproducibility are becoming
central pillars in modern data science.

What FlowCraft does
:::::::::::::::::::

FlowCraft is a python engine that automatically builds nextflow pipelines
by assembling pre-made ready-to-use :ref:`components <components>`. These components are modular
pieces of software or scripts, such as ``fastqc``, ``trimmomatic``, ``spades``,
etc, that are written for nextflow and have a set of attributes, such as
input and output types, parameters, directives, etc. This modular nature
allows them to be freely connected as long as they respect some basic rules,
such as the input type of a component must match with the output type of
the preceding component. In this way, nextflow processes can be
written only once, and FlowCraft is the magic glue that connects them,
handling the linking and forking of channels automatically. Moreover, each
component is associated with a docker image, which means that there is no
need to install any dependencies at all and all software runs on a
transparent and reliable box. To illustrate:

- A linear genome assembly pipeline can be easily built using FlowCraft
  with the following pipeline string::

    trimmomatic fastqc spades

Which will generate all the necessary files to run the nextflow
pipeline on any linux system that has nextflow and a container engine.

- You can easily add more components to perform assembly polishing, in this
  case, ``pilon``::

    trimmomatic fastqc spades pilon

- If a new assembler comes along and you want to switch that component in the
  pipeline, its as easy as replacing ``spades`` (or any other component)::

    trimmomatic fastqc skesa pilon

- And you can also fork the output of a component into multiple ones. For
  instance, we could annotate the resulting assemblies with multiple software::

    trimmomatic fastqc spades pilon (abricate | prokka)

- Or fork the execution of a pipeline early on to compare different software::

    trimmomatic fastqc (spades pilon | skesa pilon)

This will fork the output of ``fastqc`` into ``spades`` and ``skesa``, and
the pipeline will proceed independently in these two new 'lanes'.

- Directives for each process can be dynamically set when building the pipeline,
  such as the cpu/RAM usage or the software version::

    trimmomatic={'cpus':'4'} fastqc={'version':'0.11.5'} skesa={'memory':'10GB'} pilon (abricate | prokka)

- And extra input can be directly inserted in any part of the pipeline. For
  example, it is possible to assemble genomes from both fastq files and SRR
  accessions (downloaded from public databases) in a single workflow::

    download_reads trimmomatic={'extra_input':'reads'} fastqc skesa pilon

This pipeline can be executed by providing a file with accession numbers
(``--accessions`` parameter by default) **and** fastq reads, using the
``--reads`` parameter defined with the ``extra_input`` directive.


Who is FlowCraft for
::::::::::::::::::::

FlowCraft can be useful for bioinformaticians with varied levels of expertise
that need to executed genomic pipelines often and potentially in different
platforms. Building and executing pipelines requires no programming knowledge,
but familiarization with nextflow is highly recommended to take full advantage
of the generated pipelines.

At the moment, the available pre-made processes are mainly focused on
bacterial genome assembly simply because that was how we started.
However, our goal is to expand the library of existing components to other
commonly used tools in the field of genomics and to widen the applicability
and usefulness of FlowCraft pipelines.

Why not just write a Nextflow pipeline?
:::::::::::::::::::::::::::::::::::::::

In many cases, building a static nextflow pipeline is sufficient for our goals.
However, when building our own pipelines, we often felt the need to add
dynamism to this process, particularly if we take into account how fast new
tools arise and existing ones change. Our biological goals also change over
time and we might need different pipelines to answer different questions.
FlowCraft makes this very easy by having a set of pre-made and ready-to-use
components that can be freely assembled. By using components (``fastqc``,
``trimmomatic``) as its atomic elements, very complex pielines that take
full advantage of nextflow can be built with little effort. Moreover,
these components have explicit and standardized
input and output types, which means that the addition of new modules does not
require any changes in the existing code base. They just need to take into
account how data will be received by the process and how data may be emitted
from the process, to ensure that it can link with other components.

**However, why not both?**

FlowCraft generates a complete Nextflow pipeline file, which ca be used
as a starting point for your customized processes!

.. _nextflow: https://www.nextflow.io/

================================================
FILE: docs/index.rst
================================================
.. Templates documentation master file, created by
   sphinx-quickstart on Thu Feb  8 09:51:21 2018.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

FlowCraft
=========

.. image:: resources/logo_large.png
   :scale: 20 %
   :align: center

A NextFlow pipeline assembler for genomics.

.. _Getting Started:

.. toctree::
   :maxdepth: 1
   :caption: Getting Started

   getting_started/overview
   getting_started/installation
   about/about

.. _User Guide:

.. toctree::
   :maxdepth: 1
   :caption: User Guide

   user/basic_usage
   user/pipeline_building
   user/pipeline_configuration
   user/pipeline_inspect
   user/pipeline_reports
   user/available_components

.. _Developer Guide:

.. toctree::
   :maxdepth: 1
   :caption: Developer Guide

   dev/general_orientation
   dev/create_process
   dev/create_template
   dev/create_recipe
   dev/containers
   dev/process_dotfiles
   dev/pipeline_reporting
   dev/reports

.. _Source API:

.. toctree::
   :maxdepth: 2
   :caption: Source API

   flowcraft

================================================
FILE: docs/make.bat
================================================
@ECHO OFF

REM Command file for Sphinx documentation

pushd %~dp0

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_elements.papersize=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_elements.papersize=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and an HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  epub3      to make an epub3
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	echo.  coverage   to run coverage check of the documentation if enabled
	echo.  dummy      to check syntax errors of document sources
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)


REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok

:sphinx_python

set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

:sphinx_ok


if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Templates.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Templates.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "epub3" (
	%SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "coverage" (
	%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

if "%1" == "dummy" (
	%SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. Dummy builder generates no files.
	goto end
)

:end
popd


================================================
FILE: docs/setup.rst
================================================
setup module
============

.. automodule:: setup
    :members:
    :undoc-members:
    :show-inheritance:


================================================
FILE: docs/user/available_components.rst
================================================
.. _components:

Components
==========

These are the currently available FlowCraft components with a short
description of their tasks. For a more detailed information, follow the
links of each component.


Download
--------

- :doc:`components/reads_download`: Downloads reads from the SRA/ENA public
  databases from a list of accessions.

- :doc:`components/fasterq_dump`: Downloads reads from the SRA public databases
  from a list of accessions, using ``fasterq-dump``.

Reads Quality Control
--------------------

- :doc:`components/check_coverage`: Estimates the coverage for each sample and
  filters FastQ files according to a specified minimum coverage threshold.

- :doc:`components/fastqc`: Runs FastQC on paired-end FastQ files.

- :doc:`components/fastqc_trimmomatic`: Runs Trimmomatic on
  paired-end FastQ files informed by the FastQC report.

- :doc:`components/filter_poly`:  Runs PrinSeq on paired-end
  FastQ files to remove low complexity sequences.

- :doc:`components/integrity_coverage`: Tests the integrity
  of the provided FastQ files, provides the option to filter FastQ files
  based on the expected assembly coverage and provides information about
  the maximum read length and sequence encoding.

- :doc:`components/trimmomatic`: Runs Trimmomatic on paired-end FastQ files.

- :doc:`components/downsample_fastq`: Subsamples fastq files up to a target coverage
  depth.


Assembly
--------

- :doc:`components/megahit`: Assembles metagenomic paired-end FastQ files
  using megahit.

- :doc:`components/metaspades`: Assembles metagenomic paired-end FastQ files
  using metaSPAdes.

- :doc:`components/skesa`: Assembles paired-end FastQ files using
  skesa.

- :doc:`components/spades`: Assembles paired-end FastQ files
  using SPAdes.

Post-assembly
-------------

- :doc:`components/pilon`: Corrects and filters assemblies using Pilon.

- :doc:`components/process_skesa`: Processes the assembly output
  from Skesa and performs filtering base on quality criteria of GC content
  k-mer coverage and read length.

- :doc:`components/process_spades`: Processes the assembly output
  from Spades and performs filtering base on quality criteria of GC content
  k-mer coverage and read length.

Binning
-------

- :doc:`components/maxbin2`: An automatic tool for binning metagenomic sequences

Annotation
----------

- :doc:`components/abricate`: Performs anti-microbial gene screening using
  abricate.

- :doc:`components/card_rgi`: Performs anti-microbial resistance gene screening using
  CARD rgi (with contigs as input).

- :doc:`components/prokka`: Performs assembly annotation using prokka.

Distance Estimation
-------------------

- :doc:`components/mash_dist`: Executes mash distance against a reference index
  plasmid database and generates a `JSON` for pATLAS. This component calculates
  pairwise distances between sequences (one from the database and the query
  sequence). However if a different database is provided it can use mash dist
  for other purposes.

- :doc:`components/mash_screen`: Performs mash screen against a reference index
  plasmid database and generates a JSON input file for pATLAS. This component
  searches for containment of a given sequence in read sequencing data.
  However if a different database is provided it can use mash screen for other
  purposes.

- :doc:`components/fast_ani`: Performs pairwise comparisons between fastas,
given a multifasta as input for fastANI. It will split the multifasta into
single fastas that will then be provided as a matrix. The output will be the
all pairwise comparisons that pass the minimum of 50 aligned sequences with a
default length of 200 bp.

- :doc:`components/mash_sketch_fasta`: Performs mash sketch for fasta files.

- :doc:`components/mash_sketch_fastq`: Performes mash sketch for fastq files.

Mapping
-------

- :doc:`components/assembly_mapping`: Performs a mapping
  procedure of FastQ files into a their assembly and performs filtering
  based on quality criteria of read coverage and genome size.

- :doc:`components/bowtie`: Align short paired-end sequencing reads to long reference sequences

- :doc:`components/mapping_patlas`: Performs read mapping and generates a JSON
  input file for pATLAS.

- :doc:`components/remove_host`: Performs read mapping with bowtie2
  against the target host genome (default hg19) and removes the mapping reads

- :doc:`components/retrieve_mapped`: Retrieves the mapped reads of a previous
  bowtie2 mapping process.

Taxonomic Profiling
---------------------

- :doc:`components/kraken`: Performs taxonomic identification with kraken on FastQ files
  (minikrakenDB2017 as default database)

- :doc:`components/kraken2`: Performs taxonomic identification with kraken2 on FastQ files
  (minikraken2_v1_8GB as default database)

- :doc:`components/midas_species`: Performs taxonomic identification on FastQ files at the
  species level with midas (requires database)

Typing
------

- :doc:`components/chewbbaca`: Performs a core-genome/whole-genome Multilocus
  Sequence Typing analysis on an assembly using ChewBBACA.

- :doc:`components/metamlst`: Checks the Sequence Type of metagenomic reads using
  Multilocus Sequence Typing.

- :doc:`components/mlst`: Checks the Sequence Type of an assembly using
  Multilocus Sequence Typing.

- :doc:`components/patho_typing`: *In silico* pathogenic typing from raw
  illumina reads.

- :doc:`components/seq_typing`: Determines the type of a given sample from a set
  of reference sequences.

- :doc:`components/sistr`: Serovar predictions from whole-genome sequence assemblies
  by determination of antigen gene and cgMLST gene alleles.

- :doc:`components/momps`: Multi-locus sequence typing for Legionella pneumophila
  from assemblies and reads.


================================================
FILE: docs/user/basic_usage.rst
================================================
Basic Usage
===========

FlowCraft has currently two execution modes, ``build`` and ``inspect``, that are
used to build and inspect the nextflow pipeline, respectively. However, a
``report`` mode is also being developed.

Build
-----

Assembling a pipeline
:::::::::::::::::::::

Pipelines are generated using the ``build`` mode of FlowCraft
and the ``-t`` parameter to specify the :ref:`components <components>` inside quotes::

    flowcraft build -t "trimmomatic fastqc spades" -o my_pipe.nf

All components should be written inside quotes and be space separated.
This command will generate a linear pipeline with three components on the
current working directory (for more features and tips on how pipelines can be
built, see the :doc:`pipeline building <pipeline_building>` section). **A linear pipeline means that
there are no bifurcations between components, and the input data will flow
linearly.**

The rationale of how the data flows across the pipeline is simple and intuitive.
Data enters a component and is processed in some way, which may result on the
creation of result files (stored in the ``results`` directory) and reports
files (stored in the ``reports`` directory) (see `Results and reports`_ below). If that
component has an ``output_type``, it will feed the processed data into the
next component (or components) and this will repeated until the end of the
pipeline.

If you are interesting in checking the pipeline DAG tree, open the
``my_pipe.html`` file (same name as the pipeline with the html extension)
in any browser.

.. image:: ../resources/fork_4.png
   :scale: 80 %
   :align: center

The ``integrity_coverage`` component is a dependency of ``trimmomatic``, so
it was automatically added to the pipeline.

.. important::
    Not all pipeline configurations will work. **You always need to ensure
    that the output type of a component matches the input type of the next
    component**, otherwise FlowCraft will exit with an error.

Pipeline directory
::::::::::::::::::

In addition to the main nextflow pipeline file (``my_pipe.nf``),
FlowCraft will write several auxiliary files that are necessary for
the pipeline to run. The contents of the directory should look something like
this::

    $ ls
    bin                lib           my_pipe.nf       params.config     templates
    containers.config  my_pipe.html  nextflow.config  profiles.config   resources.config  user.config

You do not have to worry about most of these files. However, the
``*.config`` files can be modified to change several aspects of the pipeline run
(see :doc:`pipeline_configuration` for more details). Briefly:

- ``params.config``: Contains all the available parameters of the pipeline (see
  `Parameters`_ below). These can be changed here, or provided directly on
  run-time (e.g.: ``nextflow run --fastq value``).
- ``resources.config``: Contains the resource directives of the pipeline processes,
  such as cpus, allocated RAM and other nextflow process directives.
- ``containers.config``: Specifies the container and version tag of each process
  in the pipeline.
- ``profiles.config``: Contains a number of predefined profiles of executor and
  container engine.
- ``user.config``: Empty configuration file that is not over-written if you build
  another pipeline in the same directory. Used to set persistent configurations
  across different pipelines.

Parameters
::::::::::

The parameters of the pipeline can be viewed by running the pipeline file
with ``nextflow`` and using the ``--help`` option::

    $ nextflow run my_pipe.nf --help
    N E X T F L O W  ~  version 0.30.1
    Launching `my_pipe.nf` [kickass_mcclintock] - revision: 480b3455ba

    ============================================================
                    F L O W C R A F T
    ============================================================
    Built using flowcraft v1.2.1.dev1


    Usage:
        nextflow run my_pipe.nf

           --fastq                     Path expression to paired-end fastq files. (default: fastq/*_{1,2}.*) (default: 'fastq/*_{1,2}.*')

           Component 'INTEGRITY_COVERAGE_1_1'
           ----------------------------------
           --genomeSize_1_1            Genome size estimate for the samples in Mb. It is used to estimate the coverage and other assembly parameters andchecks (default: 1)
           --minCoverage_1_1           Minimum coverage for a sample to proceed. By default it's setto 0 to allow any coverage (default: 0)

           Component 'TRIMMOMATIC_1_2'
           ---------------------------
           --adapters_1_2              Path to adapters files, if any. (default: 'None')
           --trimSlidingWindow_1_2     Perform sliding window trimming, cutting once the average quality within the window falls below a threshold (default: '5:20')
           --trimLeading_1_2           Cut bases off the start of a read, if below a threshold quality (default: 3)
           --trimTrailing_1_2          Cut bases of the end of a read, if below a threshold quality (default: 3)
           --trimMinLength_1_2         Drop the read if it is below a specified length  (default: 55)

           Component 'FASTQC_1_3'
           ----------------------
           --adapters_1_3              Path to adapters files, if any. (default: 'None')

           Component 'SPADES_1_4'
           ----------------------
           --spadesMinCoverage_1_4     The minimum number of reads to consider an edge in the de Bruijn graph during the assembly (default: 2)
           --spadesMinKmerCoverage_1_4 Minimum contigs K-mer coverage. After assembly only keep contigs with reported k-mer coverage equal or above this value (default: 2)
           --spadesKmers_1_4           If 'auto' the SPAdes k-mer lengths will be determined from the maximum read length of each assembly. If 'default', SPAdes will use the default k-mer lengths.  (default: 'auto')

All these parameters are specific to the components of the pipeline. However,
the main input parameter (or parameters) of the pipeline is always available.
**In this case, since the pipeline started with fastq paired-end files as the
main input, the** ``--fastq`` **parameter is available.** If the pipeline started
with any other input type or with more than one input type, the appropriate
parameters will appear (more information in the :ref:`raw input types<rawInput>` section).

The parameters are composed by their name (``adapters``) followed by the ID of
the process it refers to (``_1_2``). The IDs can be consulted in the DAG tree
(See `Assembling a pipeline`_). This is done to prevent issues when duplicating
components and, as such, **all parameters will be independent between different
components**. This
behaviour can be changed when building the pipeline by using the
``--merge-params`` option (See :ref:`mergeParams`).

.. note::
    The ``--merge-params`` option of the ``build`` mode will merge all parameters
    with identical names (`e.g.:` ``--genomeSize_1_1`` and ``--genomeSize_1_5``
    become simply ``--genomeSize``) . This is usually more appropriate and useful
    in linear pipelines without component duplication.


Providing/modifying parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These parameters can be provided on run-time::

    nextflow run my_pipe.nf --genomeSize_1_1 5 --adapters_1_2 "/path/to/adapters"

or edited in the ``params.config`` file::

    params {
        genomeSize_1_1 = 5
        adapters_1_2 = "path/to/adapters"
    }

Most parameters in FlowCraft's components already come with sensible
defaults, which means that usually you'll only need to provide a small number
of arguments. In the example above, the ``--fastq`` is the only parameter
required. I have placed fastq files on the ``data`` directory::

    $ ls data
    sample_1.fastq.gz  sample_2.fastq.gz

We'll need to provide the pattern to the fastq files. This pattern is perhaps
a bit confusing at first, but it's necessary for the correct inference of the
paired::

    --fastq "data/*_{1,2}.*"

In this case, the pairs are separated by the "_1." or "_2." substring, which leads
to the pattern ``*_{1,2}.*``. Another common nomenclature for paired fastq
files is something like ``sample_R1_L001.fastq.gz``. In this case, an
acceptable pattern would be ``*_R{1,2}_*``.

.. important::

    Note the quotes around the fastq path pattern. These quotes are necessary
    to allow nextflow to resolve the pattern, otherwise your shell might try
    to resolve it and provide the wrong input to nextflow.

Execution
---------

Once you build your pipeline with Flowcraft you have a standard nextflow pipeline
ready to run. Therefore, all you need to do is::

    nextflow run my_pipe.nf --fastq "data/*_{1,2}.*

Changing executor and container engine
::::::::::::::::::::::::::::::::::::::

The default run mode of an FlowCraft pipeline is to be executed locally
and using the singularity container engine. In nextflow terms, this is
equivalent to have ``executor = "local"`` and ``singularity.enabled = true``.
If you want to change these settings, you can modify the
``nextflow.config`` file, or use one of the available profiles in the
``profiles.config`` file. These profiles provide a combination of common
``<executor>_<container_engine>`` that are `supported by nextflow`_. Therefore,
if you want to run the pipeline on a cluster with SLURM and shifter, you'll
just need to specify the `` slurm_shifter`` profile::

    nextflow run my_pipe.nf --fastq "data/*_{1,2}.*" -profile slurm_shifter

Common executors include:

- ``slurm``
- ``sge``
- ``lsf``
- ``pbs``

Other container engines are:

- ``docker``
- ``singularity``
- ``shifter``

.. _supported by nextflow: https://www.nextflow.io/docs/latest/executor.html

Docker images
:::::::::::::

All components of FlowCraft are executed in containers, which means that
the first time they are executed in a machine, **the corresponding image will have
to be downloaded**. In the case of docker, images are pulled and stored in
``var/lib/docker`` by default. In the case of singularity, the
``nextflow.config`` generated by FlowCraft sets the cache dir for the
images at ``$HOME/.singularity_cache``. Note that when an image is downloading,
nextflow does not display any informative message, except for singularity where you'll
get something like::

    Pulling Singularity image docker://ummidock/trimmomatic:0.36-2 [cache /home/diogosilva/.singularity_cache/ummidock-trimmomatic-0.36-2.img]

So, if a process seems to take too long to run the first time, it's probably
because the image is being downloaded.

Results and reports
:::::::::::::::::::

As the pipeline runs, processes may write result and report files to the
``results`` and ``reports`` directories, respectively. For example, the
reports of the pipeline above, would look something like this::

    reports
    ├── coverage_1_1
    │   └── estimated_coverage_initial.csv
    ├── fastqc_1_3
    │   ├── FastQC_2run_report.csv
    │   ├── run_2
    │   │   ├── sample_1_0_summary.txt
    │   │   └── sample_1_1_summary.txt
    │   ├── sample_1_1_trim_fastqc.html
    │   └── sample_1_2_trim_fastqc.html
    └── status
        ├── master_fail.csv
        ├── master_status.csv
        └── master_warning.csv

The ``estimated_coverage_initial.csv`` file contains a very rough coverage
estimation for each sample, the ``fastqc*`` directory contains the html
reports and summary files of FastQC for each sample, and the ``status``
directory contains a log of the status, warnings and fails of each process for
each sample.

The actual results for each process that produces them, are stored in the
``results`` directory::

    results
    ├── assembly
    │   └── spades_1_4
    │       └── sample_1_trim_spades3111.fasta
    └── trimmomatic_1_2
        ├── sample_1_1_trim.fastq.gz
        └── sample_1_2_trim.fastq.gz

If you are interested in checking the actual environment where the execution
of a particular process occurred for any given sample, you can inspected the
``pipeline_stats.txt`` file in the root of the pipeline directory. This file
contains rich information about the execution of each process, including
the working directory::

    task_id hash        process         tag         status      exit    start                   container                           cpus    duration    realtime    queue   %cpu    %mem    rss     vmem
    5       7c/cae270   trimmomatic_1_2 sample_1    COMPLETED   0       2018-04-12 11:42:29.599 docker:ummidock/trimmomatic:0.36-2  2       1m 25s      1m 17s      -       329.3%  1.1%    1.5 GB  33.3 GB

The ``hash`` column contains the start of the current working directory of that
process. In the example below, the directory would be::

    work/7c/cae270*

Inspect
-------

FlowCraft has two options (``overview`` and ``broadcast``) for inspecting the
progress of a pipeline that is running locally, either in a personal computer
or a server machine. In both cases, the progress of the pipeline will be
continuously updated in real-time.

In a terminal
:::::::::::::

To open inspect in the terminal just write the following command **on the folder
that the pipeline is running**::

    flowcraft inspect

.. image:: ../resources/flowcraft_inspect_terminal.png
   :align: center

``overview`` is the default behavior of this module, but it can also be called
like this::

    flowcraft inspect -m overview

.. note::
    To exit the inspection just type ``q`` or ``ctrl+c``.

In a browser
::::::::::::

It is also possible to track the pipeline progress in a browser in any
device using the flowcraft web application. **To do so, the following command
should be run in the folder where the pipeline is running**::

    flowcraft inspect -m broadcast


This will output an URL to the terminal that can be opened in a browser.
This is an example of the screen that is displayed once the url is opened:

.. image:: ../resources/flowcraft_inspect_broadcast.png
   :align: center

.. important::
    This pipeline inspection will be available for **anyone** via the provided URL,
    which means that the URL can be shared with anyone and/or any device with
    a browser. **However, the inspection section will only be available while
    the** ``flowcraft inspect -m broadcast`` **command is running. Once this command
    is cancelled, the data will be erased from the service and the URL will
    no longer be available**.

Want to know more?
::::::::::::::::::

:doc:`pipeline_inspect` is the full documentation of the ``inspect`` mode.


Reports
-------

The reporting of a FlowCraft pipeline is saved on a JSON file that is stored
in ``pipeline_reports/pipeline_report.json``. To visualize the reports you'll just
need to execute the following command in the folder where the pipeline was executed::

    flowcraft report

This will output an URL to the terminal that can be opened in a browser.
This is an example of the screen that is displayed once the url is opened:

.. image:: ../resources/flowcraft_report.png
   :align: center

**The actual layout and content of the reports will depend on the pipeline you
build and it will only provide the information that is directly related to
your pipeline components.**

.. important::
    This pipeline report will be available for **anyone** via the provided URL,
    which means that the URL can be shared with anyone and/or any device with
    a browser. **However, the report section will only be available while
    the** ``flowcraft report`` **command is running. Once this command
    is cancelled, the data will be erased from the service and the URL will
    no longer be available**.

Real time reports
:::::::::::::::::

The reports of any FlowCraft pipeline can be monitored in real-time using the
``--watch`` option::

    flowcraft report --watch

This will output an URL exactly as in the previous section and will render the
same reports page with a small addition. In the top right of the screen in the
navigation bar, there will be a new icon that informs the user when new
reports are available:

.. image:: ../resources/flowcraft_report_watch.png
   :align: center

Local visualization
:::::::::::::::::::

The FlowCraft report JSON file can also be visualized locally by drag and dropping
it into the FlowCraft web application page, currently hosted at http://www.flowcraft.live/reports

Offline visualization
:::::::::::::::::::::

The complete FlowCraft report is also available as a standalone HTML file that
can be visualized offline. This HTML file, stored in
``pipeline_reports/pipeline_report.html``, can be opened in any modern browser.

================================================
FILE: docs/user/components/abricate.rst
================================================
abricate
========

Purpose
-------

This component performs anti-microbial gene screening using abricate. It
includes the default databases plus the ``virulencefinder`` database.

.. note::
    Software page: https://github.com/tseemann/abricate

Input/Output type
------------------

- Input type: ``Fasta``
- Output type: None

.. note::
    The default input parameter for fasta data is ``--fasta``.

Parameters
----------

- ``abricateDatabases``: Specify the databases for abricate.

Published results
-----------------

- ``results/annotation/abricate``: Stores the results of the abricate screening
  for each sample and for each specified database.

Published reports
-----------------

None.

Default directives
------------------

- ``abricate``:
    - ``container``: ummidock/abricate
    - ``version``: 0.8.0-1
- ``process_assembly_mapping``:
    - ``container``: ummidock/abricate
    - ``version``: 0.8.0-1

Advanced
--------

Template
^^^^^^^^

:mod:`flowcraft.templates.process_abricate`


Reports JSON
^^^^^^^^^^^^

``tableRow``:
    - ``<database>``: List of gene names
``plotData``:
    - ``<database>``:
        - ``contig``: Contig ID
        - ``seqRange``: Genomic range of the contig
        - ``gene``: Gene name
        - ``accession``: Accession number
        - ``coverage``: Coverage of the match
        - ``identity``: Identity of the match

================================================
FILE: docs/user/components/assembly_mapping.rst
================================================
assembly_mapping
================

Purpose
-------

This component performs a mapping procedure of FastQ files using their assembly
as reference. The procedure is carried out with bowtie2 and samtools and
Download .txt
gitextract_0fzlskug/

├── .gitignore
├── .gitmodules
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── changelog.md
├── docker/
│   └── Dockerfile
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   └── custom.css
│   ├── about/
│   │   └── about.rst
│   ├── conf.py
│   ├── dev/
│   │   ├── containers.rst
│   │   ├── create_process.rst
│   │   ├── create_recipe.rst
│   │   ├── create_recipes.rst
│   │   ├── create_template.rst
│   │   ├── general_orientation.rst
│   │   ├── pipeline_reporting.rst
│   │   ├── process_dotfiles.rst
│   │   └── reports.rst
│   ├── flowcraft.flowcraft.rst
│   ├── flowcraft.generator.components.annotation.rst
│   ├── flowcraft.generator.components.assembly.rst
│   ├── flowcraft.generator.components.assembly_processing.rst
│   ├── flowcraft.generator.components.distance_estimation.rst
│   ├── flowcraft.generator.components.downloads.rst
│   ├── flowcraft.generator.components.metagenomics.rst
│   ├── flowcraft.generator.components.mlst.rst
│   ├── flowcraft.generator.components.patlas_mapping.rst
│   ├── flowcraft.generator.components.reads_quality_control.rst
│   ├── flowcraft.generator.components.rst
│   ├── flowcraft.generator.components.typing.rst
│   ├── flowcraft.generator.engine.rst
│   ├── flowcraft.generator.error_handling.rst
│   ├── flowcraft.generator.footer_skeleton.rst
│   ├── flowcraft.generator.header_skeleton.rst
│   ├── flowcraft.generator.inspect.rst
│   ├── flowcraft.generator.pipeline_parser.rst
│   ├── flowcraft.generator.process.rst
│   ├── flowcraft.generator.process_details.rst
│   ├── flowcraft.generator.recipe.rst
│   ├── flowcraft.generator.rst
│   ├── flowcraft.rst
│   ├── flowcraft.templates.assembly_report.rst
│   ├── flowcraft.templates.fastqc.rst
│   ├── flowcraft.templates.fastqc_report.rst
│   ├── flowcraft.templates.flowcraft_utils.flowcraft_base.rst
│   ├── flowcraft.templates.flowcraft_utils.rst
│   ├── flowcraft.templates.integrity_coverage.rst
│   ├── flowcraft.templates.mapping2json.rst
│   ├── flowcraft.templates.mashdist2json.rst
│   ├── flowcraft.templates.mashscreen2json.rst
│   ├── flowcraft.templates.megahit.rst
│   ├── flowcraft.templates.metaspades.rst
│   ├── flowcraft.templates.pATLAS_consensus_json.rst
│   ├── flowcraft.templates.pipeline_status.rst
│   ├── flowcraft.templates.process_abricate.rst
│   ├── flowcraft.templates.process_assembly.rst
│   ├── flowcraft.templates.process_assembly_mapping.rst
│   ├── flowcraft.templates.rst
│   ├── flowcraft.templates.skesa.rst
│   ├── flowcraft.templates.spades.rst
│   ├── flowcraft.templates.trimmomatic.rst
│   ├── flowcraft.templates.trimmomatic_report.rst
│   ├── flowcraft.tests.data_pipelines.rst
│   ├── flowcraft.tests.rst
│   ├── flowcraft.tests.test_assemblerflow.rst
│   ├── flowcraft.tests.test_engine.rst
│   ├── flowcraft.tests.test_pipeline_parser.rst
│   ├── flowcraft.tests.test_process_details.rst
│   ├── flowcraft.tests.test_processes.rst
│   ├── flowcraft.tests.test_sanity.rst
│   ├── getting_started/
│   │   ├── installation.rst
│   │   └── overview.rst
│   ├── index.rst
│   ├── make.bat
│   ├── setup.rst
│   └── user/
│       ├── available_components.rst
│       ├── basic_usage.rst
│       ├── components/
│       │   ├── abricate.rst
│       │   ├── assembly_mapping.rst
│       │   ├── bowtie.rst
│       │   ├── card_rgi.rst
│       │   ├── check_coverage.rst
│       │   ├── chewbbaca.rst
│       │   ├── diamond.rst
│       │   ├── downsample_fastq.rst
│       │   ├── fast_ani.rst
│       │   ├── fasterq_dump.rst
│       │   ├── fastqc.rst
│       │   ├── fastqc_trimmomatic.rst
│       │   ├── filter_poly.rst
│       │   ├── integrity_coverage.rst
│       │   ├── kraken.rst
│       │   ├── kraken2.rst
│       │   ├── mapping_patlas.rst
│       │   ├── mash_dist.rst
│       │   ├── mash_screen.rst
│       │   ├── mash_sketch_fasta.rst
│       │   ├── mash_sketch_fastq.rst
│       │   ├── maxbin2.rst
│       │   ├── megahit.rst
│       │   ├── metamlst.rst
│       │   ├── metaspades.rst
│       │   ├── midas_species.rst
│       │   ├── mlst.rst
│       │   ├── momps.rst
│       │   ├── patho_typing.rst
│       │   ├── pilon.rst
│       │   ├── process_skesa.rst
│       │   ├── process_spades.rst
│       │   ├── prokka.rst
│       │   ├── reads_download.rst
│       │   ├── remove_host.rst
│       │   ├── retrieve_mapped.rst
│       │   ├── seq_typing.rst
│       │   ├── sistr.rst
│       │   ├── skesa.rst
│       │   ├── spades.rst
│       │   └── trimmomatic.rst
│       ├── pipeline_building.rst
│       ├── pipeline_configuration.rst
│       ├── pipeline_inspect.rst
│       ├── pipeline_reports.rst
│       └── reports/
│           ├── abricate.rst
│           ├── assembly_mapping.rst
│           ├── check_coverage.rst
│           ├── chewbbaca.rst
│           ├── dengue_typing.rst
│           ├── fastqc.rst
│           ├── fastqc_trimmomatic.rst
│           ├── integrity_coverage.rst
│           ├── mash_dist.rst
│           ├── maxbin2.rst
│           ├── mlst.rst
│           ├── patho_typing.rst
│           ├── pilon.rst
│           ├── process_mapping.rst
│           ├── process_newick.rst
│           ├── process_skesa.rst
│           ├── process_spades.rst
│           ├── process_viral_assembly.rst
│           ├── seq_typing.rst
│           ├── sistr.rst
│           ├── trimmomatic.rst
│           └── true_coverage.rst
├── flowcraft/
│   ├── __init__.py
│   ├── bin/
│   │   ├── final_POST.sh
│   │   ├── merge_json.py
│   │   ├── metadata_POST.sh
│   │   ├── parse_fasta.py
│   │   ├── parse_true_coverage.py
│   │   ├── prepare_reports.py
│   │   ├── renamePE_samtoolsFASTQ.py
│   │   ├── report_POST.sh
│   │   ├── set_dotfiles.sh
│   │   └── startup_POST.sh
│   ├── flowcraft.py
│   ├── generator/
│   │   ├── __init__.py
│   │   ├── components/
│   │   │   ├── __init__.py
│   │   │   ├── alignment.py
│   │   │   ├── annotation.py
│   │   │   ├── assembly.py
│   │   │   ├── assembly_processing.py
│   │   │   ├── distance_estimation.py
│   │   │   ├── downloads.py
│   │   │   ├── mapping.py
│   │   │   ├── metagenomics.py
│   │   │   ├── mlst.py
│   │   │   ├── patlas_mapping.py
│   │   │   ├── phylogeny.py
│   │   │   ├── reads_quality_control.py
│   │   │   ├── typing.py
│   │   │   └── variant_calling.py
│   │   ├── engine.py
│   │   ├── error_handling.py
│   │   ├── footer_skeleton.py
│   │   ├── header_skeleton.py
│   │   ├── inspect.py
│   │   ├── pipeline_parser.py
│   │   ├── process.py
│   │   ├── process_collector.py
│   │   ├── process_details.py
│   │   ├── recipe.py
│   │   ├── recipes/
│   │   │   ├── __init__.py
│   │   │   ├── denim.py
│   │   │   ├── innuca.py
│   │   │   └── plasmids.py
│   │   ├── report.py
│   │   ├── templates/
│   │   │   ├── Helper.groovy
│   │   │   ├── abricate.nf
│   │   │   ├── abyss.nf
│   │   │   ├── assembly_mapping.nf
│   │   │   ├── bandage.nf
│   │   │   ├── base_recalibrator.nf
│   │   │   ├── bcalm.nf
│   │   │   ├── bowtie.nf
│   │   │   ├── bwa.nf
│   │   │   ├── card_rgi.nf
│   │   │   ├── check_coverage.nf
│   │   │   ├── chewbbaca.nf
│   │   │   ├── compiler_channels.txt
│   │   │   ├── concoct.nf
│   │   │   ├── containers.config
│   │   │   ├── dengue_typing.nf
│   │   │   ├── diamond.nf
│   │   │   ├── downsample_fastq.nf
│   │   │   ├── fast_ani.nf
│   │   │   ├── fasterq_dump.nf
│   │   │   ├── fastqc.nf
│   │   │   ├── fastqc_trimmomatic.nf
│   │   │   ├── filter_poly.nf
│   │   │   ├── haplotypecaller.nf
│   │   │   ├── init.nf
│   │   │   ├── integrity_coverage.nf
│   │   │   ├── kraken.nf
│   │   │   ├── kraken2.nf
│   │   │   ├── mafft.nf
│   │   │   ├── mapping_patlas.nf
│   │   │   ├── mark_duplicates.nf
│   │   │   ├── mash_dist.nf
│   │   │   ├── mash_screen.nf
│   │   │   ├── mash_sketch_fasta.nf
│   │   │   ├── mash_sketch_fastq.nf
│   │   │   ├── maxbin2.nf
│   │   │   ├── megahit.nf
│   │   │   ├── metabat2.nf
│   │   │   ├── metamlst.nf
│   │   │   ├── metaprob.nf
│   │   │   ├── metaspades.nf
│   │   │   ├── midas_species.nf
│   │   │   ├── mlst.nf
│   │   │   ├── momps.nf
│   │   │   ├── nextflow.config
│   │   │   ├── params.config
│   │   │   ├── patho_typing.nf
│   │   │   ├── patlas_consensus.nf
│   │   │   ├── pilon.nf
│   │   │   ├── pipeline_graph.html
│   │   │   ├── post.txt
│   │   │   ├── process_skesa.nf
│   │   │   ├── process_spades.nf
│   │   │   ├── progressive_mauve.nf
│   │   │   ├── prokka.nf
│   │   │   ├── quast.nf
│   │   │   ├── raxml.nf
│   │   │   ├── reads_download.nf
│   │   │   ├── remove_host.nf
│   │   │   ├── report_compiler.nf
│   │   │   ├── report_post.txt
│   │   │   ├── resources.config
│   │   │   ├── retrieve_mapped.nf
│   │   │   ├── seq_typing.nf
│   │   │   ├── seroba.nf
│   │   │   ├── sistr.nf
│   │   │   ├── skesa.nf
│   │   │   ├── spades.nf
│   │   │   ├── split_assembly.nf
│   │   │   ├── status_compiler.nf
│   │   │   ├── trace_compiler.nf
│   │   │   ├── trimmomatic.nf
│   │   │   ├── true_coverage.nf
│   │   │   ├── unicycler.nf
│   │   │   ├── user.config
│   │   │   └── viral_assembly.nf
│   │   └── utils.py
│   ├── lib/
│   │   └── CheckParams.groovy
│   ├── profiles.config
│   ├── templates/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── assembly_report.py
│   │   ├── compile_reports.py
│   │   ├── dengue_typing_assembly.py
│   │   ├── dengue_typing_reads.py
│   │   ├── downsample_fastq.py
│   │   ├── fasta_spliter.py
│   │   ├── fastqc.py
│   │   ├── fastqc_report.py
│   │   ├── flowcraft_utils/
│   │   │   ├── __init__.py
│   │   │   └── flowcraft_base.py
│   │   ├── integrity_coverage.py
│   │   ├── mapping2json.py
│   │   ├── mashdist2json.py
│   │   ├── mashscreen2json.py
│   │   ├── megahit.py
│   │   ├── metaspades.py
│   │   ├── pATLAS_consensus_json.py
│   │   ├── pipeline_status.py
│   │   ├── process_abricate.py
│   │   ├── process_assembly.py
│   │   ├── process_assembly_mapping.py
│   │   ├── process_concoct.py
│   │   ├── process_mapping.py
│   │   ├── process_metabat.py
│   │   ├── process_newick.py
│   │   ├── process_tsv.py
│   │   ├── process_viral_assembly.py
│   │   ├── skesa.py
│   │   ├── spades.py
│   │   ├── split_fasta.py
│   │   ├── trimmomatic.py
│   │   └── trimmomatic_report.py
│   └── tests/
│       ├── __init__.py
│       ├── broadcast_tests/
│       │   ├── empty_log.txt
│       │   ├── log_with_command.txt
│       │   ├── log_with_command_regex.txt
│       │   └── log_without_command.txt
│       ├── data_pipelines.py
│       ├── pipeline_tests/
│       │   ├── pipe1.txt
│       │   ├── pipe2.txt
│       │   ├── pipe3.txt
│       │   ├── pipe4.txt
│       │   ├── pipe5.txt
│       │   ├── pipe6.txt
│       │   ├── pipe7.txt
│       │   └── pipe8.txt
│       ├── test_assemblerflow.py
│       ├── test_broadcast.py
│       ├── test_engine.py
│       ├── test_pipeline_parser.py
│       ├── test_process_details.py
│       ├── test_processes.py
│       ├── test_recipes.py
│       └── test_sanity.py
├── requirements.txt
└── setup.py
Download .txt
SYMBOL INDEX (662 symbols across 73 files)

FILE: docs/conf.py
  function setup (line 187) | def setup(app):

FILE: flowcraft/bin/merge_json.py
  function get_core_genes (line 14) | def get_core_genes(core_file):
  function filter_core_genes (line 23) | def filter_core_genes(locus_array, info_array, core_genes):
  function assess_quality (line 34) | def assess_quality(core_array, core_genes):
  function get_table_data (line 57) | def get_table_data(data_obj, sample_id=None):
  function main (line 83) | def main():

FILE: flowcraft/bin/parse_fasta.py
  function replace_char (line 9) | def replace_char(text):
  function getSequence (line 14) | def getSequence(ref, fasta):
  function main (line 32) | def main():

FILE: flowcraft/bin/parse_true_coverage.py
  function parse_true_coverage (line 7) | def parse_true_coverage(report_json, fail_json=None):
  function main (line 40) | def main():

FILE: flowcraft/bin/prepare_reports.py
  function write_json (line 12) | def write_json(report_json, version_json, trace_file, task_name,
  function main (line 63) | def main():

FILE: flowcraft/bin/renamePE_samtoolsFASTQ.py
  function formartFastqHeaders (line 34) | def formartFastqHeaders(in_fastq_1, in_fastq_2, outdir):
  function compressionType (line 79) | def compressionType(file_to_test):
  function runTime (line 93) | def runTime(start_time):
  function main (line 102) | def main():

FILE: flowcraft/flowcraft.py
  function get_args (line 41) | def get_args(args=None):
  function validate_build_arguments (line 196) | def validate_build_arguments(args):
  function copy_project (line 252) | def copy_project(path):
  function build (line 287) | def build(args):
  function inspect (line 381) | def inspect(args):
  function report (line 402) | def report(args):
  function main (line 423) | def main():

FILE: flowcraft/generator/components/alignment.py
  class Mafft (line 7) | class Mafft(Process):
    method __init__ (line 18) | def __init__(self, **kwargs):
  class ProgressiveMauve (line 45) | class ProgressiveMauve(Process):
    method __init__ (line 56) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/annotation.py
  class Abricate (line 8) | class Abricate(Process):
    method __init__ (line 23) | def __init__(self, **kwargs):
  class CardRgi (line 71) | class CardRgi(Process):
    method __init__ (line 81) | def __init__(self, **kwargs):
  class Prokka (line 109) | class Prokka(Process):
    method __init__ (line 124) | def __init__(self, **kwargs):
  class Diamond (line 163) | class Diamond(Process):
    method __init__ (line 173) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/assembly.py
  class Bcalm (line 8) | class Bcalm(Process):
    method __init__ (line 19) | def __init__(self, **kwargs):
  class Spades (line 51) | class Spades(Process):
    method __init__ (line 65) | def __init__(self, **kwargs):
  class Skesa (line 122) | class Skesa(Process):
    method __init__ (line 126) | def __init__(self, **kwargs):
  class ViralAssembly (line 153) | class ViralAssembly(Process):
    method __init__ (line 158) | def __init__(self, **kwargs):
  class Abyss (line 231) | class Abyss(Process):
    method __init__ (line 242) | def __init__(self, **kwargs):
  class Unicycler (line 267) | class Unicycler(Process):
    method __init__ (line 278) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/assembly_processing.py
  class ProcessSkesa (line 8) | class ProcessSkesa(Process):
    method __init__ (line 10) | def __init__(self, **kwargs):
  class ProcessSpades (line 54) | class ProcessSpades(Process):
    method __init__ (line 65) | def __init__(self, **kwargs):
  class AssemblyMapping (line 108) | class AssemblyMapping(Process):
    method __init__ (line 128) | def __init__(self, **kwargs):
  class Pilon (line 179) | class Pilon(Process):
    method __init__ (line 194) | def __init__(self, **kwargs):
  class Bandage (line 233) | class Bandage(Process):
    method __init__ (line 244) | def __init__(self, **kwargs):
  class Quast (line 266) | class Quast(Process):
    method __init__ (line 277) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/distance_estimation.py
  class MashDist (line 8) | class MashDist(Process):
    method __init__ (line 10) | def __init__(self, **kwargs):
  class MashScreen (line 69) | class MashScreen(Process):
    method __init__ (line 71) | def __init__(self, **kwargs):
  class MashSketchFasta (line 131) | class MashSketchFasta(Process):
    method __init__ (line 133) | def __init__(self, **kwargs):
  class MashSketchFastq (line 170) | class MashSketchFastq(MashSketchFasta):
    method __init__ (line 172) | def __init__(self, **kwargs):
  class FastAni (line 205) | class FastAni(Process):
    method __init__ (line 207) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/downloads.py
  class ReadsDownload (line 8) | class ReadsDownload(Process):
    method __init__ (line 18) | def __init__(self, **kwargs):
  class FasterqDump (line 44) | class FasterqDump(Process):
    method __init__ (line 54) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/mapping.py
  class Bowtie (line 7) | class Bowtie(Process):
    method __init__ (line 18) | def __init__(self, **kwargs):
  class RetrieveMapped (line 67) | class RetrieveMapped(Process):
    method __init__ (line 79) | def __init__(self, **kwargs):
  class Bwa (line 113) | class Bwa(Process):
    method __init__ (line 124) | def __init__(self, **kwargs):
  class MarkDuplicates (line 153) | class MarkDuplicates(Process):
    method __init__ (line 164) | def __init__(self, **kwargs):
  class BaseRecalibrator (line 186) | class BaseRecalibrator(Process):
    method __init__ (line 197) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/metagenomics.py
  class Concoct (line 8) | class Concoct(Process):
    method __init__ (line 24) | def __init__(self, **kwargs):
  class Kraken (line 76) | class Kraken(Process):
    method __init__ (line 85) | def __init__(self, **kwargs):
  class Kraken2 (line 113) | class Kraken2(Process):
    method __init__ (line 122) | def __init__(self, **kwargs):
  class Maxbin2 (line 151) | class Maxbin2(Process):
    method __init__ (line 167) | def __init__(self, **kwargs):
  class Megahit (line 216) | class Megahit(Process):
    method __init__ (line 230) | def __init__(self, **kwargs):
  class Metabat2 (line 284) | class Metabat2(Process):
    method __init__ (line 301) | def __init__(self, **kwargs):
  class Metaspades (line 344) | class Metaspades(Process):
    method __init__ (line 358) | def __init__(self, **kwargs):
  class Midas_species (line 396) | class Midas_species(Process):
    method __init__ (line 405) | def __init__(self, **kwargs):
  class RemoveHost (line 433) | class RemoveHost(Process):
    method __init__ (line 444) | def __init__(self, **kwargs):
  class Metaprob (line 482) | class Metaprob(Process):
    method __init__ (line 493) | def __init__(self, **kwargs):
  class SplitAssembly (line 526) | class SplitAssembly(Process):
    method __init__ (line 540) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/mlst.py
  class Mlst (line 7) | class Mlst(Process):
    method __init__ (line 22) | def __init__(self, **kwargs):
  class Chewbbaca (line 42) | class Chewbbaca(Process):
    method __init__ (line 57) | def __init__(self, **kwargs):
  class Metamlst (line 144) | class Metamlst(Process):
    method __init__ (line 155) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/patlas_mapping.py
  class MappingPatlas (line 7) | class MappingPatlas(Process):
    method __init__ (line 9) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/phylogeny.py
  class Raxml (line 7) | class Raxml(Process):
    method __init__ (line 18) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/reads_quality_control.py
  class IntegrityCoverage (line 8) | class IntegrityCoverage(Process):
    method __init__ (line 23) | def __init__(self, **kwargs):
  class CheckCoverage (line 49) | class CheckCoverage(Process):
    method __init__ (line 64) | def __init__(self, **kwargs):
  class TrueCoverage (line 90) | class TrueCoverage(Process):
    method __init__ (line 94) | def __init__(self, **kwargs):
  class Fastqc (line 120) | class Fastqc(Process):
    method __init__ (line 136) | def __init__(self, **kwargs):
  class Trimmomatic (line 164) | class Trimmomatic(Process):
    method __init__ (line 178) | def __init__(self, **kwargs):
  class FastqcTrimmomatic (line 237) | class FastqcTrimmomatic(Process):
    method __init__ (line 260) | def __init__(self, **kwargs):
  class FilterPoly (line 330) | class FilterPoly(Process):
    method __init__ (line 341) | def __init__(self, **kwargs):
  class DownsampleFastq (line 380) | class DownsampleFastq(Process):
    method __init__ (line 390) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/typing.py
  class SeqTyping (line 7) | class SeqTyping(Process):
    method __init__ (line 12) | def __init__(self, **kwargs):
  class PathoTyping (line 46) | class PathoTyping(Process):
    method __init__ (line 51) | def __init__(self, **kwargs):
  class Sistr (line 81) | class Sistr(Process):
    method __init__ (line 83) | def __init__(self, **kwargs):
  class Momps (line 98) | class Momps(Process):
    method __init__ (line 100) | def __init__(self, **kwargs):
  class DengueTyping (line 130) | class DengueTyping(Process):
    method __init__ (line 135) | def __init__(self, **kwargs):
  class Seroba (line 179) | class Seroba(Process):
    method __init__ (line 184) | def __init__(self, **kwargs):

FILE: flowcraft/generator/components/variant_calling.py
  class Haplotypecaller (line 7) | class Haplotypecaller(Process):
    method __init__ (line 18) | def __init__(self, **kwargs):

FILE: flowcraft/generator/engine.py
  class NextflowGenerator (line 33) | class NextflowGenerator:
    method __init__ (line 35) | def __init__(self, process_connections, nextflow_file, process_map,
    method _parse_process_name (line 184) | def _parse_process_name(name_str):
    method _build_connections (line 232) | def _build_connections(self, process_list, ignore_dependencies,
    method _get_process_names (line 374) | def _get_process_names(self, con, pid):
    method _add_dependency (line 408) | def _add_dependency(self, p, template, inlane, outlane, pid):
    method _search_tree_backwards (line 459) | def _search_tree_backwards(self, template, parent_lanes):
    method _test_connection (line 491) | def _test_connection(parent_process, child_process):
    method _build_header (line 518) | def _build_header(self):
    method _build_footer (line 527) | def _build_footer(self):
    method _update_raw_input (line 535) | def _update_raw_input(self, p, sink_channel=None, input_type=None):
    method _update_extra_inputs (line 580) | def _update_extra_inputs(self, p):
    method _get_fork_tree (line 636) | def _get_fork_tree(self, lane):
    method _set_implicit_link (line 660) | def _set_implicit_link(self, p, link):
    method _update_secondary_channels (line 691) | def _update_secondary_channels(self, p):
    method _set_channels (line 759) | def _set_channels(self):
    method _set_init_process (line 811) | def _set_init_process(self):
    method _set_secondary_channels (line 833) | def _set_secondary_channels(self):
    method _set_compiler_channels (line 865) | def _set_compiler_channels(self):
    method _set_general_compilers (line 872) | def _set_general_compilers(self):
    method _set_status_channels (line 904) | def _set_status_channels(self):
    method _get_resources_string (line 944) | def _get_resources_string(res_dict, pid):
    method _get_container_string (line 984) | def _get_container_string(cont_dict, pid):
    method _get_params_string (line 1028) | def _get_params_string(self):
    method _get_merged_params_string (line 1080) | def _get_merged_params_string(self):
    method _get_merged_params_string (line 1135) | def _get_merged_params_string(self):
    method _get_params_help (line 1176) | def _get_params_help(self):
    method _get_merged_params_help (line 1204) | def _get_merged_params_help(self):
    method _render_config (line 1238) | def _render_config(template, context):
    method _set_configurations (line 1249) | def _set_configurations(self):
    method dag_to_file (line 1303) | def dag_to_file(self, dict_viz, output_file=".treeDag.json"):
    method render_pipeline (line 1319) | def render_pipeline(self):
    method write_configs (line 1393) | def write_configs(self, project_root):
    method export_params (line 1430) | def export_params(self):
    method export_directives (line 1446) | def export_directives(self):
    method fetch_docker_tags (line 1459) | def fetch_docker_tags(self):
    method build (line 1570) | def build(self):

FILE: flowcraft/generator/error_handling.py
  class ProcessError (line 1) | class ProcessError(Exception):
    method __init__ (line 2) | def __init__(self, value):
    method __str__ (line 5) | def __str__(self):
  class SanityError (line 9) | class SanityError(Exception):
    method __init__ (line 13) | def __init__(self, value):
  class InspectionError (line 20) | class InspectionError(Exception):
    method __init__ (line 21) | def __init__(self, value):
  class ReportError (line 25) | class ReportError(Exception):
    method __init__ (line 26) | def __init__(self, value):
  class RecipeError (line 30) | class RecipeError(Exception):
    method __init__ (line 31) | def __init__(self, value):
  class LogError (line 37) | class LogError(Exception):
    method __init__ (line 38) | def __init__(self, value):

FILE: flowcraft/generator/inspect.py
  function signal_handler (line 35) | def signal_handler(screen):
  class NextflowInspector (line 53) | class NextflowInspector:
    method __init__ (line 61) | def __init__(self, trace_file, refresh_rate, pretty=False, ip_addr=None):
    method _check_required_files (line 267) | def _check_required_files(self):
    method _header_mapping (line 281) | def _header_mapping(header):
    method _expand_path (line 301) | def _expand_path(hash_str):
    method _hms (line 327) | def _hms(s):
    method _size_coverter (line 360) | def _size_coverter(s):
    method _size_compress (line 394) | def _size_compress(s):
    method _get_pipeline_processes (line 407) | def _get_pipeline_processes(self):
    method _clear_inspect (line 456) | def _clear_inspect(self):
    method _update_pipeline_status (line 477) | def _update_pipeline_status(self):
    method _update_tag_status (line 539) | def _update_tag_status(self, process, vals):
    method _update_barrier_status (line 601) | def _update_barrier_status(self):
    method _retrieve_log (line 623) | def _retrieve_log(path):
    method _update_trace_info (line 642) | def _update_trace_info(self, fields, hm):
    method _update_process_resources (line 715) | def _update_process_resources(self, process, vals):
    method _cpu_load_parser (line 729) | def _cpu_load_parser(self, cpus, cpu_per, t):
    method _assess_resource_warnings (line 753) | def _assess_resource_warnings(self, process, vals):
    method _update_process_stats (line 801) | def _update_process_stats(self):
    method trace_parser (line 893) | def trace_parser(self):
    method log_parser (line 937) | def log_parser(self):
    method update_inspection (line 1020) | def update_inspection(self):
    method display_overview (line 1049) | def display_overview(self):
    method _curses_keybindings (line 1089) | def _curses_keybindings(self):
    method _updown (line 1108) | def _updown(self, direction):
    method _rightleft (line 1119) | def _rightleft(self, direction):
    method flush_overview (line 1129) | def flush_overview(self):
    method _convert_process_dict (line 1248) | def _convert_process_dict(self):
    method _prepare_table_data (line 1263) | def _prepare_table_data(self):
    method _prepare_overview_data (line 1320) | def _prepare_overview_data(self):
    method _prepare_general_details (line 1336) | def _prepare_general_details(self):
    method _get_log_lines (line 1356) | def _get_log_lines(self, n=300):
    method _prepare_run_status_data (line 1375) | def _prepare_run_status_data(self):
    method _send_status_info (line 1388) | def _send_status_info(self, run_id):
    method _prepare_static_info (line 1432) | def _prepare_static_info(self):
    method _dag_file_to_dict (line 1467) | def _dag_file_to_dict(self):
    method _establish_connection (line 1488) | def _establish_connection(self, run_id, dict_dag):
    method _close_connection (line 1517) | def _close_connection(self, run_id):
    method _get_run_hash (line 1533) | def _get_run_hash(self):
    method _print_msg (line 1552) | def _print_msg(self, run_id):
    method broadcast_status (line 1560) | def broadcast_status(self):

FILE: flowcraft/generator/pipeline_parser.py
  function guess_process (line 24) | def guess_process(query_str, process_map):
  function remove_inner_forks (line 58) | def remove_inner_forks(text):
  function empty_tasks (line 87) | def empty_tasks(p_string):
  function brackets_but_no_lanes (line 103) | def brackets_but_no_lanes(p_string):
  function brackets_insanity_check (line 120) | def brackets_insanity_check(p_string):
  function lane_char_insanity_check (line 150) | def lane_char_insanity_check(p_string):
  function final_char_insanity_check (line 167) | def final_char_insanity_check(p_string):
  function fork_procs_insanity_check (line 186) | def fork_procs_insanity_check(p_string):
  function start_proc_insanity_check (line 213) | def start_proc_insanity_check(p_string):
  function late_proc_insanity_check (line 232) | def late_proc_insanity_check(p_string):
  function inner_fork_insanity_checks (line 250) | def inner_fork_insanity_checks(pipeline_string):
  function insanity_checks (line 305) | def insanity_checks(pipeline_str):
  function parse_pipeline (line 341) | def parse_pipeline(pipeline_str):
  function get_source_lane (line 450) | def get_source_lane(fork_process, pipeline_list):
  function get_lanes (line 486) | def get_lanes(lanes_str):
  function linear_connection (line 535) | def linear_connection(plist, lane):
  function fork_connection (line 578) | def fork_connection(source, sink, source_lane, lane):
  function linear_lane_connection (line 627) | def linear_lane_connection(lane_list, lane):
  function add_unique_identifiers (line 657) | def add_unique_identifiers(pipeline_str):
  function remove_unique_identifiers (line 730) | def remove_unique_identifiers(identifiers_to_tags, pipeline_links):

FILE: flowcraft/generator/process.py
  class Process (line 15) | class Process:
    method __init__ (line 105) | def __init__(self, template):
    method _set_template (line 308) | def _set_template(self, template):
    method set_main_channel_names (line 330) | def set_main_channel_names(self, input_suffix, output_suffix, lane):
    method set_param_id (line 350) | def set_param_id(self, param_id):
    method get_user_channel (line 362) | def get_user_channel(self, input_channel, input_type=None):
    method render (line 402) | def render(template, context):
    method template_str (line 420) | def template_str(self):
    method set_channels (line 444) | def set_channels(self, **kwargs):
    method update_main_input (line 489) | def update_main_input(self, input_str):
    method update_main_forks (line 494) | def update_main_forks(self, sink):
    method set_secondary_channel (line 518) | def set_secondary_channel(self, source, channel_list):
    method update_attributes (line 569) | def update_attributes(self, attr_dict):
  class Compiler (line 611) | class Compiler(Process):
    method __init__ (line 615) | def __init__(self, **kwargs):
    method set_compiler_channels (line 622) | def set_compiler_channels(self, channel_list, operator="mix"):
  class Init (line 676) | class Init(Process):
    method __init__ (line 678) | def __init__(self, **kwargs):
    method set_raw_inputs (line 687) | def set_raw_inputs(self, raw_input):
    method set_secondary_inputs (line 739) | def set_secondary_inputs(self, channel_dict):
    method set_extra_inputs (line 757) | def set_extra_inputs(self, channel_dict):
  class StatusCompiler (line 803) | class StatusCompiler(Compiler):
    method __init__ (line 810) | def __init__(self, **kwargs):
  class ReportCompiler (line 815) | class ReportCompiler(Compiler):
    method __init__ (line 822) | def __init__(self, **kwargs):
  class PatlasConsensus (line 827) | class PatlasConsensus(Compiler):
    method __init__ (line 834) | def __init__(self, **kwargs):

FILE: flowcraft/generator/process_collector.py
  function convert_camel_case (line 10) | def convert_camel_case(name):
  function collect_process_map (line 28) | def collect_process_map():

FILE: flowcraft/generator/process_details.py
  function colored_print (line 18) | def colored_print(msg, color_label="white_bold"):
  function procs_dict_parser (line 50) | def procs_dict_parser(procs_dict):
  function proc_collector (line 110) | def proc_collector(process_map, args, pipeline_string):

FILE: flowcraft/generator/recipe.py
  class InnuendoRecipe (line 19) | class InnuendoRecipe:
    method __init__ (line 21) | def __init__(self):
    method validate_pipeline (line 54) | def validate_pipeline(pipeline_string):
    method build_upstream (line 77) | def build_upstream(self, process_descriptions, task, all_tasks,
    method build_downstream (line 165) | def build_downstream(self, process_descriptions, task, all_tasks,
    method define_pipeline_string (line 237) | def define_pipeline_string(self, process_descriptions, tasks,
    method build_pipeline_string (line 350) | def build_pipeline_string(self, forks):
    method run_auto_pipeline (line 455) | def run_auto_pipeline(self, tasks):
  class Innuendo (line 491) | class Innuendo(InnuendoRecipe):
    method __init__ (line 497) | def __init__(self, *args, **kwargs):
  function brew_innuendo (line 528) | def brew_innuendo(args):
  class Recipe (line 564) | class Recipe:
    method __init__ (line 566) | def __init__(self):
    method brew (line 584) | def brew(self):
    method _get_component_str (line 614) | def _get_component_str(component, params=None, directives=None):
  function brew_recipe (line 649) | def brew_recipe(recipe_name):
  function list_recipes (line 691) | def list_recipes(full=False):

FILE: flowcraft/generator/recipes/denim.py
  class Denim (line 7) | class Denim(Recipe):
    method __init__ (line 13) | def __init__(self):

FILE: flowcraft/generator/recipes/innuca.py
  class Innuca (line 7) | class Innuca(Recipe):
    method __init__ (line 14) | def __init__(self):

FILE: flowcraft/generator/recipes/plasmids.py
  class Plasmids (line 7) | class Plasmids(Recipe):
    method __init__ (line 14) | def __init__(self):
  class PlasmidsMapping (line 33) | class PlasmidsMapping(Recipe):
    method __init__ (line 39) | def __init__(self):
  class PlasmidsAssembly (line 56) | class PlasmidsAssembly(Recipe):
    method __init__ (line 62) | def __init__(self):
  class PlasmidsMash (line 81) | class PlasmidsMash(Recipe):
    method __init__ (line 87) | def __init__(self):

FILE: flowcraft/generator/report.py
  function signal_handler (line 28) | def signal_handler():
  class FlowcraftReport (line 37) | class FlowcraftReport:
    method __init__ (line 39) | def __init__(self, report_file, trace_file=None, log_file=None,
    method _check_required_files (line 129) | def _check_required_files(self):
    method _header_mapping (line 136) | def _header_mapping(header):
    method _expand_path (line 156) | def _expand_path(hash_str):
    method _get_report_id (line 181) | def _get_report_id(self):
    method _update_pipeline_status (line 219) | def _update_pipeline_status(self):
    method update_trace_watch (line 247) | def update_trace_watch(self):
    method update_log_watch (line 293) | def update_log_watch(self):
    method _send_live_report (line 309) | def _send_live_report(self, report_id):
    method _init_live_reports (line 381) | def _init_live_reports(self, report_id):
    method _close_connection (line 416) | def _close_connection(self, report_id):
    method _send_report (line 443) | def _send_report(self, report_id):
    method _print_msg (line 464) | def _print_msg(self, run_id):
    method broadcast_report (line 473) | def broadcast_report(self):

FILE: flowcraft/generator/utils.py
  function get_nextflow_filepath (line 9) | def get_nextflow_filepath(log_file):

FILE: flowcraft/templates/assembly_report.py
  function __get_version_pilon (line 51) | def __get_version_pilon():
  class Assembly (line 84) | class Assembly:
    method __init__ (line 98) | def __init__(self, assembly_file, sample_id):
    method _parse_assembly (line 143) | def _parse_assembly(self, assembly_file):
    method _get_contig_id (line 184) | def _get_contig_id(contig_str):
    method get_summary_stats (line 213) | def get_summary_stats(self, output_csv=None):
    method _get_window_labels (line 284) | def _get_window_labels(self, window):
    method _gc_prop (line 318) | def _gc_prop(s, length):
    method get_gc_sliding (line 336) | def get_gc_sliding(self, window=2000):
    method _get_coverage_from_file (line 361) | def _get_coverage_from_file(self, coverage_file):
    method get_coverage_sliding (line 388) | def get_coverage_sliding(self, coverage_file, window=2000):
  function main (line 423) | def main(sample_id, assembly_file, coverage_bp_file=None):

FILE: flowcraft/templates/compile_reports.py
  function main (line 32) | def main(reports, forks, dag, main_js):

FILE: flowcraft/templates/dengue_typing_assembly.py
  function __get_version_seq_typing (line 56) | def __get_version_seq_typing():
  function replace_char (line 76) | def replace_char(text):
  function getSequence (line 90) | def getSequence(ref, fasta):
  function get_reference_header (line 122) | def get_reference_header(file):
  function getType (line 136) | def getType(file):
  function getScore (line 149) | def getScore(file):
  function main (line 178) | def main(sample_id, assembly, reference, result):

FILE: flowcraft/templates/dengue_typing_reads.py
  function __get_version_seq_typing (line 60) | def __get_version_seq_typing():
  function replace_char (line 81) | def replace_char(text):
  function getSequence (line 95) | def getSequence(ref, fasta):
  function get_reference_header (line 127) | def get_reference_header(file):
  function getType (line 141) | def getType(file):
  function getConsesusSequence (line 154) | def getConsesusSequence(best_reference, consensus, sample_id):
  function getScore (line 186) | def getScore(file):
  function main (line 219) | def main(sample_id, assembly, fastq_pair, reference, result):

FILE: flowcraft/templates/downsample_fastq.py
  function __get_version_spades (line 72) | def __get_version_spades():
  function main (line 99) | def main(sample_id, fastq_pair, genome_size, depth, clear, seed):

FILE: flowcraft/templates/fasta_spliter.py
  function main (line 19) | def main():

FILE: flowcraft/templates/fastqc.py
  function __get_version_fastqc (line 50) | def __get_version_fastqc():
  function convert_adatpers (line 81) | def convert_adatpers(adapter_fasta):
  function main (line 133) | def main(fastq_pair, adapter_file, cpus):

FILE: flowcraft/templates/fastqc_report.py
  function _get_quality_stats (line 78) | def _get_quality_stats(d, start_str, field_start=1, field_end=2):
  function write_json_report (line 131) | def write_json_report(sample_id, data1, data2):
  function get_trim_index (line 192) | def get_trim_index(biased_list):
  function trim_range (line 244) | def trim_range(data_file):
  function get_sample_trim (line 324) | def get_sample_trim(p1_data, p2_data):
  function get_summary (line 362) | def get_summary(summary_file):
  function check_summary_health (line 409) | def check_summary_health(summary_file, **kwargs):
  function main (line 521) | def main(sample_id, result_p1, result_p2, opts):

FILE: flowcraft/templates/flowcraft_utils/flowcraft_base.py
  function get_logger (line 14) | def get_logger(filepath, level=logging.DEBUG):
  function log_error (line 31) | def log_error():
  class MainWrapper (line 39) | class MainWrapper:
    method __init__ (line 41) | def __init__(self, f):
    method __call__ (line 47) | def __call__(self, *args, **kwargs):
    method build_versions (line 67) | def build_versions(self):

FILE: flowcraft/templates/integrity_coverage.py
  function guess_file_compression (line 140) | def guess_file_compression(file_path, magic_dict=None):
  function get_qual_range (line 183) | def get_qual_range(qual_str):
  function get_encodings_in_range (line 204) | def get_encodings_in_range(rmin, rmax):
  function main (line 241) | def main(sample_id, fastq_pair, gsize, minimum_coverage, opts):

FILE: flowcraft/templates/mapping2json.py
  function depth_file_reader (line 74) | def depth_file_reader(depth_file):
  function generate_jsons (line 115) | def generate_jsons(depth_dic_coverage, plasmid_length, cutoff):
  function main (line 195) | def main(depth_file, json_dict, cutoff, sample_id):

FILE: flowcraft/templates/mashdist2json.py
  function send_to_output (line 49) | def send_to_output(master_dict, mash_output, sample_id, assembly_file):
  function main (line 118) | def main(mash_output, hash_cutoff, sample_id, assembly_file):

FILE: flowcraft/templates/mashscreen2json.py
  function main (line 46) | def main(mash_output, sample_id):

FILE: flowcraft/templates/megahit.py
  function is_odd (line 55) | def is_odd(k_mer):
  function __get_version_megahit (line 62) | def __get_version_megahit():
  function set_kmers (line 98) | def set_kmers(kmer_opt, max_read_len):
  function fix_contig_names (line 149) | def fix_contig_names(asseembly_path):
  function clean_up (line 177) | def clean_up(fastq):
  function main (line 197) | def main(sample_id, fastq_pair, max_len, kmer, mem, clear):

FILE: flowcraft/templates/metaspades.py
  function __get_version_spades (line 53) | def __get_version_spades():
  function clean_up (line 88) | def clean_up(fastq):
  function set_kmers (line 107) | def set_kmers(kmer_opt, max_read_len):
  function main (line 154) | def main(sample_id, fastq_pair, max_len, kmer, clear):

FILE: flowcraft/templates/pATLAS_consensus_json.py
  function main (line 48) | def main(list_of_jsons):

FILE: flowcraft/templates/pipeline_status.py
  function get_json_info (line 45) | def get_json_info(fields, header):
  function get_previous_stats (line 62) | def get_previous_stats(stats_path):
  function main (line 88) | def main(sample_id, trace_file, workdir):

FILE: flowcraft/templates/process_abricate.py
  function __get_version_abricate (line 47) | def __get_version_abricate():
  class Abricate (line 90) | class Abricate:
    method __init__ (line 104) | def __init__(self, fls):
    method parse_files (line 131) | def parse_files(self, fls):
    method _parser (line 152) | def _parser(self, fl):
    method _test_truth (line 210) | def _test_truth(x, op, y):
    method iter_filter (line 242) | def iter_filter(self, filters, databases=None, fields=None,
    method get_filter (line 342) | def get_filter(self, *args, **kwargs):
  class AbricateReport (line 361) | class AbricateReport(Abricate):
    method __init__ (line 376) | def __init__(self, *args, **kwargs):
    method _get_contig_id (line 380) | def _get_contig_id(contig_str):
    method get_plot_data (line 409) | def get_plot_data(self):
    method get_table_data (line 476) | def get_table_data(self):
    method write_report_data (line 527) | def write_report_data(self):
  function main (line 543) | def main(abr_file):

FILE: flowcraft/templates/process_assembly.py
  class Assembly (line 75) | class Assembly:
    method __init__ (line 96) | def __init__(self, assembly_file, min_contig_len, min_kmer_cov,
    method _parse_coverage (line 141) | def _parse_coverage(header_str):
    method _parse_assembly (line 173) | def _parse_assembly(self, assembly_file):
    method _populate_contigs (line 241) | def _populate_contigs(self, contig_id, header, cov, sequence):
    method _get_gc_content (line 278) | def _get_gc_content(sequence, length):
    method _test_truth (line 309) | def _test_truth(x, op, y):
    method filter_contigs (line 341) | def filter_contigs(self, *comparisons):
    method get_assembly_length (line 390) | def get_assembly_length(self):
    method write_assembly (line 404) | def write_assembly(self, output_file, filtered=True):
    method write_report (line 428) | def write_report(self, output_file):
  function main (line 447) | def main(sample_id, assembly_file, gsize, opts, assembler):

FILE: flowcraft/templates/process_assembly_mapping.py
  function __get_version_samtools (line 67) | def __get_version_samtools():
  function __get_version_bowtie2 (line 85) | def __get_version_bowtie2():
  function parse_coverage_table (line 122) | def parse_coverage_table(coverage_file):
  function filter_assembly (line 167) | def filter_assembly(assembly_file, minimum_coverage, coverage_info,
  function filter_bam (line 212) | def filter_bam(coverage_info, bam_file, min_coverage, output_bam):
  function check_filtered_assembly (line 304) | def check_filtered_assembly(coverage_info, coverage_bp, minimum_coverage,
  function get_coverage_from_file (line 444) | def get_coverage_from_file(coverage_file):
  function evaluate_min_coverage (line 475) | def evaluate_min_coverage(coverage_opt, assembly_coverage, assembly_size):
  function get_assembly_size (line 518) | def get_assembly_size(assembly_file):
  function main (line 560) | def main(sample_id, assembly_file, coverage_file, coverage_bp_file, bam_...

FILE: flowcraft/templates/process_concoct.py
  function parse_assembly (line 43) | def parse_assembly(file):
  function parse_cluster_csv (line 62) | def parse_cluster_csv(file):
  function get_GC (line 82) | def get_GC(sequence):
  function merge_data (line 87) | def merge_data(contigs, clusters):
  function main (line 115) | def main(sample_id, cluster_file, contig_file):

FILE: flowcraft/templates/process_mapping.py
  class Bowtie (line 56) | class Bowtie:
    method __init__ (line 62) | def __init__(self, sample_id, bowtie_log):
    method set_n_reads (line 83) | def set_n_reads(self, n_reads):
    method set_align_0x (line 87) | def set_align_0x(self,align_0x):
    method set_align_1x (line 91) | def set_align_1x(self,align_1x):
    method set_align_mt1x (line 95) | def set_align_mt1x(self,align_mt1x):
    method set_overall_rate (line 99) | def set_overall_rate(self,overall_rate):
    method parse_log (line 103) | def parse_log(self, bowtie_log):
  function main (line 196) | def main(sample_id, bowite_log):

FILE: flowcraft/templates/process_metabat.py
  function parse_assembly (line 41) | def parse_assembly(file):
  function get_cg (line 60) | def get_cg(sequence):
  function get_bin_stats (line 65) | def get_bin_stats(bin_file):
  function main (line 78) | def main(sample_id, bins):

FILE: flowcraft/templates/process_newick.py
  function main (line 55) | def main(newick, labels):

FILE: flowcraft/templates/process_tsv.py
  function main (line 39) | def main(sample_id, tsv_file):

FILE: flowcraft/templates/process_viral_assembly.py
  class Assembly (line 58) | class Assembly:
    method __init__ (line 79) | def __init__(self, assembly_file, min_contig_len, min_kmer_cov,
    method getORFs (line 127) | def getORFs(self, assembly, min_size):
    method _parse_coverage (line 144) | def _parse_coverage(header_str):
    method _parse_assembly (line 176) | def _parse_assembly(self, assembly_file):
    method _populate_contigs (line 244) | def _populate_contigs(self, contig_id, header, cov, sequence):
    method _get_gc_content (line 281) | def _get_gc_content(sequence, length):
    method _test_truth (line 312) | def _test_truth(x, op, y):
    method filter_contigs (line 344) | def filter_contigs(self, *comparisons):
    method get_assembly_length (line 393) | def get_assembly_length(self):
    method write_assembly (line 407) | def write_assembly(self, output_file, filtered=True):
    method write_report (line 431) | def write_report(self, output_file):
  function main (line 451) | def main(sample_id, assembly_file, minsize):

FILE: flowcraft/templates/skesa.py
  function __get_version_skesa (line 50) | def __get_version_skesa():
  function clean_up (line 84) | def clean_up(fastq):
  function main (line 104) | def main(sample_id, fastq_pair, clear):

FILE: flowcraft/templates/spades.py
  function __get_version_spades (line 62) | def __get_version_spades():
  function set_kmers (line 102) | def set_kmers(kmer_opt, max_read_len):
  function clean_up (line 148) | def clean_up(fastq):
  function main (line 168) | def main(sample_id, fastq_pair, max_len, kmer, opts, clear, disable_rr):

FILE: flowcraft/templates/split_fasta.py
  function main (line 51) | def main(sample_id, assembly, min_size):

FILE: flowcraft/templates/trimmomatic.py
  function __get_version_trimmomatic (line 70) | def __get_version_trimmomatic():
  function parse_log (line 113) | def parse_log(log_file):
  function write_report (line 182) | def write_report(storage_dic, output_file, sample_id):
  function trimmomatic_log (line 226) | def trimmomatic_log(log_file, sample_id):
  function clean_up (line 242) | def clean_up(fastq_pairs, clear):
  function merge_default_adapters (line 265) | def merge_default_adapters():
  function main (line 287) | def main(sample_id, fastq_pair, trim_range, trim_opts, phred, adapters_f...

FILE: flowcraft/templates/trimmomatic_report.py
  function parse_log (line 48) | def parse_log(log_file):
  function write_report (line 117) | def write_report(storage_dic, output_file, sample_id):
  function main (line 164) | def main(log_files):

FILE: flowcraft/tests/test_assemblerflow.py
  function tmp (line 10) | def tmp():
  function test_check (line 17) | def test_check():
  function test_check_invalid (line 26) | def test_check_invalid():
  function test_build_file (line 35) | def test_build_file(tmp):
  function test_build_file_2 (line 45) | def test_build_file_2(tmp):
  function test_build_recipe (line 61) | def test_build_recipe(tmp):
  function test_build_recipe_innuendo (line 71) | def test_build_recipe_innuendo(tmp):

FILE: flowcraft/tests/test_broadcast.py
  function test_empty_log (line 8) | def test_empty_log():
  function test_no_path_in_log (line 14) | def test_no_path_in_log():
  function test_path_in_log (line 20) | def test_path_in_log():
  function test_regex_in_log (line 27) | def test_regex_in_log():

FILE: flowcraft/tests/test_engine.py
  function single_con (line 15) | def single_con():
  function single_status (line 27) | def single_status():
  function single_con_fasta (line 36) | def single_con_fasta():
  function single_con_multi_raw (line 45) | def single_con_multi_raw():
  function implicit_link (line 56) | def implicit_link():
  function implicit_link_2 (line 71) | def implicit_link_2():
  function single_fork (line 84) | def single_fork():
  function raw_forks (line 101) | def raw_forks():
  function multi_forks (line 116) | def multi_forks():
  function test_simple_init (line 141) | def test_simple_init():
  function test_invalid_process (line 156) | def test_invalid_process():
  function test_connections_single_process_channels (line 165) | def test_connections_single_process_channels(single_con):
  function test_connections_invalid (line 175) | def test_connections_invalid():
  function test_connections_ignore_type (line 187) | def test_connections_ignore_type():
  function test_build_header (line 198) | def test_build_header(single_con):
  function test_connections_nofork (line 205) | def test_connections_nofork(single_con):
  function test_connections_singlefork (line 210) | def test_connections_singlefork(single_fork):
  function test_connections_rawfork (line 215) | def test_connections_rawfork(raw_forks):
  function test_connections_multiforks (line 220) | def test_connections_multiforks(multi_forks):
  function test_connections_no_fork_channel_update (line 225) | def test_connections_no_fork_channel_update(single_con):
  function test_connections_fork_channel_update (line 232) | def test_connections_fork_channel_update(single_fork):
  function test_connections_channel_update (line 239) | def test_connections_channel_update(single_con):
  function test_connections_channel_update_wfork (line 247) | def test_connections_channel_update_wfork(single_fork):
  function test_connections_channel_update_wfork_2 (line 257) | def test_connections_channel_update_wfork_2(single_fork):
  function test_connections_channel_update_wfork_3 (line 265) | def test_connections_channel_update_wfork_3(single_fork):
  function test_set_channels_single_con_raw_fastq (line 274) | def test_set_channels_single_con_raw_fastq(single_con):
  function test_set_channels_single_con_raw_fasta (line 284) | def test_set_channels_single_con_raw_fasta(single_con_fasta):
  function test_set_channels_multi_raw_input (line 295) | def test_set_channels_multi_raw_input(single_con_multi_raw):
  function test_set_channels_secondary_channels_nolink (line 306) | def test_set_channels_secondary_channels_nolink(single_con):
  function test_set_channels_secondary_chanels_link (line 313) | def test_set_channels_secondary_chanels_link(multi_forks):
  function test_set_secondary_inputs_raw_forks (line 323) | def test_set_secondary_inputs_raw_forks(raw_forks):
  function test_set_secondary_inputs_multi_raw (line 336) | def test_set_secondary_inputs_multi_raw(single_con_multi_raw):
  function test_set_secondary_channels (line 346) | def test_set_secondary_channels(multi_forks):
  function test_set_secondary_channels_2 (line 362) | def test_set_secondary_channels_2(multi_forks):
  function test_set_implicit_link (line 374) | def test_set_implicit_link(implicit_link):
  function test_set_implicit_link (line 384) | def test_set_implicit_link(implicit_link_2):
  function test_set_status_channels_multi (line 394) | def test_set_status_channels_multi(single_con):
  function test_set_status_channels_single (line 407) | def test_set_status_channels_single(single_status):
  function test_set_compiler_channels (line 418) | def test_set_compiler_channels(single_status):
  function test_set_status_channels_no_status (line 430) | def test_set_status_channels_no_status(single_status):
  function test_set_status_channels_duplicate_status (line 442) | def test_set_status_channels_duplicate_status(single_status):
  function test_build (line 452) | def test_build(multi_forks):
  function test_resources_string (line 459) | def test_resources_string(single_con):
  function test_resources_string_2 (line 469) | def test_resources_string_2(single_con):
  function test_resources_string_3 (line 479) | def test_resources_string_3(single_con):
  function test_container_string (line 491) | def test_container_string(single_con):
  function test_container_string_2 (line 501) | def test_container_string_2(single_con):
  function test_extra_inputs_1 (line 513) | def test_extra_inputs_1():
  function test_extra_inputs_2 (line 525) | def test_extra_inputs_2():
  function test_extra_inputs_3 (line 540) | def test_extra_inputs_3():
  function test_extra_inputs_default (line 556) | def test_extra_inputs_default():
  function test_extra_inputs_invalid (line 575) | def test_extra_inputs_invalid():
  function test_extra_inputs_invalid_2 (line 588) | def test_extra_inputs_invalid_2():
  function test_run_time_directives (line 604) | def test_run_time_directives():
  function test_run_time_directives_full (line 616) | def test_run_time_directives_full():
  function test_run_time_directives_invalid (line 634) | def test_run_time_directives_invalid():
  function test_not_automatic_dependency (line 645) | def test_not_automatic_dependency():
  function test_automatic_dependency (line 655) | def test_automatic_dependency():
  function test_automatic_dependency_2 (line 665) | def test_automatic_dependency_2():
  function test_automatic_dependency_3 (line 675) | def test_automatic_dependency_3():
  function test_automatic_dependency_wfork (line 686) | def test_automatic_dependency_wfork():
  function test_automatic_dependency_wfork_2 (line 698) | def test_automatic_dependency_wfork_2():
  function test_automatic_dependency_wfork_3 (line 711) | def test_automatic_dependency_wfork_3():
  function test_automatic_dependency_wfork_4 (line 727) | def test_automatic_dependency_wfork_4():
  function test_automatic_dependency_multi (line 743) | def test_automatic_dependency_multi():
  function test_automatic_dependency_non_raw (line 756) | def test_automatic_dependency_non_raw():
  function test_patlas_compiler_channels (line 768) | def test_patlas_compiler_channels():
  function test_patlas_compiler_channels_2 (line 783) | def test_patlas_compiler_channels_2():
  function test_patlas_compiler_channels_empty (line 796) | def test_patlas_compiler_channels_empty():

FILE: flowcraft/tests/test_pipeline_parser.py
  function test_get_lanes (line 8) | def test_get_lanes():
  function test_linear_connection (line 29) | def test_linear_connection():
  function test_two_fork_connection (line 56) | def test_two_fork_connection():
  function test_two_fork_connection_mismatch_lane (line 87) | def test_two_fork_connection_mismatch_lane():
  function test_multi_fork_connection (line 119) | def test_multi_fork_connection():
  function test_linear_lane_connection (line 158) | def test_linear_lane_connection():
  function test_linear_multi_lane_connection (line 182) | def test_linear_multi_lane_connection():
  function test_get_source_lane (line 206) | def test_get_source_lane():
  function test_get_source_lane_2 (line 223) | def test_get_source_lane_2():
  function test_parse_pipeline (line 244) | def test_parse_pipeline():
  function test_parse_pipeline_file (line 251) | def test_parse_pipeline_file():
  function test_unique_id_len (line 264) | def test_unique_id_len():
  function test_remove_id (line 284) | def test_remove_id():

FILE: flowcraft/tests/test_process_details.py
  function test_color_print (line 12) | def test_color_print():
  function test_long_list (line 20) | def test_long_list():
  function test_short_list (line 30) | def test_short_list():

FILE: flowcraft/tests/test_processes.py
  function mock_process (line 17) | def mock_process():
  function process_wchannels (line 23) | def process_wchannels():
  function mock_status (line 34) | def mock_status():
  function mock_patlas_compiler (line 39) | def mock_patlas_compiler():
  function mock_init (line 45) | def mock_init():
  function test_process_init (line 50) | def test_process_init():
  function test_set_correct_template (line 59) | def test_set_correct_template(mock_process):
  function test_set_wrong_template (line 66) | def test_set_wrong_template(mock_process):
  function test_template_render_empty (line 72) | def test_template_render_empty(mock_process):
  function test_template_render (line 78) | def test_template_render(process_wchannels):
  function test_main_channel_setup (line 86) | def test_main_channel_setup(mock_process):
  function test_main_raw_channel_self (line 95) | def test_main_raw_channel_self(mock_process):
  function test_main_raw_channel_fastq (line 106) | def test_main_raw_channel_fastq(mock_process):
  function test_main_raw_channel_fasta (line 114) | def test_main_raw_channel_fasta(mock_process):
  function test_main_raw_channel_invalid (line 122) | def test_main_raw_channel_invalid(mock_process):
  function test_channels_setup (line 129) | def test_channels_setup(process_wchannels):
  function test_channels_setup_withforks (line 143) | def test_channels_setup_withforks(process_wchannels):
  function test_setup_one_raw_fork (line 159) | def test_setup_one_raw_fork(process_wchannels):
  function test_setup_multiple_raw_forks (line 174) | def test_setup_multiple_raw_forks(process_wchannels):
  function test_channels_setup_status (line 189) | def test_channels_setup_status(process_wchannels):
  function test_update_main_fork_noprevious (line 199) | def test_update_main_fork_noprevious(process_wchannels):
  function test_secondary_channels_multisink (line 213) | def test_secondary_channels_multisink(process_wchannels):
  function test_secondary_channels_singlesink (line 222) | def test_secondary_channels_singlesink(process_wchannels):
  function test_secondary_channels_duplicatesink (line 231) | def test_secondary_channels_duplicatesink(process_wchannels):
  function test_status_init (line 240) | def test_status_init(mock_status):
  function test_status_channel_setup_empty (line 245) | def test_status_channel_setup_empty(mock_status):
  function test_status_channel_single (line 251) | def test_status_channel_single(mock_status):
  function test_status_channel_two (line 258) | def test_status_channel_two(mock_status):
  function test_status_channel_multiple (line 265) | def test_status_channel_multiple(mock_status):
  function test_init_process (line 272) | def test_init_process(mock_init):
  function test_init_raw_inputs_single (line 277) | def test_init_raw_inputs_single(mock_init):
  function test_init_raw_inputs_multi_forks (line 287) | def test_init_raw_inputs_multi_forks(mock_init):
  function test_init_multi_raw_inputs (line 297) | def test_init_multi_raw_inputs(mock_init):
  function test_init_secondary_inputs (line 312) | def test_init_secondary_inputs(mock_init):
  function test_init_multi_secondary_inputs (line 321) | def test_init_multi_secondary_inputs(mock_init):
  function test_directive_update (line 331) | def test_directive_update():
  function test_directive_update2 (line 340) | def test_directive_update2():
  function test_directive_update3 (line 351) | def test_directive_update3():
  function test_directive_update4 (line 365) | def test_directive_update4():
  function test_join_compiler (line 379) | def test_join_compiler(mock_patlas_compiler):
  function test_join_compiler_one_channel (line 387) | def test_join_compiler_one_channel(mock_patlas_compiler):

FILE: flowcraft/tests/test_recipes.py
  function test_empty_recipe (line 11) | def test_empty_recipe():
  function test_empty_pipeline_str (line 19) | def test_empty_pipeline_str():
  function test_basic_recipe (line 29) | def test_basic_recipe():
  function test_recipe_wdirectives (line 41) | def test_recipe_wdirectives():
  function test_recipe_partial_directives (line 64) | def test_recipe_partial_directives():
  function test_recipe_partial_directives2 (line 83) | def test_recipe_partial_directives2():
  function test_component_str (line 102) | def test_component_str():
  function test_component_str2 (line 117) | def test_component_str2():
  function test_component_str3 (line 133) | def test_component_str3():
  function test_brew_recipe (line 153) | def test_brew_recipe():
  function test_bad_recipe_name (line 160) | def test_bad_recipe_name():
  function test_all_recipes (line 166) | def test_all_recipes():
  function test_innuendo_recipe (line 180) | def test_innuendo_recipe():
  function test_innuendo_partial_recipe (line 187) | def test_innuendo_partial_recipe():
  function test_list_recipes (line 194) | def test_list_recipes():
  function test_list_recipes_full (line 199) | def test_list_recipes_full():

FILE: flowcraft/tests/test_sanity.py
  function not_raises (line 13) | def not_raises(exception, msg):
  function test_empty_tasks (line 19) | def test_empty_tasks():
  function test_no_brackets_fail (line 30) | def test_no_brackets_fail():
  function test_number_of_forks_fail (line 41) | def test_number_of_forks_fail():
  function test_lane_char_fail (line 53) | def test_lane_char_fail():
  function test_final_char_fail (line 64) | def test_final_char_fail():
  function test_fork_no_proc_fail (line 76) | def test_fork_no_proc_fail():
  function test_double_fork_fail (line 88) | def test_double_fork_fail():
  function test_close_token_ending_fail (line 99) | def test_close_token_ending_fail():
  function test_inner_forks_fail (line 110) | def test_inner_forks_fail():
  function test_string_pass_all (line 121) | def test_string_pass_all():
  function test_string_spaces_pass_all (line 143) | def test_string_spaces_pass_all():
  function test_string_pass_all_wrapper (line 161) | def test_string_pass_all_wrapper():
Condensed preview — 328 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,162K chars).
[
  {
    "path": ".gitignore",
    "chars": 76,
    "preview": "# ignore ide folders\n.idea/\n.vscode/\n\n# ignore python generated files\n*.pyc\n"
  },
  {
    "path": ".gitmodules",
    "chars": 0,
    "preview": ""
  },
  {
    "path": ".travis.yml",
    "chars": 238,
    "preview": "language: python\n\npython:\n  - \"3.6\"\n\ninstall:\n  - pip install pytest\n  - pip install coverage\n  - pip install pytest-cov"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3353,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1413,
    "preview": "# Contributing to Assemblerflow\n\nThank you for your interest in contributing to Assemblerflow. All kinds of \ncontributio"
  },
  {
    "path": "LICENSE",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 11221,
    "preview": "# FlowCraft :whale2::package:\n\n![Nextflow version](https://img.shields.io/badge/nextflow->0.27.0-brightgreen.svg)\n![Pyth"
  },
  {
    "path": "changelog.md",
    "chars": 11344,
    "preview": "# Changelog\n\n## 1.4.2\n\n### New components\n\n- `Bwa`: align short paired-end sequencing reads to long reference sequences\n"
  },
  {
    "path": "docker/Dockerfile",
    "chars": 350,
    "preview": "FROM python:3.6-alpine3.7\nMAINTAINER Bruno Gonçalves <bfgoncalves@medicina.ulisboa.pt>\n\nRUN apk add --no-cache git\n\nWORK"
  },
  {
    "path": "docs/Makefile",
    "chars": 8335,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS   ?=\nSPHINXBUILD "
  },
  {
    "path": "docs/_static/custom.css",
    "chars": 163,
    "preview": "div.wy-side-nav-search, div.wy-nav-top {\n  background: #5c6bc0;\n}\n\n.wy-menu > .caption > .caption-text {\n  color: #5c6bc"
  },
  {
    "path": "docs/about/about.rst",
    "chars": 534,
    "preview": "About\n=====\n\nFlowCraft is developed by the Molecular `Microbiology and Infection Unit (UMMI) <http://darwin.phyloviz.net"
  },
  {
    "path": "docs/conf.py",
    "chars": 5659,
    "preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Templates documentation build configuration file, created by\n# sphinx"
  },
  {
    "path": "docs/dev/containers.rst",
    "chars": 2765,
    "preview": "Docker containers guidelines\n============================\n\nAll FlowCraft components require a docker container in order "
  },
  {
    "path": "docs/dev/create_process.rst",
    "chars": 28560,
    "preview": "Process creation guidelines\n===========================\n\nBasic process creation\n----------------------\n\nThe addition of "
  },
  {
    "path": "docs/dev/create_recipe.rst",
    "chars": 3156,
    "preview": "Recipe creation guidelines\n===========================\n\nRecipes are pre-made pipeline strings that may be associated wit"
  },
  {
    "path": "docs/dev/create_recipes.rst",
    "chars": 74,
    "preview": "Recipe creation guidelines\n==========================\n\nUnder construction."
  },
  {
    "path": "docs/dev/create_template.rst",
    "chars": 6865,
    "preview": "Template creation guidelines\n============================\n\nThough none of these guidelines are mandatory nor required, t"
  },
  {
    "path": "docs/dev/general_orientation.rst",
    "chars": 1885,
    "preview": "General orientation\n===================\n\nCodebase structure\n------------------\n\nThe most important elements of FlowCraft"
  },
  {
    "path": "docs/dev/pipeline_reporting.rst",
    "chars": 3908,
    "preview": "Pipeline reporting\n==================\n\nThis section describes how the reports of a FlowCraft pipeline are generated\nand "
  },
  {
    "path": "docs/dev/process_dotfiles.rst",
    "chars": 4667,
    "preview": ".. _dotfiles:\n\nDotfiles\n========\n\nSeveral dotfiles (files prefixed by a single ``.``, as in ``.status``) are\ncreated at "
  },
  {
    "path": "docs/dev/reports.rst",
    "chars": 5219,
    "preview": "Reports\n=======\n\nReport JSON specification\n-------------------------\n\nThe report JSON is quite flexibly on the informati"
  },
  {
    "path": "docs/flowcraft.flowcraft.rst",
    "chars": 150,
    "preview": "flowcraft\\.flowcraft module\n===========================\n\n.. automodule:: flowcraft.flowcraft\n    :members:\n    :undoc-me"
  },
  {
    "path": "docs/flowcraft.generator.components.annotation.rst",
    "chars": 220,
    "preview": "flowcraft\\.generator\\.components\\.annotation module\n===================================================\n\n.. automodule::"
  },
  {
    "path": "docs/flowcraft.generator.components.assembly.rst",
    "chars": 214,
    "preview": "flowcraft\\.generator\\.components\\.assembly module\n=================================================\n\n.. automodule:: flo"
  },
  {
    "path": "docs/flowcraft.generator.components.assembly_processing.rst",
    "chars": 249,
    "preview": "flowcraft\\.generator\\.components\\.assembly\\_processing module\n=========================================================="
  },
  {
    "path": "docs/flowcraft.generator.components.distance_estimation.rst",
    "chars": 249,
    "preview": "flowcraft\\.generator\\.components\\.distance\\_estimation module\n=========================================================="
  },
  {
    "path": "docs/flowcraft.generator.components.downloads.rst",
    "chars": 217,
    "preview": "flowcraft\\.generator\\.components\\.downloads module\n==================================================\n\n.. automodule:: f"
  },
  {
    "path": "docs/flowcraft.generator.components.metagenomics.rst",
    "chars": 226,
    "preview": "flowcraft\\.generator\\.components\\.metagenomics module\n=====================================================\n\n.. automodu"
  },
  {
    "path": "docs/flowcraft.generator.components.mlst.rst",
    "chars": 202,
    "preview": "flowcraft\\.generator\\.components\\.mlst module\n=============================================\n\n.. automodule:: flowcraft.g"
  },
  {
    "path": "docs/flowcraft.generator.components.patlas_mapping.rst",
    "chars": 234,
    "preview": "flowcraft\\.generator\\.components\\.patlas\\_mapping module\n========================================================\n\n.. au"
  },
  {
    "path": "docs/flowcraft.generator.components.reads_quality_control.rst",
    "chars": 257,
    "preview": "flowcraft\\.generator\\.components\\.reads\\_quality\\_control module\n======================================================="
  },
  {
    "path": "docs/flowcraft.generator.components.rst",
    "chars": 730,
    "preview": "flowcraft\\.generator\\.components package\n========================================\n\nSubmodules\n----------\n\n.. toctree::\n\n"
  },
  {
    "path": "docs/flowcraft.generator.components.typing.rst",
    "chars": 208,
    "preview": "flowcraft\\.generator\\.components\\.typing module\n===============================================\n\n.. automodule:: flowcra"
  },
  {
    "path": "docs/flowcraft.generator.engine.rst",
    "chars": 173,
    "preview": "flowcraft\\.generator\\.engine module\n===================================\n\n.. automodule:: flowcraft.generator.engine\n    "
  },
  {
    "path": "docs/flowcraft.generator.error_handling.rst",
    "chars": 199,
    "preview": "flowcraft\\.generator\\.error\\_handling module\n============================================\n\n.. automodule:: flowcraft.gen"
  },
  {
    "path": "docs/flowcraft.generator.footer_skeleton.rst",
    "chars": 202,
    "preview": "flowcraft\\.generator\\.footer\\_skeleton module\n=============================================\n\n.. automodule:: flowcraft.g"
  },
  {
    "path": "docs/flowcraft.generator.header_skeleton.rst",
    "chars": 202,
    "preview": "flowcraft\\.generator\\.header\\_skeleton module\n=============================================\n\n.. automodule:: flowcraft.g"
  },
  {
    "path": "docs/flowcraft.generator.inspect.rst",
    "chars": 176,
    "preview": "flowcraft\\.generator\\.inspect module\n====================================\n\n.. automodule:: flowcraft.generator.inspect\n "
  },
  {
    "path": "docs/flowcraft.generator.pipeline_parser.rst",
    "chars": 202,
    "preview": "flowcraft\\.generator\\.pipeline\\_parser module\n=============================================\n\n.. automodule:: flowcraft.g"
  },
  {
    "path": "docs/flowcraft.generator.process.rst",
    "chars": 176,
    "preview": "flowcraft\\.generator\\.process module\n====================================\n\n.. automodule:: flowcraft.generator.process\n "
  },
  {
    "path": "docs/flowcraft.generator.process_details.rst",
    "chars": 202,
    "preview": "flowcraft\\.generator\\.process\\_details module\n=============================================\n\n.. automodule:: flowcraft.g"
  },
  {
    "path": "docs/flowcraft.generator.recipe.rst",
    "chars": 173,
    "preview": "flowcraft\\.generator\\.recipe module\n===================================\n\n.. automodule:: flowcraft.generator.recipe\n    "
  },
  {
    "path": "docs/flowcraft.generator.rst",
    "chars": 614,
    "preview": "flowcraft\\.generator package\n============================\n\nSubpackages\n-----------\n\n.. toctree::\n\n    flowcraft.generato"
  },
  {
    "path": "docs/flowcraft.rst",
    "chars": 322,
    "preview": "flowcraft package\n=================\n\nSubpackages\n-----------\n\n.. toctree::\n\n    flowcraft.generator\n    flowcraft.templa"
  },
  {
    "path": "docs/flowcraft.templates.assembly_report.rst",
    "chars": 202,
    "preview": "flowcraft\\.templates\\.assembly\\_report module\n=============================================\n\n.. automodule:: flowcraft.t"
  },
  {
    "path": "docs/flowcraft.templates.fastqc.rst",
    "chars": 173,
    "preview": "flowcraft\\.templates\\.fastqc module\n===================================\n\n.. automodule:: flowcraft.templates.fastqc\n    "
  },
  {
    "path": "docs/flowcraft.templates.fastqc_report.rst",
    "chars": 196,
    "preview": "flowcraft\\.templates\\.fastqc\\_report module\n===========================================\n\n.. automodule:: flowcraft.templ"
  },
  {
    "path": "docs/flowcraft.templates.flowcraft_utils.flowcraft_base.rst",
    "chars": 251,
    "preview": "flowcraft\\.templates\\.flowcraft\\_utils\\.flowcraft\\_base module\n========================================================="
  },
  {
    "path": "docs/flowcraft.templates.flowcraft_utils.rst",
    "chars": 329,
    "preview": "flowcraft\\.templates\\.flowcraft\\_utils package\n==============================================\n\nSubmodules\n----------\n\n.."
  },
  {
    "path": "docs/flowcraft.templates.integrity_coverage.rst",
    "chars": 211,
    "preview": "flowcraft\\.templates\\.integrity\\_coverage module\n================================================\n\n.. automodule:: flowc"
  },
  {
    "path": "docs/flowcraft.templates.mapping2json.rst",
    "chars": 191,
    "preview": "flowcraft\\.templates\\.mapping2json module\n=========================================\n\n.. automodule:: flowcraft.templates"
  },
  {
    "path": "docs/flowcraft.templates.mashdist2json.rst",
    "chars": 194,
    "preview": "flowcraft\\.templates\\.mashdist2json module\n==========================================\n\n.. automodule:: flowcraft.templat"
  },
  {
    "path": "docs/flowcraft.templates.mashscreen2json.rst",
    "chars": 200,
    "preview": "flowcraft\\.templates\\.mashscreen2json module\n============================================\n\n.. automodule:: flowcraft.tem"
  },
  {
    "path": "docs/flowcraft.templates.megahit.rst",
    "chars": 176,
    "preview": "flowcraft\\.templates\\.megahit module\n====================================\n\n.. automodule:: flowcraft.templates.megahit\n "
  },
  {
    "path": "docs/flowcraft.templates.metaspades.rst",
    "chars": 185,
    "preview": "flowcraft\\.templates\\.metaspades module\n=======================================\n\n.. automodule:: flowcraft.templates.met"
  },
  {
    "path": "docs/flowcraft.templates.pATLAS_consensus_json.rst",
    "chars": 222,
    "preview": "flowcraft\\.templates\\.pATLAS\\_consensus\\_json module\n====================================================\n\n.. automodule"
  },
  {
    "path": "docs/flowcraft.templates.pipeline_status.rst",
    "chars": 202,
    "preview": "flowcraft\\.templates\\.pipeline\\_status module\n=============================================\n\n.. automodule:: flowcraft.t"
  },
  {
    "path": "docs/flowcraft.templates.process_abricate.rst",
    "chars": 205,
    "preview": "flowcraft\\.templates\\.process\\_abricate module\n==============================================\n\n.. automodule:: flowcraft"
  },
  {
    "path": "docs/flowcraft.templates.process_assembly.rst",
    "chars": 205,
    "preview": "flowcraft\\.templates\\.process\\_assembly module\n==============================================\n\n.. automodule:: flowcraft"
  },
  {
    "path": "docs/flowcraft.templates.process_assembly_mapping.rst",
    "chars": 231,
    "preview": "flowcraft\\.templates\\.process\\_assembly\\_mapping module\n=======================================================\n\n.. auto"
  },
  {
    "path": "docs/flowcraft.templates.rst",
    "chars": 976,
    "preview": "flowcraft\\.templates package\n============================\n\nSubpackages\n-----------\n\n.. toctree::\n\n    flowcraft.template"
  },
  {
    "path": "docs/flowcraft.templates.skesa.rst",
    "chars": 170,
    "preview": "flowcraft\\.templates\\.skesa module\n==================================\n\n.. automodule:: flowcraft.templates.skesa\n    :me"
  },
  {
    "path": "docs/flowcraft.templates.spades.rst",
    "chars": 173,
    "preview": "flowcraft\\.templates\\.spades module\n===================================\n\n.. automodule:: flowcraft.templates.spades\n    "
  },
  {
    "path": "docs/flowcraft.templates.trimmomatic.rst",
    "chars": 188,
    "preview": "flowcraft\\.templates\\.trimmomatic module\n========================================\n\n.. automodule:: flowcraft.templates.t"
  },
  {
    "path": "docs/flowcraft.templates.trimmomatic_report.rst",
    "chars": 211,
    "preview": "flowcraft\\.templates\\.trimmomatic\\_report module\n================================================\n\n.. automodule:: flowc"
  },
  {
    "path": "docs/flowcraft.tests.data_pipelines.rst",
    "chars": 187,
    "preview": "flowcraft\\.tests\\.data\\_pipelines module\n========================================\n\n.. automodule:: flowcraft.tests.data_"
  },
  {
    "path": "docs/flowcraft.tests.rst",
    "chars": 459,
    "preview": "flowcraft\\.tests package\n========================\n\nSubmodules\n----------\n\n.. toctree::\n\n   flowcraft.tests.data_pipeline"
  },
  {
    "path": "docs/flowcraft.tests.test_assemblerflow.rst",
    "chars": 199,
    "preview": "flowcraft\\.tests\\.test\\_assemblerflow module\n============================================\n\n.. automodule:: flowcraft.tes"
  },
  {
    "path": "docs/flowcraft.tests.test_engine.rst",
    "chars": 178,
    "preview": "flowcraft\\.tests\\.test\\_engine module\n=====================================\n\n.. automodule:: flowcraft.tests.test_engine"
  },
  {
    "path": "docs/flowcraft.tests.test_pipeline_parser.rst",
    "chars": 207,
    "preview": "flowcraft\\.tests\\.test\\_pipeline\\_parser module\n===============================================\n\n.. automodule:: flowcra"
  },
  {
    "path": "docs/flowcraft.tests.test_process_details.rst",
    "chars": 207,
    "preview": "flowcraft\\.tests\\.test\\_process\\_details module\n===============================================\n\n.. automodule:: flowcra"
  },
  {
    "path": "docs/flowcraft.tests.test_processes.rst",
    "chars": 187,
    "preview": "flowcraft\\.tests\\.test\\_processes module\n========================================\n\n.. automodule:: flowcraft.tests.test_"
  },
  {
    "path": "docs/flowcraft.tests.test_sanity.rst",
    "chars": 178,
    "preview": "flowcraft\\.tests\\.test\\_sanity module\n=====================================\n\n.. automodule:: flowcraft.tests.test_sanity"
  },
  {
    "path": "docs/getting_started/installation.rst",
    "chars": 2199,
    "preview": "Installation\n============\n\nUser installation\n-----------------\n\nFlowCraft is available as a bioconda package, which alre"
  },
  {
    "path": "docs/getting_started/overview.rst",
    "chars": 5831,
    "preview": "..    include:: <isonum.txt>\n\nOverview\n========\n\nFlowCraft is an assembler of pipelines written in  nextflow_ for\nanalys"
  },
  {
    "path": "docs/index.rst",
    "chars": 1083,
    "preview": ".. Templates documentation master file, created by\n   sphinx-quickstart on Thu Feb  8 09:51:21 2018.\n   You can adapt th"
  },
  {
    "path": "docs/make.bat",
    "chars": 7492,
    "preview": "@ECHO OFF\n\nREM Command file for Sphinx documentation\n\npushd %~dp0\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-bu"
  },
  {
    "path": "docs/setup.rst",
    "chars": 106,
    "preview": "setup module\n============\n\n.. automodule:: setup\n    :members:\n    :undoc-members:\n    :show-inheritance:\n"
  },
  {
    "path": "docs/user/available_components.rst",
    "chars": 5752,
    "preview": ".. _components:\n\nComponents\n==========\n\nThese are the currently available FlowCraft components with a short\ndescription "
  },
  {
    "path": "docs/user/basic_usage.rst",
    "chars": 16599,
    "preview": "Basic Usage\n===========\n\nFlowCraft has currently two execution modes, ``build`` and ``inspect``, that are\nused to build "
  },
  {
    "path": "docs/user/components/abricate.rst",
    "chars": 1371,
    "preview": "abricate\n========\n\nPurpose\n-------\n\nThis component performs anti-microbial gene screening using abricate. It\nincludes th"
  },
  {
    "path": "docs/user/components/assembly_mapping.rst",
    "chars": 1931,
    "preview": "assembly_mapping\n================\n\nPurpose\n-------\n\nThis component performs a mapping procedure of FastQ files using the"
  },
  {
    "path": "docs/user/components/bowtie.rst",
    "chars": 1463,
    "preview": "bowtie\n======\n\nPurpose\n-------\n\nThis component performs a mapping procedure of FastQ files with a given reference.\nThe p"
  },
  {
    "path": "docs/user/components/card_rgi.rst",
    "chars": 733,
    "preview": "card_rgi\n========\n\nPurpose\n-------\n\nThis component performs anti-microbial gene screening using CARD rgi.\nIt uses data f"
  },
  {
    "path": "docs/user/components/check_coverage.rst",
    "chars": 1494,
    "preview": "check_coverage\n==============\n\nPurpose\n-------\n\nThis components estimates the coverage of a given sample based on the nu"
  },
  {
    "path": "docs/user/components/chewbbaca.rst",
    "chars": 1935,
    "preview": "chewbbaca\n=========\n\nPurpose\n-------\n\nThis components runs the allele calling operation of ChewBBACA on a set\nof fasta s"
  },
  {
    "path": "docs/user/components/diamond.rst",
    "chars": 1286,
    "preview": "diamond\n=======\n\nPurpose\n-------\n\nThis component performs ``blastx`` or ``blastp`` with diamond. The database\nused by di"
  },
  {
    "path": "docs/user/components/downsample_fastq.rst",
    "chars": 1042,
    "preview": "downsample_fastq\n================\n\nPurpose\n-------\n\ndownsample_fastq uses seqtk to subsample fastq read data to a target"
  },
  {
    "path": "docs/user/components/fast_ani.rst",
    "chars": 978,
    "preview": "fast_ani\n========\n\nPurpose\n-------\n\nThis component performs pairwise comparisons between fastas,\ngiven a multifasta as i"
  },
  {
    "path": "docs/user/components/fasterq_dump.rst",
    "chars": 1337,
    "preview": "fasterq_dump\n============\n\nPurpose\n-------\n\nThis component downloads reads from the SRA public databases from a\nlist of "
  },
  {
    "path": "docs/user/components/fastqc.rst",
    "chars": 1848,
    "preview": "fastqc\n======\n\nPurpose\n-------\n\nThis components runs FastQC on paired-end FastQ files.\n\n.. note::\n    Software page: htt"
  },
  {
    "path": "docs/user/components/fastqc_trimmomatic.rst",
    "chars": 2430,
    "preview": "fastqc_trimmomatic\n==================\n\nPurpose\n-------\n\nThis component runs Trimmomatic on paired-end FastQ files but us"
  },
  {
    "path": "docs/user/components/filter_poly.rst",
    "chars": 930,
    "preview": "filter_poly\n===========\n\nPurpose\n-------\n\nThis component removes low complexity sequence from read data\nusing PrinSeq.\n\n"
  },
  {
    "path": "docs/user/components/integrity_coverage.rst",
    "chars": 2574,
    "preview": "integrity_coverage\n==================\n\nPurpose\n-------\n\nThis component is intended to test the integrity of the provided"
  },
  {
    "path": "docs/user/components/kraken.rst",
    "chars": 758,
    "preview": "kraken\n======\n\nPurpose\n-------\n\nThis component performs Kraken to assign taxonomic labels to short DNA\nsequences, usuall"
  },
  {
    "path": "docs/user/components/kraken2.rst",
    "chars": 855,
    "preview": "kraken2\n=======\n\nPurpose\n-------\n\nThis component performs Kraken2 to assign taxonomic labels to short DNA\nsequences, usu"
  },
  {
    "path": "docs/user/components/mapping_patlas.rst",
    "chars": 2060,
    "preview": "mapping_patlas\n==============\n\nPurpose\n-------\n\nThis component performs mapping (using `bowtie2` and `samtools`) against"
  },
  {
    "path": "docs/user/components/mash_dist.rst",
    "chars": 2280,
    "preview": "mash_dist\n=========\n\nPurpose\n-------\n\nThis component executes mash dist to find plasmids\nwithin high throughoput sequenc"
  },
  {
    "path": "docs/user/components/mash_screen.rst",
    "chars": 2001,
    "preview": "mash_screen\n===========\n\nPurpose\n-------\n\nThis component performes mash screen to find plasmids\ncontained in high throug"
  },
  {
    "path": "docs/user/components/mash_sketch_fasta.rst",
    "chars": 725,
    "preview": "mash_sketch_fasta\n=================\n\nPurpose\n-------\n\nThis component performs mash sketch for fasta input files.\n\n.. not"
  },
  {
    "path": "docs/user/components/mash_sketch_fastq.rst",
    "chars": 1208,
    "preview": "mash_sketch_fastq\n=================\n\nPurpose\n-------\n\nThis component performs mash sketch for fastq input files. These s"
  },
  {
    "path": "docs/user/components/maxbin2.rst",
    "chars": 1255,
    "preview": "maxbin2\n=======\n\nPurpose\n-------\n\nThis component is an automated binning algorithm to recover genomes from multiple meta"
  },
  {
    "path": "docs/user/components/megahit.rst",
    "chars": 1240,
    "preview": "megahit\n=======\n\nPurpose\n-------\n\nThis components assembles metagenomic paired-end FastQ files using the megahit assembl"
  },
  {
    "path": "docs/user/components/metamlst.rst",
    "chars": 807,
    "preview": "metamlst\n========\n\nPurpose\n-------\n\nChecks the ST of metagenomic reads using mlst.\n\n.. note::\n    Software page: https:/"
  },
  {
    "path": "docs/user/components/metaspades.rst",
    "chars": 1160,
    "preview": "metaspades\n==========\n\nPurpose\n-------\n\nThis components assembles metagenomic paired-end FastQ files using the metaSPAde"
  },
  {
    "path": "docs/user/components/midas_species.rst",
    "chars": 813,
    "preview": "midas_species\n=============\n\nPurpose\n-------\n\nThis component performs MIDAS to assign taxonomic labels fro species to sh"
  },
  {
    "path": "docs/user/components/mlst.rst",
    "chars": 791,
    "preview": "mlst\n====\n\nPurpose\n-------\n\nChecks the ST of an assembly using mlst.\n\n.. note::\n    Software page: https://github.com/ts"
  },
  {
    "path": "docs/user/components/momps.rst",
    "chars": 874,
    "preview": "momps\n========\n\nPurpose\n-------\n\nThis component performs Multi-Locus Sequence Typing (MLST) on Legionella pneumophila\nfr"
  },
  {
    "path": "docs/user/components/patho_typing.rst",
    "chars": 852,
    "preview": "patho_typing\n==========\n\nPurpose\n-------\n\nPatho_typing is a software for *in silico* pathogenic typing\ndirectly from raw"
  },
  {
    "path": "docs/user/components/pilon.rst",
    "chars": 1933,
    "preview": "pilon\n=====\n\nPurpose\n-------\n\nThis components Performs a mapping procedure of FastQ files into a their\nassembly and perf"
  },
  {
    "path": "docs/user/components/process_skesa.rst",
    "chars": 1491,
    "preview": "process_skesa\n==============\n\nPurpose\n-------\n\nThis components processes the assembly resulting from the Skesa software "
  },
  {
    "path": "docs/user/components/process_spades.rst",
    "chars": 1538,
    "preview": "process_spades\n==============\n\n\nPurpose\n-------\n\nThis components processes the assembly resulting from the Spades softwa"
  },
  {
    "path": "docs/user/components/prokka.rst",
    "chars": 1065,
    "preview": "prokka\n======\n\n\nPurpose\n-------\n\nThis component performs annotations using the annotations available in\n`prokka <https:/"
  },
  {
    "path": "docs/user/components/reads_download.rst",
    "chars": 1208,
    "preview": "reads_download\n==============\n\nPurpose\n-------\n\nThis component downloads reads from the SRA/ENA public databases from a\n"
  },
  {
    "path": "docs/user/components/remove_host.rst",
    "chars": 1229,
    "preview": "remove_host\n===========\n\nPurpose\n-------\n\nThis component performs a mapping procedure of FastQ files using a host\ngenome"
  },
  {
    "path": "docs/user/components/retrieve_mapped.rst",
    "chars": 900,
    "preview": "retrieve_mapped\n===============\n\nPurpose\n-------\n\nThis component retrieves the mapping reads of a previous bowtie mappin"
  },
  {
    "path": "docs/user/components/seq_typing.rst",
    "chars": 1403,
    "preview": "seq_typing\n==========\n\nPurpose\n-------\n\nSeq_typing is a software that determines the type of a given sample using a\nread"
  },
  {
    "path": "docs/user/components/sistr.rst",
    "chars": 810,
    "preview": "sistr\n=====\n\nPurpose\n-------\n\nSistr (Salmonella In Silico Typing Resource) is a software for Serovar\npredictions from wh"
  },
  {
    "path": "docs/user/components/skesa.rst",
    "chars": 871,
    "preview": "skesa\n=====\n\nPurpose\n-------\n\nThis components assembles paired-end FastQ files using the Skesa assembler.\n\nInput/Output "
  },
  {
    "path": "docs/user/components/spades.rst",
    "chars": 1382,
    "preview": "spades\n======\n\nPurpose\n-------\n\nThis components assembles paired-end FastQ files using the Spades assembler.\n\n.. note::\n"
  },
  {
    "path": "docs/user/components/trimmomatic.rst",
    "chars": 1844,
    "preview": "trimmomatic\n===========\n\nPurpose\n-------\n\nThis component runs Trimmomatic on paired-end FastQ files.\n\n.. note::\n    Soft"
  },
  {
    "path": "docs/user/pipeline_building.rst",
    "chars": 8970,
    "preview": "Pipeline building\n=================\n\nFlowCraft offers a few extra features when building pipelines using the\n``build`` e"
  },
  {
    "path": "docs/user/pipeline_configuration.rst",
    "chars": 1936,
    "preview": "Pipeline configuration\n======================\n\nWhen a nextflow pipeline is built with FlowCraft, a number of configurati"
  },
  {
    "path": "docs/user/pipeline_inspect.rst",
    "chars": 4116,
    "preview": "Pipeline inspection\n===================\n\nFlowCraft offers an ``inspect`` mode for tracking the progress of a nextflow\npi"
  },
  {
    "path": "docs/user/pipeline_reports.rst",
    "chars": 831,
    "preview": "Pipeline reports\n================\n\n.. include:: reports/abricate.rst\n.. include:: reports/assembly_mapping.rst\n.. includ"
  },
  {
    "path": "docs/user/reports/abricate.rst",
    "chars": 499,
    "preview": "abricate\n--------\n\nTable data\n^^^^^^^^^^\n\nAMR table:\n    - **<abricate database>**: Number of hits for a particular give"
  },
  {
    "path": "docs/user/reports/assembly_mapping.rst",
    "chars": 486,
    "preview": "assembly_mapping\n----------------\n\nPlot data\n^^^^^^^^^\n\n- **Data loss chart**: Gives a trend of the data loss\n  (in tota"
  },
  {
    "path": "docs/user/reports/check_coverage.rst",
    "chars": 515,
    "preview": "check_coverage\n--------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Coverage**: Estimated coverage base"
  },
  {
    "path": "docs/user/reports/chewbbaca.rst",
    "chars": 282,
    "preview": "chewbbaca\n---------\n\nTable data\n^^^^^^^^^^\n\nChewbbaca table:\n    - Table with the summary statistics of ChewBBACA allele"
  },
  {
    "path": "docs/user/reports/dengue_typing.rst",
    "chars": 210,
    "preview": "dengue_typing\n-------------\n\nTable data\n^^^^^^^^^^\n\nTyping table:\n    - **seqtyping**: The sequence typing result (serot"
  },
  {
    "path": "docs/user/reports/fastqc.rst",
    "chars": 1380,
    "preview": "fastqc\n------\n\nPlot data\n^^^^^^^^^\n\n- **Base sequence quality**: The average quality score across the read length.\n\n.. i"
  },
  {
    "path": "docs/user/reports/fastqc_trimmomatic.rst",
    "chars": 440,
    "preview": "fastqc_trimmomatic\n------------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Trimmed (%)**: Percentage o"
  },
  {
    "path": "docs/user/reports/integrity_coverage.rst",
    "chars": 846,
    "preview": "integrity_coverage\n------------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Raw BP**: Number of raw bas"
  },
  {
    "path": "docs/user/reports/mash_dist.rst",
    "chars": 449,
    "preview": "mash_dist\n---------\n\nTable data\n^^^^^^^^^^\n\nPlasmids table:\n    - **Mash Dist**: Number of plasmid hits\n\n.. image:: ../r"
  },
  {
    "path": "docs/user/reports/maxbin2.rst",
    "chars": 388,
    "preview": "maxbin2\n----\n\nTable data\n^^^^^^^^^^\n\nMetagenomic Binning (sample specific):\n    - **Bin name**: The number of bin.\n    -"
  },
  {
    "path": "docs/user/reports/mlst.rst",
    "chars": 231,
    "preview": "mlst\n----\n\nTable data\n^^^^^^^^^^\n\nTyping table:\n    - **MLST species**: The inferred species name.\n    - **MLST ST**: Th"
  },
  {
    "path": "docs/user/reports/patho_typing.rst",
    "chars": 197,
    "preview": "patho_typing\n------------\n\nTable data\n^^^^^^^^^^\n\nTyping table:\n    - **Patho_typing**: The pathotyping result.\n\n.. imag"
  },
  {
    "path": "docs/user/reports/pilon.rst",
    "chars": 907,
    "preview": "pilon\n-----\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Contigs**: Number of assembled contigs.\n    - **Assem"
  },
  {
    "path": "docs/user/reports/process_mapping.rst",
    "chars": 517,
    "preview": "process_mapping\n---------------\n\nTable data\n^^^^^^^^^^\n\nRead mapping table:\n    - **Reads**: Number reads in the the Fas"
  },
  {
    "path": "docs/user/reports/process_newick.rst",
    "chars": 200,
    "preview": "process_newick\n--------------\n\nTree data\n^^^^^^^^^^\n\nPhylogenetic reconstruction with bootstrap values for the provided "
  },
  {
    "path": "docs/user/reports/process_skesa.rst",
    "chars": 538,
    "preview": "process_skesa\n-------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Contigs (skesa)**: Number of assemble"
  },
  {
    "path": "docs/user/reports/process_spades.rst",
    "chars": 541,
    "preview": "process_spades\n-------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Contigs (spades)**: Number of assemb"
  },
  {
    "path": "docs/user/reports/process_viral_assembly.rst",
    "chars": 629,
    "preview": "process_viral_assembly\n----------------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Contigs (SPAdes)**:"
  },
  {
    "path": "docs/user/reports/seq_typing.rst",
    "chars": 177,
    "preview": "seq_typing\n----------\n\nTable data\n^^^^^^^^^^\n\nTyping table:\n    - **seqtyping**: The sequence typing result.\n\n.. image::"
  },
  {
    "path": "docs/user/reports/sistr.rst",
    "chars": 163,
    "preview": "sistr\n-----\n\nTable data\n^^^^^^^^^^\n\nTyping table:\n    - **sistr**: The sequence typing result.\n\n.. image:: ../resources/"
  },
  {
    "path": "docs/user/reports/trimmomatic.rst",
    "chars": 409,
    "preview": "trimmomatic\n-----------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **Trimmed (%)**: Percentage of trimmed base"
  },
  {
    "path": "docs/user/reports/true_coverage.rst",
    "chars": 359,
    "preview": "true_coverage\n-------------\n\nTable data\n^^^^^^^^^^\n\nQuality control table:\n    - **True Coverage**: Estimated coverage b"
  },
  {
    "path": "flowcraft/__init__.py",
    "chars": 254,
    "preview": "\n__version__ = \"1.4.2\"\n__build__ = \"18062019\"\n__author__ = \"Diogo N. Silva, Tiago F. Jesus, Ines Mendes, Bruno Ribeiro-G"
  },
  {
    "path": "flowcraft/bin/final_POST.sh",
    "chars": 365,
    "preview": "#!/usr/bin/env sh\n\nst=$(cat $(pwd)/.status)\n\njson=\"{'project_id':'$1','pipeline_id':'$2','process_id':'$3','run_info':'N"
  },
  {
    "path": "flowcraft/bin/merge_json.py",
    "chars": 2807,
    "preview": "#!/usr/bin/env python3\n\nimport sys\nimport json\n\ncore_file, f1, f2 = sys.argv[1:4]\n\ntry:\n    sample_id = sys.argv[4]\nexce"
  },
  {
    "path": "flowcraft/bin/metadata_POST.sh",
    "chars": 945,
    "preview": "#!/usr/bin/env sh\n\nset -ex\n\nprojectid=$1\npipelineid=$2\nprocessid=$3\nsample=$4\nurl=$5\nusername=$6\nuserid=$7\ntask=$8\nspeci"
  },
  {
    "path": "flowcraft/bin/parse_fasta.py",
    "chars": 1815,
    "preview": "#!/usr/bin/env python3\n\n\nimport argparse\nfrom itertools import groupby\nimport os\n\n\ndef replace_char(text):\n    for ch in"
  },
  {
    "path": "flowcraft/bin/parse_true_coverage.py",
    "chars": 1230,
    "preview": "#!/usr/bin/env python\n\nimport sys\nimport json\n\n\ndef parse_true_coverage(report_json, fail_json=None):\n\n    with open(rep"
  },
  {
    "path": "flowcraft/bin/prepare_reports.py",
    "chars": 2779,
    "preview": "#!/usr/bin/env python3\n\nimport sys\nimport json\nimport logging\n\nfrom os.path import dirname, abspath\n\nlogger = logging.ge"
  },
  {
    "path": "flowcraft/bin/renamePE_samtoolsFASTQ.py",
    "chars": 5143,
    "preview": "#!/usr/bin/env python2\n\n#TODO - change to py3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nrenamePE_samtoolsFASTQ.py - Rename the fastq "
  },
  {
    "path": "flowcraft/bin/report_POST.sh",
    "chars": 1549,
    "preview": "#!/usr/bin/env sh\n\nset -ex\n\nprojectid=$1\npipelineid=$2\nprocessid=$3\nsample=$4\nurl=$5\nusername=$6\nuserid=$7\ntask=$8\nspeci"
  },
  {
    "path": "flowcraft/bin/set_dotfiles.sh",
    "chars": 72,
    "preview": "#!/usr/bin/env bash\n\ntouch .status .warning .fail .report.json .versions"
  },
  {
    "path": "flowcraft/bin/startup_POST.sh",
    "chars": 309,
    "preview": "#!/usr/bin/env bash\n\njson=\"{'project_id':'$1','pipeline_id':'$2','process_id':'$3','run_property':'log_file,status','run"
  },
  {
    "path": "flowcraft/flowcraft.py",
    "chars": 16253,
    "preview": "#!/usr/bin/env python3\n\nimport os\nimport sys\nimport shutil\nimport logging\nimport argparse\nimport logging.config\n\nfrom di"
  },
  {
    "path": "flowcraft/generator/__init__.py",
    "chars": 45,
    "preview": "\"\"\"\nPlaceholder for Process creation docs\n\"\"\""
  },
  {
    "path": "flowcraft/generator/components/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "flowcraft/generator/components/alignment.py",
    "chars": 1690,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/annotation.py",
    "chars": 5757,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/assembly.py",
    "chars": 8727,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/assembly_processing.py",
    "chars": 8690,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/distance_estimation.py",
    "chars": 6911,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/downloads.py",
    "chars": 2417,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/mapping.py",
    "chars": 6866,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/metagenomics.py",
    "chars": 16051,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/mlst.py",
    "chars": 5326,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/patlas_mapping.py",
    "chars": 2386,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/phylogeny.py",
    "chars": 1738,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/reads_quality_control.py",
    "chars": 12910,
    "preview": "\ntry:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n"
  },
  {
    "path": "flowcraft/generator/components/typing.py",
    "chars": 5258,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/components/variant_calling.py",
    "chars": 1392,
    "preview": "try:\n    from generator.process import Process\nexcept ImportError:\n    from flowcraft.generator.process import Process\n\n"
  },
  {
    "path": "flowcraft/generator/engine.py",
    "chars": 60128,
    "preview": "import os\nimport sys\nimport json\nimport jinja2\nimport shutil\nimport logging\nimport requests\n\nfrom collections import def"
  },
  {
    "path": "flowcraft/generator/error_handling.py",
    "chars": 922,
    "preview": "class ProcessError(Exception):\n    def __init__(self, value):\n        self.value = value\n\n    def __str__(self):\n       "
  },
  {
    "path": "flowcraft/generator/footer_skeleton.py",
    "chars": 420,
    "preview": "footer = \"\"\"\nworkflow.onComplete {\n  // Display complete message\n  log.info \"Completed at: \" + workflow.complete\n  log.i"
  },
  {
    "path": "flowcraft/generator/header_skeleton.py",
    "chars": 1075,
    "preview": "header = \"\"\"#!/usr/bin/env nextflow\n\nimport Helper\nimport CollectInitialMetadata\n\n// Pipeline version\nif (workflow.commi"
  },
  {
    "path": "flowcraft/generator/inspect.py",
    "chars": 54224,
    "preview": "import re\nimport os\nimport sys\nimport uuid\nimport time\nimport curses\nimport signal\nimport locale\nimport socket\nimport lo"
  },
  {
    "path": "flowcraft/generator/pipeline_parser.py",
    "chars": 24663,
    "preview": "import os\nimport logging\nimport re\nfrom difflib import SequenceMatcher\n\ntry:\n    from generator.error_handling import Sa"
  },
  {
    "path": "flowcraft/generator/process.py",
    "chars": 29967,
    "preview": "import os\nimport jinja2\nimport logging\n\nfrom os.path import dirname, join, abspath\n\ntry:\n    import generator.error_hand"
  },
  {
    "path": "flowcraft/generator/process_collector.py",
    "chars": 1593,
    "preview": "import re\nimport pkgutil\n\ntry:\n    from generator import components\nexcept ImportError:\n    from flowcraft.generator imp"
  },
  {
    "path": "flowcraft/generator/process_details.py",
    "chars": 5584,
    "preview": "import logging\nimport sys\n\nlogger = logging.getLogger(\"main.{}\".format(__name__))\n\nCOLORS = {\n    \"green_bold\": \"1;32m\","
  },
  {
    "path": "flowcraft/generator/recipe.py",
    "chars": 25835,
    "preview": "try:\n    from generator.process_details import colored_print\n    import generator.error_handling as eh\n    from generato"
  },
  {
    "path": "flowcraft/generator/recipes/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "flowcraft/generator/recipes/denim.py",
    "chars": 1754,
    "preview": "try:\n    from generator.recipe import Recipe\nexcept ImportError:\n    from flowcraft.generator.recipe import Recipe\n\n\ncla"
  },
  {
    "path": "flowcraft/generator/recipes/innuca.py",
    "chars": 1126,
    "preview": "try:\n    from generator.recipe import Recipe\nexcept ImportError:\n    from flowcraft.generator.recipe import Recipe\n\n\ncla"
  },
  {
    "path": "flowcraft/generator/recipes/plasmids.py",
    "chars": 2698,
    "preview": "try:\n    from generator.recipe import Recipe\nexcept ImportError:\n    from flowcraft.generator.recipe import Recipe\n\n\ncla"
  },
  {
    "path": "flowcraft/generator/report.py",
    "chars": 18164,
    "preview": "import os\nimport re\nimport sys\nimport json\nimport uuid\nimport signal\nimport socket\nimport hashlib\nimport logging\nimport "
  },
  {
    "path": "flowcraft/generator/templates/Helper.groovy",
    "chars": 3092,
    "preview": "class Help {\n\n    static def start_info(Map info, String time, String profile) {\n\n        println \"\"\n        println \"=="
  },
  {
    "path": "flowcraft/generator/templates/abricate.nf",
    "chars": 2166,
    "preview": "if ( params.abricateDataDir{{ param_id }} ){\n    if ( !file(params.abricateDataDir{{ param_id }}).exists() ){\n        ex"
  },
  {
    "path": "flowcraft/generator/templates/abyss.nf",
    "chars": 746,
    "preview": "process abyss_{{ pid }} {\n    {% include \"post.txt\" ignore missing %}\n\n    tag { sample_id }\n    publishDir 'results/ass"
  },
  {
    "path": "flowcraft/generator/templates/assembly_mapping.nf",
    "chars": 3894,
    "preview": "if ( !params.minAssemblyCoverage{{ param_id }}.toString().isNumber() ){\n    if (params.minAssemblyCoverage{{ param_id }}"
  },
  {
    "path": "flowcraft/generator/templates/bandage.nf",
    "chars": 1328,
    "preview": "// True when a GFA secondary channel is connected to this component.\nhas_gfa1_{{pid}} = binding.hasVariable('gfa1_{{pid}"
  },
  {
    "path": "flowcraft/generator/templates/base_recalibrator.nf",
    "chars": 2874,
    "preview": "baseRecalibratorFasta_{{ pid }} = Channel.value(params.reference{{ param_id }}.split(\"/\").last())\nbaseRecalibratorRef_{{"
  },
  {
    "path": "flowcraft/generator/templates/bcalm.nf",
    "chars": 983,
    "preview": "// Check parameter\nif ( !params.bcalmKmerSize{{ param_id }}.toString().isNumber() ){\n    exit 1, \"'bcalmKmerSize{{ param"
  },
  {
    "path": "flowcraft/generator/templates/bowtie.nf",
    "chars": 3267,
    "preview": "// Check for the presence of absence of both index and fasta reference\nif (params.index{{ param_id }} == null && params."
  },
  {
    "path": "flowcraft/generator/templates/bwa.nf",
    "chars": 938,
    "preview": "bwaIndexId_{{ pid }} = Channel.value(params.bwaIndex{{ param_id }}.split(\"/\").last())\nbwaIndex_{{ pid }} = Channel.fromP"
  }
]

// ... and 128 more files (download for full content)

About this extraction

This page contains the full source code of the assemblerflow/flowcraft GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 328 files (1.0 MB), approximately 260.6k tokens, and a symbol index with 662 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!