name: bedtools_bed12tobed6
namespace: bedtools
description: | 
  Converts BED features in BED12 (a.k.a. “blocked” BED features such as genes) to discrete BED6 features.
  For example, in the case of a gene with six exons, bed12ToBed6 would create six separate BED6 features (i.e., one for each exon).
keywords: [Converts, BED12, BED6]
links:
  documentation: https://bedtools.readthedocs.io/en/latest/content/tools/bed12tobed6.html
  repository: https://github.com/arq5x/bedtools2
  homepage: https://bedtools.readthedocs.io/en/latest/
references:
  doi: 10.1093/bioinformatics/btq033
license: MIT
requirements:
  commands: [bedtools]
authors:
  - __merge__: /src/_authors/theodoro_gasperin.yaml
    roles: [author]
  - __merge__: /src/_authors/robrecht_cannoodt.yaml
    roles: [author, maintainer]

argument_groups:

  - name: Inputs
    arguments:
      - name: --input
        alternatives: [-i]
        type: file
        description: |
          Input BED12 file containing blocked features.
          
          **Requirements:**
          - Must be in BED12 format (12 columns)
          - Should contain blocked features (e.g., genes with exons)
          - Blocks are defined by columns 10-12 (blockCount, blockSizes, blockStarts)
        required: true
        example: input.bed12
    
  - name: Outputs
    arguments:
      - name: --output
        alternatives: [-o]
        type: file
        direction: output
        description: |
          Output BED6 file containing discrete features.
          
          **Output format:**
          - Each block from input BED12 becomes a separate BED6 entry
          - Maintains chromosome, strand, and name information
          - Coordinates are adjusted to represent individual blocks
        example: output.bed6

  - name: Options
    arguments:
      - name: --n_score
        alternatives: [-n]
        type: boolean_true
        description: | 
          Force the score to be the 1-based block number from the BED12.
          
          **Default behavior:** Preserves original score from BED12
          **With --n_score:** Sets score to block number (1, 2, 3, etc.)

resources:
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - type: file
    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
