Fix N/A homoz and total obs when n.obs is 0#6038
Fix N/A homoz and total obs when n.obs is 0#6038northwestwitch wants to merge 5 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main Clinical-Genomics/scout#6038 +/- ##
=======================================
Coverage 83.88% 83.88%
=======================================
Files 336 336
Lines 21022 21022
=======================================
Hits 17635 17635
Misses 3387 3387 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| {{ value }} | ||
| {% endif %} | ||
| {%- endmacro %} | ||
| {% macro render_obs(value) %} |
There was a problem hiding this comment.
Moved this macro outside, so it can be shared by obs_table and old_observations_table
|
dnil
left a comment
There was a problem hiding this comment.
I'm still confused - my current take is that the issue was about changing loqusdbapi to a 0 return with totals, instead of throwing an exception.
| {{ value }} | ||
| {% endif %} | ||
| {%- endmacro %} | ||
| {% macro render_obs(value) %} |
| <td>{{ obs.observations|default('N/A') }}</td> | ||
| <td>{{ obs.homozygote|default('N/A') }}</td> | ||
| <td>{{ obs.total|default('N/A') }}</td> | ||
| <td>{{ render_obs(obs_count) }}</td> |
| <td>{{ obs.homozygote|default('N/A') }}</td> | ||
| <td>{{ obs.total|default('N/A') }}</td> | ||
| <td>{{ render_obs(obs_count) }}</td> | ||
| <td>{{ render_obs(0 if obs_count == 0 else obs.homozygote) }}</td> |
There was a problem hiding this comment.
Mm, sure, I guess if we saw none, then there can be no homozygotes.
| <td>{{ obs.total|default('N/A') }}</td> | ||
| <td>{{ render_obs(obs_count) }}</td> | ||
| <td>{{ render_obs(0 if obs_count == 0 else obs.homozygote) }}</td> | ||
| <td>{{ render_obs(0 if obs_count == 0 else obs.total) }}</td> |
There was a problem hiding this comment.
We used to add an N/A here for variant totals not loaded; contrast this with e.g. a fully empty loqusdb instance. I think maybe our issue contributor would rather have loqusdbapi always return totals, even if the variant was not found, much like the loqusdb exe?



This PR adds a functionality or fixes a bug.
Before
After
Testing on cg-vm1 server (Clinical Genomics Stockholm)
Prepare for testing
scout-stageand the server iscg-vm1.ssh <USER.NAME>@cg-vm1.scilifelab.sesudo -iu hiseq.clinicalssh localhostpodman pssystemctl --user stop scout@<name_of_currently_deployed_branch>systemctl --user start scout@<this_branch>systemctl --user status scout.targetscout-stage) to be used for testing by other users.Testing on hasta server (Clinical Genomics Stockholm)
Prepare for testing
ssh <USER.NAME>@hasta.scilifelab.seus; paxa -u <user> -s hasta -r scout-stage. You can also use the WSGI Pax app available at https://pax.scilifelab.se/.conda activate S_scout; pip freeze | grep scout-browserbash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_scout -t scout -b <this_branch>us; scout --versionpaxaprocedure, which will release the allocated resource (scout-stage) to be used for testing by other users.How to test:
Expected outcome:
The functionality should be working
Take a screenshot and attach or copy/paste the output.
Review: