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

Add nallo upload #4205

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Add nallo upload #4205

wants to merge 17 commits into from

Conversation

rannick
Copy link
Contributor

@rannick rannick commented Feb 13, 2025

Description

Added

  • add nallo upload to scout and ceasar

Changed

Fixed

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b [THIS-BRANCH-NAME] -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@rannick rannick self-assigned this Feb 13, 2025
@rannick rannick added the nallo label Feb 13, 2025
@rannick rannick marked this pull request as ready for review March 17, 2025 14:15
@rannick rannick requested a review from a team as a code owner March 17, 2025 14:15
Copy link
Contributor

@islean islean left a comment

Choose a reason for hiding this comment

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

Looks good! There are some legacy patterns which I am not too fond of, but I do not think any of them were introduced in this PR. Please disregard the comments if you feel they are out of scope.

LOG.info(
f"Upload of case {case.internal_id} was successful. Uploaded at {dt.datetime.now()} in StatusDB"
)
self.update_uploaded_at(analysis=analysis)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe very minor but I thought this was done after uploads to Caesar? So after line 43?

Comment on lines +40 to +41
self.case_tags: CaseTags = CaseTags(**NALLO_CASE_TAGS)
self.sample_tags: SampleTags = SampleTags(**NALLO_SAMPLE_TAGS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.case_tags: CaseTags = CaseTags(**NALLO_CASE_TAGS)
self.sample_tags: SampleTags = SampleTags(**NALLO_SAMPLE_TAGS)
self.case_tags = CaseTags(**NALLO_CASE_TAGS)
self.sample_tags = SampleTags(**NALLO_SAMPLE_TAGS)

Comment on lines +29 to +30
hk_version_obj: Version,
analysis_obj: Analysis,
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope but I do not like designs where we tie the whole class to a single Version/Analysis. It makes it less flexible

Copy link
Contributor

Choose a reason for hiding this comment

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

Also out of scope but modifying the input and making all methods return None is confusing to me. If we redesign at some point it might be nice to consider changing.

def build_load_config(self) -> NalloLoadConfig:
"""Create a NALLO specific load config for uploading analysis to Scout."""
LOG.info("Build load config for NALLO case")
load_config: NalloLoadConfig = NalloLoadConfig(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
load_config: NalloLoadConfig = NalloLoadConfig(
load_config = NalloLoadConfig(

"""Include case level files for NALLO case."""
LOG.info("Including NALLO specific case level files")
for scout_key in NALLO_CASE_TAGS.keys():
self._include_case_file(load_config, scout_key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have named arguments?

"""Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags
are found. Otherwise return None."""
file_path = self.get_file_from_hk(getattr(self.case_tags, scout_key))
setattr(load_config, scout_key, file_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Named arguments

samples: list[ScoutNalloIndividual] = []
somalier_samples: str | None = None
somalier_pairs: str | None = None
vcf_snv: Annotated[str, BeforeValidator(field_not_none)] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

I am very confused by us having a BeforeValidator seemingly avoiding "field not None" behaviour, but also us having a default value of None. Seems a bit contradictory to me.

You can consider it out of scope though, the pattern does not seem introduced by you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants