Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
- name: Run black formatter
run: poetry run black --check --exclude '__pycache__|scripts|sentieon_cli/archive.py' --line-length 79 sentieon_cli
- name: Run mypy
run: poetry run mypy .
run: poetry run mypy sentieon_cli
- name: Run flake8
run: poetry run flake8 . --extend-ignore E231,E221, --exclude .github/scripts/license_message.py,sentieon_cli/scripts/gvcf_combine.py,sentieon_cli/scripts/vcf_mod.py,sentieon_cli/scripts/hybrid_anno.py,sentieon_cli/scripts/hybrid_select.py,sentieon_cli/archive.py # false+ from python 3.12
run: poetry run flake8 . --extend-ignore E231,E221, --exclude .github/scripts/license_message.py,sentieon_cli/scripts/gvcf_combine.py,sentieon_cli/scripts/vcf_mod.py,sentieon_cli/scripts/hybrid_anno.py,sentieon_cli/scripts/hybrid_select.py,sentieon_cli/archive.py,tests # false+ from python 3.12
- name: Run the automated tests
run: poetry run pytest -v
- name: Run doct tests
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#https://stackoverflow.com/questions/75408641/whats-difference-between-tool-poetry-and-project-in-pyproject-toml
[tool.poetry]
name = "sentieon_cli"
version = "1.2.3"
version = "1.3.0"
description = "entry point for sentieon command-line tools"
authors = ["Don Freed <don.freed@sentieon.com>", "Brent <bpederse@gmail.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion sentieon_cli/command_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def bcftools_subset(
]
)
return (
f'if [ -s "{regions_bed}" ]; then '
f'if [ -s "{regions_bed}" ]; then ' # noqa
+ bcftools_subset_cmd
+ " | "
+ vcfconvert_cmd
Expand Down
163 changes: 83 additions & 80 deletions sentieon_cli/dnascope.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
check_version,
library_preloaded,
path_arg,
spit_alignment,
split_alignment,
total_memory,
)

Expand Down Expand Up @@ -75,16 +75,10 @@ class DNAscopePipeline(BasePipeline):
"""The DNAscope pipeline"""

