Snakefile - problem with too many outputs
1
0
Entering edit mode
5 weeks ago
ja4123 • 0

Hey! Part of my snakefile is below:

SAMPLES=["I_1_R1", "I_1_R2"] 
RES = list(set([i.rsplit('_R')[0] for i in SAMPLES]))

rule all:
  input:
    expand("path/{res}_0_5000_R.png", "path/{res}_0_5000_S.png", "path/{res}_500_10000_R.png", "path/{res}_500_10000_S.png", res=RES),
    expand("path/{res}_RvsR.png", "path/{res}_strand_1vs2.png", res=RES),
    expand("path/{res}_log10_500_1000.png", res=RES)

rule statistics:
  input:
    "path/{res}.tsv"
  output:
    dist = "path/{res}_0_5000_R.png", "path/{res}_0_5000_S.png", "path/{res}_500_10000_R.png", "path/{res}_500_10000_S.png"
    feature = "path/{res}_RvsR.png", "path/{res}_strand_1vs2.png"
    log10 = "path/{res}_log10_500_1000.png"
  shell:
    "path/statistics.py {input} {output.dist} {output.feature} {output.log10}"

and I have an error like this:

SyntaxError in line 15 of path/Snakefile:
positional argument follows keyword argument

line 15 is:

feature = "path/{res}_RvsR.png", "path/{res}_strand_1vs2.png"

Can someone help or give some advices?

snakemake snakefile • 178 views
ADD COMMENT
0
Entering edit mode

This might seem silly, but you're missing commas between the outputs. Try:

output:
    dist = ["path/{res}_0_5000_R.png", "path/{res}_0_5000_S.png", "path/{res}_500_10000_R.png", "path/{res}_500_10000_S.png"],
    feature = ["path/{res}_RvsR.png", "path/{res}_strand_1vs2.png"],
    log10 = "path/{res}_log10_500_1000.png"
ADD REPLY
0
Entering edit mode
5 weeks ago
liorglic ▴ 410

Try:

feature = ["path/{res}_RvsR.png", "path/{res}_strand_1vs2.png"],

Or:

feature1 = "path/{res}_RvsR.png",
feature2 =  "path/{res}_strand_1vs2.png"
ADD COMMENT
0
Entering edit mode

first try does not work, error is:

invalid syntax

second try will not work because of order of execution statistics.py

ADD REPLY

Login before adding your answer.

Traffic: 1708 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6