nextflow_generator module¶
-
class
nextflow_generator.
NextflowGenerator
(process_list, nextflow_file, process_ids=None)[source]¶ Bases:
object
Methods
build
()Main pipeline builder -
process_map
= {'check_coverage': <class 'generator.Process.CheckCoverage'>, 'patho_typing': <class 'generator.Process.PathoTyping'>, 'seq_typing': <class 'generator.Process.SeqTyping'>, 'trace_compiler': <class 'generator.Process.TraceCompiler'>, 'mlst': <class 'generator.Process.Mlst'>, 'integrity_coverage': <class 'generator.Process.IntegrityCoverage'>, 'trimmomatic': <class 'generator.Process.Trimmomatic'>, 'fastqc': <class 'generator.Process.FastQC'>, 'status_compiler': <class 'generator.Process.StatusCompiler'>, 'abricate': <class 'generator.Process.Abricate'>, 'pilon': <class 'generator.Process.Pilon'>, 'assembly_mapping': <class 'generator.Process.AssemblyMapping'>, 'chewbbaca': <class 'generator.Process.Chewbbaca'>, 'fastqc_trimmomatic': <class 'generator.Process.FastqcTrimmomatic'>, 'spades': <class 'generator.Process.Spades'>, 'process_spades': <class 'generator.Process.ProcessSpades'>, 'prokka': <class 'generator.Process.Prokka'>}¶ dict: Maps the process ids to the corresponding template interface class
-
processes
= None¶ list: Stores the process interfaces in the specified order
-
nf_file
= None¶ str: Path to file where the pipeline will be generated
-
template
= None¶ str: String that will harbour the pipeline code
-
secondary_channels
= None¶ dict: Stores secondary channel links
-
status_channels
= None¶ list: Stores the status channels from each process
-
_check_pipeline_requirements
()[source]¶ Checks for some pipeline requirements before building
Currently, the only hard requirement is that the pipeline must start with the integrity_coverage process, in order to evaluate if the input FastQ are corrupt or not.
Besides this requirements, it checks for the existence the dependencies for all processes.
-
_set_channels
()[source]¶ Sets the main channels for the pipeline
The setup of the main channels follows four main steps for each process specified in the
NextflowGenerator.processes
attribute:- (If not the first process) Checks if the input of the current
process is compatible with the output of the previous process. - Checks if the current process has starts any secondary channels. If so, populate the
NextflowGenerator.secondary_channels
with the name of the link start, the process class and a list to harbour potential receiving ends. - Checks if the current process receives from any secondary channels. If a corresponding secondary link has been previously set, it will populate theNextflowGenerator.secondary_channels
attribute with the receiving channels. - Sets the main channels by providing the process ID.Notes
On the secondary channel setup: With this approach, there can only be one secondary link start for each type of secondary link. For instance, If there are two processes that start a secondary channel for the
SIDE_max_len
channel, only the last one will be recorded, and all receiving processes will get the channel from the latest process.
-
_set_secondary_channels
()[source]¶ Sets the secondary channels for the pipeline
This will iterate over the
NextflowGenerator.secondary_channels
dictionary that is populated when executingNextflowGenerator._set_channels()
method.
-
build
()[source]¶ Main pipeline builder
This method is responsible for building the
NextflowGenerator.template
attribute that will contain the nextflow code of the pipeline.First it builds the header, then sets the main channels, the secondary channels and finally the status channels. When the pipeline is built, is writes the code to a nextflow file.
-