# ============================================================================
# Config file for Quality Control
# ==========================================[ Sections for the users ]========
#
# One of input_directory, input_pattern and input_samples must be provided
# If input_directory provided, use it otherwise if input_pattern provided,
# use it, otherwise use input_samples.
# If input_extension provided, use it otherwise assume fastq.gz
# ============================================================================


input_directory: "%(input_directory)s"
input_readtag: "%(input_readtag)s"
input_extension: "%(input_extension)s"
input_pattern: "%(input_pattern)s"
input_samples:
    file1: "%(file1)s"
    file2: "%(file2)s"

# if files are required for a pipeline and are within sequana or should
# be downloaded before the pipeline provide them in this section
# Note that sequana and url fields are followed by itemised files or links
# using the front dashes
requirements:
    - phiX174.fa


#############################################################################
# BWA used to remove a contaminant
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - reference_file: the name of the reference file to be found
#        in the analysis directory. If set to phiX174.fa,
#        it is downloaded automatically from Sequana, otherwise you will
#        need to copy it yourself in the working directory.
# - index_algorithm: the BWA index algorithm
# - options: any options recognised by BWA tool
# - threads: number of threads to be used
#
bwa_mem_phix:
    do: yes
    reference_file: "phiX174.fa"
    index_algorithm: "is"
    options: '-T 30'
    threads: 4
    tmp_directory: './tmp'




#######################################################################
# Quality trimming and adapter removal
#
# If a design_file is provided the forward and reverse complement adapters
# are automatically extracted from this file (given the sample name contained
# in the filenames). In such case, the fwd and rev fields are ignored.
#
# If there is no design_file, the fwd and rev fields are used. It can be a
# string, or a filename. If a filename, it must be prefixed with "file:" to 
# specify that it is a file and not a string. If the tool is cutadapt, the empty
# fwd and rev fields means that no adapters are to be used.
#
# :Parameters:
#
# - adapter_choice: to be used with a design_file only (see below for valid values)
# - design_file: a valid CSV file with mapping of index and sample name
# - fwd: a string or file (prefixed with *file:*)
# - m: 20 means discard trimmed reads that are shorter than 20.
#         must be > 0
# - quality: 0 means no trimming, 30 means keep base with quality
#        above 30
# - mode: must be set to one of
#     - g for 5'
#     - a for 3'
#     - b for both 5'/3'
# - rev: a string or file (prefixed with *file:*)
# - tool: only cutadapt supported for now
# - threads: number of threads to use (atropos only)
# - options: See cutadapt documentation for details on 
#            cutadapt.readthedocs.io. We change the default value
#            of -O to 6 (at least 6 bases are required to match before
#            trimming of an adapter)
#
# :Note: If design_file is provided, fwd and rev fields are ignored
#
# adapter_choice__ = ["", "PCRFree", "Rubicon", "Nextera", "TruSeq"]
# tool_choice__ = ["atropos", "cutadapt"]
cutadapt:
    do: yes
    tool_choice: cutadapt
    adapter_choice: 
    design_file:
    fwd:
    rev:
    m: 20                       # {"strict_min": 0}
    mode: "b"                   # {"values": ["b","g","a"]}
    options: "-O 6 --trim-n"
    quality: 30                 # {"range": [0,40]}
    threads: 4


#################################################################
# Select a sub-sample of the original FastQ files
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - N:  number of reads to use
#
fastq_sampling: # test
    do: no
    N: 2500


#################################################################
# FastQC section
#
# :Parameters:
#
# - options: string with any valid FastQC options
#
fastqc:
    options: "--nogroup"


#################################################################
# For taxonomy. Used in quality_control pipeline
#
# :Parameters:
#
# - do:    if unchecked, this rule is ignored
# - database_directory: select a directory with a kraken database
#   Please see sequana documentation for details
#
kraken:
    do: False
    database_directory:  "%(kraken_database_directory)s"
    threads: 4
