name: "sgdemux"
version: "add_sgdemux"
authors:
- name: "Dries Schaumont"
  roles:
  - "author"
  - "maintainer"
  info:
    links:
      email: "dries@data-intuitive.com"
      github: "DriesSchaumont"
      orcid: "0000-0002-4389-0440"
      linkedin: "dries-schaumont"
    organizations:
    - name: "Data Intuitive"
      href: "https://www.data-intuitive.com"
      role: "Data Scientist"
argument_groups:
- name: "Input"
  arguments:
  - type: "file"
    name: "--fastqs"
    alternatives:
    - "-f"
    description: "Path to the input FASTQs, or path prefix if not a file"
    info: null
    example:
    - "sample1_r1.fq;sample1_r2.fq;sample2_r1.fq;sample2_r2.fq"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--sample_metadata"
    alternatives:
    - "-s"
    description: "Path to the sample metadata CSV file including sample names and\
      \ barcode sequences"
    info: null
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Output"
  arguments:
  - type: "file"
    name: "--sample_fastq"
    description: "The directory containing demultiplexed sample FASTQ files."
    info: null
    example:
    - "output"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--metrics"
    description: "Demultiplexing summary statisitcs:\n  - control_reads_omitted: The\
      \ number of reads that were omitted for being control reads.\n  - failing_reads_omitted:\
      \ The number of reads that were omitted for having failed QC.\n  - total_templates:\
      \ The total number of template reads that were output.\n"
    info: null
    example:
    - "metrics.tsv"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--most_frequent_unmatched"
    description: "It contains the (approximate) counts of the most prevelant observed\
      \ barcode sequences\nthat did not match to one of the expected barcodes. Can\
      \ only be created when 'most_unmatched_to_output'\nis not set to 0.\n"
    info: null
    example:
    - "most_frequent_unmatched.tsv"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--sample_barcode_hop_metrics"
    description: "File containing the frequently observed barcodes that are unexpected\n\
      combinations of expected barcodes in a dual-indexed run.\n"
    info: null
    example:
    - "sample_barcode_hop_metrics.tsv"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--per_project_metrics"
    description: "Aggregates the metrics by project (aggregates the metrics across\
      \ samples with the same project) and\nhas the same columns as `--metrics`. In\
      \ this case, sample_ID will contain the project name (or None if no project\
      \ is given).\nTHe barcode will contain all Ns. The undetermined sample will\
      \ not be aggregated with any other sample.\n"
    info: null
    example:
    - "per_project_metrics.tsv"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--per_sample_metrics"
    description: "Tab-separated file containing statistics per sample.\n"
    info: null
    example:
    - "per_sample_metrics.tsv"
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    multiple: false
    multiple_sep: ";"
