Skip to content

Commit

Permalink
Jitter mean coverage boxplot
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjameskennedy committed Jul 26, 2024
1 parent bee6395 commit 0ecec81
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions notebooks/tb_validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,26 @@
"metadata": {},
"outputs": [],
"source": [
"paqc_mean_cov = km_tb_df[['Labnummer', 'mean_cov']]\n",
"paqc_mean_cov = km_tb_df[['Labnummer', 'mean_cov']].dropna()\n",
"counts = paqc_mean_cov[\"mean_cov\"].tolist()\n",
"\n",
"# Create the plot\n",
"plt.figure(figsize=(10, 8))\n",
"sns.boxplot(y='mean_cov', data=paqc_mean_cov)\n",
"\n",
"# Boxplot\n",
"plt.boxplot(counts)\n",
"\n",
"# Add jittered data points\n",
"jitter = 0.04 # Adjust the jitter as needed\n",
"x_jitter = np.random.normal(1, jitter, size=len(counts))\n",
"plt.scatter(x_jitter, counts, alpha=0.5, color=\"blue\")\n",
"\n",
"# Customize the plot\n",
"plt.xlabel('Sample ID')\n",
"plt.ylabel('Mean Coverage')\n",
"plt.title('Boxplot of mean coverage by sample name')\n",
"plt.title('Boxplot of Mean Coverage by Sample Name')\n",
"\n",
"# Adjust layout and save the figure\n",
"plt.tight_layout()\n",
"plt.savefig(tb_validation_mean_cov_fig, dpi=600, bbox_inches='tight')\n",
"plt.show()"
Expand Down

0 comments on commit 0ecec81

Please sign in to comment.