name: samtools_sort
description: Sort SAM/BAM/CRAM file
keywords:
  - sort
  - bam
  - sam
  - cram
tools:
  - samtools:
      description: |
        SAMtools is a set of utilities for interacting with and post-processing
        short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
        These files are generated as output by short read aligners like BWA.
      homepage: http://www.htslib.org/
      documentation: http://www.htslib.org/doc/samtools.html
      doi: 10.1093/bioinformatics/btp352
      licence: ["MIT"]
      identifier: biotools:samtools
input:
  - - meta:
        type: map
        description: |
          Groovy Map containing sample information
          e.g. [ id:'test', single_end:false ]
    - bam:
        type: file
        description: BAM/CRAM/SAM file(s)
        pattern: "*.{bam,cram,sam}"
        ontologies: []
  - - meta2:
        type: map
        description: |
          Groovy Map containing reference information
          e.g. [ id:'genome' ]
    - fasta:
        type: file
        description: Reference genome FASTA file
        pattern: "*.{fa,fasta,fna}"
        optional: true
        ontologies: []
  - index_format:
      type: string
      description: Index format to use (optional)
      pattern: "bai|csi|crai"
output:
  bam:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.bam":
          type: file
          description: Sorted BAM file
          pattern: "*.{bam}"
          ontologies: []
  cram:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.cram":
          type: file
          description: Sorted CRAM file
          pattern: "*.{cram}"
          ontologies: []
  sam:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.sam":
          type: file
          description: Sorted SAM file
          pattern: "*.{sam}"
          ontologies: []

  crai:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.${extension}.crai":
          type: file
          description: CRAM index file (optional)
          pattern: "*.crai"
          ontologies: []
  csi:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.${extension}.csi":
          type: file
          description: BAM index file (optional)
          pattern: "*.csi"
          ontologies: []
  bai:
    - - meta:
          type: map
          description: |
            Groovy Map containing sample information
            e.g. [ id:'test', single_end:false ]
      - "${prefix}.${extension}.bai":
          type: file
          description: BAM index file (optional)
          pattern: "*.bai"
          ontologies: []
  versions:
    - versions.yml:
        type: file
        description: File containing software versions
        pattern: "versions.yml"
        ontologies:
          - edam: http://edamontology.org/format_3750 # YAML
authors:
  - "@drpatelh"
  - "@ewels"
  - "@matthdsm"
maintainers:
  - "@drpatelh"
  - "@ewels"
  - "@matthdsm"
