From ee26deae3c8eb1890738286b36a5bf3dc77031a0 Mon Sep 17 00:00:00 2001 From: DonFreed Date: Tue, 17 Sep 2024 09:47:34 -0700 Subject: [PATCH] Add `-Y` to minimap2 by default Expose `--minimap2_args` on the command line. --- sentieon_cli/command_strings.py | 4 ++++ sentieon_cli/dnascope_longread.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/sentieon_cli/command_strings.py b/sentieon_cli/command_strings.py index 01259d5..8c9e1cc 100644 --- a/sentieon_cli/command_strings.py +++ b/sentieon_cli/command_strings.py @@ -260,6 +260,7 @@ def cmd_samtools_fastq_minimap2( sample_name: str, input_ref: Optional[pathlib.Path] = None, fastq_taglist: str = "*", + minimap2_args: str = "-Y", util_sort_args: str = "--cram_write_options version=3.0,compressor=rans", ) -> str: """Re-align an input BAM/CRAM/uBAM/uCRAM file with minimap2""" @@ -288,6 +289,7 @@ def cmd_samtools_fastq_minimap2( "-t", str(cores), "-a", + minimap2_args, "-x", f"{model_bundle}/minimap2.model", str(reference), @@ -434,6 +436,7 @@ def cmd_fastq_minimap2( model_bundle: pathlib.Path, cores: int, unzip: str = "gzip", + minimap2_args: str = "-Y", util_sort_args: str = "--cram_write_options version=3.0,compressor=rans", ) -> str: """Align an input fastq file with minimap2""" @@ -449,6 +452,7 @@ def cmd_fastq_minimap2( "-t", str(cores), "-a", + minimap2_args, "-x", f"{model_bundle}/minimap2.model", "-R", diff --git a/sentieon_cli/dnascope_longread.py b/sentieon_cli/dnascope_longread.py index efd4a75..be32a48 100644 --- a/sentieon_cli/dnascope_longread.py +++ b/sentieon_cli/dnascope_longread.py @@ -72,6 +72,7 @@ def align_inputs( skip_version_check: bool = False, bam_format: bool = False, fastq_taglist: str = "*", + minimap2_args: str = "-Y", util_sort_args: str = "--cram_write_options version=3.0,compressor=rans", input_ref: Optional[pathlib.Path] = None, **_kwargs: Any, @@ -107,6 +108,7 @@ def align_inputs( sample_name, input_ref, fastq_taglist, + minimap2_args, util_sort_args, ) ) @@ -124,6 +126,7 @@ def align_fastq( readgroups: Optional[List[str]] = None, skip_version_check: bool = False, bam_format: bool = False, + minimap2_args: str = "-Y", util_sort_args: str = "--cram_write_options version=3.0,compressor=rans", **_kwargs: Any, ) -> List[pathlib.Path]: @@ -166,6 +169,7 @@ def align_fastq( model_bundle, cores, unzip, + minimap2_args, util_sort_args, ) ) @@ -726,6 +730,10 @@ def mosdepth( help="Use the BAM format instead of CRAM for output aligned files", action="store_true", ) +@arg( + "--minimap2_args", + help="Extra arguments for sentieon minimap2", +) @arg( "--util_sort_args", help="Extra arguments for sentieon util sort", @@ -766,6 +774,7 @@ def dnascope_longread( input_ref: Optional[pathlib.Path] = None, fastq_taglist: str = "*", # pylint: disable=W0613 bam_format: bool = False, # pylint: disable=W0613 + minimap2_args: str = "-Y", # pylint: disable=W0613 util_sort_args: str = ( "--cram_write_options version=3.0,compressor=rans" ), # pylint: disable=W0613