Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
snakemake
Commits
73abde0f
Commit
73abde0f
authored
May 09, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
add information about the way of writing workflow
parent
11a919a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
workflows/README.md
0 → 100644
View file @
73abde0f
# Snakemake workflows
This directory contains every workflows built from Snakemake tool found in the
`tools`
directory of the repository.
## Design and best practices
All the Snakemake workflows try to respect some rules and best practices in their design.
Therefore, workflows have the following parts:
1.
reference to
`config.yaml`
file
2.
reference to tool rules
3.
set up of common variable for the workflow
4.
set up of specific variables for the tools
5.
`rule all`
to specify what is/are the specific file(s) expected from the workflow.
#### Reference to tool rules
The location of the tools included in the workflow can vary depending your organization.
Therefore, we decide to put every references at the begining of the workflow to make it easy
to customize and change if necessary.
#### Set up common variable for the workflow
Then every common variables are set up. This can be handy for reference to a common directory.
#### Set up specific variables for the tools
Every specific variables for every tools are then specified. For more details about the way
every tool is describe, you can refer to the
`README`
of the
`tools`
directory of the
repository.
In brief, every tool has its input and output refered as a variable:
`__TOOLNAME_variable`
.
Therefore every variable needs to be configured and we recommand using reference to a
`config.yaml`
file.
Thus, we can easily set up the input of a tool
`B`
as being the output of
`A`
:
```
python
# ---- Tool A
__toola_input
=
config
.
get
(
'input'
)
__toola_output
=
"file.a"
# ---- Tool B
__toolb_input
=
__toola_output
__toolb_ouput
=
config
.
get
(
'output'
)
```
## Usage
### Using on TARS
For the following examples, we consider that we want to run every job a dedicated queue called
`atm`
.
First need a virtual environment with snakemake:
```
bash
module load Python/3.6.0
# Install seems to fail with latest version of Python
python3
-m
venv .snakemake_venv
source
.snakemake_venv/bin/activate
(
.snakemake_venv
)
$
pip
install
snakemake
```
Then, to run a
`SnakeFile`
on Tars we use a command similar to the following:
```
bash
sbatch
--qos
=
atm
-p
atm
-c
1 snakemake
-p
-j
6
--cluster-config
cluster.yml
--cluster
"sbatch --qos={cluster.queue} -p {cluster.queue} -c {threads}"
```
\ No newline at end of file
workflows/cluster.yml
0 → 100644
View file @
73abde0f
__default__
:
queue
:
atm
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment