name: "bowtie2_align"
namespace: "bowtie2"
version: "main"
authors:
- name: "Robrecht Cannoodt"
  roles:
  - "author"
  - "maintainer"
  info:
    links:
      email: "robrecht@data-intuitive.com"
      github: "rcannood"
      orcid: "0000-0003-3641-729X"
      linkedin: "robrechtcannoodt"
    organizations:
    - name: "Data Intuitive"
      href: "https://www.data-intuitive.com"
      role: "Data Science Engineer"
    - name: "Open Problems"
      href: "https://openproblems.bio"
      role: "Core Member"
argument_groups:
- name: "Inputs"
  arguments:
  - type: "string"
    name: "--index"
    description: "Index filename prefix (minus trailing .X.bt2)."
    info: null
    example:
    - "genome_index"
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--mate1"
    description: "Files with #1 mates, paired with files in --mate2."
    info: null
    example:
    - "reads_R1.fastq.gz"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--mate2"
    description: "Files with #2 mates, paired with files in --mate1."
    info: null
    example:
    - "reads_R2.fastq.gz"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--unpaired"
    description: "Files with unpaired reads."
    info: null
    example:
    - "reads.fastq.gz"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--interleaved"
    description: "Files with interleaved paired-end FASTQ/FASTA reads."
    info: null
    example:
    - "interleaved.fastq.gz"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--bam_input"
    description: "Files are unaligned BAM sorted by read name."
    info: null
    example:
    - "unaligned.bam"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
- name: "Outputs"
  arguments:
  - type: "file"
    name: "--output"
    description: "File for SAM output (default stdout)."
    info: null
    example:
    - "aligned.sam"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--un"
    description: "Write unpaired reads that didn't align to file."
    info: null
    example:
    - "unaligned.fastq"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--al"
    description: "Write unpaired reads that aligned at least once to file."
    info: null
    example:
    - "aligned.fastq"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--un_conc"
    description: "Write pairs that didn't align concordantly to file."
    info: null
    example:
    - "unaligned_pairs.fastq"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--al_conc"
    description: "Write pairs that aligned concordantly at least once to file."
    info: null
    example:
    - "aligned_pairs.fastq"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--met_file"
    description: "Send metrics to file."
    info: null
    example:
    - "metrics.txt"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
- name: "Input Format Options"
  arguments:
  - type: "boolean_true"
    name: "--fastq"
    description: "Query input files are FASTQ .fq/.fastq (default)."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--tab5"
    description: "Query input files are TAB5 .tab5."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--tab6"
    description: "Query input files are TAB6 .tab6."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--qseq"
    description: "Query input files are in Illumina's qseq format."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--fasta"
    description: "Query input files are (multi-)FASTA .fa/.mfa."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--raw"
    description: "Query input files are raw one-sequence-per-line."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--cmdline"
    description: "<m1>, <m2>, <r> are sequences themselves, not files."
    info: null
    direction: "input"
  - type: "integer"
    name: "--skip"
    description: "Skip the first <int> reads/pairs in the input."
    info: null
    example:
    - 1000
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--upto"
    description: "Stop after first <int> reads/pairs."
    info: null
    example:
    - 10000
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--trim5"
    description: "Trim <int> bases from 5'/left end of reads."
    info: null
    example:
    - 5
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--trim3"
    description: "Trim <int> bases from 3'/right end of reads."
    info: null
    example:
    - 3
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--trim_to"
    description: "Trim reads exceeding <int> bases from either 3' or 5' end. Format:\
      \ [3:|5:]<int>"
    info: null
    example:
    - "3:100"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--continuous_fasta"
    description: "Query input files are continuous FASTA where reads are k-mers. Format:\
      \ k:<int>,i:<int>"
    info: null
    example:
    - "k:25,i:1"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--phred33"
    description: "Qualities are Phred+33 (default)."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--phred64"
    description: "Qualities are Phred+64."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--int_quals"
    description: "Qualities encoded as space-delimited integers."
    info: null
    direction: "input"
