name: busco_run
namespace: busco
description: Assessment of genome assembly and annotation completeness with single copy orthologs
keywords: [Genome assembly, quality control]
links:
  homepage: https://busco.ezlab.org/
  documentation: https://busco.ezlab.org/busco_userguide.html
  repository: https://gitlab.com/ezlab/busco
references:
  doi: 10.1007/978-1-4939-9173-0_14
license: MIT
argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        alternatives: ["-i"]
        type: file
        description: |
          Input sequence file in FASTA format. Can be an assembled genome or transcriptome (DNA), or protein sequences from an annotated gene set. Also possible to use a path to a directory containing multiple input files.
        required: true
        example: file.fasta
      - name: --mode
        alternatives: ["-m"]
        type: string
        choices: [genome, geno, transcriptome, tran, proteins, prot]
        required: true
        description: |
          Specify which BUSCO analysis mode to run. There are three valid modes:
            - geno or genome, for genome assemblies (DNA)
            - tran or transcriptome, for transcriptome assemblies (DNA)
            - prot or proteins, for annotated gene sets (protein)
        example: proteins
      - name: --lineage_dataset
        alternatives: ["-l"]
        type: string
        required: false
        description: |
          Specify a BUSCO lineage dataset that is most closely related to the assembly or gene set being assessed. 
          The full list of available datasets can be viewed [here](https://busco-data.ezlab.org/v5/data/lineages/) or by running the busco/busco_list_datasets component.
          When unsure, the "--auto_lineage" flag can be set to automatically find the optimal lineage path.
          BUSCO will automatically download the requested dataset if it is not already present in the download folder. 
          You can optionally provide a path to a local dataset instead of a name, e.g. path/to/dataset.
          Datasets can be downloaded using the busco/busco_download_dataset component.
        example: stramenopiles_odb10

  - name: Outputs
    arguments:
      - name: --short_summary_json
        required: false
        direction: output
        type: file
        example: short_summary.json
        description: |
          Output file for short summary in JSON format.
      - name: --short_summary_txt
        required: false
        direction: output
        type: file
        example: short_summary.txt
        description: |
          Output file for short summary in TXT format.
      - name: --full_table
        required: false
        direction: output
        type: file
        example: full_table.tsv
        description: |
          Full table output in TSV format.
      - name: --missing_busco_list
        required: false
        direction: output
        type: file
        example: missing_busco_list.tsv
        description: |
          Missing list output in TSV format.
      - name: --output_dir
        required: false
        direction: output
        type: file
        example: output_dir/
        description: |
          The full output directory, if so desired.

  - name: Resource and Run Settings
    arguments:
      - name: --force
        type: boolean_true
        description: |
          Force rewriting of existing files. Must be used when output files with the provided name already exist.
      - name: --quiet
        alternatives: ["-q"]
        type: boolean_true
        description: |
          Disable the info logs, displays only errors.
      - name: --restart
        alternatives: ["-r"]
        type: boolean_true
        description: |
          Continue a run that had already partially completed. Restarting skips calls to tools that have completed but performs all pre- and post-processing steps.
      - name: --tar
        type: boolean_true
        description: |
          Compress some subdirectories with many files to save space.

  - name: Lineage Dataset Settings
    arguments:
      - name: --auto_lineage
        type: boolean_true
        description: |
          Run auto-lineage pipelilne to automatically determine BUSCO lineage dataset that is most closely related to the assembly or gene set being assessed.
      - name: --auto_lineage_euk
        type: boolean_true
        description: |
          Run auto-placement just on eukaryota tree to find optimal lineage path.
      - name: --auto_lineage_prok
        type: boolean_true
        description: |
          Run auto_lineage just on prokaryota trees to find optimum lineage path.
      - name: --datasets_version
        type: string
        required: false
        description: |
          Specify the version of BUSCO datasets
        example: odb10

  - name: Augustus Settings
    arguments:
      - name: --augustus
        type: boolean_true
        description: |
          Use augustus gene predictor for eukaryote runs.
      - name: --augustus_parameters
        type: string
        required: false
        description: |
          Additional parameters to be passed to Augustus (see Augustus documentation: https://github.com/Gaius-Augustus/Augustus/blob/master/docs/RUNNING-AUGUSTUS.md).
          Parameters should be contained within a single string, without whitespace and seperated by commas.
        example: "--PARAM1=VALUE1,--PARAM2=VALUE2"
      - name: --augustus_species
        type: string
        required: false
        description: |
          Specify the augustus species
      - name: --long
        type: boolean_true
        description: |
          Optimize Augustus self-training mode. This adds considerably to the run time, but can improve results for some non-model organisms.

  - name: BBTools Settings
    arguments:
      - name: --contig_break
        type: integer
        required: false
        description: |
          Number of contiguous Ns to signify a break between contigs in BBTools analysis.
      - name: --limit
        type: integer
        required: false
        description: |
          Number of candidate regions (contig or transcript) from the BLAST output to consider per BUSCO.
          This option is only effective in pipelines using BLAST, i.e. the genome pipeline (see --augustus) or the prokaryota transcriptome pipeline.
      - name: --scaffold_composition
        type: boolean_true
        description: |
          Writes ACGTN content per scaffold to a file scaffold_composition.txt.

  - name: BLAST Settings
    arguments:
      - name: --e_value
        type: double
        required: false
        description: |
          E-value cutoff for BLAST searches.

  - name: Protein Gene Prediction settings
    arguments:
      - name: --miniprot
        type: boolean_true
        description: |
          Use Miniprot gene predictor.

  - name: MetaEuk Settings
    arguments:
      - name: --metaeuk_parameters
        type: string
        description: |
          Pass additional arguments to Metaeuk for the first run (see Metaeuk documentation https://github.com/soedinglab/metaeuk).
          All parameters should be contained within a single string with no white space, with each parameter separated by a comma.
        example: "--max-overlap=15,--min-exon-aa=15"
      - name: --metaeuk_rerun_parameters
        type: string
        description: |
          Pass additional arguments to Metaeuk for the second run (see Metaeuk documentation https://github.com/soedinglab/metaeuk).
          All parameters should be contained within a single string with no white space, with each parameter separated by a comma.
        example: "--max-overlap=15,--min-exon-aa=15"

resources:
  - type: bash_script
    path: script.sh
test_resources:
  - type: bash_script
    path: test.sh
  - type: file
    path: test_data
engines:
  - type: docker
    image: quay.io/biocontainers/busco:5.6.1--pyhdfd78af_0
    setup:
      - type: docker
        run: |
          busco --version | sed 's/BUSCO\s\(.*\)/busco: "\1"/' > /var/software_versions.txt
runners:
  - type: executable
  - type: nextflow
