Skip to content

Commit

Permalink
added mutational patterns figures
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainlab committed Feb 11, 2025
1 parent 7486e32 commit 2d93500
Show file tree
Hide file tree
Showing 43 changed files with 1,400 additions and 615 deletions.
Binary file modified .RData
Binary file not shown.
996 changes: 498 additions & 498 deletions .Rhistory

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .Rproj.user/71512E68/pcs/files-pane.pper
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ascending": true
}
],
"path": "I:/dataviz-gallery/code/tcga_workflow/figures"
"path": "I:/dataviz-gallery/code/mutational_patterns/figures"
}
2 changes: 1 addition & 1 deletion .Rproj.user/71512E68/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"windowheight": 983
},
"right": {
"splitterpos": 731,
"splitterpos": 714,
"topwindowstate": "NORMAL",
"panelheight": 945,
"windowheight": 983
Expand Down
2 changes: 1 addition & 1 deletion .Rproj.user/71512E68/pcs/workbench-pane.pper
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"TabSet1": 0,
"TabSet1": 4,
"TabSet2": 4,
"TabZoom": {}
}
3 changes: 2 additions & 1 deletion .Rproj.user/71512E68/sources/prop/43C08583
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"source_window_id": "",
"Source": "Source",
"cursorPosition": "7,13",
"scrollLine": "7"
"scrollLine": "0",
"rmdVisualMode": "false"
}
4 changes: 2 additions & 2 deletions .Rproj.user/71512E68/sources/prop/C0304933
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "33,0",
"scrollLine": "26"
"cursorPosition": "67,79",
"scrollLine": "55"
}
1 change: 1 addition & 0 deletions .Rproj.user/71512E68/sources/prop/INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2F01-IntroductionGe
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2F02_IntroductionToDataViz.R="833E5EA2"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2F06_Plot_anything.R="5C92BAD6"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2F08_Heatmaps.R="F321CB92"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2Flesson_02_importing_and_downloading_data.R="30001246"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2Flesson_03_Interrogating_your_data.R="C977EF40"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2Flesson_05_Tweaking_everything.R="EB440501"
I%3A%2Fdataviz-gallery%2Fcode%2Fbiological_dataviz%2Fscripts%2Flesson_06_Plot_anything.R="6DCBDE06"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"chunk_definitions":[],"doc_write_time":1739101456}
{"chunk_definitions":[],"doc_write_time":1739263361}
7 changes: 2 additions & 5 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ I:/dataviz-gallery/.gitignore="06A50993"
I:/dataviz-gallery/_quarto.yml="34B50CE7"
I:/dataviz-gallery/carousel.R="678318CA"
I:/dataviz-gallery/code/GEO2R/GEO2R.R="0AB77D37"
I:/dataviz-gallery/code/biological_dataviz/figures/venn_genes.png.2025-02-09_23-41-10.69948.log="E2771C26"
I:/dataviz-gallery/code/biological_dataviz/scripts/01-IntroductionGenViz.R="21ED7100"
I:/dataviz-gallery/code/biological_dataviz/scripts/02_IntroductionToDataViz.R="BF850A44"
I:/dataviz-gallery/code/biological_dataviz/scripts/06_Plot_anything.R="0C39E3AB"
I:/dataviz-gallery/code/biological_dataviz/scripts/08_Heatmaps.R="871B8C4D"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_02_importing_and_downloading_data.R="4B0B91E1"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_03_Interrogating_your_data.R="84DE25FE"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_05_Tweaking_everything.R="D4833118"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_06_Plot_anything.R="4C3CE26E"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_07_Multifaceted_figures.R="8D948956"
I:/dataviz-gallery/code/biological_dataviz/scripts/lesson_08_Heatmaps.R="D1AC9542"
I:/dataviz-gallery/code/maftools/scripts/01_introduction.R="040FF8CC"
I:/dataviz-gallery/code/maftools/scripts/Untitled.R="64B2DC45"
I:/dataviz-gallery/code/mutational_patterns/scripts/DataExploration.R="413CE465"
I:/dataviz-gallery/code/mutational_patterns/scripts/Data_Download_BiomaRt.R="F4A20CF9"
I:/dataviz-gallery/code/mutational_patterns/scripts/GenomicDistribution.R="7825CEE3"
I:/dataviz-gallery/code/mutational_patterns/scripts/MutationalSignatures.R="D2B501B8"
I:/dataviz-gallery/code/mutational_patterns/scripts/StrainBiasAnalysis.R="8F59F0FE"
I:/dataviz-gallery/code/tcga_workflow/scripts/1.2.3_pan_cancer_immune_correlation.R="FC0BD20E"
I:/dataviz-gallery/code/tcga_workflow/scripts/1.2.4 Pan-cancer gene expression and immune infiltration correlation.R="D3F66702"
I:/dataviz-gallery/code/tcga_workflow/scripts/1.2_pan_caner_correction_analysis.R="B9057997"
I:/dataviz-gallery/code/tcga_workflow/scripts/2.1.1 Expression analysis grouped by clinical information.R="FF29E31A"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ==========================================================
#
# Lesson 2 -- Importing and downloading data
# Importing and downloading data
# • Importing data from Excel
# • Downloading from UCSC
# • Downloading from ENSEMBL
Expand All @@ -15,7 +15,7 @@

