name: bcftools_sort
namespace: bcftools
description: | 
  Sort VCF/BCF file.
keywords: [Sort, VCF, BCF]
links:
  homepage: https://samtools.github.io/bcftools/
  documentation: https://samtools.github.io/bcftools/bcftools.html#sort
  repository: https://github.com/samtools/bcftools
  issue_tracker: https://github.com/samtools/bcftools/issues
references:
  doi: https://doi.org/10.1093/gigascience/giab008
license: MIT/Expat, GNU
requirements:
  commands: [bcftools]
authors:
  - __merge__: /src/_authors/theodoro_gasperin.yaml
    roles: [author]

argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        type: file
        description: |
          Input VCF/BCF file to sort.
          
          The file to be sorted by genomic coordinates.
        required: true
        example: "input.vcf.gz"
    
  - name: Outputs
    arguments:
      - name: --output
        alternatives: [-o]
        direction: output
        type: file
        description: |
          Write output to a file.
          
          If not specified, output goes to standard output.
        required: true
        example: "sorted.vcf.gz"
         
  - name: Options
    arguments:
      - name: --output_type
        alternatives: [-O]
        type: string
        description: |
          Output file type.
          
          **Options:**
          - u: uncompressed BCF
          - b: compressed BCF  
          - v: uncompressed VCF
          - z: compressed VCF
          - 0-9: compression level for compressed formats
          
          **Default:** v (uncompressed VCF)
        example: "z"
        
      - name: --verbosity
        alternatives: [-v]
        type: integer
        description: |
          Verbosity level.
          
          Higher values increase verbosity of output messages.
        example: 1
        
      - name: --write_index
        alternatives: [-W]
        type: string
        description: |
          Automatically index the output files.
          
          **Format:** Specify index format or use default.
        example: "tbi"        

resources:
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - path: /src/_utils/test_helpers.sh

engines:
  - type: docker
    image: quay.io/biocontainers/bcftools:1.22--h3a4d415_1
    setup:
      - type: docker
        run: |
          bcftools --version 2>&1 | head -1 | sed 's/bcftools /bcftools: /' > /var/software_versions.txt

runners:
  - type: executable
  - type: nextflow
