Last active
February 1, 2018 02:34
-
-
Save gpratt/edbaf3c6f10c6dc3b2fea59ef15d6f04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total_datasets = len(merged_data.groupby(level=0)) | |
num_cols = 4 | |
num_rows = (total_datasets / 4) + 1 | |
count = 0 | |
with dataviz.Figure(os.path.join(img_dir, "increase_in_enriched_regions.svg"), figsize=(4* num_cols, 4*num_rows)) as fig: | |
for uID, df in merged_data.groupby(level='uID'): | |
count += 1 | |
ax = fig.add_subplot(num_rows, num_cols, count) | |
for rep, dataset_df in df.groupby(level='rep'): | |
rbp_name = dataset_df.index.get_level_values(level="RBP")[0] | |
name = "{} {}".format(uID, rbp_name) | |
ax.plot(dataset_df[reads], dataset_df.increase_in_enriched_regions, | |
label=name, | |
alpha=.7, | |
linewidth=3) | |
ax.xaxis.set_major_formatter(xfmt) | |
ax.set_xlabel("Reads (M)") | |
ax.set_ylabel("Fraction Overlapped") | |
ax.set_ylim(0,.3) | |
sns.despine(ax=ax) | |
ax.legend(fontsize=18) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment