BIMSBbioinfo / pigx_bsseq

bisulfite sequencing pipeline from fastq to methylation reports
https://bioinformatics.mdc-berlin.de/pigx/
GNU General Public License v3.0
11 stars 4 forks source link

settings in tool section remove defaults #43

Closed alexg9010 closed 7 years ago

alexg9010 commented 7 years ago

I was just trying to modify the tools section of the user specific settings file, but when I add some lines there, then all the default values will be remove.

This would be my settings file before tools edited:

locations:
  input-dir: /data/tursun/BS_seq/Project/TDaniele_BSseq/Data/Raw/links/
  output-dir: /data/tursun/BS_seq/Project/TDaniele_BSseq/pigx-bsseq_out/
  genome-dir: /data/tursun/BS_seq/Base/Genomes/ce10/

general:
  genome-version: ce10
  methylation-calling:
    minimum-coverage: 10
    minimum-quality: 20
  differential-methylation:
    cores: 4
    treatment-groups:
      - ['0', '1']

execution:
  submit-to-cluster: yes
  jobs: 6
  nice: 19
  cluster:
    memory: 8G
    stack: 128M
    queue: all
    contact-email: alexander.gosdschan@mdc-berlin.de

# tools:
#   trim-galore:
#     args: "--clip_R1 10 --clip_R2 10"
#   bismark:
#     args: "--non_directional"
#     cores: 4
#     memory: 10G

Leading to this tools dictionary in config.json:

[...]
    "tools": {
        "R": {
            "Rscript": "/gnu/store/if1rbjw0hxhbxlk5s4y3q6arz14w2apc-profile/bin/Rscript",
            "args": "",
            "executable": "/gnu/store/if1rbjw0hxhbxlk5s4y3q6arz14w2apc-profile/bin/R"
        },
        "bismark": {
            "args": " -N 0 -L 20 ",
            "cores": 3,
            "executable": "/gnu/store/if1rbjw0hxhbxlk5s4y3q6arz14w2apc-profile/bin/bismark",
            "memory": "19G"
        },
        "bismark-genome-preparation": {
            "args": "",
            "executable": "/gnu/store/if1rbjw0hxhbxlk5s4y3q6arz14w2apc-profile/bin/bismark_genome_preparation"
        },
        "bowtie2": {
            "args": "",
            "executable": "/gnu/store/if1rbjw0hxhbxlk5s4y3q6arz14w2apc-profile/bin/bowtie2"
        },
[....]

After editing the settings:

locations:
  input-dir: /data/tursun/BS_seq/Project/TDaniele_BSseq/Data/Raw/links/
  output-dir: /data/tursun/BS_seq/Project/TDaniele_BSseq/pigx-bsseq_out/
  genome-dir: /data/tursun/BS_seq/Base/Genomes/ce10/

general:
  genome-version: ce10
  methylation-calling:
    minimum-coverage: 10
    minimum-quality: 20
  differential-methylation:
    cores: 4
    treatment-groups:
      - ['0', '1']

execution:
  submit-to-cluster: yes
  jobs: 6
  nice: 19
  cluster:
    memory: 8G
    stack: 128M
    queue: all
    contact-email: alexander.gosdschan@mdc-berlin.de

tools:
  trim-galore:
    args: "--clip_R1 10 --clip_R2 10"
  bismark:
    args: "--non_directional"
    cores: 4
    memory: 10G

leads to this tools section:

[...]
    "tools": {
        "bismark": {
            "args": "--non_directional",
            "cores": 4,
            "memory": "10G"
        },
        "trim-galore": {
            "args": "--clip_R1 10 --clip_R2 10"
        }
    }

I guess this has something to do with the way we update the yaml dictionary, as it seems, not in a recursive way.

alexg9010 commented 7 years ago

Could be fixed using this: http://snakemake.readthedocs.io/en/stable/api_reference/snakemake_utils.html#snakemake.utils.update_config