Skip to content

Commit

Permalink
Merge pull request #241 from uclahs-cds/yashpatel-use-bzip2-directly
Browse files Browse the repository at this point in the history
Use `bzip2` directly
  • Loading branch information
yashpatel6 authored Oct 19, 2023
2 parents c32a73f + cab7235 commit 77f6bcd
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 65 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.0.0] - 2023-10-18

### Changed
- Use `bzip2` directly for compression

## [7.0.0-rc.2] - 2023-10-05

### Added
Expand Down
7 changes: 5 additions & 2 deletions config/default.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ params {
max_cpus = SysHelper.getAvailCpus()
max_memory = SysHelper.getAvailMemory()

min_cpus = 1
min_memory = 1.MB

// default docker container registry
docker_container_registry = "ghcr.io/uclahs-cds"

Expand All @@ -19,7 +22,7 @@ params {
GATK_version = "4.4.0.0"
somaticsniper_version = "1.0.5.0"
bam_readcount_version = "0.8.0"
blarchive_version = "2.0.0"
ubuntu_version = "20.04"
strelka2_version = "2.9.10"
manta_version = "1.6.0"
MuSE_version = "2.0.3"
Expand All @@ -31,7 +34,7 @@ params {
docker_image_GATK = "broadinstitute/gatk:${params.GATK_version}"
docker_image_somaticsniper = "${-> params.docker_container_registry}/somaticsniper:${params.somaticsniper_version}"
docker_image_bam_readcount = "${-> params.docker_container_registry}/bam-readcount:${params.bam_readcount_version}"
docker_image_blarchive = "${-> params.docker_container_registry}/blarchive:${params.blarchive_version}"
docker_image_ubuntu = "ubuntu:${params.ubuntu_version}"
docker_image_strelka2 = "${-> params.docker_container_registry}/strelka2:${params.strelka2_version}"
docker_image_manta = "${-> params.docker_container_registry}/manta:${params.manta_version}"
docker_image_MuSE = "${-> params.docker_container_registry}/muse:${params.MuSE_version}"
Expand Down
13 changes: 6 additions & 7 deletions module/common.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ log.info """\
Docker Images:
- docker_image_BCFtools: ${params.docker_image_BCFtools}
- docker_image_validate_params: ${params.docker_image_validate_params}
- docker_image_blarchive: ${params.docker_image_blarchive}
- docker_image_ubuntu: ${params.docker_image_ubuntu}
"""

process filter_VCF_BCFtools {
Expand Down Expand Up @@ -90,12 +90,12 @@ process rename_samples_BCFtools {
"""
}

process compress_file_blarchive {
container params.docker_image_blarchive
publishDir path: params.blarchive_publishDir,
process compress_file_bzip2 {
container params.docker_image_ubuntu
publishDir path: params.compress_publishdir,
mode: "copy",
pattern: "*.bz2",
enabled: params.blarchive_enabled
enabled: params.compress_enabled
publishDir path: "${params.workflow_log_output_dir}",
mode: "copy",
pattern: ".command.*",
Expand All @@ -112,8 +112,7 @@ process compress_file_blarchive {
"""
set -euo pipefail
dereferenced_file=\$(readlink -f ${file_to_compress})
blarchive compress_files --input \$dereferenced_file \
--log ./
bzip2 \$dereferenced_file
ln -s \${dereferenced_file}.bz2 ${file_to_compress}.bz2
"""
}
10 changes: 5 additions & 5 deletions module/intersect.nf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include { generate_sha512sum } from './common'
include { compress_file_blarchive} from './common' addParams(
blarchive_publishDir : "${params.workflow_output_dir}/output",
blarchive_enabled : true
include { compress_file_bzip2} from './common' addParams(
compress_publishdir : "${params.workflow_output_dir}/output",
compress_enabled : true
)
include { reorder_samples_BCFtools; intersect_VCFs_BCFtools; plot_VennDiagram_R; concat_VCFs_BCFtools ; convert_VCF_vcf2maf } from './intersect-processes.nf'
include { compress_index_VCF as compress_index_VCF_reordered } from '../external/pipeline-Nextflow-module/modules/common/index_VCF_tabix/main.nf' addParams(
Expand Down Expand Up @@ -85,7 +85,7 @@ workflow intersect {
compress_index_VCF_concat(concat_VCFs_BCFtools.out.vcf
.map{ it -> ['SNV', it]}
)
compress_file_blarchive(convert_VCF_vcf2maf.out.maf
compress_file_bzip2(convert_VCF_vcf2maf.out.maf
.map{ it -> ['MAF', it]}
)
file_for_sha512 = intersect_VCFs_BCFtools.out.gzvcf
Expand All @@ -101,7 +101,7 @@ workflow intersect {
.mix(compress_index_VCF_concat.out.index_out
.map{ it -> ["concat-${it[0]}-index", it[2]] }
)
.mix(compress_file_blarchive.out.compressed_file
.mix(compress_file_bzip2.out.compressed_file
.map{ it -> ["concat-${it[0]}", it[1]]}
)
generate_sha512sum(file_for_sha512)
Expand Down
8 changes: 4 additions & 4 deletions module/somaticsniper.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ include { compress_index_VCF as compress_index_VCF_fix } from '../external/pipel
bgzip_extra_args: params.bgzip_extra_args,
tabix_extra_args: params.tabix_extra_args
])
include { compress_file_blarchive} from './common' addParams(
blarchive_publishDir : "${params.workflow_output_dir}/intermediate/generate_ReadCount_bam_readcount",
blarchive_enabled : params.save_intermediate_files
include { compress_file_bzip2} from './common' addParams(
compress_publishdir : "${params.workflow_output_dir}/intermediate/generate_ReadCount_bam_readcount",
compress_enabled : params.save_intermediate_files
)

workflow somaticsniper {
Expand Down Expand Up @@ -56,7 +56,7 @@ workflow somaticsniper {
filter_FalsePositive_SomaticSniper(apply_TumorIndelFilter_SomaticSniper.out.vcf_tumor, generate_ReadCount_bam_readcount.out.readcount)
call_HighConfidenceSNV_SomaticSniper(filter_FalsePositive_SomaticSniper.out.fp_pass)
// combining to delay compression until after filtering step
compress_file_blarchive(
compress_file_bzip2(
generate_ReadCount_bam_readcount.out.readcount
.combine(filter_FalsePositive_SomaticSniper.out.fp_pass.collect())
.map{ it -> ['readcount', it[0]] }
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ manifest {
nextflowVersion = '>=20.07.1'
author = 'Yuan Zhe (Caden) Bugh, Mao Tian, Sorel Fitz-Gibbon'
homePage = 'https://github.com/uclahs-cds/pipeline-call-sSNV'
version = '7.0.0-rc.2'
version = '7.0.0'
name = 'call-sSNV'
}
Loading

0 comments on commit 77f6bcd

Please sign in to comment.