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 118 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,120 points
77 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,710 points
58 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,500 points
10 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,500 points
25 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
20 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.