-
Notifications
You must be signed in to change notification settings - Fork 248
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
[query/plot] removes "chr" prefix for manhattan plot x-axis labels #13966
Conversation
hail/python/hail/plot/plots.py
Outdated
@@ -1573,7 +1573,7 @@ def manhattan(pvals: 'Float64Expression', | |||
source_pd['_contig'] = [locus.split(":")[0] for locus in source_pd['locus']] | |||
|
|||
observed_contigs = [ | |||
contig for contig in ref.contigs.copy() | |||
contig.replace("chr", "") for contig in ref.contigs.copy() | |||
if contig in set(source_pd['_contig']) | |||
] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this next line is gonna fail b/c the contains aren't valid anymore. I think you'll have to replace this at the very latest moment: when you construct the major_label_overrides.
tested the latest version of the change by copying and running the plotting tutorial notebook; verified that the code as is generates a visually identical manhattan plot, and then added this line before the manhattan plot is displayed: gwas = gwas.key_by(locus = hl.locus("chr" + gwas.locus.contig, hl.int(gwas.locus.position / 2), reference_genome="GRCh38")) and the output looked like this (the big gaps between the points for each chromosome come from dividing by 2 above, which is a quick-and-dirty trick to make sure none of the loci have position values that are too large for GRCh38): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have unpushed changes?
This fails:
In [4]: gwas = hl.balding_nichols_model(1,100, 1, reference_genome='GRCh38').rows().annotate(p_value=10 **
...: -hl.rand_int32(1, 8))
...: hl.plot.manhattan(gwas.p_value, gwas.locus).show()
b9135a9
to
ad26447
Compare
@danking oh yep, sorry! github was down but it said the changes had pushed from the command line, now it's fixed |
Fixes #13952.