when i do this:
expand('test/{unit.sample}-paired_reads', unit.sample=units.itertuples())
I got this error:
SyntaxError in line 18 of path/test.smk:
keyword can't be an expression
the expansion in the rule all it's fine, is working as expected as the snakemake error indicates, it's producing the expected files (strings). What happens is that itertuples() returns a named tuple and its attribute is sample, so that's why {unit.sample} works. the .sample part of unit.sample it's its attribute which is called sample. My problem is passing the proper wildcard to my input function in the rule getfastas

In the function that you are passing
wildcardsto the name of the variable isunit.samplenotunit. Sowildcards.sample, wildcards.unitdoes not exist.Hi Medhat, thanks for your time.
I don't understand what are you referring to. Can you elaborate a bit more?
As is understand it,
unit.sampleis a named tuple (valid python), so the variable is namedunit, and has the attribute namedsample, that's why in the rule all, the wildcard{unit.sample}produces theSRR339638xstrings. To explain it better, it's a wildcard that has two 'named' attributes, "unit" and "sample".I edited my original post, I'm posting a simpler example but is exactly the same scenario.
My bad, It was not clear previously.