name: ismapper
description: Identify insertion sites positions in bacterial genomes
icon: false
tags:
  - fastq
  - insertion sequences
modules:
  - ismapper
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - reads:
      type: file
      description: A set of paired-end FASTQ files
      pattern: "*.{fastq.gz,fq.gz}"
  - reference:
      type: file
      description: Reference genome in GenBank format
      pattern: "*.{gbk}"
  - query:
      type: file
      description: Insertion sequences to query in FASTA format
      pattern: "*.{fasta,fa}"
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
  - results:
      type: directory
      description: Directory containing ISMapper result files
      pattern: "*/*"
docs:
  meta:
    title: ismapper
    description: >-
      A Bactopia Tool which uses ISMapper to search for insertion sites in
      your samples.
  introduction: |
    The `ismapper` module uses [ISMapper](https://github.com/jhawkey/IS_mapper) to search for 
    insertion sites in your samples.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── ismapper
      │           └── ismapper
      │               ├── <INSERTION_NAME>
      │               │   ├── <SAMPLE_NAME>_<FASTA_ENTRY>_{left_final,right_final}.fastq
      │               │   ├── <SAMPLE_NAME>__<REFERENCE>_closest.bed
      │               │   ├── <SAMPLE_NAME>__<REFERENCE>_intersect.bed
      │               │   ├── <SAMPLE_NAME>__<REFERENCE>_table.txt
      │               │   ├── <SAMPLE_NAME>_{left,right}_<REFERENCE>_finalcov.bed
      │               │   ├── <SAMPLE_NAME>_{left,right}_<REFERENCE>_merged.sorted.bed
      │               │   └── <SAMPLE_NAME>_{left,right}_<REFERENCE>_unpaired.bed
      │               └── logs
      │                   ├── SRR2838702.log
      │                   ├── nf-ismapper.{begin,err,log,out,run,sh,trace}
      │                   └── versions.yml
      └── bactopia-runs
          └── ismapper-<TIMESTAMP>
              └── nf-reports
                  ├── ismapper-dag.dot
                  ├── ismapper-report.html
                  ├── ismapper-timeline.html
                  └── ismapper-trace.txt
    add_note: false
    folders:
      - name: ISMapper
        description: |
            Below is a description of the _per-sample_ results from [ISMapper](https://github.com/jhawkey/IS_mapper).
        is_extensions: true
        table:
          - id: _final.fastq
            description: Sequences (FASTQ format) that mapped to the flanking regions of the IS query.
          - id: _closest.bed
            description: Merged regions that are close but do not overlap.
          - id: _intersect.bed
            description: An intersection of merged regions from the left and right flanks.
          - id: _table.txt
            description: A [detailed description](https://github.com/jhawkey/IS_mapper#single-isolate-output) of the IS query results.
          - id: _finalcov.bed
            description: Contains information about the coverage of the IS query
          - id: _merged.sorted.bed
            description: Merged overlapping regions that passed coverage cutoffs
          - id: _unpaired.bed
            description: All unpaired mappings to the IS query
  citations:
    - ismapper
