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

Several QOL changes for plots #185

Merged
merged 18 commits into from
Jan 7, 2025
Merged

Conversation

Shettland
Copy link
Member

This PR includes several changes:

  • Speed up intranet/received_samples page by including samples_map in graphicJsons and improving the queries for received_samples_with_date(), which also has been changed to show created_at dates instead of sequencing_dates (Closes received samples per date graph is limited to 2021 #175 )

  • Included host-info data in graphic json to speed up the loading time

  • Included the number of samples represented for each lineage in Lineage-Variants dashboard plot

Copy link
Member

@saramonzon saramonzon left a comment

Choose a reason for hiding this comment

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

@codecov-ai-reviewer review

Comment on lines +71 to +72
if "xaxis" in options:
fig.update_layout(xaxis=options["xaxis"])
Copy link

Choose a reason for hiding this comment

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

The current implementation directly updates the layout of the figure if 'xaxis' is present in the options. This can be made more robust by using the update method of the dictionary to avoid potential key errors and to make the code more readable.

Suggested change
if "xaxis" in options:
fig.update_layout(xaxis=options["xaxis"])
fig.update_layout({
xaxis: options.get("xaxis", {})
})

@@ -33,15 +32,13 @@ def create_samples_received_map():
"received_samples_map"
)

ldata = pd.DataFrame(json_data)

fig = px.choropleth_mapbox(
Copy link

Choose a reason for hiding this comment

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

The removal of the DataFrame conversion for json_data might cause issues if json_data is not in the expected format. Ensure that json_data is a dictionary with the required keys.

@@ -104,7 +104,7 @@ def create_needle_plot_graph_mutation_by_lineage(
mutationData=mdata,
rangeSlider=True,
xlabel="Genome Position",
ylabel="Population Allele Frequency samples",
ylabel="Population Allele Frequency",
Copy link

Choose a reason for hiding this comment

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

The label 'Population Allele Frequency samples' seems to be a typo. The corrected label 'Population Allele Frequency' is more appropriate.

@Shettland Shettland merged commit 0ec4efb into BU-ISCIII:develop Jan 7, 2025
2 checks passed
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.

received samples per date graph is limited to 2021
2 participants