:py:mod:`wfexs_backend.workflow_engines.nextflow_engine`
========================================================

.. py:module:: wfexs_backend.workflow_engines.nextflow_engine

.. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine
   :allowtitles:

Module Contents
---------------

Classes
~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`NextflowWorkflowEngine <wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine>`
     -

Functions
~~~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`_tzstring <wfexs_backend.workflow_engines.nextflow_engine._tzstring>`
     - .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine._tzstring
          :summary:

Data
~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`DEFAULT_STATIC_BASH_CMDS <wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_BASH_CMDS>`
     - .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_BASH_CMDS
          :summary:
   * - :py:obj:`DEFAULT_STATIC_PS_CMDS <wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_PS_CMDS>`
     - .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_PS_CMDS
          :summary:

API
~~~

.. py:data:: DEFAULT_STATIC_BASH_CMDS
   :canonical: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_BASH_CMDS
   :value: None

   .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_BASH_CMDS

.. py:data:: DEFAULT_STATIC_PS_CMDS
   :canonical: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_PS_CMDS
   :value: None

   .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.DEFAULT_STATIC_PS_CMDS

.. py:function:: _tzstring() -> str
   :canonical: wfexs_backend.workflow_engines.nextflow_engine._tzstring

   .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine._tzstring

.. py:class:: NextflowWorkflowEngine(container_factory_clazz: Type[ContainerFactory] = NoContainerFactory, cacheDir: Optional[pathlib.Path] = None, engine_config: Optional[EngineLocalConfig] = None, progs_mapping: Optional[ProgsMapping] = None, engineTweaksDir: Optional[pathlib.Path] = None, cacheWorkflowDir: Optional[pathlib.Path] = None, cacheWorkflowInputsDir: Optional[pathlib.Path] = None, workDir: Optional[pathlib.Path] = None, outputsDir: Optional[pathlib.Path] = None, outputMetaDir: Optional[pathlib.Path] = None, intermediateDir: Optional[pathlib.Path] = None, tempDir: Optional[pathlib.Path] = None, stagedContainersDir: Optional[pathlib.Path] = None, secure_exec: bool = False, allowOther: bool = False, config_directory: Optional[pathlib.Path] = None, writable_containers: bool = False)
   :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine

   Bases: :py:obj:`wfexs_backend.workflow_engines.WorkflowEngine`

   .. py:attribute:: NEXTFLOW_REPO
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_REPO
      :value: 'https://github.com/nextflow-io/nextflow'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_REPO

   .. py:attribute:: DEFAULT_NEXTFLOW_VERSION
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION
      :value: 'cast(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION

   .. py:attribute:: DEFAULT_NEXTFLOW_VERSION_WITH_PODMAN
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION_WITH_PODMAN
      :value: 'cast(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION_WITH_PODMAN

   .. py:attribute:: DEFAULT_NEXTFLOW_VERSION_20_04
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION_20_04
      :value: 'cast(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_VERSION_20_04

   .. py:attribute:: DEFAULT_NEXTFLOW_DOCKER_IMAGE
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_DOCKER_IMAGE
      :value: 'nextflow/nextflow'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_DOCKER_IMAGE

   .. py:attribute:: DEFAULT_NEXTFLOW_ENTRYPOINT
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_ENTRYPOINT
      :value: 'main.nf'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_NEXTFLOW_ENTRYPOINT

   .. py:attribute:: NEXTFLOW_CONFIG_FILENAME
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_CONFIG_FILENAME
      :value: 'nextflow.config'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_CONFIG_FILENAME

   .. py:attribute:: TROJAN_CONFIG_FILENAME
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.TROJAN_CONFIG_FILENAME
      :value: 'force-params-with-trojan.config'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.TROJAN_CONFIG_FILENAME

   .. py:attribute:: INPUT_DECLARATIONS_FILENAME
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.INPUT_DECLARATIONS_FILENAME
      :value: 'inputdeclarations.yaml'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.INPUT_DECLARATIONS_FILENAME

   .. py:attribute:: NEXTFLOW_IO
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_IO
      :value: 'cast(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NEXTFLOW_IO

   .. py:attribute:: DEFAULT_MAX_RETRIES
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_MAX_RETRIES
      :value: 5

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_MAX_RETRIES

   .. py:attribute:: DEFAULT_MAX_CPUS
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_MAX_CPUS
      :value: 4

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DEFAULT_MAX_CPUS

   .. py:attribute:: ENGINE_NAME
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.ENGINE_NAME
      :value: 'nextflow'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.ENGINE_NAME

   .. py:attribute:: SUPPORTED_CONTAINER_TYPES
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SUPPORTED_CONTAINER_TYPES
      :value: None

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SUPPORTED_CONTAINER_TYPES

   .. py:attribute:: SUPPORTED_SECURE_EXEC_CONTAINER_TYPES
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SUPPORTED_SECURE_EXEC_CONTAINER_TYPES
      :value: None

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SUPPORTED_SECURE_EXEC_CONTAINER_TYPES

   .. py:method:: MyWorkflowType() -> wfexs_backend.workflow_engines.WorkflowType
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.MyWorkflowType
      :classmethod:

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.MyWorkflowType

   .. py:method:: HasExplicitOutputs() -> bool
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.HasExplicitOutputs
      :classmethod:

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.HasExplicitOutputs

   .. py:method:: SupportedContainerTypes() -> Set[ContainerType]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SupportedContainerTypes
      :classmethod:

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SupportedContainerTypes

   .. py:method:: SupportedSecureExecContainerTypes() -> Set[ContainerType]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SupportedSecureExecContainerTypes
      :classmethod:

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.SupportedSecureExecContainerTypes

   .. py:property:: engine_url
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.engine_url
      :type: wfexs_backend.common.URIType

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.engine_url

   .. py:attribute:: NXF_VER_PAT
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NXF_VER_PAT
      :type: Pattern[str]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.NXF_VER_PAT

   .. py:method:: identifyWorkflow(localWf: wfexs_backend.common.LocalWorkflow, engineVer: Optional[EngineVersion] = None) -> Union[Tuple[EngineVersion, LocalWorkflow], Tuple[None, None]]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.identifyWorkflow

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.identifyWorkflow

   .. py:method:: materializeEngineVersion(engineVersion: wfexs_backend.common.EngineVersion) -> Tuple[EngineVersion, pathlib.Path, Fingerprint]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.materializeEngineVersion

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.materializeEngineVersion

   .. py:method:: runNextflowCommand(nextflow_version: wfexs_backend.common.EngineVersion, commandLine: Sequence[str], containers_path: Optional[pathlib.Path] = None, workdir: Optional[pathlib.Path] = None, intermediateDir: Optional[pathlib.Path] = None, nextflow_path: Optional[pathlib.Path] = None, stdoutFilename: Optional[pathlib.Path] = None, stderrFilename: Optional[pathlib.Path] = None, runEnv: Optional[Mapping[str, str]] = None) -> Tuple[ExitVal, Optional[str], Optional[str]]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runNextflowCommand

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runNextflowCommand

   .. py:method:: runLocalNextflowCommand(nextflow_version: wfexs_backend.common.EngineVersion, commandLine: Sequence[str], containers_path: pathlib.Path, workdir: Optional[pathlib.Path] = None, intermediateDir: Optional[pathlib.Path] = None, nextflow_install_dir: Optional[pathlib.Path] = None, stdoutFilename: Optional[pathlib.Path] = None, stderrFilename: Optional[pathlib.Path] = None, runEnv: Optional[Mapping[str, str]] = None) -> Tuple[ExitVal, Optional[str], Optional[str]]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runLocalNextflowCommand

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runLocalNextflowCommand

   .. py:method:: runNextflowCommandInDocker(nextflow_version: wfexs_backend.common.EngineVersion, commandLine: Sequence[str], containers_path: pathlib.Path, workdir: Optional[pathlib.Path] = None, intermediateDir: Optional[pathlib.Path] = None, stdoutFilename: Optional[pathlib.Path] = None, stderrFilename: Optional[pathlib.Path] = None, runEnv: Optional[Mapping[str, str]] = None) -> Tuple[ExitVal, Optional[str], Optional[str]]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runNextflowCommandInDocker

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.runNextflowCommandInDocker

   .. py:method:: _get_engine_version_str(matWfEng: wfexs_backend.workflow_engines.MaterializedWorkflowEngine) -> wfexs_backend.workflow_engines.WorkflowEngineVersionStr
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine._get_engine_version_str

   .. py:attribute:: ContConfigPat
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.ContConfigPat
      :type: Pattern[str]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.ContConfigPat

   .. py:attribute:: RegistryPat
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.RegistryPat
      :type: Pattern[str]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.RegistryPat

   .. py:attribute:: C_URL_REGEX
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.C_URL_REGEX
      :type: Final[Pattern[str]]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.C_URL_REGEX

   .. py:attribute:: C_DOCKER_REGEX
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.C_DOCKER_REGEX
      :type: Final[Pattern[str]]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.C_DOCKER_REGEX

   .. py:attribute:: DSLEnablePat
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DSLEnablePat
      :type: Final[Pattern[str]]
      :value: 'compile(...)'

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.DSLEnablePat

   .. py:method:: _genDockSingContainerTaggedName(container_tag: str, registries: Mapping[ContainerType, str]) -> Optional[ContainerTaggedName]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine._genDockSingContainerTaggedName

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine._genDockSingContainerTaggedName

   .. py:method:: materializeWorkflow(matWorkflowEngine: wfexs_backend.workflow_engines.MaterializedWorkflowEngine, consolidatedWorkflowDir: pathlib.Path, offline: bool = False, profiles: Optional[Sequence[str]] = None) -> Tuple[MaterializedWorkflowEngine, Sequence[ContainerTaggedName]]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.materializeWorkflow

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.materializeWorkflow

   .. py:method:: simpleContainerFileName(imageUrl: wfexs_backend.common.URIType) -> Sequence[RelPath]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.simpleContainerFileName

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.simpleContainerFileName

   .. py:method:: structureAsNXFParams(matInputs: Sequence[MaterializedInput], outputsDir: pathlib.Path) -> Mapping[str, Any]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.structureAsNXFParams

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.structureAsNXFParams

   .. py:method:: augmentNextflowInputs(matHash: Mapping[SymbolicParamName, MaterializedInput], allExecutionParams: Mapping[str, Any], prefix: str = '') -> Sequence[MaterializedInput]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.augmentNextflowInputs

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.augmentNextflowInputs

   .. py:method:: launchWorkflow(matWfEng: wfexs_backend.workflow_engines.MaterializedWorkflowEngine, matInputs: Sequence[MaterializedInput], matEnvironment: Sequence[MaterializedInput], outputs: Sequence[ExpectedOutput], profiles: Optional[Sequence[str]] = None) -> Iterator[StagedExecution]
      :canonical: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.launchWorkflow

      .. autodoc2-docstring:: wfexs_backend.workflow_engines.nextflow_engine.NextflowWorkflowEngine.launchWorkflow