filename <- "Lesson-02/micro_array_results_table1.txt"

my_data <- read.csv(filename, sep="\t", header=TRUE)
my_data <- read.csv("data/micro_array_results_table1.txt", sep="\t", header=TRUE)
head(my_data)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"data":{"layout-restorer:data":{"main":{"dock":{"type":"tab-area","currentIndex":1,"widgets":["notebook:reproduce/Untitled.ipynb"]},"current":"notebook:reproduce/Untitled.ipynb"},"down":{"size":0,"widgets":[]},"left":{"collapsed":false,"visible":true,"current":"filebrowser","widgets":["filebrowser","running-sessions","@jupyterlab/toc:plugin","extensionmanager.main-view"]},"right":{"collapsed":true,"visible":true,"widgets":["jp-property-inspector","debugger-sidebar"]},"relativeSizes":[0.16621694549379384,0.8337830545062062,0],"top":{"simpleVisibility":true}},"file-browser-filebrowser:cwd":{"path":"reproduce"},"notebook:reproduce/unemployment.ipynb":{"data":{"path":"reproduce/unemployment.ipynb","factory":"Notebook"}}},"metadata":{"id":"default"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"# Separate calculation and plotting of boxplots\n",
"\n",
"Drawing a `~.axes.Axes.boxplot` for a given data set, consists of two main operations,\n",
"that can also be used separately:\n",
"\n",
"1. Calculating the boxplot statistics: `matplotlib.cbook.boxplot_stats`\n",
"2. Drawing the boxplot: `matplotlib.axes.Axes.bxp`\n",
"\n",
"Thus, ``ax.boxplot(data)`` is equivalent to ::\n",
"\n",
" stats = cbook.boxplot_stats(data)\n",
" ax.bxp(stats)\n",
"\n",
"All styling keyword arguments are identical between `~.axes.Axes.boxplot` and\n",
"`~.axes.Axes.bxp`, and they are passed through from `~.axes.Axes.boxplot` to\n",
"`~.axes.Axes.bxp`. However, the *tick_labels* parameter of `~.axes.Axes.boxplot`\n",
"translates to a generic *labels* parameter in `.boxplot_stats`, because the labels are\n",
"data-related and attached to the returned per-dataset dictionaries.\n",
"\n",
"The following code demonstrates the equivalence between the two methods.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from matplotlib import cbook\n",
"\n",
"np.random.seed(19680801)\n",
"data = np.random.randn(20, 3)\n",
"\n",
"fig, (ax1, ax2) = plt.subplots(1, 2)\n",
"\n",
"# single boxplot call\n",
"ax1.boxplot(data, tick_labels=['A', 'B', 'C'],\n",
" patch_artist=True, boxprops={'facecolor': 'bisque'})\n",
"\n",
"# separate calculation of statistics and plotting\n",
"stats = cbook.boxplot_stats(data, labels=['A', 'B', 'C'])\n",
"ax2.bxp(stats, patch_artist=True, boxprops={'facecolor': 'bisque'})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using the separate functions allows to pre-calculate statistics, in case you need\n",
"them explicitly for other purposes, or to reuse the statistics for multiple plots.\n",
"\n",
"Conversely, you can also use the `~.axes.Axes.bxp` function directly, if you already\n",
"have the statistical parameters:\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"\n",
"stats = [\n",
" dict(med=0, q1=-1, q3=1, whislo=-2, whishi=2, fliers=[-4, -3, 3, 4], label='A'),\n",
" dict(med=0, q1=-2, q3=2, whislo=-3, whishi=3, fliers=[], label='B'),\n",
" dict(med=0, q1=-3, q3=3, whislo=-4, whishi=4, fliers=[], label='C'),\n",
"]\n",
"\n",
"ax.bxp(stats, patch_artist=True, boxprops={'facecolor': 'bisque'})\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
".. tags:: plot-type: speciality, domain: statistics\n",
"\n",
".. admonition:: References\n",
"\n",
" The use of the following functions, methods, classes and modules is shown\n",
" in this example:\n",
"\n",
" - `matplotlib.axes.Axes.bxp`\n",
" - `matplotlib.axes.Axes.boxplot`\n",
" - `matplotlib.cbook.boxplot_stats`\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.18"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 2d93500

Please sign in to comment.