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

Cleanup and fix datafile accessions #98

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

kdp-cloud
Copy link
Collaborator

@kdp-cloud kdp-cloud commented Jan 3, 2025

  • Cleaning up of mars_cli.py
  • Better logging:
    • extra handler for stdout, with color-coded formatting for different logging levels, instead of printing to stdout.
    • logs in stdout are identical to the ones in the logfiles
    • logs from external libraries are also logged

image

  • Adds Study related accessions as a study comment. E.g. If ENA returns the Study accession 'ERP167466' in the receipt. it will add the following comment:
          {
            "name": "ena_study_accession",
            "value": "ERP167466"
          }
  • Add it as a comment in the assay as well
  • Add datafile accessions to the updated ISA-JSON

@kdp-cloud
Copy link
Collaborator Author

Test submission to BioSamples and ENA

2025-01-06 10:49:00,067 - MARS-CLI - INFO - ############# Welcome to the MARS CLI. #############
2025-01-06 10:49:00,067 - MARS-CLI - INFO - Running in Development environment
2025-01-06 10:49:00,068 - MARS-CLI - INFO - Starting submission of the ISA JSON to the target repositories: biosamples, ena.
2025-01-06 10:49:00,069 - MARS-CLI - INFO - ISA JSON with investigation 'Bob's investigation' is valid.
2025-01-06 10:49:01,857 - MARS-CLI - INFO - Submission to biosamples was successful. Result:
{'targetRepository': 'biosamples', 'errors': [], 'info': [], 'accessions': [{'value': 'SAMEA131505508', 'path': [{'key': 'investigation'}, {'key': 'studies', 'where': {'key': 'title', 'value': 'Arabidopsis thaliana'}}, {'key': 'materials'}, {'key': 'samples', 'where': {'key': 'name', 'value': 'leaf 1'}}]}, {'value': 'SAMEA131505507', 'path': [{'key': 'investigation'}, {'key': 'studies', 'where': {'key': 'title', 'value': 'Arabidopsis thaliana'}}, {'key': 'materials'}, {'key': 'sources', 'where': {'key': 'name', 'value': 'plant 1'}}]}]}
2025-01-06 10:49:02,517 - MARS-CLI - INFO - Uploading ENA_TEST2.R2.fastq.gz to FTP
2025-01-06 10:49:07,722 - MARS-CLI - INFO - Submission to ena was successful. Result:
{'targetRepository': 'ena', 'errors': [], 'info': [{'message': 'This submission is a TEST submission and will be discarded within 24 hours'}], 'accessions': [{'value': 'ERP167530', 'path': [{'key': 'investigation'}, {'key': 'studies', 'where': {'key': 'title', 'value': 'Arabidopsis thaliana'}}]}, {'value': 'ERX13507164', 'path': [{'key': 'investigation'}, {'key': 'studies', 'where': {'key': 'title', 'value': 'Arabidopsis thaliana'}}, {'key': 'assays', 'where': {'key': '@id', 'value': '#assay/18_20_21'}}, {'key': 'materials'}, {'key': 'otherMaterials', 'where': {'key': '@id', 'value': '#other_material/332'}}]}, {'value': 'ERX13507165', 'path': [{'key': 'investigation'}, {'key': 'studies', 'where': {'key': 'title', 'value': 'Arabidopsis thaliana'}}, {'key': 'assays', 'where': {'key': '@id', 'value': '#assay/18_20_21'}}, {'key': 'materials'}, {'key': 'otherMaterials', 'where': {'key': '@id', 'value': '#other_material/333'}}]}]}

Repository study accession is dumped as a study comment and an assay comment:
image

DataFile accessions SHOULD be present as a comment in dataFiles in the updated ISA-JSON. They are not present in this example because the receipt did not include the accessions. However, there are some tests written to simulate this behavior.

@kdp-cloud kdp-cloud marked this pull request as ready for review January 6, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENA run accession is not being dumped back into the ISA-JSON datafile comment field
1 participant