name: "spaceranger_count"
namespace: "mapping"
version: "v0.3.0"
authors:
- name: "Jakub Majercik"
  roles:
  - "author"
  info:
    role: "Contributor"
    links:
      email: "jakub@data-intuitive.com"
      github: "jakubmajercik"
      linkedin: "jakubmajercik"
    organizations:
    - name: "Data Intuitive"
      href: "https://www.data-intuitive.com"
      role: "Bioinformatics Engineer"
argument_groups:
- name: "Inputs"
  arguments:
  - type: "file"
    name: "--gex_reference"
    description: "Path of folder containing 10x-compatible reference"
    info: null
    example:
    - "/path/to/refdata-gex-GRCh38-2020-A"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--input"
    description: "The fastq.gz files to align. Can also be a single directory containing\
      \ fastq.gz files.\n\nIndividual FASTQ files should follow the naming convention\
      \ of 10x Genomics:\n[Sample Name]_S[Sample Number]_L[Lane Number]_[Read Type]_001.fastq.gz\n\
      \nWhere:\n[Sample Name] is the name assigned during sample preparation/sequencing\n\
      S[Sample Number] is the sample index (usually S1, S2, etc.)\nL[Lane Number]\
      \ identifies the sequencing lane (L001, L002, etc.)\n\n[Read Type] will be one\
      \ of:\nR1 - Read 1 (contains the spatial barcode and UMI)\nR2 - Read 2 (contains\
      \ the actual cDNA sequence)\n"
    info: null
    example:
    - "sample_S1_L001_R1_001.fastq.gz"
    - "sample_S1_L001_R2_001.fastq.gz"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "file"
    name: "--probe_set"
    description: "CSV file specifying the probe set used"
    info: null
    example:
    - "Visium_Human_Transcriptome_Probe_Set_v2.0_GRCh38-2020-A.csv"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--cytaimage"
    description: "Brightfield image generated by the CytAssist instrument. \nWhen\
      \ using CytAssist workflow, either this or --image must be provided.\n"
    info: null
    example:
    - "cyta_image.tif"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--image"
    description: "H&E or fluorescence microscope image in TIFF or JPG format. \nRequired\
      \ for standard Visium workflow, optional when using --cytaimage for CytAssist\
      \ workflow.\n"
    info: null
    example:
    - "brightfield.tif"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Outputs"
  arguments:
  - type: "file"
    name: "--output"
    description: "The folder to store the alignment results"
    info: null
    example:
    - "/path/to/output"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
- name: "Slide Information"
  arguments:
  - type: "string"
    name: "--slide"
    description: "Visium slide serial number (e.g., 'V10J25-015')"
    info: null
    example:
    - "V10J25-015"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--area"
    description: "Visium capture area identifier (e.g., 'A1')"
    info: null
    example:
    - "A1"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--unknown_slide"
    description: "Use this option if the slide serial number and area were entered\
      \ incorrectly on the CytAssist \ninstrument and the correct values are unknown.\
      \ Not compatible with --slide, --area, or \n--slide-file options\n"
    info: null
    required: false
    choices:
    - "visium-1"
    - "visium-2"
    - "visium-2-large"
    - "visium-hd"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--slidefile"
    description: "Slide design file for offline use"
    info: null
    example:
    - "slide_design.gpr"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--override_id"
    description: "Overrides the slide serial number and capture area provided in the\
      \ Cytassist image metadata"
    info: null
    direction: "input"
