manifest {
  name = 'filter/filter_with_scrublet'
  mainScript = 'main.nf'
  nextflowVersion = '!>=20.12.1-edge'
  version = 'v4.0.2'
  description = 'Doublet detection using the Scrublet method (Wolock, Lopez and Klein, 2019).\nThe method tests for potential doublets by using the expression profiles of\ncells to generate synthetic potential doubles which are tested against cells. \nThe method returns a "doublet score" on which it calls for potential doublets.\n\nFor the source code please visit https://github.com/AllonKleinLab/scrublet.\n\nFor 10x we expect the doublet rates to be:\n  Multiplet Rate (%) - # of Cells Loaded - # of Cells Recovered\n  ~0.4% ~800 ~500\n  ~0.8% ~1,600 ~1,000\n  ~1.6% ~3,200 ~2,000\n  ~2.3% ~4,800 ~3,000\n  ~3.1% ~6,400 ~4,000\n  ~3.9% ~8,000 ~5,000\n  ~4.6% ~9,600 ~6,000\n  ~5.4% ~11,200 ~7,000\n  ~6.1% ~12,800 ~8,000\n  ~6.9% ~14,400 ~9,000\n  ~7.6% ~16,000 ~10,000\n'
  author = 'Dries De Maeyer, 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 }
}

includeConfig("nextflow_labels.config")
