-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.nf
74 lines (68 loc) · 1.98 KB
/
main.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
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env nextflow
params.eskape = "$baseDir/data/ESKAPE_FDA-ARGOS_complete_genomes.txt"
params.outdir = "$baseDir/nf_output"
eskape_file = file(params.eskape)
// nextflow.preview.dsl = 2
/*** from get_accessions/ ***/
process get_accession_file {
publishDir "${params.outdir}", mode: 'copy', overwrite: true
input:
path eskape from params.eskape
output:
file("assembly_accession.txt") into summary_ch
file("assembly_accession.txt") into download_ch
shell:
'''
cat !{params.eskape} | cut -f1 | grep -v "# Assembly" > assembly_accession.txt
'''
}
/*** from get_accessions/ ***/
process summary {
conda "ncbi-datasets-cli"
publishDir "${params.output}", mode: 'copy', overwrite: true
input:
file (access) from summary_ch
output:
file("all.json")
shell:
'''
datasets summary genome accession --inputfile !{access} > all.json
'''
}
/*** from get_accessions/ ***/
process download {
conda "ncbi-datasets-cli"
publishDir "${params.output}", mode: 'copy', overwrite: true
input:
file (access) from download_ch
output:
file("ncbi_dataset.zip")
shell:
'''
datasets download genome accession --inputfile assembly_accession.txt --exclude-gff3 --exclude-protein --exclude-rna
'''
}
/*** from get_reference_data/ ***/
process download_CARD_canonical_data {
publishDir "${params.output}", mode: 'copy', overwrite: true
shell:
'''
wget -O data --no-check-certificate https://card.mcmaster.ca/latest/data
mkdir -p card_data
tar xf data -C card_data
rm data
'''
}
/*** from get_reference_data/ ***/
process download_CARD_variants_data {
publishDir "${params.output}", mode: 'copy', overwrite: true
shell:
'''
echo "=================================== DOWNLOAD CARD VARIANTS DATA ==================================="
wget -O variants --no-check-certificate https://card.mcmaster.ca/latest/variants
mkdir -p card_variants
tar xf variants -C card_variants
gunzip card_variants/*.gz
rm variants
'''
}