Comments (3)
Which
rule a
is this referencing? :
Well, rule.a
is referencing the only rule that is in scope, aka the one defined in main.smk
.
Thanks for providing an option that is working, I appreciate it ❤️
However, I believe it to be more of a workaround than an actual "good" way of doing it. I would much rather specify only the rules I'm interested in instead of importing everything and then only use a subset of the rules.
I think Hocnonsense is right here :
and I've found that it is caused by refering rules.a.output in rules.b in imported.smk
and this is indeed a bug.
Since I'm overwriting the inputs, I don't see the point in trying to interpret input: rules.a.output
in imported.smk
from snakemake.
Which rule a
is this referencing? :
use rule b from imported as b with:
input: rules.a.output
Seems like main's rule a
would shadow imported's since they both are called rule a
.
Assuming you want to use main's rule a
as input you could do this in your main.smk:
# main.smk
module imported:
snakefile: "imported.smk"
use rule * from imported as imported_*
rule a:
output: "a.from_main.txt"
shell: "touch {output}"
use rule imported_b as b with:
input: rules.a.output
rule target:
input:
rules.b.output
Dryrun output:
❯ snakemake -s main.smk target -n
Building DAG of jobs...
Job stats:
job count
------ -------
a 1
b 1
target 1
total 3
Execute 1 jobs...
[Wed Apr 24 16:32:44 2024]
localrule a:
output: a.from_main.txt
jobid: 2
reason: Missing output files: a.from_main.txt
resources: tmpdir=<TBD>
Execute 1 jobs...
[Wed Apr 24 16:32:44 2024]
localrule b:
input: a.from_main.txt
output: b.txt
jobid: 1
reason: Missing output files: b.txt; Input files updated by another job: a.from_main.txt
resources: tmpdir=<TBD>
Execute 1 jobs...
[Wed Apr 24 16:32:44 2024]
localrule target:
input: b.txt
jobid: 0
reason: Input files updated by another job: b.txt
resources: tmpdir=<TBD>
Job stats:
job count
------ -------
a 1
b 1
target 1
total 3
from snakemake.
I also meet this exception, and I've found that it is caused by refering rules.a.output
in rules.b
in imported.smk
It happened when loading module module imported
:
as you ONLY select b
to be used (use rule b from imported as b with:
),
snakemake go through each rule and only record the one you select, otherwise, it does nothing:
snakemake/snakemake/workflow.py
Lines 1518 to 1529 in a988cef
snakemake/snakemake/modules.py
Lines 217 to 221 in a988cef
if you try to print workflow.modifier.rule_whitelist
, you will find that it is not None
I think this is more similar to a bug than a behavier.
from snakemake.
Related Issues (20)
- nested for loop in f-string
- --quiet settings not intuitive HOT 1
- Progress report when downloading from storage provider HOT 3
- install error HOT 1
- install snakemake using `pip install git+https://github.com/snakemake/snakemake` HOT 2
- Snakemake Pipeline Issue
- snakemake --export-cwl doesn't actually export CWL
- Stop workflow (without error) if an output file is empty HOT 1
- Allow child rule to inherit localrule tag
- More descriptive error message for AmbiguousRuleException and update Documentation: Ruleorder
- Module conflicts in workflows with a diamond-shape file structure
- --jobs does not consider --local-cores when executing localrules
- Runnning multiple instance of workflow on slurm causes Denial-of-Service HOT 1
- file inclusion/exclusion control?
- Error handling for pointing at non-existing script
- mem_mb parsing error in workflow profile HOT 1
- Invalid choice: 'slurm-jobstep' (choose from 'local', 'd ryrun', 'touch') HOT 1
- Snakemake API
- slurm executor not printing logs on fail
- slurm job submission
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snakemake.