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

error when there's no population data to display #152

Open
savitakartik opened this issue Apr 16, 2024 · 1 comment
Open

error when there's no population data to display #152

savitakartik opened this issue Apr 16, 2024 · 1 comment
Milestone

Comments

@savitakartik
Copy link
Collaborator

In the Mutations page, I'm creating this dataframe to display the population frequency information:

df = pd.DataFrame(
    {
        "population": [
            pop.replace("pop_", "").replace("_freq", "") for pop in pops
        ],
        "frequency": [mut_data[col] for col in pops],
    }
)
df = df[df["frequency"] > 0]

and then I filter it so that we don't display populations with 0 frequency of mutation.
df = df[df["frequency"] > 0]
When the dataframe is empty then this line seems to cause an error at this line:
title=f"Mutation {mut_data['id']}"

Should check if df is empty before making the plot.

@savitakartik
Copy link
Collaborator Author

image

@benjeffery benjeffery added this to the MVP milestone Oct 14, 2024
@benjeffery benjeffery modified the milestones: MVP, MVP+1 Nov 15, 2024
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

No branches or pull requests

2 participants