I have a file 'filenames.txt' with in it:
a.txt
b.txt
c.txt
d.txt
I want to use these lines as input in snakemake. Does anyone know how I could do this?
I have a file 'filenames.txt' with in it:
a.txt
b.txt
c.txt
d.txt
I want to use these lines as input in snakemake. Does anyone know how I could do this?
You can use python inside a snakefile. Here is how you could obtain a list of file names:
with open('filenames.txt') as fh:
filenames = [line.strip() for line in fh]
Then, I'm not sure how you intend to use those file names.
If you want your workflow to create those files, it should be made the input
section of the top all
rule:
rule all:
input: filenames
And you should of course have a rule that can create such a file:
rule create_file:
output: "{letter}.txt"
shell:
"""
touch {output[0]}
"""