Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 D3b-ify Sentieon Updates #15

Merged
merged 11 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 10 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
6 changes: 3 additions & 3 deletions docs/dockers_ont.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ nanocaller_merge.cwl|genomicslab/nanocaller:3.2.0
samtools_coverage.cwl|staphb/samtools:1.17
samtools_head.cwl|staphb/samtools:1.17
samtools_split.cwl|staphb/samtools:1.17
sentieon_LongReadSV.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202112.06
sentieon_ReadWriter.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202112.01_hifi
sentieon_minimap2.cwl|pgc-images.sbgenomics.com/d3b-bixu/sentieon:202112.01_hifi
sentieon_DNAscope_LongRead_CLI.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sentieon_ReadWriter.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sentieon_minimap2.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sniffles.cwl|pgc-images.sbgenomics.com/d3b-bixu/sniffles:2.0.7
tar.cwl|None
7 changes: 3 additions & 4 deletions docs/dockers_pacbio.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ pbsv_call.cwl|quay.io/biocontainers/pbsv:2.9.0--h9ee0642_0
pbsv_discover.cwl|quay.io/biocontainers/pbsv:2.9.0--h9ee0642_0
samtools_head.cwl|staphb/samtools:1.17
samtools_split.cwl|staphb/samtools:1.17
sentieon_DNAscope_LongRead.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202112.01_hifi
sentieon_LongReadSV.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202112.06
sentieon_ReadWriter.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202112.01_hifi
sentieon_minimap2.cwl|pgc-images.sbgenomics.com/d3b-bixu/sentieon:202112.01_hifi
sentieon_DNAscope_LongRead_CLI.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sentieon_ReadWriter.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sentieon_minimap2.cwl|pgc-images.sbgenomics.com/hdchen/sentieon:202308.03
sniffles.cwl|pgc-images.sbgenomics.com/d3b-bixu/sniffles:2.0.7
tar.cwl|None
28 changes: 28 additions & 0 deletions scripts/get_dnascope_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3

import argparse
import yaml
import requests
import sys


def main():
parser = argparse.ArgumentParser(description="Download DNAscope model bundle")
parser.add_argument("model_name", help="the name of the model bundle, e.g. Illumina_WGS")
args = parser.parse_args()
model_name = args.model_name.split("-")
sentieon_models_yaml = "https://github.com/Sentieon/sentieon-models/raw/refs/heads/main/sentieon_models.yaml"
response = requests.get(sentieon_models_yaml, allow_redirects=True)
content = response.content.decode("utf-8")
content = yaml.safe_load(content)
try:
url = content["DNAscope_bundles"][model_name[0]][model_name[1]]
r = requests.get(url, allow_redirects=True)
open(url.split("/")[-1], 'wb').write(r.content)
except:
open('empty.bundle', 'wb')
print('Models updated on: ' + content["Updated on"], file=sys.stderr)


if __name__ == '__main__':
main()
46 changes: 46 additions & 0 deletions tools/download_DNAscope_model.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cwlVersion: v1.2
class: CommandLineTool
label: Download DNAscope model bundle
hints:
- class: ResourceRequirement
coresMin: 1
requirements:
- class: ShellCommandRequirement
- class: InlineJavascriptRequirement
- class: DockerRequirement
dockerPull: python:3.7-slim
- class: InitialWorkDirRequirement
listing:
- entryname: get_dnascope_model.py
entry:
$include: ../scripts/get_dnascope_model.py
arguments:
- position: 0
valueFrom: 'pip install pyyaml requests;'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I am a big fan of having to install a package every time. Can we find/create an image that has what's needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I'd agree but:

  • this isn't part of the workflow and would only be run in a one-off context
  • there really isn't a good docker out there that has pyyaml and requests built in

shellQuote: false
- position: 1
valueFrom: 'python get_dnascope_model.py'
shellQuote: false
inputs:
- id: model_name
label: Model name
doc: Model platform and data type. For example, Illumina_WGS
type:
- type: enum
symbols:
- Illumina-WGS
- Illumina-WES
- MGI-WGS
- MGI-WES
- Element_Biosciences-WGS
- PacBio_HiFi-WGS
- Oxford_Nanopore-WGS
inputBinding:
position: 2
outputs:
- id: model_bundle
label: DNAscope Model bundle
type: File
outputBinding:
glob: '*.bundle'

169 changes: 0 additions & 169 deletions tools/sentieon_DNAscope_LongRead.cwl

This file was deleted.

Loading