Я попробовал следующую функцию
Код: Выделить всё
# output_path=simulations/sim1/model/test.out
# idx=2 == add after 2nd element
# x=logs
# returns= simulations/sim1/logs/model/test.out
def get_xpath(wildcards,x,idx):
outbase=wildcards.output[0]
return str('/'.join(outbase.split('/')[:idx])+"/"+x+"/"+'/'.join(outbase.split('/')[idx:]))
rule testme:
...
log: lambda wildcards: get_xpath(wildcards,"logs",2),
Код: Выделить всё
'function' object has no attribute 'get_wildcard_names'
Код: Выделить всё
rule testme:
...
log: lambda wildcards, output: output[0].split('.')[0],
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/724 ... -snakemake