Recursive input calling in Snakemake rule
up vote
0
down vote
favorite
I am writing rule to process some data:
data in directory will be something like:
myfirst.trim_1P, myfirst.trim_2P, mysecond.trim_1P, mysecond.trim_2P,...
rule trim_data:
input:"{dataset}/{sample}.trim_{r}P"
output:"{dataset}/{sample}.{r}.fastq"
params:
length=14
shell:
"""
reformat.sh forcetrimleft="{params.length}" in="{input}" out="{output}"
"""
I have this error:
WorkflowError:
RecursionError: maximum recursion depth exceeded
If building the DAG exceeds the recursion limit
myDir/myfirst.1.trimed.1.trimed.2.trimed.2.trimed.2....
Why it run in recursive way if the output different from the input? and how I can fix it?
snakemake
add a comment |
up vote
0
down vote
favorite
I am writing rule to process some data:
data in directory will be something like:
myfirst.trim_1P, myfirst.trim_2P, mysecond.trim_1P, mysecond.trim_2P,...
rule trim_data:
input:"{dataset}/{sample}.trim_{r}P"
output:"{dataset}/{sample}.{r}.fastq"
params:
length=14
shell:
"""
reformat.sh forcetrimleft="{params.length}" in="{input}" out="{output}"
"""
I have this error:
WorkflowError:
RecursionError: maximum recursion depth exceeded
If building the DAG exceeds the recursion limit
myDir/myfirst.1.trimed.1.trimed.2.trimed.2.trimed.2....
Why it run in recursive way if the output different from the input? and how I can fix it?
snakemake
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am writing rule to process some data:
data in directory will be something like:
myfirst.trim_1P, myfirst.trim_2P, mysecond.trim_1P, mysecond.trim_2P,...
rule trim_data:
input:"{dataset}/{sample}.trim_{r}P"
output:"{dataset}/{sample}.{r}.fastq"
params:
length=14
shell:
"""
reformat.sh forcetrimleft="{params.length}" in="{input}" out="{output}"
"""
I have this error:
WorkflowError:
RecursionError: maximum recursion depth exceeded
If building the DAG exceeds the recursion limit
myDir/myfirst.1.trimed.1.trimed.2.trimed.2.trimed.2....
Why it run in recursive way if the output different from the input? and how I can fix it?
snakemake
I am writing rule to process some data:
data in directory will be something like:
myfirst.trim_1P, myfirst.trim_2P, mysecond.trim_1P, mysecond.trim_2P,...
rule trim_data:
input:"{dataset}/{sample}.trim_{r}P"
output:"{dataset}/{sample}.{r}.fastq"
params:
length=14
shell:
"""
reformat.sh forcetrimleft="{params.length}" in="{input}" out="{output}"
"""
I have this error:
WorkflowError:
RecursionError: maximum recursion depth exceeded
If building the DAG exceeds the recursion limit
myDir/myfirst.1.trimed.1.trimed.2.trimed.2.trimed.2....
Why it run in recursive way if the output different from the input? and how I can fix it?
snakemake
snakemake
edited Nov 22 at 18:22
asked Nov 21 at 21:50
Medhat Helmy
934820
934820
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
This is a wild guess... Maybe the wildcards capture more then they should since they are interpreted as regular expression. If {dataset}
, {sample}
and {r}
take a defined list of values, try constraining their scope with:
wildcard_constraints:
dataset= '|'.join([re.escape(x) for x in DATASET]),
sample= '|'.join([re.escape(x) for x in SAMPLE]),
r= '|'.join([re.escape(x) for x in R]),
Where DATASET, SAMPLE and R are lists of values (e.g. R= ['1', '2']
)
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like thisrule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This is a wild guess... Maybe the wildcards capture more then they should since they are interpreted as regular expression. If {dataset}
, {sample}
and {r}
take a defined list of values, try constraining their scope with:
wildcard_constraints:
dataset= '|'.join([re.escape(x) for x in DATASET]),
sample= '|'.join([re.escape(x) for x in SAMPLE]),
r= '|'.join([re.escape(x) for x in R]),
Where DATASET, SAMPLE and R are lists of values (e.g. R= ['1', '2']
)
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like thisrule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
add a comment |
up vote
0
down vote
This is a wild guess... Maybe the wildcards capture more then they should since they are interpreted as regular expression. If {dataset}
, {sample}
and {r}
take a defined list of values, try constraining their scope with:
wildcard_constraints:
dataset= '|'.join([re.escape(x) for x in DATASET]),
sample= '|'.join([re.escape(x) for x in SAMPLE]),
r= '|'.join([re.escape(x) for x in R]),
Where DATASET, SAMPLE and R are lists of values (e.g. R= ['1', '2']
)
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like thisrule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
add a comment |
up vote
0
down vote
up vote
0
down vote
This is a wild guess... Maybe the wildcards capture more then they should since they are interpreted as regular expression. If {dataset}
, {sample}
and {r}
take a defined list of values, try constraining their scope with:
wildcard_constraints:
dataset= '|'.join([re.escape(x) for x in DATASET]),
sample= '|'.join([re.escape(x) for x in SAMPLE]),
r= '|'.join([re.escape(x) for x in R]),
Where DATASET, SAMPLE and R are lists of values (e.g. R= ['1', '2']
)
This is a wild guess... Maybe the wildcards capture more then they should since they are interpreted as regular expression. If {dataset}
, {sample}
and {r}
take a defined list of values, try constraining their scope with:
wildcard_constraints:
dataset= '|'.join([re.escape(x) for x in DATASET]),
sample= '|'.join([re.escape(x) for x in SAMPLE]),
r= '|'.join([re.escape(x) for x in R]),
Where DATASET, SAMPLE and R are lists of values (e.g. R= ['1', '2']
)
answered Nov 22 at 10:07
dariober
9061121
9061121
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like thisrule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
add a comment |
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like thisrule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
Thanks, this could be the case I will test it and give feedback.
– Medhat Helmy
Nov 22 at 18:33
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
unfortunately, it did not work. I will try to figure something else, Thanks.
– Medhat Helmy
Nov 26 at 16:00
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like this
rule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
So the error was in another downstream rule that could cause this recursion I fixed it and add some constraints on the name like this
rule bam2fastq: input: datain="{dataset}/{sample}.{filter, ^[0-9]}.bam" output: dataout="{dataset}/{sample}.{filter}.reads.fastq" run: shell(""" bedtools bamtofastq -i "{input.datain}" -fq "{output.dataout}" """)
– Medhat Helmy
Nov 26 at 20:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420956%2frecursive-input-calling-in-snakemake-rule%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown