Skip to content

Commit

Permalink
limit models to current container
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHarrop committed Jun 11, 2024
1 parent ab7055d commit c655091
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 70 deletions.
20 changes: 13 additions & 7 deletions tools/dorado/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Dorado is distributed on
but not tagged with a version.

That means the hash for the current version has to be hard-coded into the
wrapper. Unfortunately you have to pull a >6 GB container just to check the tool
version. At least you can update the list of models at the same time (see
below).
wrapper. Unfortunately you have to pull a >6 GB container and run `dorado
--version` just to check the tool version.

**Make sure you do this when you update the wrapper**!
You can update the list of models at the same time (see
below). **You must do this when you update the wrapper**.

## Basecalling models

Expand All @@ -20,11 +20,17 @@ The models are bundled in the container at `/models` and made available by the
container, doing this will also make them unavailable to Galaxy. Check the diff
before you merge.

Here's a one-liner to **replace** the contents of the loc file with the models that are bundled in the container `nanoporetech/dorado:shac2d8bc91ca2d043fed84d06cca92aaeb62bcc1cd`.
The columns are `value`, `tool_version`, `name` and `path`.

Here's a one-liner to **update** the loc file with the models that are bundled
in the container
`nanoporetech/dorado:shac2d8bc91ca2d043fed84d06cca92aaeb62bcc1cd`. Note that you
would use the hash for the current dorado version (obtained above), and the
dorado version is manually passed to `awk`.

