Snakemake: how to map input to output without using dynamic() [closed]

0 votes

I have a pipeline that has a problematic rule. I can't use wildcards in the output, and so I am unable to map the input to the output. The problem is Snakemake launch a job for each one of the combinations. However, I the tool outputs the three required files. I was able to sort the problem with 'dynamic', but I would prefer to

mapping: {'a': ['a_1', 'a_2', 'a_3'], 'b': ['b_1', 'b_2', 'b_3']}


rule build:
    input:
        ini=rules.create_ini.output,
        bam=lambda wildcards:
            expand('mappings/{names}.bam', names=mapping[wildcards.cond],
                cond=wildcards.cond)
    output:
        dynamic('tool/{cond}/{names}.tool')
    params: 
        output='{cond}'
    shell:
        '''
        module load tool
        tool build --conf {input.ini} --output {params.output} # < here
        '''

The tool produces three files, not one and Snakemake is launching six jobs instead two.

Oct 3, 2018 in Python by eatcodesleeprepeat
• 4,670 points

closed Oct 3, 2018 by Priyaj 292 views

Related Questions In Python

+1 vote
1 answer

How can I map input to output without using dynamic()

Here am talking about my example you ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,900 points
154 views
0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,720 points
136 views
0 votes
1 answer
0 votes
1 answer

How to get textual output when using exceptions in Python?

Hi, the answer is pretty simple.  Without the ...READ MORE

answered Jan 17 in Python by Nymeria
• 3,520 points
40 views
0 votes
1 answer

How to output the rows which are affected using SQLAlchemy in Python?

Hi, good question. This is actually not ...READ MORE

answered Feb 15 in Python by Nymeria
• 3,520 points
198 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 333 views