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

Update SQL for non-priority case in cell plot #384

Conversation

lingyun1010
Copy link
Contributor

This a bugfix related to the issue #374.

In the previous implementation, we suppose at least one highest priority value, i.e. larger than 0, would be curated in the table scxa-dimension-reduction. However, due to lack of enough data or curated by mistakes, we do not always have the highest prioriy value, so I fix the postgres query to select proper entries in both cases.

There are some data populating issues on dev PostgreSQL database, which has been reported to data production team members on Slack. Please follow the updates via https://ebi-fg.slack.com/archives/C7U2CRS58/p1706111909985499.

@lingyun1010 lingyun1010 added the bug Something isn't working label Jan 24, 2024
@lingyun1010 lingyun1010 self-assigned this Jan 24, 2024
Copy link
Contributor

@upendrakumbham upendrakumbham left a comment

Choose a reason for hiding this comment

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

Please add a test case for this change or modify it if it already exists.

@lingyun1010
Copy link
Contributor Author

lingyun1010 commented Feb 21, 2024

@upendrakumbham reported a bug regarding t-SNE plots. The default umap plot parameterisation for experiment E-ANND-3 is n_neighbors:20, however the only entry in the postgres table is n_neighbors:15.

Due to I don't have E-ANND-3 experiment data yet locally, to debug the issue, I temporarily deleted the table entries for the experiment E-EHCA-2 for umap plot methods, including n_neighbors:10,100,20,25,3,30,5,50 and only left n_neighbors:15.

I can generate the same bug locally in this way. To check the default parameterisation value I check the json endpoint http://localhost:8080/gxa/sc/json/cell-plots/E-EHCA-2//default/plot-method and I got

{"tsne":{"perplexity":25},"umap":{"n_neighbors":20}}

In conclusion by now, the bug comes from the backend not frontend issue and we may encounter the same bug if the database has only one entry for one of the cell plot type method.

@lingyun1010
Copy link
Contributor Author

I tested the relevant SQL implemented in CellPlotDao.fetchDefaultPlotMethodWithParameterisation as following:

SELECT DISTINCT dr.method, jsonb_array_elements(dr.parameterisation) parameterisation
                    FROM scxa_dimension_reduction dr
                    JOIN (SELECT method,  max(priority) as prt
                        FROM scxa_dimension_reduction
                        WHERE experiment_accession=:experiment_accession
                         GROUP BY method) fi
                    ON dr.method = fi.method
                    AND dr.priority = fi.prt
            ORDER BY parameterisation

where experiment_accession = E-EHCA-2 as my test case.

I get a wrong query response, which contains all the other n_neighbors options. Hence, the bug is from the above SQL.

upendrakumbham
upendrakumbham previously approved these changes Feb 28, 2024
Copy link
Contributor

@upendrakumbham upendrakumbham left a comment

Choose a reason for hiding this comment

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

All looks good, please fix the build before merge.

Copy link
Contributor

@ke4 ke4 left a comment

Choose a reason for hiding this comment

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

LGTM

@lingyun1010 lingyun1010 merged commit a5c044d into develop Apr 9, 2024
1 of 3 checks passed
@lingyun1010 lingyun1010 deleted the 374-experiments-default-plot-option-is-not-correctly-displayed-in-scxa branch April 9, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Experiment's default plot option is not correctly displayed in SCXA
3 participants