Skip to content

Commit

Permalink
Support BAM/CRAM input without SM tags in DNAscopeLR
Browse files Browse the repository at this point in the history
  • Loading branch information
DonFreed committed Jun 5, 2024
1 parent 046f148 commit fc5d181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sentieon_cli/command_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def cmd_samtools_fastq_minimap2(
model_bundle: pathlib.Path,
cores: int,
rg_lines: List[str],
sample_name: str,
input_ref: Optional[pathlib.Path] = None,
fastq_taglist: str = "*",
util_sort_args: str = "--cram_write_options version=3.0,compressor=rans",
Expand Down Expand Up @@ -284,6 +285,9 @@ def cmd_samtools_fastq_minimap2(
# Commands to replace the @RG lines in the header
rg_cmds: List[List[str]] = []
for rg_line in rg_lines:
# Add an SM value, if missing
if "\tSM:" not in rg_line:
rg_line += f"\tSM:{sample_name}"
rg_cmds.append(
[
"samtools",
Expand Down
2 changes: 2 additions & 0 deletions sentieon_cli/dnascope_longread.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def align_inputs(

res: List[pathlib.Path] = []
suffix = "bam" if bam_format else "cram"
sample_name = output_vcf.name.replace(".vcf.gz", "")
for i, input_aln in enumerate(sample_input):
out_aln = pathlib.Path(
str(output_vcf).replace(".vcf.gz", f"_mm2_sorted_{i}.{suffix}")
Expand All @@ -96,6 +97,7 @@ def align_inputs(
model_bundle,
cores,
rg_lines,
sample_name,
input_ref,
fastq_taglist,
util_sort_args,
Expand Down

0 comments on commit fc5d181

Please sign in to comment.