# ============================================================================
# Config file for RNA-seq
#
# ==================[ 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
    - Institut_Pasteur.png


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


#############################################################################
# Indexing section: if checked, all index for bowtie (1&2), star, etc... will be produced in dir
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - dir: directory where all indexed are written
# - name: name of prefix use in all mapping rules
# - fasta: path to Reference Genome in fasta format
# - gff: path to GFF annotation file. Be carefull: chromosome names must me concordant with Fasta file
# - rRNA_fasta: path to fasta file for ribosomal RNA if provided
# - rRNA_feature: if rRNA_fasta not provided, ribosomal RNA will be extract from GFF using this feature
#
genome:
  do: yes
  fasta_hairpin_file: /pasteur/projets/specific/PF2_ngs/protected/Genomes/hsa-mir/hsa-mir.fa
  fasta_mature_file: /pasteur/projets/specific/PF2_ngs/protected/Genomes/hsa-mir/hsa-mir_miRNA.fa

#######################################################################
# 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_type: can only be one of PCRFree, Nextera, Rubicon, TruSeq.
#   Only used if design_file is provided.
# - 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 are ignored
#
#   ref: http://cutadapt.readthedocs.io/
# adapter_choice__ = ["PCRFree", "Rubicon", "Nextera", "TruSeq", "Small", "SMARTer"]
# tool_choice__ = ["cutadapt", "atropos"]
cutadapt:
    do: yes
    tool_choice: cutadapt
    adapter_choice:
    design_file:
    fwd:
    rev:
    m: 18
    mode: "a"
    quality: "30"
    options: "-O 6 --trim-n -M30"
    threads: 4


#############################################################################
# bowtie1_mapping_mature used to align reads against mature miRNA
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - options: any options recognised by bowtie1 tool
# - threads: number of threads to be used
#
bowtie1_mapping_mature:
    do: yes
    options: "--chunkmbs 400 -q -m 1 "
    threads: 4


#############################################################################
# bowtie1_mapping_hairpin used to align reads against hairpin
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - options: any options recognised by bowtie1 tool
# - threads: number of threads to be used
#
bowtie1_mapping_hairpin:
    do: no
    options: "--chunkmbs 400 -a --best -q -e20 "
    threads: 4


#############################################################################
# fastq_screen used to align reads against genomes file contain in conf file with bowtie2
#
# :Parameters:
#
# - do: if unchecked, this rule is ignored
# - conf: the name of the configuration file
# - pf2_report: allows to plot a specific PF2 report
#
fastq_screen:
    do: yes
    conf: "/pasteur/projets/specific/PF2_ngs/protected/bowtie2_genomes/fastq_screen.conf"
    options: "--subset 200000  --aligner bowtie2"
    pf2_report: yes




#############################################################################
#   MultiQC aggregates results from bioinformatics analyses across many
#   samples into a single report.
#
# :Parameters:
#
# - options: any options recognised by multiqc
# - output-directory: Create report in the specified output directory
#
multiqc:
    options: "-c multiqc_config.yaml -f -x *_init_* -x *left_kept_reads* -x *report_rnaseq* -e htseq -e slamdunk"
    output-directory: "multiqc"

