name: snpeff_ann
namespace: snpeff
description: |
  Genetic variant annotation, and functional effect prediction toolbox. 
  It annotates and predicts the effects of genetic variants on genes and 
  proteins (such as amino acid changes).
keywords: [ "annotation", "effect prediction", "snp", "variant", "vcf"]

links:
  repository: https://github.com/pcingola/SnpEff
  homepage: https://pcingola.github.io/SnpEff/
  documentation: https://pcingola.github.io/SnpEff/
references:
  doi: 10.3389/fgene.2012.00035
license: MIT
argument_groups:
  - name: Inputs
    arguments:
      - name: --input
        type: file
        description: Input variants file.
        example: test.vcf
        required: true
      - name: --genome_version
        type: string
        description: Reference genome version.
        example: GRCh38.86
        required: true
  - name: Outputs
    arguments:
      - name: --output
        type: file
        description: The output file.
        example: out.vcf
        direction: output
        required: true
      - name: --summary
        type: file
        description: Summary file directory.
        example: summary_dir
        direction: output
      - name: --genes
        type: file
        description: Txt file directory.
        example: genes_dir
        direction: output
  - name: Options
    arguments:
      - name: --chr
        type: string
        description: |
          Prepend 'string' to chromosome name (e.g. 'chr1' instead of '1'). Only on TXT output.
      - name: --classic
        type: boolean_true
        description: Use old style annotations instead of Sequence Ontology and Hgvs.
      - name: --csv_stats
        type: file
        description: Create CSV summary file.
      - name: --download
        type: boolean_true
        description: Download reference genome if not available.
      - name: --input_format
        alternatives: [-i]
        type: string
        description: |
          Input format [ vcf, bed ]. Default: VCF.
          example: "VCF"
      - name: --file_list
        type: boolean_true
        description: Input actually contains a list of files to process.
      - name: --output_format
        alternatives: [-o]
        type: string
        description: |
          Output format [ vcf, gatk, bed, bedAnn ]. Default: VCF.
        example: "VCF"
      - name: --stats
        alternatives: [-s, --htmlStats]
        type: boolean_true
        description: Create HTML summary file.
      - name: --no_stats
        type: boolean_true
        description: Do not create stats (summary) file.
  - name: Results filter options
    arguments:
      - name: --fi
        alternatives: [--filterInterval]
        type: file
        description: |
          Only analyze changes that intersect with the intervals 
          specified in this file. This option can be used several times.
      - name: --no_downstream 
        type: boolean_true
        description: Do not show DOWNSTREAM changes
      - name: --no_intergenic
        type: boolean_true
        description: Do not show INTERGENIC changes.
      - name: --no_intron
        type: boolean_true
        description: Do not show INTRON changes.
      - name: --no_upstream
        type: boolean_true
        description: Do not show UPSTREAM changes.
      - name: --no_utr
        type: boolean_true
        description: Do not show 5_PRIME_UTR or 3_PRIME_UTR changes.
      - name: --no
        type: string
        description: |
          Do not show 'EffectType'. This option can be used several times.
  - name: Annotations options
    arguments:
      - name: --cancer 
        type: boolean_true
        description: Perform 'cancer' comparisons (Somatic vs Germline).
      - name: --cancer_samples
        type: file
        description: Two column TXT file defining 'original \t derived' samples.
      - name: --fastaprot
        type: file
        description: |
          Create an output file containing the resulting protein sequences.
      - name: --format_eff
        type: boolean_true
        description: |
          Use 'EFF' field compatible with older versions (instead of 'ANN').
      - name: --gene_id
        type: boolean_true
        description: Use gene ID instead of gene name (VCF output).
      - name: --hgvs
        type: boolean_true
        description: Use HGVS annotations for amino acid sub-field.
      - name: --hgvs_old
        type: boolean_true
        description: Use old HGVS notation.
      - name: --hgvs1_letter_aa 
        type: boolean_true
        description: Use one letter Amino acid codes in HGVS notation.
      - name: --hgvs_tr_id
        type: boolean_true
        description: Use transcript ID in HGVS notation.
      - name: --lof
        type: boolean_true
        description: |
          Add loss of function (LOF) and Nonsense mediated decay (NMD) tags.
      - name: -no_hgvs
        type: boolean_true
        description: Do not add HGVS annotations.
      - name: --no_lof
        type: boolean_true
        description: Do not add LOF and NMD annotations.
      - name: --no_shift_hgvs
        type: boolean_true
        description: |
          Do not shift variants according to HGVS notation (most 3prime end).
      - name: --oicr
        type: boolean_true
        description: Add OICR tag in VCF file.
      - name: --sequence_ontology
        type: boolean_true
        description: Use Sequence Ontology terms.
  - name: Generic options
    arguments:
      - name: --config
        alternatives: [-c]
        type: file
        description: Specify config file
      - name: --config_option
        type: string
        description: Override a config file option (name=value).
      - name: --debug
        alternatives: [-d]
        type: boolean_true
        description: Debug mode (very verbose).
      - name: --data_dir
        type: file
        description: Override data_dir parameter from config file.
      - name: --no_download
        type: boolean_true
        description: Do not download a SnpEff database, if not available locally.
      - name: --no_log
        type: boolean_true
        description: Do not report usage statistics to server.
      - name: --quiet
        alternatives: [-q]
        type: boolean_true
        description: Quiet mode (do not show any messages or errors)
      - name: --verbose
        alternatives: [-v]
        type: boolean_true
        description: Verbose mode.
  - name: Database options
    arguments:
      - name: --canon 
        type: boolean_true
        description: Only use canonical transcripts.
      - name: --canon_list
        type: file
        description: |
          Only use canonical transcripts, replace some transcripts using the 'gene_id         
          transcript_id' entries in <file>.
      - name: --tag
        type: string
        description: |
          Only use transcript having a tag 'tagName'. This option can be used multiple times.
      - name: --no_tag
        type: boolean_true
        description: |
          Filter out transcript having a tag 'tagName'. This option can be used multiple times.
      - name: --interaction
        type: boolean_true
        description: Annotate using interactions (requires interaction database).
      - name: --interval
        type: file
        description: |
          Use a custom intervals in TXT/BED/BigBed/VCF/GFF file (you may use this option many times).
      - name: --max_tsl
        type: integer
        description: Only use transcripts having Transcript Support Level lower than <TSL_number>.
      - name: --motif 
        type: boolean_true
        description: Annotate using motifs (requires Motif database).
      - name: --nextprot
        type: boolean_true
        description: Annotate using NextProt (requires NextProt database).
      - name: --no_genome
        type: boolean_true
        description: Do not load any genomic database (e.g. annotate using custom files).
      - name: --no_expand_iub
        type: boolean_true
        description: Disable IUB code expansion in input variants.
      - name: --no_interaction
        type: boolean_true
        description: Disable inteaction annotations.
      - name: --no_motif
        type: boolean_true
        description: Disable motif annotations.
      - name: --no_nextprot
        type: boolean_true
        description: Disable NextProt annotations.
      - name: --only_reg
        type: boolean_true
        description: Only use regulation tracks.
      - name: --only_protein
        type: boolean_true
        description: Only use protein coding transcripts.
      - name: --only_tr
        type: file
        description: |
          Only use the transcripts in this file. Format: One transcript ID per line.
        example: file.txt
      - name: --reg
        type: string
        description: Regulation track to use (this option can be used add several times).
      - name: --ss
        alternatives: [--spliceSiteSize]
        type: integer
        description: |
          Set size for splice sites (donor and acceptor) in bases. Default: 2.
      - name: --splice_region_exon_size
        type: integer
        description: |
          Set size for splice site region within exons. Default: 3 bases.
      - name: --splice_region_intron_min
        type: integer
        description: |
          Set minimum number of bases for splice site region within intron. Default: 3 bases.
      - name: --splice_region_intron_max
        type: integer
        description: |
          Set maximum number of bases for splice site region within intron. Default: 8 bases.
      - name: --strict
        type: boolean_true
        description: Only use 'validated' transcripts (i.e. sequence has been checked).
      - name: --ud
        alternatives: [--upDownStreamLen]
        type: integer
        description: Set upstream downstream interval length (in bases).
resources:
  - type: bash_script
    path: script.sh
  - path: config.patch
test_resources:
  - type: bash_script
    path: test.sh
  - type: file
    path: test_data
engines:
  - type: docker
    image: quay.io/staphb/snpeff:5.2f
    setup:
      - type: docker
        # Apply a partial patch from this commit
        # https://github.com/pcingola/SnpEff/commit/6339f6cab984bd5f35b81a77e05c517be5d112a6
        # This updates the repositories where to download the references from
        # At the time of writing this comment, these changes were not included in a release.
        # This patch can be removed in an upcomming release.
        copy: ["config.patch /opt/config.patch"]
      - type: apt
        packages: 
          - git
      - type: docker
        run: |
          bash -c "pushd /snpEff && git apply /opt/config.patch && popd"
      - type: docker
        run: |
          version=$(snpEff -version) && \
          version_trimmed=$(echo "$version" | awk '{print $1, $2}') && \
          echo "$version_trimmed" > /var/software_versions.txt
runners:
  - type: executable
  - type: nextflow