- name: "Alignment Presets"
  arguments:
  - type: "boolean_true"
    name: "--very_fast"
    description: "Same as -D 5 -R 1 -N 0 -L 22 -i S,0,2.50."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--fast"
    description: "Same as -D 10 -R 2 -N 0 -L 22 -i S,0,2.50."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--sensitive"
    description: "Same as -D 15 -R 2 -N 0 -L 22 -i S,1,1.15 (default)."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--very_sensitive"
    description: "Same as -D 20 -R 3 -N 0 -L 20 -i S,1,0.50."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--very_fast_local"
    description: "Same as -D 5 -R 1 -N 0 -L 25 -i S,1,2.00."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--fast_local"
    description: "Same as -D 10 -R 2 -N 0 -L 22 -i S,1,1.75."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--sensitive_local"
    description: "Same as -D 15 -R 2 -N 0 -L 20 -i S,1,0.75."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--very_sensitive_local"
    description: "Same as -D 20 -R 3 -N 0 -L 20 -i S,1,0.50."
    info: null
    direction: "input"
- name: "Alignment Options"
  arguments:
  - type: "integer"
    name: "--N"
    description: "Max # mismatches in seed alignment; can be 0 or 1."
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--L"
    description: "Length of seed substrings; must be >3, <32."
    info: null
    example:
    - 22
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--i"
    description: "Interval between seed substrings w/r/t read len."
    info: null
    example:
    - "S,1,1.15"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--n_ceil"
    description: "Function for max # non-A/C/G/Ts permitted in aln."
    info: null
    example:
    - "L,0,0.15"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--dpad"
    description: "Include <int> extra ref chars on sides of DP table."
    info: null
    example:
    - 15
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--gbar"
    description: "Disallow gaps within <int> nucs of read extremes."
    info: null
    example:
    - 4
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--ignore_quals"
    description: "Treat all quality values as 30 on Phred scale."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--nofw"
    description: "Do not align forward (original) version of read."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--norc"
    description: "Do not align reverse-complement version of read."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_1mm_upfront"
    description: "Do not allow 1 mismatch alignments before attempting to scan for\
      \ the optimal seeded alignments."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--end_to_end"
    description: "Entire read must align; no clipping (default)."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--local"
    description: "Local alignment; ends might be soft clipped."
    info: null
    direction: "input"
- name: "Scoring Options"
  arguments:
  - type: "integer"
    name: "--ma"
    description: "Match bonus (0 for --end-to-end, 2 for --local)."
    info: null
    example:
    - 2
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--mp"
    description: "Max penalty for mismatch; lower qual = lower penalty."
    info: null
    example:
    - "6"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--np"
    description: "Penalty for non-A/C/G/Ts in read/ref."
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--rdg"
    description: "Read gap open, extend penalties."
    info: null
    example:
    - "5,3"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--rfg"
    description: "Reference gap open, extend penalties."
    info: null
    example:
    - "5,3"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--score_min"
    description: "Min acceptable alignment score w/r/t read length."
    info: null
    example:
    - "L,-0.6,-0.6"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Reporting Options"
  arguments:
  - type: "integer"
    name: "--k"
    description: "Report up to <int> alns per read; MAPQ not meaningful."
    info: null
    example:
    - 10
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--all"
    description: "Report all alignments; very slow, MAPQ not meaningful."
    info: null
    direction: "input"
- name: "Effort Options"
  arguments:
  - type: "integer"
    name: "--D"
    description: "Give up extending after <int> failed extends in a row."
    info: null
    example:
    - 15
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--R"
    description: "For reads w/ repetitive seeds, try <int> sets of seeds."
    info: null
    example:
    - 2
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Paired-end Options"
  arguments:
  - type: "integer"
    name: "--minins"
    description: "Minimum fragment length."
    info: null
    example:
    - 0
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--maxins"
    description: "Maximum fragment length."
    info: null
    example:
    - 500
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--fr"
    description: "-1, -2 mates align fw/rev (default)."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--rf"
    description: "-1, -2 mates align rev/fw."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--ff"
    description: "-1, -2 mates align fw/fw."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_mixed"
    description: "Suppress unpaired alignments for paired reads."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_discordant"
    description: "Suppress discordant alignments for paired reads."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--dovetail"
    description: "Concordant when mates extend past each other."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_contain"
    description: "Not concordant when one mate alignment contains other."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_overlap"
    description: "Not concordant when mates overlap at all."
    info: null
    direction: "input"
