manifest {
  name = 'arriba'
  mainScript = 'main.nf'
  nextflowVersion = '!>=20.12.1-edge'
  version = 'main'
  description = 'Arriba is a command-line tool for the detection of gene fusions from RNA-Seq data. It was developed for the use in a clinical research setting. Therefore, short runtimes and high sensitivity were important design criteria.\n\nArriba is based on the STAR RNA-Seq aligner and post-processes the alignments (output from STAR) to:\n\n1. detect split reads and discordant mates, which are indicative of structural rearrangements,\n2. find reads supporting gene fusions (i.e., reads spanning the breakpoints of gene fusions),\n3. perform various filtering steps to remove false positives, and\n4. output the final predictions in a standardized format.\n\nIn contrast to many other fusion detection tools, Arriba does not require to reduce the STAR parameter `--alignIntronMax` (maximum intron size). Reducing this parameter impairs detection of long introns and may affect expression quantification. Arriba reliably filters translocation-based false positives even when large maximum intron sizes are used.\n\n**Important**: Arriba requires BAM files that were aligned with STAR using specific chimeric alignment parameters, particularly `--chimOutType WithinBAM HardClip`. See the [official workflow documentation](https://github.com/suhrig/arriba/blob/master/run_arriba.sh) for the complete set of recommended STAR parameters.\n'
  author = 'Robrecht Cannoodt'
}

process.container = 'nextflow/bash:latest'

// detect tempdir
tempDir = java.nio.file.Paths.get(
  System.getenv('NXF_TEMP') ?:
    System.getenv('VIASH_TEMP') ?: 
    System.getenv('TEMPDIR') ?: 
    System.getenv('TMPDIR') ?: 
    '/tmp'
).toAbsolutePath()

profiles {
  no_publish {
    process {
      withName: '.*' {
        publishDir = [
          enabled: false
        ]
      }
    }
  }
  mount_temp {
    docker.temp            = tempDir
    podman.temp            = tempDir
    charliecloud.temp      = tempDir
  }
  docker {
    docker.enabled         = true
    // docker.userEmulation   = true
    singularity.enabled    = false
    podman.enabled         = false
    shifter.enabled        = false
    charliecloud.enabled   = false
  }
  singularity {
    singularity.enabled    = true
    singularity.autoMounts = true
    docker.enabled         = false
    podman.enabled         = false
    shifter.enabled        = false
    charliecloud.enabled   = false
  }
  podman {
    podman.enabled         = true
    docker.enabled         = false
    singularity.enabled    = false
    shifter.enabled        = false
    charliecloud.enabled   = false
  }
  shifter {
    shifter.enabled        = true
    docker.enabled         = false
    singularity.enabled    = false
    podman.enabled         = false
    charliecloud.enabled   = false
  }
  charliecloud {
    charliecloud.enabled   = true
    docker.enabled         = false
    singularity.enabled    = false
    podman.enabled         = false
    shifter.enabled        = false
  }
}

process{
  withLabel: mem1gb { memory = 1000000000.B }
  withLabel: mem2gb { memory = 2000000000.B }
  withLabel: mem5gb { memory = 5000000000.B }
  withLabel: mem10gb { memory = 10000000000.B }
  withLabel: mem20gb { memory = 20000000000.B }
  withLabel: mem50gb { memory = 50000000000.B }
  withLabel: mem100gb { memory = 100000000000.B }
  withLabel: mem200gb { memory = 200000000000.B }
  withLabel: mem500gb { memory = 500000000000.B }
  withLabel: mem1tb { memory = 1000000000000.B }
  withLabel: mem2tb { memory = 2000000000000.B }
  withLabel: mem5tb { memory = 5000000000000.B }
  withLabel: mem10tb { memory = 10000000000000.B }
  withLabel: mem20tb { memory = 20000000000000.B }
  withLabel: mem50tb { memory = 50000000000000.B }
  withLabel: mem100tb { memory = 100000000000000.B }
  withLabel: mem200tb { memory = 200000000000000.B }
  withLabel: mem500tb { memory = 500000000000000.B }
  withLabel: mem1gib { memory = 1073741824.B }
  withLabel: mem2gib { memory = 2147483648.B }
  withLabel: mem4gib { memory = 4294967296.B }
  withLabel: mem8gib { memory = 8589934592.B }
  withLabel: mem16gib { memory = 17179869184.B }
  withLabel: mem32gib { memory = 34359738368.B }
  withLabel: mem64gib { memory = 68719476736.B }
  withLabel: mem128gib { memory = 137438953472.B }
  withLabel: mem256gib { memory = 274877906944.B }
  withLabel: mem512gib { memory = 549755813888.B }
  withLabel: mem1tib { memory = 1099511627776.B }
  withLabel: mem2tib { memory = 2199023255552.B }
  withLabel: mem4tib { memory = 4398046511104.B }
  withLabel: mem8tib { memory = 8796093022208.B }
  withLabel: mem16tib { memory = 17592186044416.B }
  withLabel: mem32tib { memory = 35184372088832.B }
  withLabel: mem64tib { memory = 70368744177664.B }
  withLabel: mem128tib { memory = 140737488355328.B }
  withLabel: mem256tib { memory = 281474976710656.B }
  withLabel: mem512tib { memory = 562949953421312.B }
  withLabel: cpu1 { cpus = 1 }
  withLabel: cpu2 { cpus = 2 }
  withLabel: cpu5 { cpus = 5 }
  withLabel: cpu10 { cpus = 10 }
  withLabel: cpu20 { cpus = 20 }
  withLabel: cpu50 { cpus = 50 }
  withLabel: cpu100 { cpus = 100 }
  withLabel: cpu200 { cpus = 200 }
  withLabel: cpu500 { cpus = 500 }
  withLabel: cpu1000 { cpus = 1000 }
}