- name: "Arguments"
  arguments:
  - type: "string"
    name: "--read_structures"
    alternatives:
    - "-r"
    description: "Read structures, one per input FASTQ. Do not provide when using\
      \ a path prefix for FASTQs"
    info: null
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "integer"
    name: "--allowed_mismatches"
    alternatives:
    - "-m"
    description: "Number of allowed mismatches between the observed barcode and the\
      \ expected barcode"
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--min_delta"
    alternatives:
    - "-d"
    description: "The minimum allowed difference between an observed barcode and the\
      \ second closest expected barcode"
    info: null
    example:
    - 2
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--free_ns"
    alternatives:
    - "-F"
    description: "Number of N's to allow in a barcode without counting against the\
      \ allowed_mismatches"
    info: null
    example:
    - 1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--max_no_calls"
    alternatives:
    - "-N"
    description: "Max no-calls (N's) in a barcode before it is considered unmatchable.\n\
      A barcode with total N's greater than 'max_no_call' will be considered unmatchable.\n"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--quality_mask_threshold"
    alternatives:
    - "-M"
    description: "Mask template bases with quality scores less than specified value(s).\n\
      Sample barcode/index and UMI bases are never masked. If provided either a single\
      \ value,\nor one value per FASTQ must be provided.\n"
    info: null
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--filter_control_reads"
    alternatives:
    - "-C"
    description: "Filter out control reads"
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--filter_failing_quality"
    alternatives:
    - "-Q"
    description: "Filter reads failing quality filter\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--output_types"
    alternatives:
    - "-T"
    description: "The types of output FASTQs to write.\nFor each read structure, all\
      \ segment types listed will be output to a FASTQ file.\n\nThese may be any of\
      \ the following:\n - `T` - Template bases\n - `B` - Sample barcode bases\n -\
      \ `M` - Molecular barcode bases\n - `S` - Skip bases\n"
    info: null
    example:
    - "T"
    required: false
    choices:
    - "T"
    - "B"
    - "S"
    - "M"
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "string"
    name: "--undetermined_sample_name"
    alternatives:
    - "-u"
    description: "The sample name for undetermined reads (reads that do not match\
      \ an expected barcode)\n"
    info: null
    example:
    - "Undetermined"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--most_unmatched_to_output"
    alternatives:
    - "-U"
    description: "Output the most frequent \"unmatched\" barcodes up to this number.\n\
      If set to 0 unmatched barcodes will not be collected, improving overall performance.\n"
    info: null
    example:
    - 1000
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--override_matcher"
    description: "If the sample barcodes are > 12 bp long, a cached hamming distance\
      \ matcher is used.\nIf the barcodes are less than or equal to 12 bp long, all\
      \ possible matches are precomputed.\nThis option allows for overriding that\
      \ heuristic.\n"
    info: null
    required: false
    choices:
    - "cached-hamming-distance"
    - "pre-compute"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--skip_read_name_check"
    description: "If this is true, then all the read names across FASTQs will not\
      \ be enforced to be the same.\nThis may be useful when the read names are known\
      \ to be the same and performance matters.\nRegardless, the first read name in\
      \ each FASTQ will always be checked.\n"
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--sample_barcode_in_fastq_header"
    description: "If this is true, then the sample barcode is expected to be in the\
      \ FASTQ read header.\nFor dual indexed data, the barcodes must be `+` (plus)\
      \ delimited.  Additionally, if true,\nthen neither index FASTQ files nor sample\
      \ barcode segments in the read structure may be specified.\n"
    info: null
    direction: "input"
  - type: "string"
    name: "--metric_prefix"
    description: "Prepend this prefix to all output metric file names\n"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--lane"
    alternatives:
    - "-l"
    description: "Select a subset of lanes to demultiplex.  Will cause only samples\
      \ and input FASTQs with\nthe given `Lane`(s) to be demultiplexed. Samples without\
      \ a lane will be ignored, and\nFASTQs without lane information will be ignored\n"
    info: null
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
description: "Demultiplex sequence data generated on Singular Genomics' sequencing\
  \ instruments.\n"
test_resources:
- type: "bash_script"
  path: "test.sh"
  is_executable: true
- type: "file"
  path: "test_data"
info: null
status: "enabled"
requirements:
  commands:
  - "ps"
keywords:
- "demultiplex"
- "fastq"
license: "Proprietairy"
links:
  repository: "https://github.com/Singular-Genomics/singular-demux"
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: "continuumio/miniconda3:latest"
  target_registry: "images.viash-hub.com"
  target_tag: "add_sgdemux"
  namespace_separator: "/"
  setup:
  - type: "apt"
    packages:
    - "procps"
    interactive: false
  - type: "docker"
    run:
    - "conda install -c conda-forge -c bioconda sgdemux && \\\necho \"sgdemux: $(sgdemux\
      \ --version | cut -d' ' -f2)\" > /var/software_versions.txt\n"
  entrypoint: []
  cmd: null
- type: "native"
  id: "native"
build_info:
  config: "src/sgdemux/config.vsh.yaml"
  runner: "executable"
  engine: "docker|native"
  output: "target/executable/sgdemux"
  executable: "target/executable/sgdemux/sgdemux"
  viash_version: "0.9.0"
  git_commit: "402ad6a813c0d0b141bbf8f9a3aab9c270a74812"
  git_remote: "https://x-access-token:ghs_VWGBwCOTHxXRJ07uVE94xFn8UJ2FmS0FLhmc@github.com/viash-hub/biobox"
  git_tag: "v0.2.0-27-g402ad6a"
package_config:
  name: "biobox"
  version: "add_sgdemux"
  description: "A collection of bioinformatics tools for working with sequence data.\n"
  info: null
  viash_version: "0.9.0"
  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 := 'add_sgdemux'"
  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"
