name: bedtools_complement
namespace: bedtools
description: |
  Find genomic intervals that are NOT covered by input intervals.
  
  This tool returns the complement of genomic intervals - the regions
  of the genome that are NOT covered by the input features. Useful for
  finding gaps, uncovered regions, or background intervals.

keywords: [genomics, intervals, complement, gaps, uncovered, background]
links:
  homepage: https://bedtools.readthedocs.io/
  documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.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, maintainer]

argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        alternatives: [-i]
        type: file
        description: |
          Input file in BED, GFF, or VCF format.
          
          **BED format:** Standard genomic interval format
          **GFF format:** Gene feature format with annotations
          **VCF format:** Variant call format
          **Requirements:** Should be sorted by chromosome and position for optimal performance
        required: true
        example: covered_regions.bed

      - name: --genome
        alternatives: [-g]
        type: file
        description: |
          Genome file defining chromosome names and sizes.
          
          **Format:** Tab-delimited file with chromosome name and size
          **Example line:** chr1  249250621
          **Sources:** Can be created with samtools faidx or UCSC Table Browser
          **Purpose:** Defines the complete genomic space for complement calculation
        required: true
        example: genome.txt
    
  - name: Outputs
    arguments:
      - name: --output
        type: file
        direction: output
        description: |
          Output file with complement intervals.
          
          Contains genomic intervals representing the regions NOT covered
          by the input intervals. Output is in BED format with chromosome,
          start, and end coordinates.
        required: true
        example: uncovered_regions.bed

  - name: Options
    arguments:
      - name: --limit_chromosomes
        alternatives: [-L]
        type: boolean_true
        description: |
          Limit output to chromosomes present in input file.
          
          **Default:** Output includes all chromosomes from genome file
          **When enabled:** Only output complement for chromosomes that have
          records in the input file
          **Use case:** Focus analysis on chromosomes of interest

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
