From 42e0e82767f350eeb03651abf289e266b607382f Mon Sep 17 00:00:00 2001 From: Max Schubach Date: Tue, 16 Jul 2024 13:15:14 +0200 Subject: [PATCH] refactor: getting rid of general thread config. now using build in resources/threads --- config/example_assignment_bwa.yaml | 1 - config/example_assignment_exact_lazy.yaml | 1 - config/example_assignment_exact_linker.yaml | 1 - config/example_config.yaml | 3 +-- config/example_count.yaml | 15 +++++++++++++++ docs/assignment_example1.rst | 2 +- docs/config.rst | 2 -- resources/assoc_basic/config.yml | 1 - resources/combined_basic/config.yml | 1 - resources/experiment_basic/experiment.csv | 4 ---- workflow/rules/assignment/mapping_bwa.smk | 4 ++-- workflow/schemas/config.schema.yaml | 4 ---- 12 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 config/example_count.yaml delete mode 100644 resources/experiment_basic/experiment.csv diff --git a/config/example_assignment_bwa.yaml b/config/example_assignment_bwa.yaml index 35aa441..d483abe 100644 --- a/config/example_assignment_bwa.yaml +++ b/config/example_assignment_bwa.yaml @@ -1,6 +1,5 @@ --- global: # generall configs effecting one or multiple parts - threads: 1 assignments: split_number: 1 # number of files fastq should be split for parallelization assignments: diff --git a/config/example_assignment_exact_lazy.yaml b/config/example_assignment_exact_lazy.yaml index ea3b75e..97835b5 100644 --- a/config/example_assignment_exact_lazy.yaml +++ b/config/example_assignment_exact_lazy.yaml @@ -1,6 +1,5 @@ --- global: # generall configs effecting one or multiple parts - threads: 1 assignments: split_number: 1 # number of files fastq should be split for parallelization assignments: diff --git a/config/example_assignment_exact_linker.yaml b/config/example_assignment_exact_linker.yaml index 13c4fda..b2468ee 100644 --- a/config/example_assignment_exact_linker.yaml +++ b/config/example_assignment_exact_linker.yaml @@ -1,6 +1,5 @@ --- global: # generall configs effecting one or multiple parts - threads: 1 assignments: split_number: 1 # number of files fastq should be split for parallelization assignments: diff --git a/config/example_config.yaml b/config/example_config.yaml index 80e716e..f24e8fe 100644 --- a/config/example_config.yaml +++ b/config/example_config.yaml @@ -1,6 +1,5 @@ --- global: # generall configs effecting one or multiple parts - threads: 1 assignments: split_number: 1 # number of files fastq should be split for parallelization assignments: @@ -31,7 +30,7 @@ experiments: exampleCount: bc_length: 15 umi_length: 10 - data_folder: resources/Count_Basic/data + data_folder: resources/count_basic/data experiment_file: resources/example_experiment.csv demultiplex: false assignments: diff --git a/config/example_count.yaml b/config/example_count.yaml new file mode 100644 index 0000000..c80397d --- /dev/null +++ b/config/example_count.yaml @@ -0,0 +1,15 @@ +--- +experiments: + exampleCount: + bc_length: 15 + umi_length: 10 + data_folder: resources/count_basic/data + experiment_file: resources/count_basic/experiment.csv + demultiplex: false + assignments: + fromFile: + type: file + assignment_file: resources/count_basic/SRR10800986_barcodes_to_coords.tsv.gz + design_file: resources/count_basic/design.fa + configs: + default: {} # name of an example filtering config diff --git a/docs/assignment_example1.rst b/docs/assignment_example1.rst index 134aee5..b4db386 100644 --- a/docs/assignment_example1.rst +++ b/docs/assignment_example1.rst @@ -108,7 +108,7 @@ First we do a try run using snakemake :code:`-n` option. The MPRAsnakeflow comma cd assoc_basic conda activate mprasnakeflow - snakemake -c 1 --use-conda --snakefile /home/user/MPRAsnakeflow/workflow/Snakefile --configfile /home/user/MPRAsnakeflow/resources/assoc_basic/config.yml -n -q + snakemake -c 1 --sdm conda --snakefile /home/user/MPRAsnakeflow/workflow/Snakefile --configfile /home/user/MPRAsnakeflow/resources/assoc_basic/config.yml -n -q --set-threads assignment_mapping_bwa=10 You should see a list of rules that will be executed. This is the summary: diff --git a/docs/config.rst b/docs/config.rst index c447595..34f8970 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -24,8 +24,6 @@ The general settings are located in the :code:`global` section. The following se :start-after: start_global :end-before: start_assignments -:threads: - Number of threads that are available to run a rule. Right now this is used for bwa mem in the assignment workflow. Be sure to set up the snakemake option :code:`-c` correctly when using larger number of possible threads. Default is set to 1. :assignments: Global parameters that hold for the assignment workflow. diff --git a/resources/assoc_basic/config.yml b/resources/assoc_basic/config.yml index 2e9036f..c9c720c 100644 --- a/resources/assoc_basic/config.yml +++ b/resources/assoc_basic/config.yml @@ -1,6 +1,5 @@ --- global: - threads: 10 assignments: split_number: 30 assignments: diff --git a/resources/combined_basic/config.yml b/resources/combined_basic/config.yml index 777834c..1c770b8 100644 --- a/resources/combined_basic/config.yml +++ b/resources/combined_basic/config.yml @@ -1,6 +1,5 @@ --- global: - threads: 10 assignments: split_number: 30 assignments: diff --git a/resources/experiment_basic/experiment.csv b/resources/experiment_basic/experiment.csv deleted file mode 100644 index 80dbdfa..0000000 --- a/resources/experiment_basic/experiment.csv +++ /dev/null @@ -1,4 +0,0 @@ -Condition,Replicate,DNA_BC_F,DNA_UMI,DNA_BC_R,RNA_BC_F,RNA_UMI,RNA_BC_R -HEPG2,1,SRR10800881_1.fastq.gz,SRR10800881_2.fastq.gz,SRR10800881_3.fastq.gz,SRR10800882_1.fastq.gz,SRR10800882_2.fastq.gz,SRR10800882_3.fastq.gz -HEPG2,2,SRR10800883_1.fastq.gz,SRR10800883_2.fastq.gz,SRR10800883_3.fastq.gz,SRR10800884_1.fastq.gz,SRR10800884_2.fastq.gz,SRR10800884_3.fastq.gz -HEPG2,3,SRR10800885_1.fastq.gz,SRR10800885_2.fastq.gz,SRR10800885_3.fastq.gz,SRR10800886_1.fastq.gz,SRR10800886_2.fastq.gz,SRR10800886_3.fastq.gz diff --git a/workflow/rules/assignment/mapping_bwa.smk b/workflow/rules/assignment/mapping_bwa.smk index da99eca..8933643 100644 --- a/workflow/rules/assignment/mapping_bwa.smk +++ b/workflow/rules/assignment/mapping_bwa.smk @@ -39,7 +39,7 @@ rule assignment_mapping_bwa: ), output: bam=temp("results/assignment/{assignment}/bam/merge_split{split}.mapped.bam"), - threads: config["global"]["threads"] + threads: 1 log: temp("results/logs/assignment/mapping.{assignment}.{split}.log"), shell: @@ -109,7 +109,7 @@ rule assignment_collect: ), output: "results/assignment/{assignment}/aligned_merged_reads.bam", - threads: config["global"]["threads"] + threads: 1 log: temp("results/logs/assignment/collect.{assignment}.log"), shell: diff --git a/workflow/schemas/config.schema.yaml b/workflow/schemas/config.schema.yaml index d53beb3..bd3473f 100644 --- a/workflow/schemas/config.schema.yaml +++ b/workflow/schemas/config.schema.yaml @@ -14,7 +14,6 @@ properties: global: type: object default: - threads: 1 assignments: split_number: 1 properties: @@ -25,9 +24,6 @@ properties: type: integer default: 1 additionalProperties: false - threads: - type: integer - default: 1 additionalProperties: false # start_assignments assignments: