Two config files for one Snakemake file
1
0
Entering edit mode
8 weeks ago
Xiaokang ▴ 80

I have one yaml file called config_T11H.yaml with the following content:

# the configuration for workflow of T11H

BASE_EDITOR: T11H
INDIR: data/alignment
OUTDIR: output/output_T11H

# start and end positions of editing window
START: 3
END: 9

and I have another yaml file named config_T11L.yaml with the following content:

# the configuration for workflow of T11L

BASE_EDITOR: T11L
INDIR: data/alignment
OUTDIR: output/output_T11L

# start and end positions of editing window
START: 3
END: 15

I have written a snakemake file base_editing.smk that will run a pipeline with the two sets of parameters in the two yaml files above.

Currently what I am doing is to manually modify the variable configfile in the snakemake file:

Firstly I write configfile: "config_T11H.yaml" at the beginning of the snakemake file, and run the snakemake file snakemake -c 1 -s base_editing.smk;

After it finishes, I then modify the snakemake file configfile: "config_T11L.yaml" and run the snakemake file again snakemake -c 1 -s base_editing.smk.

Is there an easier way to run the snakemake file on the two yaml files with only one-go?

config yaml snakemake • 532 views
ADD COMMENT
0
Entering edit mode
8 weeks ago

That is exactly what Snakemake is for.

You could create a sample variable at the top of a config.yaml file and loop over these samples in your main snakemake.

samples:
    T11H
    T11I
    T11L

Then, either create a list in your config file associating your samples and their start/end values, or txt file like T11H.txt that your rules would interpret.

You can also call your config_T11H.yaml directly in the command like :

snakemake -c 1 -s base_editing.smk --configfile config_T11H.yaml
ADD COMMENT
0
Entering edit mode

Thank you! To make the Snakemake file clean, specifying the config file in the command line is a good option!

ADD REPLY

Login before adding your answer.

Traffic: 3583 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