>=3.8
and <=3.11
Snakefile
to ensure compatibility with cloud execution on Latch.
SnakemakeMetadata
object. Fortunately, the Latch SDK provides a command to automatically generate this object from an existing config file. Run the following command in the root directory of your project:
SnakemakeMetadata
object, and the second file contains the input parameter definitions. Be sure to inspect the resulting files to verify that the input parameters are as expected.
Below is an explanation of the most relevant fields of the SnakemakeMetadata
object:
SnakemakeParameter
objects. The Latch Console will expose these parameters to scientists before they execute the workflow. The type
and default
fields for each parameter are inferred from the config file when the generate-metadata
command is run.
SnakemakeFileMetadata
in the file_metadata
field. LatchFile and LatchDir are pointers to remote files that are hosted on the Latch platform. The SnakemakeFileMetadata
object provides required metadata about each remote file, such as:
path
: The local path inside the container where the workflow engine will copy Latch Data files/directories before the job executesconfig
: If True
, exposes the local file path in the Snakemake configdownload
: If True
, downloads the file in the JIT step instead of creating an empty file.
Note: To limit network consumption, the download
field should only be True
for files that the Snakefile reads at compilation time (such as configuration files).Dockerfile
and verify that it installs all required runtime dependencies for your workflow.
container
and conda
Snakemake directives instead of building one large image.
When using the container
directive, the Latch workflow will:
env_config
field to your workflow’s SnakemakeMetadata
object in latch_metadata/__init__.py
(this field is similar to the --use-conda
and --use-singularity
flags in Snakemake). For example:
latch register
command. This will take you to an interface like the one below:
Launch Workflow
in the bottom right.