name: cellranger_atac_count
namespace: mapping
scope: "public"
description: Align fastq files using Cell Ranger ATAC count.
authors:
  - __merge__: /src/authors/vladimir_shitov.yaml
    roles: [ author ]
argument_groups:
  - name: Inputs
    arguments:
      - type: file
        name: --input
        required: true
        multiple: true
        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. Can also be a directory.
        example: reference.tar.gz
  - name: Outputs
    arguments:
      - type: file
        name: --output
        direction: output
        description: The folder to store the alignment results.
        example: "/path/to/output"
        required: true
  - name: Arguments
    arguments:
      - type: string
        name: --description
        description: Sample description to embed in output files
        default: ""
      - type: integer
        name: --force_cells
        description: "Define the top N barcodes with the most fragments overlapping peaks as cells and override the cell calling algorithm. N must be a positive integer <= 20,000. Use this option if the number of cells estimated by Cell Ranger ATAC is not consistent with the barcode rank plot"
        max: 20000
      - type: file
        name: --peaks
        description: "Override peak caller: specify peaks to use in downstream analyses from supplied 3-column BED file. The supplied peaks file must be sorted by position and not contain overlapping peaks; comment lines beginning with # are allowed"
      - type: string
        name: --dim_reduce
        description: "Dimensionality reduction mode for clustering"
        choices: [ lsa, pca, plsa ]
        default: lsa
      - type: double
        name: --subsample_rate
        description: "Downsample to preserve this fraction of reads"
        example: 0.1
      - type: string
        multiple: true
        name: --lanes
        description: bcl2fastq option. Semicolon-delimited series of lanes to demultiplex. Use this if you have a sample sheet for an entire flow cell but only want to generate a few lanes for further 10x Genomics analysis.
        example: 1,3
resources:
  - type: bash_script
    path: script.sh
test_resources:
  - type: python_script
    path: test.py
  - path: /resources_test/cellranger_atac_tiny_bcl
  - path: /src/utils/setup_logger.py
  - path: /resources_test/reference_gencodev41_chr1
engines:
  - type: docker
    image: ghcr.io/data-intuitive/cellranger_atac:2.1
    setup:
      - type: docker
        run: |
          DEBIAN_FRONTEND=noninteractive apt update \
          && apt upgrade -y && apt install -y procps && rm -rf /var/lib/apt/lists/*
runners:
  - type: executable
  - type: nextflow
    directives:
      label: [ highmem, highcpu, middisk ]
