name: fgbio_groupreadsbyumi
description: |
  Groups reads together that appear to have come from the same original molecule.
  Reads are grouped by template, and then templates are sorted by the 5’ mapping positions
  of the reads from the template, used from earliest mapping position to latest.
  Reads that have the same end positions are then sub-grouped by UMI sequence.
  (!) Note: the MQ tag is required on reads with mapped mates (!)
  This can be added using samblaster with the optional argument --addMateTags.
keywords:
  - UMI
  - groupreads
  - fgbio
tools:
  - fgbio:
      description: A set of tools for working with genomic and high throughput sequencing data, including UMIs
      homepage: http://fulcrumgenomics.github.io/fgbio/
      documentation: http://fulcrumgenomics.github.io/fgbio/tools/latest/
      tool_dev_url: https://github.com/fulcrumgenomics/fgbio
      doi: ""
      licence: ["MIT"]

input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - bam:
      type: file
      description: |
        BAM file. Note: the MQ tag is required on reads with mapped mates (!)
      pattern: "*.bam"
  - strategy:
      type: value
      description: |
        Reguired argument: defines the UMI assignment strategy.
        Must be chosen among: Identity, Edit, Adjacency, Paired.

output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
  - bam:
      type: file
      description: UMI-grouped BAM
      pattern: "*.bam"
  - histogram:
      type: file
      description: A text file containing the tag family size counts
      pattern: "*.txt"

authors:
  - "@lescai"
