pairs = {"P1" : "P1", "P2" : "P2"}
samples = {
"sample1": "sample1",
"sample2": "sample2"
}
wildcard_constraints:
pair = "|".join(pairs),
sample = "|".join(samples),
rule all:
input: expand("data/{sample}/{sample}_concatenated.txt", sample = samples)
rule get_txt_files:
output:
"data/{sample}_{pair}.txt"
shell:
"""
echo 1 > {output}
"""
rule reorganise:
input:
expand("data/{{sample}}_{pair}.txt", \
pair=pairs)
output:
"data/{sample}/{sample}_{pair}.txt"
shell:
"mv {input} data/{wildcards.sample}/."
rule concat:
input:
expand("data/{{sample}}/{{sample}}_{pair}.txt", \
pair=pairs)
output:
"data/{sample}/{sample}_concatenated.txt"
shell:
"cat {input} > {output}"