-
Notifications
You must be signed in to change notification settings - Fork 2
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
fetch tissue type from original sample #3979
base: master
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@@ -345,6 +345,16 @@ def get_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: | |||
for link in case.links: | |||
yield link.sample.internal_id | |||
|
|||
def get_original_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: | |||
"""Return original sample ids (go to original sample id for downloaded samples) from case id.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Return original sample ids (go to original sample id for downloaded samples) from case id.""" | |
"""Return original sample id from case id.""" |
@@ -345,6 +345,16 @@ def get_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: | |||
for link in case.links: | |||
yield link.sample.internal_id | |||
|
|||
def get_original_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a unit test for this function?
def get_original_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: | ||
"""Return original sample ids (go to original sample id for downloaded samples) from case id.""" | ||
case: Case = self.get_case_by_internal_id(internal_id=case_id) | ||
self._is_case_found(case=case, case_id=case_id) | ||
for link in case.links: | ||
if link.sample.from_sample: | ||
original_sample: Sample = link.sample.from_sample | ||
yield original_sample.internal_id | ||
yield link.sample.internal_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we require.a yield here as we only fetch one id it seems?
def get_original_sample_ids_by_case_id(self, case_id: str = None) -> Iterator[str]: | |
"""Return original sample ids (go to original sample id for downloaded samples) from case id.""" | |
case: Case = self.get_case_by_internal_id(internal_id=case_id) | |
self._is_case_found(case=case, case_id=case_id) | |
for link in case.links: | |
if link.sample.from_sample: | |
original_sample: Sample = link.sample.from_sample | |
yield original_sample.internal_id | |
yield link.sample.internal_id | |
def get_original_sample_ids_by_case_id(self, case_id: str = None) -> str: | |
"""Return original sample ids (go to original sample id for downloaded samples) from case id.""" | |
case: Case = self.get_case_by_internal_id(internal_id=case_id) | |
self._is_case_found(case=case, case_id=case_id) | |
for link in case.links: | |
if link.sample.from_sample: | |
original_sample: Sample = link.sample.from_sample | |
return original_sample.internal_id | |
return link.sample.internal_id |
Description
Added
Changed
Fixed
How to prepare for test
us
paxa
How to test
Expected test outcome
Review
Thanks for filling in who performed the code review and the test!
This version is a
Implementation Plan