name: "umitools_extract"
namespace: "umitools"
info:
  migration_info:
    git_repo: https://github.com/nf-core/rnaseq.git
    paths: [modules/nf-core/umitools/extract/main.nf, modules/nf-core/umitools/extract/meta.yml]
    last_sha: 54721c6946daf6d602d7069dc127deef9cbe6b33
description: |
  UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs) and single cell RNA-Seq cell barcodes. See https://umi-tools.readthedocs.io/en/latest/ for more information.
  This component flexible removes UMI sequences from fastq reads. UMIs are removed and appended to the read name.
  This component extracts UMI barcode from a read and add it to the read name, leaving any sample barcode in place

argument_groups:
- name: "Input"
  arguments: 
  - name: "--paired"
    type: boolean 
    required: false
    default: false
    description: Paired fastq files or not?
  - name: "--input"
    type: file
    required: true
    multiple: true
    multiple_sep: ","
    description: Input fastq files, either one or two (paired)
    example: sample.fastq
  - name: "--bc_pattern"
    type: string
    description: "The UMI barcode pattern to use e.g. 'NNNNNN' indicates that the first 6 nucleotides of the read are from the UMI."
    multiple: true
    multiple_sep: ","
    
- name: "Output"
  arguments:  
  - name: "--fastq_1"
    type: file
    required: true
    description: Output file for read 1.
    direction: output
    default: $id.$key.read_1.fastq
  - name: "--fastq_2"
    type: file
    required: false
    must_exist: false
    description: Output file for read 2.
    direction: output
    default: $id.$key.read_2.fastq

- name: "Optional arguments"
  arguments:
  - name: "--umitools_extract_method"
    type: "string"
    description: UMI pattern to use.
    default: string
    choices: [ string, regex ]
  - name: "--umitools_umi_separator"
    type: string
    default: "_"
    description: The character that separates the UMI in the read name. Most likely a colon if you skipped the extraction with UMI-tools and used other software.
  - name: "--umitools_grouping_method"
    type: string
    description: Method to use to determine read groups by subsuming those with similar UMIs. All methods start by identifying the reads with the same mapping position, but treat similar yet nonidentical UMIs differently.
    default: "directional"
    choices: ["unique", "percentile", "cluster", "adjacency", "directional"]
  - name: "--umi_discard_read"
    type: integer
    description: After UMI barcode extraction discard either R1 or R2 by setting this parameter to 1 or 2, respectively.
    choices: [0, 1, 2]
    default: 0

resources:
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - path: /testData/unit_test_resources/scrb_seq_fastq.1.gz
  - path: /testData/unit_test_resources/scrb_seq_fastq.2.gz
  - path: /testData/unit_test_resources/slim.fastq.gz

engines:
- type: docker
  image: ubuntu:22.04
  setup:
    - type: apt
      packages: [pip]
    - type: python
      packages: [umi_tools]
runners: 
- type: executable
- type: nextflow
