name: bedtools_expand
namespace: bedtools
description: |
  Expand rows by splitting comma-separated values into separate rows.
  
  This tool replicates lines based on columns containing comma-separated values,
  creating one row for each value. Useful for expanding collapsed data formats
  like BED12 blocks or multi-value annotations into individual entries.

keywords: [genomics, intervals, expand, split, comma-separated, replicate]
links:
  homepage: https://bedtools.readthedocs.io/
  documentation: https://bedtools.readthedocs.io/en/latest/content/tools/expand.html
  repository: https://github.com/arq5x/bedtools2
references:
  doi: 10.1093/bioinformatics/btq033
license: MIT

requirements:
  commands: [bedtools]

authors:
  - __merge__: /src/_authors/robrecht_cannoodt.yaml
    roles: [author]

argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        alternatives: [-i]
        type: file
        description: |
          Input file with comma-separated values to expand.
          
          **Format:** Tab-delimited file with one or more columns containing
          comma-separated values
          **Example:** BED file with comma-separated scores or annotations
        required: true
        example: collapsed_data.bed
    
  - name: Outputs
    arguments:
      - name: --output
        type: file
        direction: output
        description: |
          Output file with expanded rows.
          
          Contains one row for each comma-separated value, with other
          columns replicated across all expanded rows.
        required: true
        example: expanded_data.bed

  - name: Expansion Options
    arguments:
      - name: --columns
        alternatives: [-c]
        type: string
        description: |
          Column(s) to expand (1-based indexing).
          
          **Single column:** Specify one column number (e.g., "4")
          **Multiple columns:** Comma-separated list (e.g., "4,5")
          **Behavior:** Values in specified columns are split and expanded
          **Requirement:** All specified columns must have same number of values
        required: true
        example: "4,5"

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/bedtools:2.31.1--h13024bc_3
    setup:
      - type: docker
        run: |
          bedtools --version 2>&1 | head -1 | sed 's/.*bedtools v/bedtools: /' > /var/software_versions.txt

runners:
  - type: executable
  - type: nextflow
