I want to create a list of BAM files in the folder using this command line:
ls *.bam > bam_list
But, I would like to integrate this in snakemake. How to do this? This is what I tried, but is not working:
rule bam_list:
input:
inlist ="dup/{sample}.bam"
output:
outlist = "dup/bam_list"
shell:
"""
ls {input.inlist} > {output.outlist}
"""
The output bam_list looks like this:
bob.bam
anne.bam
john.bam
You could completely skip the input:
edit
for more complex logic you will probably have to use input functions.