Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-parker committed Sep 22, 2024
1 parent 25396ae commit deba20e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
23 changes: 20 additions & 3 deletions ena-submission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ curl -X 'POST' 'http://localhost:8079/groups' \
"country": "Germany"
},
"contactEmail": "something@loculus.org"}'
loculus_accession = $(curl -X 'POST' \
LOCULUS_ACCESSION = $(curl -X 'POST' \
'http://localhost:8079/cchf/submit?groupId=1&dataUseTermsType=OPEN' \
-H 'accept: application/json' \
-H "Authorization: Bearer ${JWT}" \
Expand Down Expand Up @@ -231,9 +231,26 @@ snakemake trigger_submission_to_ena_from_file

Alternatively you can upload data to the [test folder](https://github.com/pathoplexus/ena-submission/blob/main/test/approved_ena_submission_list.json) and run `snakemake trigger_submission_to_ena`.

5. Create project, sample and assembly: `snakemake results/project_created results/sample_created results/assembly_created` - you will need the credentials of the ENA test submission account for this.
5. Create project, sample and assembly: `snakemake results/project_created results/sample_created results/assembly_created` - you will need the credentials of the ENA test submission account for this. (You can terminate the rules after you see assembly creation has been successful, or earlier if you see errors.)

6. Note that ENA's dev server does not always finish processing and you might not receive a `gcaAccession` for your dev submissions. If you would like to test the full submission cycle on the ENA dev instance it makes sense to manually alter the gcaAccession in the database to `ERZ24784470` (a known test submission with 2 chromosomes/segments - sadly ERZ accessions are private so I do not have other test examples).
6. Note that ENA's dev server does not always finish processing and you might not receive a `gcaAccession` for your dev submissions. If you would like to test the full submission cycle on the ENA dev instance it makes sense to manually alter the gcaAccession in the database to `ERZ24784470` (a known test submission with 2 chromosomes/segments - sadly ERZ accessions are private so I do not have other test examples). You can do this after connecting via pgAdmin or connecting via the CLI:

```sh
psql -h 127.0.0.1:5432 -U postgres -d loculus
```

Then perform the update:

```sql
SET search_path TO "ena-submission";
UPDATE assembly_table
SET result = '{"erz_accession": "ERZ24784470", "segment_order": ["L", "M"]}'::jsonb
WHERE accession = '$LOCULUS_ACCESSION';
```

Exit `psql` using `\q`.

7. Upload to loculus (you can run the webpage locally if you would like to see this visually), `snakemake results/assembly_created results/uploaded_external_metadata`.

If you experience issues you can look at the database locally using pgAdmin. On local instances the password is `unsecure`.

Expand Down
9 changes: 5 additions & 4 deletions ena-submission/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ for key, value in defaults.items():
if not key in config:
config[key] = value

Path("results").mkdir(parents=True, exist_ok=True)
with open("results/config.yaml", "w") as f:
f.write(yaml.dump(config))

LOG_LEVEL = config.get("log_level", "INFO")
SUBMIT_TO_ENA_PROD = config.get("submit_to_ena_prod", False)
SUBMIT_TO_ENA_DEV = not SUBMIT_TO_ENA_PROD
Expand All @@ -38,6 +34,11 @@ if SUBMIT_TO_ENA_PROD:
config["ena_reports_service_url"] = "https://www.ebi.ac.uk/ena/submit/report"


Path("results").mkdir(parents=True, exist_ok=True)
with open("results/config.yaml", "w") as f:
f.write(yaml.dump(config))


rule all:
input:
triggered="results/triggered",
Expand Down
4 changes: 3 additions & 1 deletion ena-submission/scripts/create_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ def assembly_table_create(
)
continue
logger.info(f"Starting assembly creation for accession {row["accession"]}")
segment_order = get_segment_order(sample_data_in_submission_table[0]["unaligned_sequences"])
segment_order = get_segment_order(
sample_data_in_submission_table[0]["unaligned_nucleotide_sequences"]
)
assembly_creation_results: CreationResults = create_ena_assembly(
ena_config, manifest_file, center_name=center_name, test=test
)
Expand Down

0 comments on commit deba20e

Please sign in to comment.