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

Get_cram_paths external IDs fix #828

Merged
merged 5 commits into from
Jun 19, 2024
Merged

Get_cram_paths external IDs fix #828

merged 5 commits into from
Jun 19, 2024

Conversation

EddieLF
Copy link
Contributor

@EddieLF EddieLF commented Jun 18, 2024

A quick fix for the get_sample_cram_path_map_for_seqr Analysis table function to allow it to work with the recent external ID changes. Now joins to the participant_external_id table to get the external ID.

@EddieLF EddieLF requested a review from jmarshall June 18, 2024 04:50
Copy link
Contributor

@jmarshall jmarshall left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and apologies for the inconvenience!

I've made a couple of additions, and commented on the significant ones.

LGTM — The fix should be good to go now.

@@ -431,16 +433,16 @@ async def get_sample_cram_path_map_for_seqr(
filters.append('JSON_VALUE(a.meta, "$.sequencing_type") ' + seq_check)

if participant_ids:
filters.append('p.id IN :pids')
filters.append('peid.participant_id IN :pids')
Copy link
Contributor

Choose a reason for hiding this comment

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

This field needs to be changed to participant_id (as per the new table) here too. And a minor renaming of the table alias.

],
)

id_map = await self.al.get_sample_cram_path_map_for_seqr(self.project_id, ['blood'], [part[0].id])
Copy link
Contributor

Choose a reason for hiding this comment

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

Added a basic test case so that this code gets exercised. There's not enough data set up to get a non-empty id_map back, so we don't check the result very much.

filters = [
'a.active',
'a.type = "cram"',
'a.status = "completed"',
'p.project = :project',
'peid.project = :project',
'peid.name = :PRIMARY_EXTERNAL_ORG',
Copy link
Contributor

Choose a reason for hiding this comment

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

At least for now, maintained the status quo by only returning a row for the primary external id rather than several, one for each external id. This is a technique I used in several of the “higher level” queries, and will want to be revisited eventually.

@EddieLF
Copy link
Contributor Author

EddieLF commented Jun 19, 2024

Thanks for the help @jmarshall, appreciate your input and the inclusion of a basic test case

@EddieLF EddieLF merged commit 6a0c58a into dev Jun 19, 2024
5 checks passed
@EddieLF EddieLF deleted the get_cram_paths_ext_id_fix branch June 19, 2024 00:46
@jmarshall
Copy link
Contributor

Thanks for finding the problem…

If that test case had been there previously, this wouldn't have been missed out in the multiple-ext-ids PR because even this basic test would have failed. Turns out test coverage is a good thing!

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.

2 participants