- name: "SAM Output Options"
  arguments:
  - type: "boolean_true"
    name: "--time"
    description: "Print wall-clock time taken by search phases."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--quiet"
    description: "Print nothing to stderr except serious errors."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--met_stderr"
    description: "Send metrics to stderr."
    info: null
    direction: "input"
  - type: "integer"
    name: "--met"
    description: "Report internal counters & metrics every <int> secs."
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--no_unal"
    description: "Suppress SAM records for unaligned reads."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_head"
    description: "Suppress header lines, i.e. lines starting with @."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--no_sq"
    description: "Suppress @SQ header lines."
    info: null
    direction: "input"
  - type: "string"
    name: "--rg_id"
    description: "Set read group id, reflected in @RG line and RG:Z: opt field."
    info: null
    example:
    - "sample1"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--rg"
    description: "Add <text> (\"lab:value\") to @RG line of SAM header."
    info: null
    example:
    - "SM:sample1"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--omit_sec_seq"
    description: "Put '*' in SEQ and QUAL fields for secondary alignments."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--sam_no_qname_trunc"
    description: "Suppress standard behavior of truncating readname at first whitespace."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--xeq"
    description: "Use '='/'X', instead of 'M,' to specify matches/mismatches in SAM\
      \ record."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--soft_clipped_unmapped_tlen"
    description: "Exclude soft-clipped bases when reporting TLEN."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--sam_append_comment"
    description: "Append FASTA/FASTQ comment to SAM record."
    info: null
    direction: "input"
  - type: "string"
    name: "--sam_opt_config"
    description: "Use config to toggle SAM Optional fields. Example: '-MD,YP,-AS'"
    info: null
    example:
    - "-MD,YP,-AS"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "BAM Options"
  arguments:
  - type: "boolean_true"
    name: "--align_paired_reads"
    description: "Align paired-end reads instead of unpaired BAM reads."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--preserve_tags"
    description: "Preserve tags from the original BAM record."
    info: null
    direction: "input"
- name: "Performance Options"
  arguments:
  - type: "boolean_true"
    name: "--reorder"
    description: "Force SAM output order to match order of input reads."
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--mm"
    description: "Use memory-mapped I/O for index; many 'bowtie's can share."
    info: null
    direction: "input"
- name: "Other Options"
  arguments:
  - type: "boolean_true"
    name: "--qc_filter"
    description: "Filter out reads that are bad according to QSEQ filter."
    info: null
    direction: "input"
  - type: "integer"
    name: "--seed"
    description: "Seed for random number generator."
    info: null
    example:
    - 42
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--non_deterministic"
    description: "Seed rand. gen. arbitrarily instead of using read attributes."
    info: null
    direction: "input"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
description: "Align single-end and paired-end reads to a reference genome using Bowtie2.\n\
  \nBowtie2 is an ultrafast and memory-efficient tool for aligning sequencing reads\n\
  to long reference sequences. It is particularly good at aligning reads of about\n\
  50 up to 100s of characters, and particularly good at aligning to relatively\nlong\
  \ (e.g. mammalian) genomes.\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:
  - "bowtie2"
  - "ps"
keywords:
- "Alignment"
- "Sequencing"
license: "GPL-3.0"
references:
  doi:
  - "10.1038/nmeth.1923"
links:
  repository: "https://github.com/BenLangmead/bowtie2"
  homepage: "https://bowtie-bio.sourceforge.net/bowtie2/index.shtml"
  documentation: "https://bowtie-bio.sourceforge.net/bowtie2/manual.shtml"
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/bowtie2:2.5.4--he96a11b_6"
  target_registry: "images.viash-hub.com"
  target_tag: "main"
  namespace_separator: "/"
  setup:
  - type: "docker"
    run:
    - "bowtie2 --version 2>&1 | head -1 | sed 's/.*version /bowtie2: /' > /var/software_versions.txt\n"
  entrypoint: []
  cmd: null
- type: "native"
  id: "native"
build_info:
  config: "src/bowtie2/bowtie2_align/config.vsh.yaml"
  runner: "nextflow"
  engine: "docker|native"
  output: "target/nextflow/bowtie2/bowtie2_align"
  executable: "target/nextflow/bowtie2/bowtie2_align/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"
