Last active
August 2, 2020 20:55
-
-
Save samesense/9be3bc76abee29b0720ec235511fa887 to your computer and use it in GitHub Desktop.
Dynamic rule for snakemake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mk_rule(in_file, out_file, tmp_snake='tmp_snake.py'): | |
'''input is single file | |
output is single file | |
''' | |
with open(tmp_snake, 'w') as f: | |
rule_str = f"""rule auto: | |
input: | |
'{in_file}' | |
output: | |
'{out_file}' | |
shell: | |
'touch {{output}}'""" | |
print(rule_str, file=f) | |
return tmp_snake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment