name: "bcftools_norm"
namespace: "bcftools"
version: "main"
authors:
- name: "Theodoro Gasperin Terra Camargo"
  roles:
  - "author"
  info:
    links:
      email: "theodorogtc@gmail.com"
      github: "tgaspe"
      linkedin: "theodoro-gasperin-terra-camargo"
argument_groups:
- name: "Inputs"
  arguments:
  - type: "file"
    name: "--input"
    description: "Input VCF/BCF file.\n\nThe file to be normalized, left-aligned,\
      \ and/or processed.\n"
    info: null
    example:
    - "input.vcf.gz"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Outputs"
  arguments:
  - type: "file"
    name: "--output"
    alternatives:
    - "-o"
    description: "Write output to a file.\n\nIf not specified, output goes to standard\
      \ output.\n"
    info: null
    example:
    - "normalized.vcf.gz"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
- name: "Options"
  arguments:
  - type: "boolean_true"
    name: "--atomize"
    alternatives:
    - "-a"
    description: "Decompose complex variants (e.g., MNVs become consecutive SNVs).\n\
      \nBreaks down complex variants into simpler components.\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--atom_overlaps"
    description: "Use the star allele (*) for overlapping alleles or set to missing\
      \ (.).\n\n**Options:**\n- `*`: Use star allele for overlaps (default)\n- `.`:\
      \ Set overlapping alleles to missing\n"
    info: null
    example:
    - "*"
    required: false
    choices:
    - "."
    - "*"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--check_ref"
    alternatives:
    - "-c"
    description: "Check REF alleles and exit (e), warn (w), exclude (x), or set (s)\
      \ bad sites.\n\n**Options:**\n- `e`: exit on REF mismatch (default)\n- `w`:\
      \ warn about REF mismatches\n- `x`: exclude sites with REF mismatches\n- `s`:\
      \ set/fix REF mismatches\n"
    info: null
    example:
    - "w"
    required: false
    choices:
    - "e"
    - "w"
    - "x"
    - "s"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--remove_duplicates_flag"
    alternatives:
    - "-D"
    description: "Remove duplicate lines of the same type.\n\nShorthand for --rm_dup\
      \ exact.\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--rm_dup"
    alternatives:
    - "-d"
    description: "Remove duplicate snps|indels|both|all|exact.\n\n**Options:**\n-\
      \ `snps`: Remove duplicate SNPs\n- `indels`: Remove duplicate indels\n- `both`:\
      \ Remove duplicate SNPs and indels\n- `all`: Remove all duplicates\n- `exact`:\
      \ Remove exact duplicates only\n"
    info: null
    example:
    - "exact"
    required: false
    choices:
    - "snps"
    - "indels"
    - "both"
    - "all"
    - "exact"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--exclude"
    alternatives:
    - "-e"
    description: "Do not normalize records for which the expression is true.\n\nUses\
      \ bcftools expression syntax (see man page for details).\n"
    info: null
    example:
    - "INFO/DP<10"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--fasta_ref"
    alternatives:
    - "-f"
    description: "Reference sequence file.\n\nRequired for checking REF alleles and\
      \ left-alignment.\n"
    info: null
    example:
    - "reference.fa"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--force"
    description: "Try to proceed even if malformed tags are encountered.\n\n**Warning:**\
      \ Experimental feature, use at your own risk.\n"
    info: null
    direction: "input"
  - type: "file"
    name: "--gff_annot"
    alternatives:
    - "-g"
    description: "Follow HGVS 3'rule and right-align variants in transcripts on the\
      \ forward strand.\n\nUses GFF annotation file for transcript information.\n"
    info: null
    example:
    - "genes.gff"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--include"
    alternatives:
    - "-i"
    description: "Normalize only records for which the expression is true.\n\nUses\
      \ bcftools expression syntax (see man page for details).\n"
    info: null
    example:
    - "QUAL>=30"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--keep_sum"
    description: "Keep vector sum constant when splitting multiallelics.\n\nComma-separated\
      \ list of INFO tags (see github issue #360).\n"
    info: null
    example:
    - "AC,AF"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--multiallelics"
    alternatives:
    - "-m"
    description: "Split multiallelics (-) or join biallelics (+), type: snps|indels|both|any.\n\
      \n**Options:**\n- `-both`: Split multiallelic sites (default)\n- `+both`: Join\
      \ biallelic sites\n- Use `snps`, `indels`, `any` for specific variant types\n"
    info: null
    example:
    - "-both"
    required: false
    choices:
    - "+snps"
    - "+indels"
    - "+both"
    - "+any"
    - "-snps"
    - "-indels"
    - "-both"
    - "-any"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--multi_overlaps"
    description: "Fill in the reference (0) or missing (.) allele when splitting multiallelics.\n\
      \n**Options:**\n- `0`: Fill with reference allele (default)\n- `.`: Fill with\
      \ missing allele\n"
    info: null
    example:
    - "0"
    required: false
    choices:
    - "0"
    - "."
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--no_version"
    description: "Do not append version and command line to the header.\n\nProduces\
      \ cleaner output headers.\n"
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--do_not_normalize"
    alternatives:
    - "-N"
    description: "Do not normalize indels (with -m or -c s).\n\nSkips indel left-alignment\
      \ and normalization.\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--old_rec_tag"
    description: "Annotate modified records with INFO/STR indicating the original\
      \ variant.\n\nAdds specified INFO tag to track original variants.\n"
    info: null
    example:
    - "OLD_VARIANT"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--output_type"
    alternatives:
    - "-O"
    description: "Output type and compression level.\n\n**Options:**\n- `u`: uncompressed\
      \ BCF\n- `b`: compressed BCF\n- `v`: uncompressed VCF (default)\n- `z`: compressed\
      \ VCF (with optional compression level 0-9)\n"
    info: null
    example:
    - "z"
    required: false
    choices:
    - "u"
    - "z"
    - "b"
    - "v"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--regions"
    alternatives:
    - "-r"
    description: "Restrict to comma-separated list of regions.\n\n**Formats supported:**\
      \ chr|chr:pos|chr:beg-end|chr:beg-[,…​]\n"
    info: null
    example:
    - "chr20:1000000-2000000"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--regions_file"
    alternatives:
    - "-R"
    description: "Restrict to regions listed in a file.\n\nRegions can be specified\
      \ in VCF, BED, or tab-delimited format.\n"
    info: null
    example:
    - "regions.bed"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--regions_overlap"
    description: "Include if POS in the region (0), record overlaps (1), variant overlaps\
      \ (2).\n\n**Options:**\n- `0`: POS inside region (default for -t/-T)\n- `1`:\
      \ overlapping records included (default for -r/-R)\n- `2`: true overlapping\
      \ variation only\n"
    info: null
    example:
    - "1"
    required: false
    choices:
    - "0"
    - "1"
    - "2"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--strict_filter"
    alternatives:
    - "-s"
    description: "When merging (-m+), merged site is PASS only if all sites being\
      \ merged PASS.\n\nStricter FILTER handling during multiallelic joining.\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--sort"
    alternatives:
    - "-S"
    description: "Sort order: chr_pos,lex.\n\n**Options:**\n- `chr_pos`: Sort by chromosome\
      \ and position (default)\n- `lex`: Lexicographic sort\n"
    info: null
    example:
    - "chr_pos"
    required: false
    choices:
    - "chr_pos"
    - "lex"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--targets"
    alternatives:
    - "-t"
    description: "Similar to --regions but streams rather than index-jumps.\n\nMore\
      \ efficient for processing many small regions.\n"
    info: null
    example:
    - "chr20:1000000-2000000"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--targets_file"
    alternatives:
    - "-T"
    description: "Similar to --regions_file but streams rather than index-jumps.\n\
      \nMore efficient for processing many regions from file.\n"
    info: null
    example:
    - "targets.bed"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--targets_overlap"
    description: "Include if POS in the region (0), record overlaps (1), variant overlaps\
      \ (2).\n\nSimilar to --regions_overlap but for streaming mode.\n"
    info: null
    example:
    - "0"
    required: false
    choices:
    - "0"
    - "1"
    - "2"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--verbosity"
    alternatives:
    - "-v"
    description: "Verbosity level.\n\nControls amount of diagnostic output.\n"
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--site_win"
    alternatives:
    - "-w"
    description: "Buffer for sorting lines which changed position during realignment.\n\
      \nLarger values use more memory but handle more complex rearrangements.\n"
    info: null
    example:
    - 1000
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--write_index"
    alternatives:
    - "-W"
    description: "Automatically index the output files.\n\n**Format:** Specify index\
      \ format or use default.\n"
    info: null
    example:
    - "tbi"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
description: "Left-align and normalize indels, check if REF alleles match the reference,\
  \ split multiallelic sites into multiple rows; \nrecover multiallelics from multiple\
  \ rows. \n"
test_resources:
- type: "bash_script"
  path: "test.sh"
  is_executable: true
- type: "file"
  path: "test_helpers.sh"
info: null
status: "enabled"
scope:
  image: "public"
  target: "public"
requirements:
  commands:
  - "bcftools"
  - "ps"
keywords:
- "Normalize"
- "VCF"
- "BCF"
license: "MIT/Expat, GNU"
references:
  doi:
  - "https://doi.org/10.1093/gigascience/giab008"
links:
  repository: "https://github.com/samtools/bcftools"
  homepage: "https://samtools.github.io/bcftools/"
  documentation: "https://samtools.github.io/bcftools/bcftools.html#norm"
  issue_tracker: "https://github.com/samtools/bcftools/issues"
runners:
- type: "executable"
  id: "executable"
  docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
  id: "nextflow"
  directives:
    tag: "$id"
  auto:
    simplifyInput: true
    simplifyOutput: false
    transcript: false
    publish: false
  config:
    labels:
      mem1gb: "memory = 1000000000.B"
      mem2gb: "memory = 2000000000.B"
      mem5gb: "memory = 5000000000.B"
      mem10gb: "memory = 10000000000.B"
      mem20gb: "memory = 20000000000.B"
      mem50gb: "memory = 50000000000.B"
      mem100gb: "memory = 100000000000.B"
      mem200gb: "memory = 200000000000.B"
      mem500gb: "memory = 500000000000.B"
      mem1tb: "memory = 1000000000000.B"
      mem2tb: "memory = 2000000000000.B"
      mem5tb: "memory = 5000000000000.B"
      mem10tb: "memory = 10000000000000.B"
      mem20tb: "memory = 20000000000000.B"
      mem50tb: "memory = 50000000000000.B"
      mem100tb: "memory = 100000000000000.B"
      mem200tb: "memory = 200000000000000.B"
      mem500tb: "memory = 500000000000000.B"
      mem1gib: "memory = 1073741824.B"
      mem2gib: "memory = 2147483648.B"
      mem4gib: "memory = 4294967296.B"
      mem8gib: "memory = 8589934592.B"
      mem16gib: "memory = 17179869184.B"
      mem32gib: "memory = 34359738368.B"
      mem64gib: "memory = 68719476736.B"
      mem128gib: "memory = 137438953472.B"
      mem256gib: "memory = 274877906944.B"
      mem512gib: "memory = 549755813888.B"
      mem1tib: "memory = 1099511627776.B"
      mem2tib: "memory = 2199023255552.B"
      mem4tib: "memory = 4398046511104.B"
      mem8tib: "memory = 8796093022208.B"
      mem16tib: "memory = 17592186044416.B"
      mem32tib: "memory = 35184372088832.B"
      mem64tib: "memory = 70368744177664.B"
      mem128tib: "memory = 140737488355328.B"
      mem256tib: "memory = 281474976710656.B"
      mem512tib: "memory = 562949953421312.B"
      cpu1: "cpus = 1"
      cpu2: "cpus = 2"
      cpu5: "cpus = 5"
      cpu10: "cpus = 10"
      cpu20: "cpus = 20"
      cpu50: "cpus = 50"
      cpu100: "cpus = 100"
      cpu200: "cpus = 200"
      cpu500: "cpus = 500"
      cpu1000: "cpus = 1000"
  debug: false
  container: "docker"
