|
19 | 19 | "metadata": {},
|
20 | 20 | "outputs": [],
|
21 | 21 | "source": [
|
22 |
| - "import vuecore" |
| 22 | + "import pathlib\n", |
| 23 | + "\n", |
| 24 | + "import pandas as pd\n", |
| 25 | + "from vuecore.plots.basic.histogram import create_histogram_plot" |
| 26 | + ] |
| 27 | + }, |
| 28 | + { |
| 29 | + "cell_type": "markdown", |
| 30 | + "id": "5410e0c2", |
| 31 | + "metadata": {}, |
| 32 | + "source": [ |
| 33 | + "## Proteomics data example" |
23 | 34 | ]
|
24 | 35 | },
|
25 | 36 | {
|
|
29 | 40 | "metadata": {},
|
30 | 41 | "outputs": [],
|
31 | 42 | "source": [
|
32 |
| - "# ## Proteomics data example" |
| 43 | + "dir_data = pathlib.Path(\"data\")\n", |
| 44 | + "df = (\n", |
| 45 | + " pd.read_csv(dir_data / \"proteins\" / \"proteins.csv\", index_col=0)\n", |
| 46 | + " .rename_axis(\"Protein_ID\", axis=1)\n", |
| 47 | + " .stack()\n", |
| 48 | + " .reset_index(name=\"Intensity\")\n", |
| 49 | + ")\n", |
| 50 | + "df" |
33 | 51 | ]
|
34 | 52 | },
|
35 | 53 | {
|
36 | 54 | "cell_type": "code",
|
37 | 55 | "execution_count": null,
|
38 | 56 | "id": "16458ab0",
|
| 57 | + "metadata": { |
| 58 | + "lines_to_next_cell": 2 |
| 59 | + }, |
| 60 | + "outputs": [], |
| 61 | + "source": [ |
| 62 | + "# to be continued\n", |
| 63 | + "# Generate the advanced histogram plot\n", |
| 64 | + "fig = create_histogram_plot(\n", |
| 65 | + " data=df,\n", |
| 66 | + " x=\"Intensity\",\n", |
| 67 | + " color=\"Reference\",\n", |
| 68 | + " barmode=\"overlay\",\n", |
| 69 | + " histnorm=\"probability density\",\n", |
| 70 | + " title=\"Protein intensities by sample\",\n", |
| 71 | + " subtitle=\"Histogram with probability density normalized\",\n", |
| 72 | + " labels={\"Intensity\": \"Protein Intensity\", \"Reference\": \"Sample\"},\n", |
| 73 | + " hover_data=[\"Protein_ID\"],\n", |
| 74 | + " opacity=0.75,\n", |
| 75 | + ")\n", |
| 76 | + "fig" |
| 77 | + ] |
| 78 | + }, |
| 79 | + { |
| 80 | + "cell_type": "markdown", |
| 81 | + "id": "9d569777", |
| 82 | + "metadata": {}, |
| 83 | + "source": [ |
| 84 | + "For now vuecore is built on top of ploltly:" |
| 85 | + ] |
| 86 | + }, |
| 87 | + { |
| 88 | + "cell_type": "code", |
| 89 | + "execution_count": null, |
| 90 | + "id": "127fe4b1", |
39 | 91 | "metadata": {},
|
40 | 92 | "outputs": [],
|
41 |
| - "source": [] |
| 93 | + "source": [ |
| 94 | + "type(fig)" |
| 95 | + ] |
42 | 96 | }
|
43 | 97 | ],
|
44 | 98 | "metadata": {
|
|
0 commit comments