Entering edit mode
4.8 years ago
Hello people,
I am creating a Snakefile, the first few rules are 1) downloading the raw files from a repo, and 2) assembling WGS from these files. This repo will always be updated from time to time.
Usually to create a Snakefile, I would know the names of the samples, and it is easy to create wildcards from them. However, I wouldnt know the names of the samples. I would only know them after I download them. Is it possible to execute step 1, then create a list of sample names as wildcards, then use these sample names to execute step 2?
Separate your run into two: one snakefile to download the repo, to make a list of filenames (eg, make a .tsv), and to subsequenly call the other snakefile as a subworkflow. The second snakefile would have access to the filenames, and you could use wildcards in the typical setting where you do know the sample names.
Maybe dynamic-files can help. https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#dynamic-files