This seems like a basic question but I keep getting some variation of the error: No values given for wildcard
.
I have a group of 22 files named Ne-sQTL_perind.counts.gz.qqnorm_chr{#}.gz
. I would like to act on them in a rule. What I have originally looks like this:
rule QTLtools_filter:
input:
file=expand("Ne-sQTL_perind.counts.gz.qqnorm_chr{i}.gz",i=range(1,22)),
chk=".prepare_phen_table.chkpnt"
output:
expand("{input.file}.qtltools")
message:
"Making phenotype files QTLtools compatible..."
shell:
"cat {input.file} | awk '{ $4=$4\" . +\"; print $0 }' | tr " " \"\t\" | bgzip -c > {input.file}.qtltools"
However, I get the No values found for wildcare 'input'
, which is confusing to me, because in the docs, we have a clear example of this working with the wildcare replicates
. How do I expand this wildcard such that it includes all files numbered between 1-22? I've also tried defining a function to do this for me at the suggestion of this SO post to no avail; still same error message.
def expandChromo(wildcards):
return expand("Ne-sQTL_perind.counts.gz.qqnorm_chr{i}.gz",i=range(1,22))
...
rule QTLtools_filter:
input:
expandChromo,
chk=".prepare_phen_table.chkpnt"
output:
expand("{wildcards.expandChromo}.qtltools")
message:
"Making phenotype files QTLtools compatible..."
shell:
"cat {wildcards.expandChromo} | awk '{ $4=$4\" . +\"; print $0 }' | tr " " \"\t\" | bgzip -c > {wildcards.expandChromo}.qtltools"