name: nanoplot
description: |
  Run NanoPlot on nanopore-sequenced reads.
  NanoPlot is a plotting tool for long read sequencing data and alignments.
keywords: ["fastq", "sequencing summary", "nanopore"]
links:
  repository: https://github.com/wdecoster/NanoPlot
  homepage: http://nanoplot.bioinf.be/
  documentation: https://github.com/wdecoster/NanoPlot
references:
  doi: 10.1093/bioinformatics/btad311
license: MIT
argument_groups:
  - name: Inputs
    arguments:
      - name: --fastq
        type: file
        description: Input fastq file(s), separated by ";".
        example: read.fq
        direction: input
        multiple: true
      - name: --fasta
        type: file
        description: Input fasta file(s), separated by ";".
        example: read.fa
        direction: input
        multiple: true
      - name: --fastq_rich
        type: file
        description: |
          Input fastq file(s) generated by albacore or 
          MinKNOW with additional information concerning channel and time, separated by ";".
        example: read.fq
        direction: input
        multiple: true
      - name: --fastq_minimal
        type: file
        description: |
          Input fastq file(s) generated by albacore or MinKNOW with
          additional information concerning channel and time. Minimal data is extracted
          swiftly without elaborate checks. Separated by ";".
        example: read.fq
        direction: input
        multiple: true
      - name: --summary
        type: file
        description: |
          Input summary file(s) generated by albacore or guppy, separated by ";".
        example: read.txt
        direction: input
        multiple: true
      - name: --bam
        type: file
        description: Input sorted bam file(s), separated by ";".
        example: read.bam
        direction: input
        multiple: true
      - name: --ubam
        type: file
        description: Input unmapped bam file(s), separated by ";".
        example: read.ubam
        direction: input
        multiple: true
      - name: --cram
        type: file
        description: Input sorted cram file(s), separated by ";".
        example: read.cram
        direction: input
        multiple: true
      - name: --pickle
        type: file
        description: Input pickle file stored earlier, separated by ";".
        example: read.pkl
        direction: input
        multiple: true
      - name: --feather
        alternatives: [--arrow]
        type: file
        description: Input feather file(s), separated by ";".
        example: read.arrow
        direction: input
        multiple: true
  - name: Outputs
    arguments:
      - name: --outdir
        alternatives: [-o]
        type: file
        direction: output
        description: Specify directory in which output has to be created.
        required: true
  - name: Options
    arguments:
      - name: --verbose
        type: boolean_true
        description: Write log messages also to terminal
      - name: --store
        type: boolean_true
        description: Store the extracted data in a pickle file for future plotting.
      - name: --raw
        type: boolean_true
        description: Store the extracted data in tab separated file.
      - name: --huge
        type: boolean_true
        description: Input data is one very large file.
      - name: --no_static
        type: boolean_false
        description: Do not make static (png) plots.
      - name: --prefix
        alternatives: [-p]
        type: string
        description: Specify an optional prefix to be used for the output files.
      - name: --tsv_stats
        type: boolean_true
        description: Output the stats file as a properly formatted TSV.
      - name: --only_report
        type: boolean_true
        description: Output only the report.
      - name: --info_in_report
        type: boolean_true
        description: Add NanoPlot run info in the report.
  - name: Filtering or transforming input
    arguments:
      - name: --maxlength
        type: integer
        description: Drop reads longer than length specified.
      - name: --minlength
        type: integer
        description: Drop reads shorter than length specified.
      - name: --drop_outliers
        type: boolean_false
        description: Drop outlier reads with extreme long length.
      - name: --downsample
        type: integer
        description: Reduce dataset to N reads by random sampling.
      - name: --loglength
        type: boolean_true
        description: Logarithmic scaling of lengths in plots.
      - name: --percentqual
        type: boolean_true
        description: Use qualities as theoretical percent identities.
      - name: --alength
        type: boolean_true
        description: Use aligned read lengths rather than sequenced length (bam mode). 
      - name: --minqual
        type: integer
        description: Drop reads with an average quality lower than specified.
      - name: --runtime_until
        type: integer
        description: Only take the N first hours of a run.
      - name: --readtype
        type: string
        description: |
          Which read type to extract information about from summary.
          Options are 1D, 2D, 1D2
      - name: --barcoded
        type: boolean_true
        description: Use if you want to split the summary file by barcode.
      - name: --no_supplementary
        type: boolean_false
        description: Use if you want to remove supplementary alignments.
  - name: Customizing plots
    arguments:
      - name: --color
        alternatives: [-c]
        type: string
        description: Specify a color for the plots, must be a valid matplotlib color.
      - name: --colormap
        alternatives: [-cm]
        type: string
        description: Specify a valid matplotlib colormap for the heatmap.
      - name: --format
        alternatives: [-f]
        type: string
        default: png
        description: |
          Specify the output format of the plots.
          {eps,jpeg,jpg,pdf,pgf,png,ps,raw,rgba,svg,svgz,tif,tiff}
      - name: --plots
        type: string
        description: |
          Specify which bivariate plots have to be made.
          [{kde,hex,dot} ...]
      - name: --legacy
        type: string
        description: |
          Specify which bivariate plots have to be made (legacy mode).
          [{kde,dot,hex} ...]
      - name: --listcolors
        type: boolean_true
        description: List the colors which are available for plotting and exit.
      - name: --listcolormaps
        type: boolean_true
        description: List the colormaps which are available for plotting and exit.
      - name: --no_N50 
        type: boolean_false
        description: Hide the N50 mark in the read length histogram.
      - name: --N50 
        type: boolean_true
        description: Show the N50 mark in the read length histogram.
      - name: --title
        type: string
        description: Add a title to all plots, requires quoting if using spaces.
      - name: --font_scale
        type: double
        description: Scale the font of the plots by a factor.
      - name: --dpi
        type: integer
        description: Set the dpi for saving images.
      - name: --hide_stats
        type: boolean_false
        description: Not adding Pearson R stats in some bivariate plots.
resources:
  - type: bash_script
    path: script.sh
test_resources:
  - type: bash_script
    path: test.sh
  - type: file
    path: test_data
engines:
  - type: docker
    image: quay.io/biocontainers/nanoplot:1.43.0--pyhdfd78af_1
    setup:
      - type: docker
        run: |
          version=$(NanoPlot --version) && \
          echo "$version" > /var/software_versions.txt
runners:
  - type: executable
  - type: nextflow