```bash
apptainer exec docker://nanoporetech/dorado:shac2d8bc91ca2d043fed84d06cca92aaeb62bcc1cd \
ls /models | \
awk '{print $0 "\t" $0 "\t/models/" $0}' \
> tool-data/dorado_models.loc.sample
awk -v tv="0.7.1" '{print tv "_" $0 "\t" tv "\t" $0 "\t/models/" $0}' \
>> tool-data/dorado_models.loc.sample
```
6 changes: 4 additions & 2 deletions tools/dorado/dorado.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ reads.pod5
]]></command>
<inputs>
<param name="pod5_file" type="data" format="fast5" label="Raw fast5 file"/>
<!-- TODO: the model needs to be linked to the tool version, e.g. to prevent trying to run a new model with a previous version of the tool. -->
<param name="model" type="select">
<options from_data_table="dorado_models"/>
<options from_data_table="dorado_models">
<!-- only allow models that shipped with this tool_version -->
<filter type="static_value" column="1" value="@VERSION@" />
</options>
</param>
</inputs>
<outputs>
Expand Down
2 changes: 1 addition & 1 deletion tools/dorado/macros.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<macros>
<!-- UPDATING: pull the latest container and check the version. Update both tokens. You can also update the model list. See README.md for more. -->
<!-- UPDATING: pull the latest container and check the version. Update both tokens. You MUST also update the model list. See README.md for more. -->
<token name="@VERSION@">0.7.1</token>
<token name="@CONTAINER_HASH@">1c65eb070a9fc1d88710c4dc09b06541f96fdd28</token>
<xml name="requirements">
Expand Down
116 changes: 58 additions & 58 deletions tools/dorado/tool-data/dorado_models.loc.sample
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
dna_r10.[email protected]_5mC_5hmC@v1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
dna_r10.[email protected]_6mA@v2 [email protected]_6mA@v2 /models/[email protected]_6mA@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_4mC_5mC@v1 [email protected]_4mC_5mC@v1 /models/[email protected]_4mC_5mC@v1
dna_r10.[email protected]_5mCG_5hmCG@v1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
dna_r10.[email protected]_5mC_5hmC@v1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
dna_r10.[email protected]_6mA@v1 [email protected]_6mA@v1 /models/[email protected]_6mA@v1
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v2 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_5mCG_5hmCG@v1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
dna_r10.[email protected]_5mC_5hmC@v1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
dna_r10.[email protected]_6mA@v2 [email protected]_6mA@v2 /models/[email protected]_6mA@v2
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r10.[email protected]_4mC_5mC@v1 [email protected]_4mC_5mC@v1 /models/[email protected]_4mC_5mC@v1
dna_r10.[email protected]_5mCG_5hmCG@v1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
dna_r10.[email protected]_5mC_5hmC@v1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
dna_r10.[email protected]_6mA@v1 [email protected]_6mA@v1 /models/[email protected]_6mA@v1
dna_r10.[email protected] [email protected] /models/[email protected]
dna_r9.[email protected] [email protected] /models/[email protected]
dna_r9.[email protected][email protected] [email protected][email protected] /models/[email protected][email protected]
dna_r9.[email protected]_5mCG_5hmCG@v0 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
dna_r9.[email protected] [email protected] /models/[email protected]
dna_r9.[email protected][email protected] [email protected][email protected] /models/[email protected][email protected]
dna_r9.[email protected]_5mCG_5hmCG@v0 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
dna_r9.[email protected] [email protected] /models/[email protected]
dna_r9.[email protected][email protected] [email protected][email protected] /models/[email protected][email protected]
dna_r9.[email protected]_5mCG_5hmCG@v0 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
dna_r9.[email protected] [email protected] /models/[email protected]
rna002_70bps_fast@v3 rna002_70bps_fast@v3 /models/rna002_70bps_fast@v3
rna002_70bps_hac@v3 rna002_70bps_hac@v3 /models/rna002_70bps_hac@v3
rna004_130bps_fast@v3.0.1 [email protected] /models/[email protected]
rna004_130bps_fast@v5.0.0 [email protected] /models/[email protected]
rna004_130bps_hac@v3.0.1 [email protected] /models/[email protected]
rna004_130bps_hac@v5.0.0 [email protected] /models/[email protected]
rna004_130bps_hac@v5.0.0_m6A@v1 [email protected]_m6A@v1 /models/[email protected]_m6A@v1
rna004_130bps_hac@v5.0.0_pseU@v1 [email protected]_pseU@v1 /models/[email protected]_pseU@v1
rna004_130bps_sup@v3.0.1 [email protected] /models/[email protected]
rna004_130bps_sup@v3.0.1_m6A_DRACH@v1 [email protected]_m6A_DRACH@v1 /models/[email protected]_m6A_DRACH@v1
rna004_130bps_sup@v5.0.0 [email protected] /models/[email protected]
rna004_130bps_sup@v5.0.0_m6A@v1 [email protected]_m6A@v1 /models/[email protected]_m6A@v1
rna004_130bps_sup@v5.0.0_pseU@v1 [email protected]_pseU@v1 /models/[email protected]_pseU@v1
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v1 0.7.1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
0.7.1_dna_r10.[email protected]_5mC_5hmC@v1 0.7.1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
0.7.1_dna_r10.[email protected]_6mA@v2 0.7.1 [email protected]_6mA@v2 /models/[email protected]_6mA@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_4mC_5mC@v1 0.7.1 [email protected]_4mC_5mC@v1 /models/[email protected]_4mC_5mC@v1
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v1 0.7.1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
0.7.1_dna_r10.[email protected]_5mC_5hmC@v1 0.7.1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
0.7.1_dna_r10.[email protected]_6mA@v1 0.7.1 [email protected]_6mA@v1 /models/[email protected]_6mA@v1
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v2 0.7.1 [email protected]_5mCG_5hmCG@v2 /models/[email protected]_5mCG_5hmCG@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v1 0.7.1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
0.7.1_dna_r10.[email protected]_5mC_5hmC@v1 0.7.1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
0.7.1_dna_r10.[email protected]_6mA@v2 0.7.1 [email protected]_6mA@v2 /models/[email protected]_6mA@v2
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r10.[email protected]_4mC_5mC@v1 0.7.1 [email protected]_4mC_5mC@v1 /models/[email protected]_4mC_5mC@v1
0.7.1_dna_r10.[email protected]_5mCG_5hmCG@v1 0.7.1 [email protected]_5mCG_5hmCG@v1 /models/[email protected]_5mCG_5hmCG@v1
0.7.1_dna_r10.[email protected]_5mC_5hmC@v1 0.7.1 [email protected]_5mC_5hmC@v1 /models/[email protected]_5mC_5hmC@v1
0.7.1_dna_r10.[email protected]_6mA@v1 0.7.1 [email protected]_6mA@v1 /models/[email protected]_6mA@v1
0.7.1_dna_r10.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r9.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r9.[email protected]_5mCG@v0.1 0.7.1 [email protected][email protected] /models/[email protected][email protected]
0.7.1_dna_r9.[email protected]_5mCG_5hmCG@v0 0.7.1 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
0.7.1_dna_r9.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r9.[email protected]_5mCG@v0.1 0.7.1 [email protected][email protected] /models/[email protected][email protected]
0.7.1_dna_r9.[email protected]_5mCG_5hmCG@v0 0.7.1 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
0.7.1_dna_r9.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_dna_r9.[email protected]_5mCG@v0.1 0.7.1 [email protected][email protected] /models/[email protected][email protected]
0.7.1_dna_r9.[email protected]_5mCG_5hmCG@v0 0.7.1 [email protected]_5mCG_5hmCG@v0 /models/[email protected]_5mCG_5hmCG@v0
0.7.1_dna_r9.[email protected] 0.7.1 [email protected] /models/[email protected]
0.7.1_rna002_70bps_fast@v3 0.7.1 rna002_70bps_fast@v3 /models/rna002_70bps_fast@v3
0.7.1_rna002_70bps_hac@v3 0.7.1 rna002_70bps_hac@v3 /models/rna002_70bps_hac@v3
0.7.1_rna004_130bps_fast@v3.0.1 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_fast@v5.0.0 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_hac@v3.0.1 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_hac@v5.0.0 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_hac@v5.0.0_m6A@v1 0.7.1 [email protected]_m6A@v1 /models/[email protected]_m6A@v1
0.7.1_rna004_130bps_hac@v5.0.0_pseU@v1 0.7.1 [email protected]_pseU@v1 /models/[email protected]_pseU@v1
0.7.1_rna004_130bps_sup@v3.0.1 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_sup@v3.0.1_m6A_DRACH@v1 0.7.1 [email protected]_m6A_DRACH@v1 /models/[email protected]_m6A_DRACH@v1
0.7.1_rna004_130bps_sup@v5.0.0 0.7.1 [email protected] /models/[email protected]
0.7.1_rna004_130bps_sup@v5.0.0_m6A@v1 0.7.1 [email protected]_m6A@v1 /models/[email protected]_m6A@v1
0.7.1_rna004_130bps_sup@v5.0.0_pseU@v1 0.7.1 [email protected]_pseU@v1 /models/[email protected]_pseU@v1
2 changes: 1 addition & 1 deletion tools/dorado/tool_data_table_conf.xml.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tables>
<table name="dorado_models" comment_char="#">
<columns>value, name, path</columns>
<columns>value, tool_version, name, path</columns>
<file path="tool-data/dorado_models.loc" />
</table>
</tables>
2 changes: 1 addition & 1 deletion tools/dorado/tool_data_table_conf.xml.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tables>
<table name="dorado_models" comment_char="#">
<columns>value, name, path</columns>
<columns>value, tool_version, name, path</columns>
<file path="${__HERE__}/test-data/dorado_models.loc" />
</table>
</tables>

0 comments on commit c655091

Please sign in to comment.