Skip to content

microSALT v4.2.1#208

Merged
karlnyr merged 40 commits intomasterfrom
rc4.2.1
Jun 10, 2025
Merged

microSALT v4.2.1#208
karlnyr merged 40 commits intomasterfrom
rc4.2.1

Conversation

@karlnyr
Copy link
Copy Markdown
Contributor

@karlnyr karlnyr commented May 28, 2025

Description

This hotfixes the bug we had for authenticating requests. It also adds possibilities to alter the logging levels from the CLI, and adds further debug statements to the DB_manipulator, increasing transparency when things are added into a profiles table.

Added

  • Opened up the CLI to alter the logging levels
  • Version file generated when pipeline starts
  • Version file added to deliverables

Changed

  • Removed custom header, using the implicit OAuth1Session header instead

Primary function of PR

  • Hotfix
  • Patch
  • Minor functionality improvement
  • New type of analysis
  • Backward-breaking functionality improvement
  • This change requires internal documents to be updated
  • This change requires another repository to be updated

Testing

If the update is a hotfix, it is sufficient to rely on the development testing along with the Travis self-test automatically applied to the PR.

Test routine to verify the stability of the PR:

  • bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh BRANCHNAME
  • us
  • conda activate S_microSALT
  • (SITUATIONAL) export MICROSALT_CONFIG=/home/proj/dropbox/microSALT.json
  • Select a relevant subset of the following:
  • microSALT analyse project MIC3109
  • microSALT analyse project MIC4107
  • microSALT analyse project MIC4109
  • microSALT analyse project ACC5551

Verify that the results for projects MIC3109, MIC4107, MIC4109 & ACC5551 are consistent with the results attached to AMSystem doc 1490, Microbial_WGS.xlsx

Test results

These are the results of the tests, and necessary conclusions, that prove the stability of the PR.

Sign-offs

@karlnyr karlnyr requested a review from a team as a code owner May 28, 2025 07:54
karlnyr and others added 9 commits May 28, 2025 09:56
### Fixed

