name: "qualimap"
info:
  migration_info:
    git_repo: https://github.com/nf-core/rnaseq.git
    paths: [modules/nf-core/qualimap/rnaseq/main.nf]
    last_sha: 54721c6946daf6d602d7069dc127deef9cbe6b33
description: |
  RNA-seq QC analysis using the qualimap 

argument_groups:
- name: "Input"
  arguments: 
  - name: "--input"
    type: file
    required: true
    description: path to input mapping file in BAM format.

  - name: "--gtf"
    type: file
    required: true
    description: path to annotations file in Ensembl GTF format.
    
- name: "Output"
  arguments: 
  - name: "--output_dir"
    direction: output
    type: file
    required: false
    default: $id.qualimap_output
    description: path to output directory for raw data and report.

  - name: "--output_pdf"
    type: file
    direction: output
    required: false
    must_exist: false
    default: $id.report.pdf
    description: path to output file for pdf report.

  - name: "--output_format"
    type: string
    required: false
    default: html
    description: Format of the output report (PDF or HTML, default is HTML)

- name: "Optional"
  arguments: 
  - name: "--pr_bases"
    type: integer
    required: false
    default: 100
    min: 1
    description: Number of upstream/downstream nucleotide bases to compute 5'-3' bias (default = 100).

  - name: "--tr_bias"
    type: integer
    required: false
    default: 1000
    min: 1
    description: Number of top highly expressed transcripts to compute 5'-3' bias (default = 1000).

  - name: "--algorithm"
    type: string
    required: false
    default: uniquely-mapped-reads
    description: Counting algorithm (uniquely-mapped-reads (default) or proportional).

  - name: "--sequencing_protocol"
    type: string
    required: false
    choices: ["non-strand-specific", "strand-specific-reverse", "strand-specific-forward"]
    default: non-strand-specific
    description: Sequencing library protocol (strand-specific-forward, strand-specific-reverse or non-strand-specific (default)).
  
  - name: "--paired"
    type: boolean_true
    description: Setting this flag for paired-end experiments will result in counting fragments instead of reads.

  - name: "--sorted"
    type: boolean_true
    description: Setting this flag indicates that the input file is already sorted by name. If flag is not set, additional sorting by name will be performed. Only requiredfor paired-end analysis.

  - name: "--java_memory_size"
    type: string
    required: false
    default: 4G 
    description: maximum Java heap memory size, default = 4G.

resources:
  - type: bash_script
    path: script.sh
test_resources:
  - type: bash_script
    path: test.sh
  - path: /testData/unit_test_resources/wgEncodeCaltechRnaSeqGm12878R1x75dAlignsRep2V2.bam
  - path: /testData/unit_test_resources/wgEncodeCaltechRnaSeqGm12878R1x75dAlignsRep2V2.bam.bai
  - path: /testData/unit_test_resources/genes.gtf
  
engines:
- type: docker
  image: ubuntu:22.04
  setup:   
    - type: apt
      packages: [ r-base, unzip, wget, openjdk-8-jdk, libxml2-dev, libcurl4-openssl-dev ]
    - type: docker
      run: |
        wget https://bitbucket.org/kokonech/qualimap/downloads/qualimap_v2.3.zip && \
        unzip qualimap_v2.3.zip && \
        cp -a qualimap_v2.3/. usr/bin && \
        unset DISPLAY && \
        mkdir -p tmp && \
        export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp
    - type: r
      bioc: [ NOISeqr ]
      cran: [ optparse ]
runners: 
- type: executable
- type: nextflow
