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

added code for sup fig 6 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
474,518 changes: 474,518 additions & 0 deletions data/sup6data.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion figures/Fig2a.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ library(ggplot2)

## embryo simulation results

emb <- fread("./indivbrca_data_noids.csv")
emb <- fread("./data/indivbrca_data_noids.csv")

## with original beta

Expand Down
35 changes: 35 additions & 0 deletions figures/SuppFigure6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/env python


import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt


datapath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data'))
figpath = os.path.abspath(os.path.dirname(__file__))

popdata = pd.read_csv(os.path.join(datapath, 'sup6data.csv'))


fig, axs = plt.subplots(ncols=2, sharey=False)

sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'EUR'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'AFR'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'SAS'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'EAS'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'AKJ'], ax=axs[0], legend=False)
axs[0].set(xlabel="raw score")

sns.kdeplot(popdata['standardized'].loc[popdata.population == 'AFR'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'EUR'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'SAS'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'EAS'], ax=axs[1], legend=False)
sns.kdeplot(popdata['zscore'].loc[popdata.population == 'AKJ'], ax=axs[1], legend=False)
axs[1].set(xlabel="corrected score")
axs[1].set(ylabel=None)

plt.legend(title=None, labels=['EUR', 'AFR', 'SAS', 'EAS', 'AKJ'])

fig.savefig(os.path.join(figpath, 'sup6.pdf'))
35 changes: 35 additions & 0 deletions figures/SuppFigure6.py~
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/env python


import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt


datapath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data'))

popdata = pd.read_csv(os.path.join(datapath, 'sup6data.csv'))


fig, axs = plt.subplots(ncols=2, sharey=False)

sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'EUR'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'AFR'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'SAS'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'EAS'], ax=axs[0], legend=False)
sns.kdeplot(popdata['PGS000008_breast_cancer_score'].loc[popdata.population == 'AKJ'], ax=axs[0], legend=False)
axs[0].set(xlabel="raw score")

sns.kdeplot(popdata['standardized'].loc[popdata.population == 'AFR'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'EUR'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'SAS'], ax=axs[1], legend=False)
sns.kdeplot(popdata['standardized'].loc[popdata.population == 'EAS'], ax=axs[1], legend=False)
sns.kdeplot(popdata['zscore'].loc[popdata.population == 'AKJ'], ax=axs[1], legend=False)
axs[1].set(xlabel="corrected score")
axs[1].set(ylabel=None)

plt.legend(title=None, labels=['EUR', 'AFR', 'SAS', 'EAS', 'AKJ'])

fig.savefig('sup6.png')

Binary file added figures/sup6.pdf
Binary file not shown.
Binary file added figures/sup6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.