params: Dict[str, Dict[str, Any]] = {
"reference": {
"flags": ["-r", "--reference"],
"model_bundle": {
"flags": ["-m", "--model_bundle"],
"help": "The model bundle file.",
"required": True,
"help": "fasta for reference genome.",
"type": path_arg(exists=True, is_file=True),
},
"sample_input": {
"flags": ["-i", "--sample_input"],
"nargs": "*",
"help": "sample BAM or CRAM file.",
"type": path_arg(exists=True, is_file=True),
},
"r1_fastq": {
Expand All @@ -101,19 +95,36 @@ class DNAscopePipeline(BasePipeline):
"nargs": "*",
"help": "Readgroup information for the fastq files.",
},
"model_bundle": {
"flags": ["-m", "--model_bundle"],
"help": "The model bundle file.",
"reference": {
"flags": ["-r", "--reference"],
"required": True,
"help": "fasta for reference genome.",
"type": path_arg(exists=True, is_file=True),
},
"dbsnp": {
"flags": ["-d", "--dbsnp"],
"sample_input": {
"flags": ["-i", "--sample_input"],
"nargs": "*",
"help": "sample BAM or CRAM file.",
"type": path_arg(exists=True, is_file=True),
},
"align": {
"help": (
"dbSNP vcf file Supplying this file will annotate variants "
"with their dbSNP refSNP ID numbers."
"Align the reads in the input uBAM/uCRAM file to the "
"reference genome. Assumes paired reads are collated in the "
"input file."
),
"type": path_arg(exists=True, is_file=True),
"action": "store_true",
},
"assay": {
"help": "The type of assay, WGS or WES.",
"choices": ["WGS", "WES"],
"default": "WGS",
},
"bam_format": {
"help": (
"Use the BAM format instead of CRAM for output aligned files"
),
"action": "store_true",
},
"bed": {
"flags": ["-b", "--bed"],
Expand All @@ -123,9 +134,17 @@ class DNAscopePipeline(BasePipeline):
),
"type": path_arg(exists=True, is_file=True),
},
"interval_padding": {
"help": "Amount to pad all intervals.",
"type": int,
"collate_align": {
"help": (
"Collate and align the reads in the input BAM/CRAM file to "
"the reference genome. Suitable for coordinate-sorted "
"BAM/CRAM input."
),
"action": "store_true",
},
"consensus": {
"help": "Generate consensus reads during dedup",
"action": "store_true",
},
"cores": {
"flags": ["-t", "--cores"],
Expand All @@ -135,42 +154,44 @@ class DNAscopePipeline(BasePipeline):
),
"default": mp.cpu_count(),
},
"pcr_free": {
"help": "Use arguments for PCR-free data processing",
"action": "store_true",
},
"gvcf": {
"flags": ["-g", "--gvcf"],
"dbsnp": {
"flags": ["-d", "--dbsnp"],
"help": (
"Generate a gVCF output file along with the VCF."
" (default generates only the VCF)"
"dbSNP vcf file Supplying this file will annotate variants "
"with their dbSNP refSNP ID numbers."
),
"type": path_arg(exists=True, is_file=True),
},
"dry_run": {
"help": "Print the commands without running them.",
"action": "store_true",
},
"duplicate_marking": {
"help": "Options for duplicate marking.",
"choices": ["markdup", "rmdup", "none"],
"default": "markdup",
},
"assay": {
"help": "The type of assay, WGS or WES.",
"choices": ["WGS", "WES"],
"default": "WGS",
},
"consensus": {
"help": "Generate consensus reads during dedup",
"gvcf": {
"flags": ["-g", "--gvcf"],
"help": (
"Generate a gVCF output file along with the VCF."
" (default generates only the VCF)"
),
"action": "store_true",
},
"dry_run": {
"help": "Print the commands without running them.",
"action": "store_true",
"input_ref": {
"help": (
"Used to decode the input alignment file. Required if the "
"input file is in the CRAM/uCRAM formats."
),
"type": path_arg(exists=True, is_file=True),
},
"skip_small_variants": {
"help": "Skip small variant (SNV/indel) calling",
"action": "store_true",
"interval_padding": {
"help": "Amount to pad all intervals.",
"type": int,
},
"skip_svs": {
"help": "Skip SV calling",
"pcr_free": {
"help": "Use arguments for PCR-free data processing",
"action": "store_true",
},
"skip_metrics": {
Expand All @@ -181,50 +202,23 @@ class DNAscopePipeline(BasePipeline):
"help": "Skip multiQC report generation",
"action": "store_true",
},
"align": {
"help": (
"Align the reads in the input uBAM/uCRAM file to the "
"reference genome. Assumes paired reads are collated in the "
"input file."
),
"action": "store_true",
},
"collate_align": {
"help": (
"Collate and align the reads in the input BAM/CRAM file to "
"the reference genome. Suitable for coordinate-sorted "
"BAM/CRAM input."
),
"skip_small_variants": {
"help": "Skip small variant (SNV/indel) calling",
"action": "store_true",
},
"input_ref": {
"help": (
"Used to decode the input alignment file. Required if the "
"input file is in the CRAM/uCRAM formats."
),
"type": path_arg(exists=True, is_file=True),
},
"bam_format": {
"help": (
"Use the BAM format instead of CRAM for output aligned files"
),
"skip_svs": {
"help": "Skip SV calling",
"action": "store_true",
},
"bwa_args": {
"help": "Extra arguments for sentieon bwa",
# "help": "Extra arguments for sentieon bwa",
"help": argparse.SUPPRESS,
"default": "",
},
"bwa_k": {
"help": "The '-K' argument in bwa",
"default": 100000000,
},
"util_sort_args": {
"help": "Extra arguments for sentieon util sort",
"default": "--cram_write_options version=3.0,compressor=rans",
},
"skip_version_check": {
# "help": "The '-K' argument in bwa",
"help": argparse.SUPPRESS,
"action": "store_true",
"default": 100000000,
},
"bwt_max_mem": {
# Manually set `bwt_max_mem`
Expand All @@ -239,6 +233,15 @@ class DNAscopePipeline(BasePipeline):
"help": argparse.SUPPRESS,
"action": "store_true",
},
"skip_version_check": {
"help": argparse.SUPPRESS,
"action": "store_true",
},
"util_sort_args": {
# "help": "Extra arguments for sentieon util sort",
"help": argparse.SUPPRESS,
"default": "--cram_write_options version=3.0,compressor=rans",
},
}

positionals: Dict[str, Dict[str, Any]] = {
Expand Down Expand Up @@ -343,7 +346,7 @@ def configure_alignment(self) -> None:
self.numa_nodes: List[str] = []
n_alignment_jobs = 1
if not self.no_split_alignment:
self.numa_nodes = spit_alignment(self.cores)
self.numa_nodes = split_alignment(self.cores)
n_alignment_jobs = max(1, len(self.numa_nodes))

total_input_size = 0
Expand Down
Loading