engines:
- type: "docker"
  id: "docker"
  image: "quay.io/biocontainers/bcftools:1.22--h3a4d415_1"
  target_registry: "images.viash-hub.com"
  target_tag: "main"
  namespace_separator: "/"
  setup:
  - type: "docker"
    run:
    - "bcftools --version 2>&1 | head -1 | sed 's/bcftools /bcftools: /' > /var/software_versions.txt\n"
  entrypoint: []
  cmd: null
- type: "native"
  id: "native"
build_info:
  config: "src/bcftools/bcftools_norm/config.vsh.yaml"
  runner: "nextflow"
  engine: "docker|native"
  output: "target/nextflow/bcftools/bcftools_norm"
  executable: "target/nextflow/bcftools/bcftools_norm/main.nf"
  viash_version: "0.9.4"
  git_commit: "9991e9a4f5ddd5085a4e2becf962950b1daf594b"
  git_remote: "https://github.com/viash-hub/biobox"
package_config:
  name: "biobox"
  version: "main"
  summary: "A curated collection of high-quality, standalone bioinformatics components\
    \ built with [Viash](https://viash.io).\n"
  description: "`biobox` offers a suite of reliable bioinformatics components, similar\
    \ to [nf-core/modules](https://github.com/nf-core/modules) and [snakemake-wrappers/bio](https://github.com/snakemake/snakemake-wrappers/tree/master/bio),\
    \ but built using the [Viash](https://viash.io) framework.\n\nThis approach emphasizes\
    \ **reusability**, **reproducibility**, and adherence to **best practices**. Key\
    \ features of `biobox` components include:\n\n* **Standalone & Nextflow Ready:**\
    \ Run components directly via the command line or seamlessly integrate them into\
    \ Nextflow workflows.\n* **High Quality Standards:**\n    * Comprehensive documentation\
    \ for components and parameters.\n    * Full exposure of underlying tool arguments.\n\
    \    * Containerized (Docker) for dependency management and reproducibility.\n\
    \    * Unit tested for verified functionality.\n"
  info: null
  viash_version: "0.9.4"
  source: "src"
  target: "target"
  config_mods:
  - ".requirements.commands += ['ps']\n"
  - ".engines += { type: \"native\" }"
  - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
  - ".engines[.type == 'docker'].target_tag := 'main'"
  keywords:
  - "bioinformatics"
  - "modules"
  - "sequencing"
  license: "MIT"
  organization: "vsh"
  links:
    repository: "https://github.com/viash-hub/biobox"
    issue_tracker: "https://github.com/viash-hub/biobox/issues"
