Commit d378743c authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

fixed realigned window

parent eb9d89e8
...@@ -31,10 +31,11 @@ def realigned_zfiles_on_panel(ref_panel, zscore): ...@@ -31,10 +31,11 @@ def realigned_zfiles_on_panel(ref_panel, zscore):
If not, the coded and other allele are inverted and the zscore sign If not, the coded and other allele are inverted and the zscore sign
is inverted also. is inverted also.
""" """
allele_inverted = (ref_panel.loc[zscore.index, 'Ref_all'] != zscore.A0) sub_ref_panel = ref_panel.loc[zscore.index]
allele_inverted = (sub_ref_panel['Ref_all'] != zscore.A0)
zscore.loc[allele_inverted, "A0"] = ref_panel.alt_all zscore.loc[allele_inverted, "A0"] = sub_ref_panel.loc[allele_inverted].Ref_all
zscore.loc[allele_inverted, "A1"] = ref_panel.Ref_all zscore.loc[allele_inverted, "A1"] = sub_ref_panel.loc[allele_inverted].alt_all
zscore.loc[allele_inverted, "Z"] = - zscore.loc[allele_inverted, "Z"] zscore.loc[allele_inverted, "Z"] = - zscore.loc[allele_inverted, "Z"]
return zscore return zscore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment