-
Notifications
You must be signed in to change notification settings - Fork 0
/
last.nf
62 lines (48 loc) · 1.64 KB
/
last.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env nextflow
/*
* Defines pipeline parameters in order to specify the
* read pairs by using the command line options
*/
params.chromosomes = "$baseDir/data/references/Sbicolor.Chr*.softmasked.fa"
params.genome_m = "$baseDir/data/references/Zmays_493_APGv4.softmasked.fa"
genome_file_m = file(params.genome_m)
sobic_chromosomes = Channel
.fromPath(params.chromosomes)
.map { file -> tuple(file.baseName, file) }
index_chromosomes = Channel
.fromPath(params.chromosomes)
.map { file -> tuple(file.baseName, file) }
/*
* Index chromosomes
*/
process indexChr {
publishDir "$baseDir/data/references"
input:
set dataset_id, file(chromosome) from index_chromosomes
output:
file "${dataset_id}.???" into indices
clusterOptions = { "-l select=1:ncpus=2:mem=12gb,walltime=05:00:00" }
module 'singularity'
script:
"""
singularity run -B /scratch2,/zfs ~/singularity_containers/last.simg lastdb -c -P 2 ${dataset_id} ${chromosome}
"""
}
/*
* Last alignment
*/
process alignment {
publishDir "results"
input:
set dataset_id, file(chromosome) from sobic_chromosomes
file "${dataset_id}.???" from indices
file genome_file_m
output:
file "Zmays_onto_Sbicolor.Chr*.softmasked.maf"
clusterOptions = { "-l select=1:ncpus=4:mem=12gb,walltime=05:00:00" }
module 'singularity'
script:
"""
singularity run -B /scratch2,/zfs ~/singularity_containers/last.simg lastal -P4 $baseDir/data/references/${dataset_id} ${genome_file_m} > Zmays_onto_${dataset_id}.maf
"""
}