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

fix: relative aggregation of samples for variants and lineages over time plots #382

Merged
merged 7 commits into from
Dec 10, 2021

Conversation

AKBrueggemann
Copy link
Collaborator

@AKBrueggemann AKBrueggemann commented Dec 8, 2021

Description

Changing the threshold for the appearance of lineages and variants in the plots from a static to a relative value, so that for a smaller number of samples the variants and lineages are plotted.

Related Issue

#339

Checklist

@AKBrueggemann AKBrueggemann linked an issue Dec 8, 2021 that may be closed by this pull request
Copy link
Contributor

@thomasbtf thomasbtf left a comment

Choose a reason for hiding this comment

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

Nice easy fix for the problem.

Could you please add a plot with only one sample (for one date) and another with several samples, distributed over several dates?

pangolin_calls["lineage_count"] < 10, "lineage"
] = "other (< 10 occ.)"
pangolin_calls["lineage_count"] < threshold, "lineage"
] = "other (< low occ.)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please insert here the masking threshold number. It would make sense to cast it to an integer before.

threshold = len(calls) / 10
calls.loc[
calls["total occurrence"] < threshold, "alteration"
] = "other (< low occ.)"
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, see above

@thomasbtf
Copy link
Contributor

Ah and please fill out the Description, Related Issue and Checklist of this PR ;)

@AKBrueggemann
Copy link
Collaborator Author

VariantplotsNewRelative

@AKBrueggemann
Copy link
Collaborator Author

Lineages over time of 5 samples:
5SamplesLineages
Lineages over time of 1 sample:
OneSampleLineages

@AKBrueggemann
Copy link
Collaborator Author

Variants over time of the S-ORF of one sample:
OneSampleSVariants
Variants over time of the S-ORF of five samples:
5SamplesVariantsS

@thomasbtf
Copy link
Contributor

Just a quick pointer to string formatting best practices: https://realpython.com/python-string-formatting/ :)

@thomasbtf thomasbtf merged commit ebe556c into master Dec 10, 2021
@thomasbtf thomasbtf deleted the relative-aggregation-sample-plot branch December 10, 2021 12:29
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.

Fix aggregation of sample in variants and lineages over time plot
2 participants