UserOnWeb
UserOnWeb

Reputation: 98

Get input function from another .smk file in SnakeMake

I have stored my SnakeMake rules in different .smk files. I have one file (a.smk) with following input function

def get_input(wildcards):
   # Some processing
   return input_list

rule some_rule_in_first_file:
   input: get_input
   # rest of the rule

Now in another file (b.smk) I want to do something like following,

rule another_rule_in_second_file:
   input: get_input 
   # Rest of the rule

How can I achieve above?

Upvotes: 1

Views: 597

Answers (1)

dariober
dariober

Reputation: 9062

I think you could use the include directive. I.e., in your b.smk you should add something like:

include: '/path/to/a.smk'

Upvotes: 2

Related Questions