name: "cellranger_mapping"
namespace: "workflows/ingestion"
scope: "public"
description: "A pipeline for running Cell Ranger mapping."
info:
  name: Cell Ranger mapping
  test_dependencies:
    - name: cellranger_mapping_test
      namespace: test_workflows/ingestion
authors:
  - __merge__: /src/authors/angela_pisco.yaml
    roles: [ author ]
  - __merge__: /src/authors/robrecht_cannoodt.yaml
    roles: [ author, maintainer ]
  - __merge__: /src/authors/dries_de_maeyer.yaml
    roles: [ author ]
argument_groups:
  - name: Inputs
    arguments:
      - name: "--id"
        required: true
        type: string
        description: ID of the sample.
        example: foo
      - type: file
        name: --input
        required: true
        multiple: true
        multiple_sep: ";"
        example: [ "sample_S1_L001_R1_001.fastq.gz", "sample_S1_L001_R2_001.fastq.gz" ]
        description: The fastq.gz files to align. Can also be a single directory containing fastq.gz files.
      - type: file
        name: --reference
        required: true
        description: The path to Cell Ranger reference tar.gz file.
        example: reference.tar.gz
  - name: Outputs
    arguments:
      - name: "--output_raw"
        type: file
        direction: output
        description: "Location where the output folder from Cell Ranger will be stored."
        required: true
        example: output_dir/
      - name: "--output_h5mu"
        type: file
        direction: output
        description: "The output from Cell Ranger, converted to h5mu."
        required: true
        example: output.h5mu
      - name: "--uns_metrics"
        type: string
        description: Name of the .uns slot under which to QC metrics (if any).
        default: "metrics_summary"
      - name: "--output_type"
        type: string
        description: "Which Cell Ranger output to use for converting to h5mu."
        choices: [ raw, filtered ]
        default: raw
  - name: Cell Ranger arguments
    arguments:
      - type: integer
        name: --expect_cells
        example: 3000
        description: "Expected number of recovered cells, used as input to cell calling algorithm."

      - type: string
        name: --chemistry
        default: auto
        description: |
          Assay configuration.
          - auto: autodetect mode
          - threeprime: Single Cell 3'
          - fiveprime: Single Cell 5'
          - SC3Pv1: Single Cell 3' v1
          - SC3Pv2: Single Cell 3' v2
          - SC3Pv3: Single Cell 3' v3
          - SC3Pv3LT: Single Cell 3' v3 LT
          - SC3Pv3HT: Single Cell 3' v3 HT
          - SC5P-PE: Single Cell 5' paired-end
          - SC5P-R2: Single Cell 5' R2-only
          - SC-FB: Single Cell Antibody-only 3' v2 or 5'
          See https://kb.10xgenomics.com/hc/en-us/articles/115003764132-How-does-Cell-Ranger-auto-detect-chemistry- for more information.
        choices: [ auto, threeprime, fiveprime, SC3Pv1, SC3Pv2, SC3Pv3, SC3Pv3LT, SC3Pv3HT, SC5P-PE, SC5P-R2, SC-FB ] 

      - type: boolean
        name: "--secondary_analysis"
        default: false
        description: Whether or not to run the secondary analysis e.g. clustering.

      - type: boolean
        name: "--generate_bam"
        default: true
        description: Whether to generate a BAM file.
        
      - type: boolean
        name: "--include_introns"
        default: true
        description: Include intronic reads in count (default=true unless --target-panel is specified in which case default=false)
dependencies:
  - name: mapping/cellranger_count
  - name: mapping/cellranger_count_split
  - name: convert/from_10xh5_to_h5mu
resources:
  - type: nextflow_script
    path: main.nf
    entrypoint: run_wf
  - type: file
    path: /src/workflows/utils/
test_resources:
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf
  - path: /resources_test/cellranger_tiny_fastq
runners:
  - type: nextflow