- name: "Image Options"
  arguments:
  - type: "file"
    name: "--darkimage"
    description: "Multi-channel, dark-background fluorescence image"
    info: null
    example:
    - "fluorescence.tif"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--colorizedimage"
    description: "Color image representing pre-colored dark-background fluorescence\
      \ images"
    info: null
    example:
    - "colored_fluorescence.tif"
    must_exist: true
    create_parent: true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--dapi_index"
    description: "Index of DAPI channel (1-indexed) of fluorescence image"
    info: null
    example:
    - 1
    required: false
    min: 1
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--image_scale"
    description: "Microns per microscope image pixel"
    info: null
    example:
    - 0.65
    required: false
    min: 0.01
    max: 10.0
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean"
    name: "--reorient_images"
    description: "Whether to rotate and mirror image to align fiducial pattern"
    info: null
    default:
    - true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Processing Options"
  arguments:
  - type: "boolean"
    name: "--create_bam"
    description: "Enable or disable BAM file generation"
    info: null
    default:
    - true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_true"
    name: "--nosecondary"
    description: "Disable secondary analysis (e.g., clustering)"
    info: null
    direction: "input"
  - type: "integer"
    name: "--r1_length"
    description: "Hard trim the input Read 1 to this length before analysis"
    info: null
    required: false
    min: 1
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--r2_length"
    description: "Hard trim the input Read 2 to this length before analysis"
    info: null
    required: false
    min: 1
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean"
    name: "--filter_probes"
    description: "Whether to filter the probe set using the \"included\" column"
    info: null
    default:
    - true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--custom_bin_size"
    description: "Bin Visium HD data to specified size in microns (4-100, even values\
      \ only) in addition to the standard binning size (2 µm, 8 µm, 16 µm)"
    info: null
    required: false
    min: 4
    max: 100
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Input Selection"
  arguments:
  - type: "string"
    name: "--project"
    description: "Project folder name within mkfastq output"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--sample"
    description: "Prefix of FASTQ filenames to select"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--lanes"
    description: "Only use FASTQs from selected lanes"
    info: null
    example:
    - 1
    - 2
    - 3
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
- type: "file"
  path: "nextflow_labels.config"
  dest: "nextflow_labels.config"
description: "Count gene expression and protein expression reads from a single capture\
  \ area."
test_resources:
- type: "python_script"
  path: "test.py"
  is_executable: true
- type: "file"
  path: "visium"
- type: "file"
  path: "GRCh38"
info: null
status: "enabled"
scope:
  image: "public"
  target: "public"
repositories:
- type: "vsh"
  name: "openpipeline"
  repo: "openpipeline"
  tag: "v4.0.3"
keywords:
- "spaceranger"
links:
  repository: "https://github.com/openpipelines-bio/openpipeline_spatial"
  docker_registry: "ghcr.io"
  documentation: "https://www.10xgenomics.com/support/software/space-ranger/latest/analysis/running-pipelines/space-ranger-count"
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"
    script:
    - "includeConfig(\"nextflow_labels.config\")"
  debug: false
  container: "docker"
engines:
- type: "docker"
  id: "docker"
  image: "ghcr.io/data-intuitive/spaceranger:3.1"
  target_registry: "images.viash-hub.com"
  target_tag: "v0.3.0"
  namespace_separator: "/"
  setup:
  - type: "docker"
    run:
    - "DEBIAN_FRONTEND=noninteractive apt update && \\\napt upgrade -y && apt install\
      \ -y procps && rm -rf /var/lib/apt/lists/*\n"
  test_setup:
  - type: "apt"
    packages:
    - "git"
    interactive: false
  - type: "python"
    user: false
    packages:
    - "viashpy==0.9.0"
    github:
    - "openpipelines-bio/core#subdirectory=packages/python/openpipeline_testutils"
    upgrade: true
  entrypoint: []
  cmd: null
- type: "native"
  id: "native"
build_info:
  config: "src/mapping/spaceranger_count/config.vsh.yaml"
  runner: "executable"
  engine: "docker|native"
  output: "target/executable/mapping/spaceranger_count"
  executable: "target/executable/mapping/spaceranger_count/spaceranger_count"
  viash_version: "0.9.4"
  git_commit: "84e2b7cc63aa97671f5df15385e35180aad6d7df"
  git_remote: "https://github.com/openpipelines-bio/openpipeline_spatial"
package_config:
  name: "openpipeline_spatial"
  version: "v0.3.0"
  info:
    test_resources:
    - type: "s3"
      path: "s3://openpipelines-bio/openpipeline_spatial/resources_test"
      dest: "resources_test"
  repositories:
  - type: "vsh"
    name: "openpipeline"
    repo: "openpipeline"
    tag: "v4.0.3"
  viash_version: "0.9.4"
  source: "src"
  target: "target"
  config_mods:
  - ".resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n\
    .runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\
    )'"
  - ".engines += { type: \"native\" }"
  - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
  - ".engines[.type == 'docker'].target_tag := 'v0.3.0'"
  organization: "vsh"
  links:
    repository: "https://github.com/openpipelines-bio/openpipeline_spatial"
    docker_registry: "ghcr.io"
