Skip to content

Commit

Permalink
Create assembly, add webin-cli to docker container, add call to API t…
Browse files Browse the repository at this point in the history
…o check status of assembly submission.
  • Loading branch information
anna-parker committed Aug 13, 2024
1 parent 6e1830d commit 750fc67
Show file tree
Hide file tree
Showing 14 changed files with 1,184 additions and 156 deletions.
16 changes: 15 additions & 1 deletion ena-submission/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM mambaorg/micromamba:1.5.8

# Install dependencies needed for webin-cli
USER root
RUN apt-get update && apt-get install -y \
default-jre \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /package
USER $MAMBA_USER

COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/env.yaml
COPY --chown=$MAMBA_USER:$MAMBA_USER .mambarc /tmp/.mambarc

Expand All @@ -10,6 +19,11 @@ RUN micromamba config set extract_threads 1 \
# Set the environment variable to activate the conda environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1

COPY --chown=$MAMBA_USER:$MAMBA_USER . /package

ENV WEBIN_CLI_VERSION 7.3.1
USER root
RUN wget -q "https://github.com/enasequence/webin-cli/releases/download/${WEBIN_CLI_VERSION}/webin-cli-${WEBIN_CLI_VERSION}.jar" -O /package/webin-cli.jar
USER $MAMBA_USER

COPY --chown=$MAMBA_USER:$MAMBA_USER . /package
WORKDIR /package
29 changes: 28 additions & 1 deletion ena-submission/ENA_submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,34 @@ The following could be implement as post-MVP features:
-password YYYYYY
```

5. Save accession numbers (these will be returned by the webin-cli)
5. Save ERZ accession numbers (these will be returned by the webin-cli)
6. Wait to receive GCA accession numbers (returned later after assignment by NCBI). This can be retrieved via https://wwwdev.ebi.ac.uk/ena/submit/report/swagger-ui/index.html

```
curl -X 'GET' \
'https://www.ebi.ac.uk/ena/submit/report/analysis-process/{erz_accession}?format=json&max-results=100' \
-H 'accept: */*' \
-H 'Authorization: Basic KEY'
```
When processing is finished the response should look like:
```
[
{
"report": {
"id": "{erz_accession}",
"analysisType": "SEQUENCE_ASSEMBLY",
"acc": "chromosomes:OZ076380-OZ076381,genome:GCA_964187725.1",
"processingStatus": "COMPLETED",
"processingStart": "14-06-2024 05:07:40",
"processingEnd": "14-06-2024 05:08:19",
"processingError": null
},
"links": []
}
]
```
## Promises made to ENA
Expand Down
6 changes: 6 additions & 0 deletions ena-submission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ micromamba create -f environment.yml --platform osx-64 --rc-file .mambarc
micromamba activate loculus-ena-submission
```

In order to submit assemblies you will also need to install ENA's `webin-cli.jar`. Their [webpage](https://ena-docs.readthedocs.io/en/latest/submit/general-guide/webin-cli.html) offers more instructions. This pipeline has been tested with `WEBIN_CLI_VERSION=7.3.1`.

```bash
wget -q "https://github.com/enasequence/webin-cli/releases/download/${WEBIN_CLI_VERSION}/webin-cli-${WEBIN_CLI_VERSION}.jar" -O /package/webin-cli.jar
```

Then run snakemake using `snakemake` or `snakemake {rule}`.
15 changes: 15 additions & 0 deletions ena-submission/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ rule create_sample:
sample_created=touch("results/sample_created"),
params:
log_level=LOG_LEVEL,
shell:
"""
python {input.script} \
--config-file {input.config} \
--log-level {params.log_level} \
"""

rule create_assembly:
input:
script="scripts/create_assembly.py",
config="results/config.yaml",
output:
sample_created=touch("results/assembly_created"),
params:
log_level=LOG_LEVEL,
shell:
"""
python {input.script} \
Expand Down
1 change: 1 addition & 0 deletions ena-submission/config/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ena_submission_url: https://wwwdev.ebi.ac.uk/ena/submit/drop-box/submit
github_username: fake_username
github_pat: fake_pat
github_url: https://api.github.com/repos/pathoplexus/ena-submission/contents/test/approved_ena_submission_list.json?ref=main
ena_reports_service_url: https://wwwdev.ebi.ac.uk/ena/submit/report
metadata_mapping:
'subject exposure':
loculus_fields: [exposure_event]
Expand Down
Loading

0 comments on commit 750fc67

Please sign in to comment.