name: "bbmap_bbsplit"
info:
  migration_info:
    git_repo: https://github.com/nf-core/rnaseq.git
    paths: [modules/nf-core/bbmap/bbsplit/main.nf, modules/nf-core/bbmap/bbsplit/meta.yml]
    last_sha: 277bd337739a8b8f753fa7b5eda6743b9b6acb89

description: |
  Split sequencing reads by mapping them to multiple references simultaneously.
  
argument_groups:
- name: "Input"
  arguments:
  - name: "--id"
    type: string
    description: Sample ID
  - name: "--paired"
    type: boolean 
    default: false
    description: Paired fastq files or not?
  - name: "--input"
    type: file
    multiple: true
    multiple_sep: ","
    description: Input fastq files, either one or two (paired)
    example: sample.fastq
  - name: "--primary_ref"
    type: file
    description: Primary reference FASTA
  - name: "--bbsplit_fasta_list"
    type: file
    description: Path to comma-separated file containing a list of reference genomes to filter reads against with BBSplit.
  - name: "--only_build_index"
    type: boolean
    description: true = only build index; false = mapping
  - name: "--built_bbsplit_index"
    type: file
    description: Directory with index files
  
- name: "Output"
  arguments:
  - name: "--fastq_1"
    type: file
    required: false
    description: Output file for read 1.
    direction: output
    must_exist: false
    default: $id.$key.read_1.fastq
  - name: "--fastq_2"
    type: file
    required: false
    must_exist: false
    description: Output file for read 2.
    direction: output
    default: $id.$key.read_2.fastq
  - name: "--bbsplit_index"
    type: file
    description: Directory with index files
    direction: output
    must_exist: false
    default: BBSplit_index
    
resources:
  - type: bash_script
    path: script.sh

test_resources:
  - type: bash_script
    path: test.sh
  - path: /testData/minimal_test/reference/genome.fasta
  - path: /testData/minimal_test/input_fastq/SRR6357070_1.fastq.gz
  - path: /testData/minimal_test/input_fastq/SRR6357070_2.fastq.gz
  - path: /testData/minimal_test/reference/bbsplit_fasta/sarscov2.fa
  - path: /testData/minimal_test/reference/bbsplit_fasta/human.fa

engines:
- type: docker
  image: ubuntu:22.04
  setup:
    - type: docker
      run: | 
        apt-get update && \
        apt-get install -y build-essential openjdk-17-jdk wget tar && \
        wget --no-check-certificate https://sourceforge.net/projects/bbmap/files/BBMap_39.01.tar.gz && \
        tar xzf BBMap_39.01.tar.gz && \
        cp -r bbmap/* /usr/local/bin
runners:
  - type: executable
  - type: nextflow
