Skip to content

Commit d9cd224

Browse files
author
Chenghao Zhu
authored
Merge pull request #27 from uclahs-cds/cz-update-bwa-mem2-2.1
update to bwa-mem2 v2.1
2 parents 684faeb + 1ffffea commit d9cd224

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

docker/bwa-and-samtools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LABEL maintainer="Ben Carlin <bcarlin@mednet.ucla.edu>"
55
# add channels in correct order to avoid missing libcrypto dependency
66
# https://github.com/bioconda/bioconda-recipes/issues/12100
77
RUN conda update -n base -c defaults conda && \
8-
conda install -q -y -c bioconda bwa-mem2=2.0 && \
8+
conda install -q -y -c bioconda bwa-mem2=2.1 && \
99
conda clean --all -y
1010

1111
CMD ["bwa-mem2"]

pipeline/align-DNA.nf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- NEEDS LOGGING UPDATE FOR OUTPUS, LOGS AND REPORTS
77
*/
88

9-
def docker_image_BWA_and_SAMTools = "blcdsdockerregistry/align-dna:bwa-mem2-2.0_samtools-1.10"
9+
def docker_image_BWA_and_SAMTools = "blcdsdockerregistry/align-dna:bwa-mem2-2.1_samtools-1.10"
1010
def docker_image_PicardTools = "blcdsdockerregistry/align-dna:picardtools-2.23.3"
1111
def docker_image_sha512sum = "blcdsdockerregistry/align-dna:sha512sum-1.0"
1212
def docker_image_validate_params = "blcdsdockerregistry/align-dna:sha512sum-1.0"
@@ -33,13 +33,11 @@ params.mem_command_build_bam_index = "4g"
3333
// The memory requied by bwa-mem2 increases along with the threads. Here we ensure that each cpu has
3434
// at least 2.5 GB of memory, to avoid out-of-memory failure, unless the number of cpu is defined in
3535
// config.
36-
if (params.containsKey("bwa_mem_number_of_cpus")) {
37-
bwa_mem_number_of_cpus = params.bwa_mem_number_of_cpus
38-
} else {
36+
if (!params.containsKey("bwa_mem_number_of_cpus")) {
3937
amount_of_memory_int = amount_of_memory.replace(" GB", "") as Integer
40-
bwa_mem_number_of_cpus = (int) Math.min(number_of_cpus, Math.floor(amount_of_memory_int / 2.5))
41-
if (bwa_mem_number_of_cpus < 1) {
42-
bwa_mem_number_of_cpus = 1
38+
params.bwa_mem_number_of_cpus = (int) Math.min(number_of_cpus, Math.floor(amount_of_memory_int / 2.5))
39+
if (params.bwa_mem_number_of_cpus < 1) {
40+
params.bwa_mem_number_of_cpus = 1
4341
}
4442
}
4543

@@ -66,6 +64,7 @@ log.info """\
6664
save_intermediate_files = ${params.save_intermediate_files}
6765
cache_intermediate_pipeline_steps = ${params.cache_intermediate_pipeline_steps}
6866
max_number_of_parallel_jobs = ${params.max_number_of_parallel_jobs}
67+
bwa_mem_number_of_cpus = ${params.bwa_mem_number_of_cpus}
6968
7069
Tools Used:
7170
- BWA-MEM2 and SAMtools: ${docker_image_BWA_and_SAMTools}
@@ -161,7 +160,7 @@ process BWA_mem_SAMTools_Convert_Sam_to_Bam {
161160
publishDir path: params.output_dir, enabled: params.save_intermediate_files, mode: 'copy'
162161

163162
memory amount_of_memory
164-
cpus bwa_mem_number_of_cpus
163+
cpus params.bwa_mem_number_of_cpus
165164

166165
when:
167166
number_of_invalid_inputs == 0

0 commit comments

Comments
 (0)