name: runner
namespace: workflows
description: Runner for HT RNA-seq pipeline
argument_groups:
  - name: Input arguments
    arguments:
      - name: --input
        description: |
          Base directory of the form `s3:/<bucket>/Sequencing/<Sequencer>/<RunID>/<demultiplex_dir>`.
          Must contains FASTQ files in the format `PoolName_S*_L*_R1_001.fastq.gz` where
            * PoolName is a unique ID for the microwell plates or combination thereof.
            * S followed by a running number: the sample number based on the order
              that samples are listed in the sample sheet (that was used to demultiplex the pools)
              starting with 1 (e.g. S1)
            * (Optional) the lane number (e.g. L001)
            * _001 fixed suffix.
        type: file
        required: true
      - name: "--run_id"
        description: |
          Unique ID for the sequencing run
        type: string
        required: false
      - name: --barcodesFasta
        type: file
        required: true
      - name: --genomeDir
        type: file
        required: true
      - name: --annotation
        type: file
        required: true
      - name: --pools
        description: |
          Filter the FASTQ files in the input directory to only include pools from the provided list.
          Pool names are inferred from the FASTQ file names (see input argument for more information).
          By default all pools are included.
        type: string
        multiple: true
      - name: "--umi_length"
        description: |
          Length of the UMI sequences
        type: integer
        min: 1
        default: 10
  - name: Metadata arguments
    arguments:
      - name: --id
        description: Unique identifier for the run
        type: string
      - name: --project_id
        description: Project ID
        type: string
        required: true
      - name: --experiment_id
        description: Experiment ID
        type: string
        required: true
  - name: Publish arguments
    arguments:
      - name: --fastq_publish_dir
        type: string
        required: true
      - name: --results_publish_dir
        type: string
        required: true
  - name: Output arguments
    description: |
      Parameters that determine the structure of the output. These parameters are provided for internal use only
      and their defaults should not be overwritten.
    arguments:
      - name: "--run_params"
        type: file
        direction: output
        default: params.yaml
      - name: "--star_output_dir"
        type: file
        direction: output
        default: "star_output"
      - name: "--nrReadsNrGenesPerChrom_dir"
        type: file
        direction: output
        default: "nrReadsNrGenesPerChrom"
      - name: "--star_qc_metrics_dir"
        type: file
        direction: output
        default: "starLogs"
      - name: "--eset_dir"
        type: file
        direction: output
        default: "esets"
      - name: "--f_data_dir"
        type: file
        direction: output
        default: "fData"
      - name: "--p_data_dir"
        type: file
        direction: output
        default: "pData"

resources:
  - type: nextflow_script
    path: main.nf
    entrypoint: run_wf
  - path: disable_publishfiles_process.config

test_resources:
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf_with_lanes
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf_only_one_eset
  - type: nextflow_script
    path: test.nf
    entrypoint: test_same_experiment_id_different_projects_wf

dependencies:
  - name: utils/listInputDir
    repository: local
  - name: workflows/well_demultiplex
    repository: local
  - name: workflows/well_fastqs_to_esets
    repository: local
  - name: io/publish_fastqs
    repository: local
  - name: io/publish_results
    repository: local
  - name: utils/save_params
    repository: local

runners:
  - type: nextflow
    config: 
      script: 
        - includeConfig("disable_publishfiles_process.config")

engines:
  - type: native
