Comments (4)
It is a fragile hack, but rather than importing submodules you can just make a rule in your top snakefile that runs the submodule directly. This would also solve your DAG visualiation, because the complex submodules only appear as the single rule “Create_transport_timeseries” etc (which then spawn all their own jobs when run). include: <submodule>
can sometimes slow DAG building too much or have naming clashes, so each approach has its own drawbacks.
rule Create_transport_timeseries:
input:
<all input needed to start submodule>
output:
<any output you want from the entire submodule>
shell:
'snakemake -s <submodule> ...'
from snakemake.
It is a fragile hack, but rather than importing submodules you can just make a rule in your top snakefile that runs the submodule directly. This would also solve your DAG visualiation, because the complex submodules only appear as the single rule “Create_transport_timeseries” etc (which then spawn all their own jobs when run).
include: <submodule>
can sometimes slow DAG building too much or have naming clashes, so each approach has its own drawbacks.rule Create_transport_timeseries: input: <all input needed to start submodule> output: <any output you want from the entire submodule> shell: 'snakemake -s <submodule> ...'
Thank you for the input. This might work! Testing shows some issues, though.
With the following structure:
project
- Snakemake
- output/
- modules/
- light/
- output/
- Snakemake
I run
rule run_light_submodule:
input:
"output/global.txt"
output:
"modules/light/output/final.txt"
shell:
'snakemake -s modules/light/Snakefile -c 1'
Which returns
LockException:
Error: Directory cannot be locked. Please make sure that no other Snakemake process is trying to create the same files in the following directory:
/home/ivanruizmanuel/Documents/git/snakemake_tests
If you are sure that no other instances of snakemake are running on this directory, the remaining lock was likely caused by a kill signal or a power loss. It can be removed with the --unlock argument.
[Wed Mar 27 15:15:13 2024]
Error in rule run_light_submodule:
jobid: 8
input: output/global.txt
output: modules/light/output/final.txt
shell:
snakemake -s modules/light/Snakefile -c 1
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-03-27T151513.412171.snakemake.log
WorkflowError:
At least one job did not complete successfully.
It seems like the subfolder is locked by snakemake... any advice?
from snakemake.
You should pass --nolock
to any "submodule" snakemake calls, as well as any config/profile args you would normally run them with
from snakemake.
In the end, I just went with the module functionality.
It's... not perfect, and does not abstract the DAG, but it's enough for now.
from snakemake.
Related Issues (20)
- Services setup and teardown procedures with specific scripts and warmup time
- Key Error: workflow/rules/common.smk, line 25: 'resource_config' HOT 1
- Using option --drmaa_logs crashes snakemake
- Add possibility to provide empty default resources in a profile (as was possible with SnakeMake 7.x.x)
- Make --cores a forbidden parameter if an executor is used.
- Incomplete DAG with checkpoints HOT 3
- --until not working with checkpoints HOT 4
- --dry-run --quiet fails on 8
- `--show-failed-logs` if binary file used as `log` file
- --cluster-config BsubInvocation Error HOT 1
- Incorrect shell command executed when defined within a loop. HOT 5
- carbon footprint in report HOT 2
- question: SFTP options
- Error when using wrappers and `use rule as`
- Bind current working directory to container
- incompatibility with using `rules.rulename.output` and importing snakefile as a module, using `use rule a from somemodule as a with...` HOT 3
- ModuleNotFoundError: No module named 'asyncore' HOT 2
- `keep_local` does not keep remote files locally
- `snakemake.io._IOFile.open` method doesn't use it's keyword arguments
- document ChildIOException
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.