name: fastqc
description: FastQC - A high throughput sequence QC analysis tool.
keywords: [Quality control, BAM, SAM, FASTQ]
links:
  homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/
  documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/
  repository: https://github.com/s-andrews/FastQC
  issue_tracker: https://github.com/s-andrews/FastQC/issues
license: GPL-3.0, Apache-2.0
authors:
  - __merge__: /src/_authors/theodoro_gasperin.yaml
    roles: [ author, maintainer ]

argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        type: file
        direction: input
        multiple: true
        description: | 
          FASTQ file(s) to be analyzed.
        required: true
        example: input.fq
        
  - name: Outputs
    description: |
      At least one of the output options (--html, --zip, --summary, --data) must be used.
    arguments:

      - name: --html
        type: file
        direction: output
        multiple: true
        description: |
          Create the HTML report of the results. 
          '*' wild card must be provided in the output file name. 
          Wild card will be replaced by the input file basename.
          e.g. 
            --input "sample_1.fq"
            --html "*.html"
            would create an output html file named sample_1.html
        example: "*.html"
      
      - name: --zip
        type: file
        direction: output
        multiple: true
        description: |
          Create the zip file(s) containing: html report, data, images, icons, summary, etc.
          '*' wild card must be provided in the output file name.
          Wild card will be replaced by the input basename.
          e.g. 
            --input "sample_1.fq"
            --html "*.zip"
            would create an output zip file named sample_1.zip
        example: "*.zip"   

      - name: --summary
        type: file
        direction: output
        multiple: true
        description: |
          Create the summary file(s).
          '*' wild card must be provided in the output file name.
          Wild card will be replaced by the input basename.
          e.g. 
            --input "sample_1.fq"
            --summary "*_summary.txt"
            would create an output summary.txt file named sample_1_summary.txt
        example: "*_summary.txt"

      - name: --data
        type: file
        direction: output
        multiple: true
        description: |
          Create the data file(s).
          '*' wild card must be provided in the output file name.
          Wild card will be replaced by the input basename.
          e.g. 
            --input "sample_1.fq"
            --summary "*_data.txt"
            would create an output data.txt file named sample_1_data.txt
        example: "*_data.txt"

  - name: Options
    arguments:  
      - name: --casava
        type: boolean_true
        description: | 
          Files come from raw casava output. Files in the same sample
          group (differing only by the group number) will be analysed
          as a set rather than individually. Sequences with the filter
          flag set in the header will be excluded from the analysis.
          Files must have the same names given to them by casava
          (including being gzipped and ending with .gz) otherwise they
          won't be grouped together correctly.
      
      - name: --nano
        type: boolean_true
        description: |
          Files come from nanopore sequences and are in fast5 format. In
          this mode you can pass in directories to process and the program
          will take in all fast5 files within those directories and produce
          a single output file from the sequences found in all files.
      
      - name: --nofilter
        type: boolean_true
        description: |
          If running with --casava then don't remove read flagged by
          casava as poor quality when performing the QC analysis.

      - name: --nogroup
        type: boolean_true
        description: |
          Disable grouping of bases for reads >50bp. 
          All reports will show data for every base in the read. 
          WARNING: Using this option will cause fastqc to crash 
          and burn if you use it on really long reads, and your 
          plots may end up a ridiculous size. You have been warned!

      - name: --min_length
        type: integer
        description: |
          Sets an artificial lower limit on the length of the 
          sequence to be shown in the report. As long as you 
          set this to a value greater or equal to your longest 
          read length then this will be the sequence length used 
          to create your read groups. This can be useful for making
          directly comparable statistics from datasets with somewhat 
          variable read lengths.
        example: 0

      - name: --format
        alternatives: -f
        type: string
        description: |
          Bypasses the normal sequence file format detection and 
          forces the program to use the specified format. 
          Valid formats are bam, sam, bam_mapped, sam_mapped, and fastq.
        example: bam
        
      - name: --contaminants
        alternatives: -c
        type: file
        description: |
          Specifies a non-default file which contains the list 
          of contaminants to screen overrepresented sequences against. 
          The file must contain sets of named contaminants in the form
          name[tab]sequence. Lines prefixed with a hash will be ignored.
        example: contaminants.txt
        
      - name: --adapters
        alternatives: -a
        type: file
        description: |
          Specifies a non-default file which contains the list of 
          adapter sequences which will be explicitly searched against 
          the library. The file must contain sets of named adapters 
          in the form name[tab]sequence. Lines prefixed with a hash will be ignored.
        example: adapters.txt

      - name: --limits
        alternatives: -l
        type: file
        description: |
          Specifies a non-default file which contains 
          a set of criteria which will be used to determine 
          the warn/error limits for the various modules. 
          This file can also be used to selectively remove 
          some modules from the output altogether. The format 
          needs to mirror the default limits.txt file found in 
          the Configuration folder.
        example: limits.txt

      - name: --kmers
        alternatives: -k
        type: integer
        description: |
          Specifies the length of Kmer to look for in the Kmer 
          content module. Specified Kmer length must be between 
          2 and 10. Default length is 7 if not specified.
        example: 7
        
      - name: --quiet
        alternatives: -q
        type: boolean_true
        description: |
          Suppress all progress messages on stdout and only report errors.
        
resources:
  - type: bash_script
    path: script.sh
test_resources:
  - type: bash_script
    path: test.sh

engines:
  - type: docker
    image: biocontainers/fastqc:v0.11.9_cv8
    setup:
      - type: docker
        run: |
          echo "fastqc: $(fastqc --version | sed -n 's/^FastQC //p')" > /var/software_versions.txt

runners:
  - type: executable
  - type: nextflow
