nextflow.command
- nextflow.command.create_process_execution_from_line(line, cached=False)
Creates a process execution from a line of the log file in which its submission (or previous caching) is reported.
- Parameters:
line (str) – a line from the log file.
cached (bool) – whether the process is cached.
- Return type:
nextflow.models.ProcessExecution
- nextflow.command.get_execution(execution_path, log_path, nextflow_command, execution=None, log_start=0)
Creates an execution object from a location. If you are polling, you can pass in the previous execution to update it with new information.
- Parameters:
execution_path (str) – the location of the execution.
log_path (str) – the location of the log.
nextflow_command (str) – the command used to run the pipeline.
execution (nextflow.models.Execution) – the existing execution, if any.
log_start (int) – the number of lines already read from the log.
- Return type:
nextflow.models.Execution
- nextflow.command.get_initial_process_executions(log, execution)
Parses a section of a log file and looks for new process executions not currently in the list, or uncompleted ones which can now be completed. Some attributes are not yet filled in.
The identifiers of the proccess executions seen are returned.
- Parameters:
log (str) – a section of the log file.
execution (nextflow.models.Execution) – the containing execution.
- Return type:
tuple
- nextflow.command.make_nextflow_command(run_path, output_path, log_path, pipeline_path, resume, version, configs, params, profiles, timezone, report, timeline, dag, trace)
Generates the nextflow run commmand.
- Parameters:
run_path (str) – the location to run the pipeline in.
output_path (str) – the location to store the output in.
log_path (str) – the location to store the log in.
pipeline_path (str) – the absolute path to the pipeline .nf file.
resume (bool) – whether to resume an existing execution.
version (str) – the nextflow version to use.
configs (list) – any config files to be applied.
params (dict) – the parameters to pass.
profiles (list) – any profiles to be applied.
timezone (str) – the timezone to use.
report (str) – the filename to use for the execution report.
timeline (str) – the filename to use for the timeline report.
dag (str) – the filename to use for the DAG report.
trace (str) – the filename to use for the trace report.
- Return type:
str
- nextflow.command.make_nextflow_command_config_string(configs)
Creates the config setting portion of the nextflow run command string. Absolute paths are recommended.
- Parameters:
version (str) – the nextflow version to use.
- Return type:
str
- nextflow.command.make_nextflow_command_env_string(version, timezone, output_path, run_path)
Creates the environment variable setting portion of the nextflow run command string.
- Parameters:
version (str) – the nextflow version to use.
timezone (str) – the timezone to use.
output_path (str) – the location to store the output in.
- Return type:
str
- nextflow.command.make_nextflow_command_log_string(log_path, run_path)
Creates the log setting portion of the nextflow run command string.
- Parameters:
log_path (str) – the location to store the log file in.
- Return type:
str
- nextflow.command.make_nextflow_command_params_string(params)
Creates the parameter setting portion of the nextflow run command
- Parameters:
params (dict) – the parameters to pass.
- Return type:
str
- nextflow.command.make_nextflow_command_profiles_string(profiles)
Creates the profile setting portion of the nextflow run command string.
- Parameters:
profiles (list) – any profiles to be applied.
- Return type:
str
- nextflow.command.make_nextflow_command_resume_string(resume)
Creates the resume setting portion of the nextflow run command string.
- Parameters:
resume – whether to resume an existing execution.
- Return type:
str
- nextflow.command.make_or_update_execution(log, execution_path, nextflow_command, execution)
Creates an Execution object from a log file, or updates an existing one from a previous poll.
- Parameters:
log (str) – a section of the log file.
execution_path (str) – the location of the execution.
nextflow_command (str) – the command used to run the pipeline.
execution (nextflow.models.Execution) – the existing execution.
- Return type:
nextflow.models.Execution
- nextflow.command.make_reports_string(output_path, report, timeline, dag, trace)
Creates the report setting portion of the nextflow run command string.
- Parameters:
output_path (str) – the location to store the output in.
report (str) – the filename to use for the execution report.
timeline (str) – the filename to use for the timeline report.
dag (str) – the filename to use for the DAG report.
trace (str) – the filename to use for the trace report.
- Return type:
str
- nextflow.command.run(*args, **kwargs)
Runs a pipeline and returns the execution.
- Parameters:
pipeline_path (str) – the absolute path to the pipeline .nf file.
run_path (str) – the location to run the pipeline in (if not current directory).
output_path (str) – the location to store the output in (if not run path).
log_path (str) – the location to store the log in (if not output path).
resume – whether to resume an existing execution.
runner (function) – a function to run the pipeline command.
version (str) – the nextflow version to use.
configs (list) – any config files to be applied.
params (dict) – the parameters to pass.
profiles (list) – any profiles to be applied.
timezone (str) – the timezone to use for the log.
report (str) – the filename to use for the execution report.
timeline (str) – the filename to use for the timeline report.
dag (str) – the filename to use for the DAG report.
trace (str) – the filename to use for the trace report.
- Return type:
nextflow.models.Execution
- nextflow.command.run_and_poll(*args, **kwargs)
Runs a pipeline and polls it for updates. Yields the execution after each update.
- Parameters:
pipeline_path (str) – the absolute path to the pipeline .nf file.
run_path (str) – the location to run the pipeline in (if not current directory).
output_path (str) – the location to store the output in (if not run path).
log_path (str) – the location to store the log in (if not output path).
resume – whether to resume an existing execution.
runner (function) – a function to run the pipeline command.
version (str) – the nextflow version to use.
configs (list) – any config files to be applied.
params (dict) – the parameters to pass.
profiles (list) – any profiles to be applied.
timezone (str) – the timezone to use for the log.
report (str) – the filename to use for the execution report.
timeline (str) – the filename to use for the timeline report.
dag (str) – the filename to use for the DAG report.
trace (str) – the filename to use for the trace report.
sleep (int) – the number of seconds to wait between polls.
- Return type:
nextflow.models.Execution
- nextflow.command.update_process_execution_from_line(process_executions, line)
Updates a process execution with information from a line of the log file in which its completion is reported. The identifier of the process execution is returned.
- Parameters:
process_executions (dict) – a dictionary of process executions.
line (str) – a line from the log file.
- Return type:
str
- nextflow.command.update_process_execution_from_path(process_execution, execution_path)
Some attributes of a process execution need to be obtained from files on disk. This function updates the process execution with these values.
- Parameters:
process_execution (nextflow.models.ProcessExecution) – the process execution.
execution_path (str) – the location of the containing execution.
- nextflow.command.wait_for_log_creation(output_path, start)
Waits for a log file for this execution to be created.
- Parameters:
output_path (str) – the location to store the output in.
start (datetime) – the start time.