main.nf 1.12 KB
Newer Older
1
2
3
4
version = "0.3.1"
container_url = "lbmc/emase-zero:${version}"

include { tr2g } from "./../kb/main.nf"
5
include { bam2ec } from "./../alntools/main.nf"
6
include { fasta_to_transcripts_lengths } from "./../bioawk/main.nf"
7
8
9
10
11
12


params.count = "-m 2"
params.count_out = ""
workflow count {
  take:
13
    bam_idx
14
    fasta
15
    gtf
16
17

  main:
18
    tr2g(gtf)
19
20
    fasta_to_transcripts_lengths(fasta)
    bam2ec(bam_idx, fasta_to_transcripts_lengths.out.tsv.collect())
21
    emase(bam2ec.out.bin, bam2ec.out.tsv, tr2g.out.t2g)
22
23

  emit:
24
    count = emase.out.count
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
}

process emase {
  container = "${container_url}"
  label "big_mem_mono_cpus"
  tag "$file_id"
  if (params.count_out != "") {
    publishDir "results/${params.count_out}", mode: 'copy'
  }

  input:
    tuple val(file_id), path(bin)
    tuple val(transcript_length_id), path(transcript_length)
    tuple val(transcript_to_gene_id), path(transcript_to_gene)

  output:
    tuple val(file_id), path("${bin.simpleName}.quantified"), emit: count

  script:
"""
emase-zero ${params.count} \
  -b ${bin} \
  -o ${bin.simpleName}.quantified \
  -l ${transcript_length} \
  -g ${transcript_to_gene}
"""
}