comparison CSP2/docker/Makefile @ 39:93393808f415

"planemo upload"
author rliterman
date Thu, 12 Dec 2024 13:53:15 -0500
parents 01431fa12065
children
comparison
equal deleted inserted replaced
38:ee512a230a1e 39:93393808f415
1 .PHONY:
2
3 .ONESHELL:
4
5
6
7 usage: ## Show this menu
8 @grep -E '^[a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?##"}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
9
10 version: ## Show version and branch
11 @echo "CSP2 v$${CSP2_VER}/$${CSP2_BRANCH}"
12
13 # ENV CSP2_VER=${CSP2_VER}
14 # ENV BEDTOOLS_VER=${BEDTOOLS_VER}
15 # ENV MIUMMER_VER=${MUMMER_VER}
16 # ENV SKESA_VER=${SKESA_VER}
17 # ENV MASH_VER=${MASH_VER}
18 # ENV BBMAP_VER=${BBMAP_VER}
19 # ENV PYTHON_VER=${PYTHON_VER}
20
21 versions: version ## Show versions of key installed depedencies
22 @echo `nextflow -v`
23 @echo `python3 --version` " (container says ${PYTHON_VER})"
24 @echo `bedtools --version` " (container says ${BEDTOOLS_VER})"
25 @echo "mummer " `mummer --version` " (container says ${MUMMER_VER})"
26 @echo `skesa --version 2>&1` " (container says ${SKESA_VER})"
27 @echo "mash " `mash --version` " (container says ${MASH_VER})"
28 @echo `bbmap.sh --version 2>&1` " (container says ${BBMAP_VER})"
29
30 help: ## Show help
31 @echo "Citation: CFSAN SNP Pipeline 2, v$${CSP2_VER}, Literman et al. 2024"
32 @echo
33 @echo "CSP2 is a Nextflow pipeline for rapid, accurate SNP distance estimation"
34 @echo "from assembly data."
35 @echo
36 @echo "Please see: https://github.com/CFSAN-Biostatistics/CSP2"
37 @echo
38 @echo "CSP2 runs are managed via Nextflow, providing the user with an array of"
39 @echo "customizations while also facilitating module development and additions in"
40 @echo "future releases."
41 @echo
42 @echo "Important Note: The software continues to be focused on the analysis of"
43 @echo "groups of bacterial genomes with limited evolutionary differences (<1000"
44 @echo "SNPs). Testing is underway to determine how the underlying cluster"
45 @echo "diversity impacts distances estimates."
46 @echo
47 @echo "CSP2 has two main run modes:"
48 @echo "1) "Screening Mode" (screen): Used to determine whether query isolates are"
49 @echo "close to a set of reference isolates (e.g., lab control strains, strains"
50 @echo "related to an outbreak, etc.) Given one or more user-provided reference"
51 @echo "isolates (--ref_reads; --ref_fasta), get alignment statistics and SNP"
52 @echo "distances between all reference and query isolates (--reads; --fasta)"
53 @echo
54 @echo "2) "SNP Pipeline Mode" (snp): Used to generate pairwise distances and"
55 @echo "alignments for a set of query isolates Generate pairwise SNP distances and"
56 @echo "alignments for 2+ isolates (--reads; --fasta) based on comparisons to:"
57 @echo
58 @echo "One or more user-provided references (--ref_reads; --ref_fasta), or One or"
59 @echo "more reference isolates selected by RefChooser (--n_ref)"
60 @echo
61 @echo "Usage: screen [options] {--fasta PATH {--reads=PATH | --forward=STR --reverse=STR} --out=PATH}"
62 @echo " or snp [options] {--fasta {--reads=PATH | --forward=STR --reverse=STR} --out=PATH}"
63 @echo
64 @echo "Options:"
65 @echo " --outroot=PATH\tBase directory to create output folder [default=$CWD] "
66 @echo " --out=PATH\t\tName of the output folder to create (must not exist)"
67 @echo "\t\t\t [default=CSP2_<current_datetime>]"
68 @echo " --forward=STR\t\tFull file extension for forward/left reads of query"
69 @echo "\t\t\t [default='_1.fastq.gz']"
70 @echo " --reverse=STR\t\tFull file extension for reverse/right reads of reference"
71 @echo "\t\t\t [default='_2.fastq.gz']"
72 @echo " --ref_forward=STR\tFull file extension for forward/left reads of reference"
73 @echo "\t\t\t [default='_1.fastq.gz']"
74 @echo " --ref_reverse=STR\tFull file extension for reverse/right reads of reference"
75 @echo "\t\t\t [default='_2.fastq.gz']"
76 @echo " --readext=STR\t\tExtension for single-end reads for query [default='fastq.gz']"
77 @echo " --ref_readext=STR\tExtension for single-end reads for reference"
78 @echo "\t\t\t [default='fastq.gz']"
79 @echo " --min_cov=NUM\t\tDo not analyze queries that cover less than <min_cov>% of the"
80 @echo "\t\t\treference assembly [default=85]"
81 @echo " --min_iden=NUM\tOnly consider alignments where the percent identity is at least"
82 @echo "\t\t\t <min_iden> [default=99]"
83 @echo " --min_len=NUM\t\tOnly consider alignments that span at least <min_len> in bp"
84 @echo "\t\t\t [default=500]"
85 @echo " --dwin=LIST\t\tA comma-separated list of windows to check SNP densities"
86 @echo "\t\t\t [default=1000,125,15]"
87 @echo " --wsnps=LIST\t\tThe maximum number of SNPs allowed in the corresponding window from"
88 @echo "\t\t\t --dwin [default=3,2,1]"
89 @echo " --query_edge=NUM\tOnly consider SNPs that occur within <query_edge>bp of the end"
90 @echo "\t\t\t of a query contig [default=250]"
91 @echo " --ref_edge=NUM\tOnly consider SNPs that occur within <query_edge>bp of the end"
92 @echo "\t\t\t of a reference contig [default=250]"
93 @echo " --n_ref=NUM\t\tThe number of RefChooser reference isolates to consider (only"
94 @echo "\t\t\t applied if using RefChooser) [default=3]"
95 @echo " --reads=PATH\t\tLocation of query read data (Path to directory, or path to file with"
96 @echo "\t\t\t multiple directories)"
97 @echo " --fasta=PATH\t\tLocation of query assembly data (Path to directory containing"
98 @echo "\t\t\t FASTAs, path to FASTA, path to multiple FASTAs)"
99 @echo " --ref_reads=PATH\tLocation of reference read data (Path to directory, or path to"
100 @echo "\t\t\t file with multiple directories)"
101 @echo " --ref_fasta=PATH\tLocation of reference assembly data (Path to directory"
102 @echo "\t\t\t containing FASTAs, path to FASTA, path to multiple FASTAs)"
103 @echo " --trim_name=STR\tA string in assembly file names that you want to remove from"
104 @echo "\t\t\t sample IDs (e.g., _contigs_skesa)"
105
106 config:
107 @cat <<- EOF
108 profiles {
109 standard {
110 process.executor = 'local'
111 params.cores = `nproc --all`
112 }
113 }
114 EOF > ~/.nextflow/config
115
116
117 ifeq (screen, $(firstword $(MAKECMDGOALS)))
118 runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
119 $(eval $(runargs):;@true)
120 endif
121
122 ifeq (snp, $(firstword $(MAKECMDGOALS)))
123 runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
124 $(eval $(runargs):;@true)
125 endif
126
127 screen: config ## determine whether query isolates are close to a reference
128 nextflow run CSP2.nf -profile standard --runmode screen $(runargs)
129
130 snp: config ## generate pairwise distances for a set of query isolates
131 nextflow run CSP2.nf -profile standard --runmode snp $(runargs)
132
133 snpdiffs: config
134
135 test_screen:
136 nextflow run CSP2.nf -profile standard --runmode screen --fasta assets/Screen/Assembly/Week_42_Assembly.fasta --reads assets/Screen/Reads/ --ref_fasta assets/Screen/Assembly/Lab_Control.fasta --out ./CSP2_Test_Screen --readext fq.gz --forward _1.fq.gz --reverse _2.fq.gz
137
138 test_snp:
139 nextflow run CSP2.nf -profile standard --runmode snp --fasta assets/SNP/ --n_ref 3 --out ./CSP2_Test_SNP --max_missing 50
140
141 test: config test_screen test_snp
142 ls -lah assets/Screen/Output/Contamination_Screen/
143 diff -bur ./CSP2_Test_SNP/snpdiffs assets/SNP/Output/Soil_Analysis/snpdiffs