- Replaced custom OAuth1 header generation with rauth.OAuth1Session for handling API requests, simplifying authentication logic and improving maintainability. (microSALT/utils/pubmlst/client.py, [1] [2]
- Removed the generate_oauth_header function, as it is no longer needed due to the adoption of OAuth1Session. (microSALT/utils/pubmlst/helpers.py, microSALT/utils/pubmlst/helpers.pyL143-L173)

### Added

- Added a new CLI command update_organism to update specific organisms, enabling more granular database updates. (microSALT/cli.py, microSALT/cli.pyR462-R472)
- Forced a fresh session token retrieval before downloading MLST profiles to ensure up-to-date access credentials. (microSALT/utils/pubmlst/client.py, microSALT/utils/pubmlst/client.pyR166-R171)

### Changed

- Simplified logger initialization by removing type hints and directly assigning None. (microSALT/__init__.py, microSALT/init.pyL27-R27)
@karlnyr
Copy link
Copy Markdown
Contributor Author

karlnyr commented Jun 2, 2025

activate S_base; activate S_microSALT; 

# Running:

microSALT utils resync update-organism --force-update --organism "streptococcus pneumoniae"
microSALT utils resync update-organism --force-update --organism "staphylococcus aureus"

# Checking output

tail -n 1 /home/proj/stage/microbial/references/ST_profiles/streptococcus_pneumoniae # should have at least 20253
[15:09] [hiseq.clinical@hasta:/home/proj/stage/bin/git/microSALT] [S_microSALT]  (rc4.2.1) $ tail -n 1 /home/proj/stage/microbial/references/ST_profiles/streptococcus_pneumoniae # should have at least 20253
20253   12      19      2       17      15      112     9
tail -n 1 /home/proj/stage/microbial/references/ST_profiles/staphylococcus_aureus # should have at least have 9964
[15:25] [hiseq.clinical@hasta:/home/proj/stage/bin/git/microSALT] [S_microSALT]  (rc4.2.1) $ tail -n 1 /home/proj/stage/microbial/references/ST_profiles/staphylococcus_aureus
10095   295     14      8       6       10      3       2

Also, to ensure that pasteur is working we reran the sync of the databases from the static page:

[14:18] [hiseq.clinical@hasta:/home/proj/stage/bin/git/microSALT] [S_microSALT]  (rc4.2.1) $ microSALT utils resync update-from-static
2025-06 14:19:05        INFO    Profile for Brachyspira pilosicoli already at the latest version.
2025-06 14:19:06        INFO    Profile for Brachyspira spp. already at the latest version.
2025-06 14:19:07        INFO    Profile for Citrobacter freundii already at the latest version.
2025-06 14:19:07        INFO    Profile for Enterobacter cloacae already at the latest version.
2025-06 14:19:08        INFO    Profile for Enterococcus faecalis already at the latest version.
2025-06 14:19:08        INFO    Profile for Enterococcus faecium already at the latest version.
2025-06 14:19:09        INFO    Profile for Escherichia coli already at the latest version.
2025-06 14:19:10        INFO    Profile for Glaesserella parasuis already at the latest version.
2025-06 14:19:10        INFO    Profile for Klebsiella aerogenes already at the latest version.
2025-06 14:19:11        INFO    Profile for Klebsiella oxytoca already at the latest version.
2025-06 14:19:11        INFO    pasteur reference for Klebsiella pneumoniae updated to 2025-06-02 from 2025-05-19
2025-06 14:19:12        INFO    Profiles CSV downloaded to /home/proj/stage/microbial/references/ST_profiles/klebsiella_pneumoniae
2025-06 14:19:13        INFO    Locus FASTA downloaded: gapA.tfa
2025-06 14:19:13        INFO    Locus FASTA downloaded: infB.tfa
2025-06 14:19:14        INFO    Locus FASTA downloaded: mdh.tfa
2025-06 14:19:15        INFO    Locus FASTA downloaded: pgi.tfa
2025-06 14:19:16        INFO    Locus FASTA downloaded: phoE.tfa
2025-06 14:19:16        INFO    Locus FASTA downloaded: rpoB.tfa
2025-06 14:19:20        INFO    Locus FASTA downloaded: tonB.tfa
2025-06 14:19:24        INFO    Re-indexed contents of /home/proj/stage/microbial/references/ST_loci/klebsiella_pneumoniae
2025-06 14:29:16        INFO    Profile for Neisseria spp. already at the latest version.
2025-06 14:29:17        INFO    Profile for Paenibacillus larvae already at the latest version.
2025-06 14:29:18        INFO    Profile for Pseudomonas aeruginosa already at the latest version.
2025-06 14:29:18        INFO    Profile for Pseudomonas putida already at the latest version.
2025-06 14:29:19        INFO    Profile for Salmonella enterica already at the latest version.
2025-06 14:29:20        INFO    Profile for Staphylococcus aureus already at the latest version.
2025-06 14:29:21        INFO    Profile for Staphylococcus epidermidis already at the latest version.
2025-06 14:29:21        INFO    Profile for Staphylococcus haemolyticus already at the latest version.
2025-06 14:29:22        INFO    Profile for Staphylococcus pseudintermedius already at the latest version.
2025-06 14:29:23        INFO    Profile for Streptococcus agalactiae already at the latest version.
2025-06 14:29:23        INFO    Profile for Streptococcus pneumoniae already at the latest version.
2025-06 14:29:24        INFO    Profile for Streptococcus pyogenes already at the latest version.
2025-06 14:29:24        INFO    Profile for Streptococcus uberis already at the latest version.
2025-06 14:29:25        INFO    Profile for Streptococcus zooepidemicus already at the latest version.
INFO - Execution finished!

References are obtained without issues from pasteur. And to confirm that we have the correct versions we used the website to query the profiles and found that the latest ST is 8503

image

To confirm this we heck the profiles:

[15:26] [hiseq.clinical@hasta:/home/proj/stage/bin/git/microSALT] [S_microSALT]  (rc4.2.1) $ tail -n 1 /home/proj/stage/microbial/references/ST_profiles/klebsiella_pneumoniae
8503    18      22      55      1       167     13      154

Which also seems good!

Copy link
Copy Markdown
Contributor

@samuell samuell left a comment

Choose a reason for hiding this comment

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

LGTM with some very minor quibbles and questions that you might decide if they are worth it.

Comment thread microSALT/__init__.py
Comment thread microSALT/cli.py Outdated
Comment thread microSALT/utils/referencer.py Outdated
@karlnyr karlnyr merged commit 9eb6739 into master Jun 10, 2025
1 check passed
@karlnyr
Copy link
Copy Markdown
Contributor Author

karlnyr commented Jun 10, 2025

Deployed in prod:

image

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.

3 participants