# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
# yaml-language-server: $schema=yaml-schema.json
name: "fastq_fastqc_umitools_fastp"
description: Read QC, UMI extraction and trimming
keywords:
  - fastq
  - fastqc
  - qc
  - UMI
  - trimming
  - fastp
components:
  - fastqc
  - umitools/extract
  - fastp
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test' ]
  - reads:
      type: file
      description: |
        List of input FastQ files of size 1 and 2 for single-end and paired-end data,
        respectively.
  - skip_fastqc:
      type: boolean
      description: |
        Skip fastqc process
  - with_umi:
      type: boolean
      description: |
        With or without umi detection
  - skip_umi_extract:
      type: boolean
      description: |
        With or without umi extrection
  - umi_discard_read:
      type: integer
      description: |
        Discard R1 / R2 if required
  - skip_trimming:
      type: boolean
      description: |
        Allows to skip FastP execution
  - adapter_fasta:
      type: file
      description: |
        Fasta file of adapter sequences
  - save_trimmed_fail:
      type: boolean
      description: |
        Save trimmed fastqs of failed samples
  - save_merged:
      type: boolean
      description: |
        Save merged fastqs
  - min_trimmed_reads:
      type: integer
      description: |
        Inputs with fewer than this reads will be filtered out of the "reads" output channel
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test' ]
  - reads:
      type: file
      description: >
        Extracted FASTQ files. | For single-end reads, pattern is \${prefix}.umi_extract.fastq.gz. |
        For paired-end reads, pattern is \${prefix}.umi_extract_{1,2}.fastq.gz.
      pattern: "*.{fastq.gz}"
  - fastqc_html:
      type: file
      description: FastQC report
      pattern: "*_{fastqc.html}"
  - fastqc_zip:
      type: file
      description: FastQC report archive
      pattern: "*_{fastqc.zip}"
  - log:
      type: file
      description: Logfile for umi_tools
      pattern: "*.{log}"
  - trim_json:
      type: file
      description: FastP Trimming report
      pattern: "*.{fastp.json}"
  - trim_html:
      type: file
      description: FastP Trimming report
      pattern: "*.{fastp.html}"
  - log:
      type: file
      description: Logfile FastP
      pattern: "*.{fastp.log}"
  - trim_reads_fail:
      type: file
      description: Trimmed fastq files failing QC
      pattern: "*.{fastq.gz}"
  - trim_reads_merged:
      type: file
      description: Trimmed and merged fastq files
      pattern: "*.{fastq.gz}"
  - trim_read_count:
      type: integer
      description: Number of reads after trimming
  - fastqc_trim_html:
      type: file
      description: FastQC report
      pattern: "*_{fastqc.html}"
  - fastqc_trim_zip:
      type: file
      description: FastQC report archive
      pattern: "*_{fastqc.zip}"
  - adapter_seq:
      type: string
      description: |
        Adapter Sequence found in read1
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
authors:
  - "@robsyme"
maintainers:
  - "@robsyme"
