-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
323 lines (295 loc) · 16.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.2.269">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Modesto">
<title>HPBBM2022</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
</style>
<script src="index_files/libs/clipboard/clipboard.min.js"></script>
<script src="index_files/libs/quarto-html/quarto.js"></script>
<script src="index_files/libs/quarto-html/popper.min.js"></script>
<script src="index_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="index_files/libs/quarto-html/anchor.min.js"></script>
<link href="index_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="index_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="index_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="index_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="index_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
</head>
<body>
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#wellcome-disclaimer" id="toc-wellcome-disclaimer" class="nav-link active" data-scroll-target="#wellcome-disclaimer"><span style="color:cornflowerblue">Wellcome & Disclaimer</span></a></li>
<li><a href="#bibliography-and-resources" id="toc-bibliography-and-resources" class="nav-link" data-scroll-target="#bibliography-and-resources"><span style="color:cornflowerblue">Bibliography and Resources</span></a></li>
<li><a href="#contents" id="toc-contents" class="nav-link" data-scroll-target="#contents"><span style="color:cornflowerblue">Contents</span></a>
<ul class="collapse">
<li><a href="#lesson-9-data-input-and-output-in-r" id="toc-lesson-9-data-input-and-output-in-r" class="nav-link" data-scroll-target="#lesson-9-data-input-and-output-in-r">Lesson 9: Data input and output in R</a></li>
<li><a href="#lesson-10-write-your-own-functions" id="toc-lesson-10-write-your-own-functions" class="nav-link" data-scroll-target="#lesson-10-write-your-own-functions">Lesson 10: Write your own functions</a></li>
<li><a href="#lesson-11-plots" id="toc-lesson-11-plots" class="nav-link" data-scroll-target="#lesson-11-plots">Lesson 11: Plots</a></li>
<li><a href="#lesson-12-data-management" id="toc-lesson-12-data-management" class="nav-link" data-scroll-target="#lesson-12-data-management">Lesson 12: Data management</a></li>
<li><a href="#lesson-13-advanced-plots-with-ggplot" id="toc-lesson-13-advanced-plots-with-ggplot" class="nav-link" data-scroll-target="#lesson-13-advanced-plots-with-ggplot">Lesson 13: Advanced plots with ggplot</a></li>
<li><a href="#lesson-14-applications-for-molecular-biology" id="toc-lesson-14-applications-for-molecular-biology" class="nav-link" data-scroll-target="#lesson-14-applications-for-molecular-biology">Lesson 14: Applications for Molecular Biology</a></li>
<li><a href="#extra-lesson-introduction-to-r-projects-r-markdown-and-quarto." id="toc-extra-lesson-introduction-to-r-projects-r-markdown-and-quarto." class="nav-link" data-scroll-target="#extra-lesson-introduction-to-r-projects-r-markdown-and-quarto.">Extra Lesson: Introduction to R projects, R Markdown and Quarto.</a></li>
</ul></li>
</ul>
</nav>
</div>
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">HPBBM2022</h1>
</div>
<div class="quarto-title-meta-author">
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-heading">Affiliation</div>
<div class="quarto-title-meta-contents">
<a href="https://mredrejo.github.io/rnrlab">Modesto</a>
</div>
<div class="quarto-title-meta-contents">
<p class="affiliation">
Department of Biochemistry, UAM
</p>
</div>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Modified</div>
<div class="quarto-title-meta-contents">
<p class="date-modified">January 12, 2023</p>
</div>
</div>
</div>
</header>
<blockquote class="blockquote">
<p>There are only two kinds of programming languages: the ones people complain about and the ones nobody uses. —<em>Bjarne Stroustrup</em></p>
</blockquote>
<section id="wellcome-disclaimer" class="level2">
<h2 class="anchored" data-anchor-id="wellcome-disclaimer"><span style="color:cornflowerblue">Wellcome & Disclaimer</span></h2>
<div id="p" style="float: left; position: relative; top: 0px; padding: 0px;">
<p>This site contains the materials for the <em>Coding tools for Biochemistry & Molecular Biology</em> (Herramientas de Programación para Bioquímica y Biología Molecular) course of fall 2022 in the Bachelor’s Degree in Biochemistry @<a href="www.uam.es">UAM</a> (Universidad Autónoma de Madrid, Spain). The course contains a first block of lessons on Python programming (Lessons 1-7) and a Python-vs-R introductory lesson (Lesson 8) that are not included here. Detailed academic information about the course contents, dates, and assessment only can be found at the <a href="https://moodle.uam.es/">UAM Moodle site</a>. Each lesson contains <span style="color:green"><em>R challenges or exercises</em></span>, some of them from freely available online solved exercises and others that I created. The answers to the latter are not available online, but I’ll be glad to provide them upon request.</p>
</div>
<div style="float: right; position: relative; top: 0px; padding: 3px;">
<p><img src="HPBBM2022.png" class="img-fluid" width="209"></p>
</div>
<p>This site is on a <a href="https://github.com/mredrejo/HPBBM2022">GitHub repo</a>, containing the source <em>R Markdown files</em> and the data used in the examples and exercises. You can use <a href="https://yehonal.github.io/DownGit/#/home">DownGit</a> links to download specific folders in a Zip file, like the <a href="https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/mredrejo/HPBBM2022/tree/main/data">data</a> folder. When you “knit” the report, R Studio will execute the code within each chunk in the notebook and the results appear beneath the code in the output file (usually HTML or PDF). Check also <a href="https://bookdown.org/yihui/rmarkdown-cookbook/spin.html" class="uri">https://bookdown.org/yihui/rmarkdown-cookbook/spin.html</a> for more info about how to use Notebooks and Markdown. Markdown recently evolved to <strong>Quarto</strong>, which has increased capabilities. To learn more about Quarto see <a href="https://quarto.org" class="uri">https://quarto.org</a>. Check also the <a href="Lesson_E_markdown/E_markdown.html">final lesson</a> of this course.</p>
<p>All this material is open access and it is shared under <a href="https://creativecommons.org/licenses/by-nc/2.0/">CC BY-NC</a> license.</p>
<div class="callout-warning callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Under construction
</div>
</div>
<div class="callout-body-container callout-body">
</div>
</div>
<p>This is the first complete draft of this site, but it is intended to be expanded and corrected throughout the next weeks and new versions will be available the following years. Any feedback, help, or suggestions will be very warmly welcome.</p>
<p>Also, it is likely that you find some mistypes or even some big mistakes throughout these course materials. I, and the future students, will appreciate it if you let me know about anything that could be corrected or just improved. You can reach me by <a href="mailto::modesto.redrejo@uam.es">email</a> or <a href="https://twitter.com/mredrejo" title="Twitter"><img src="index_files/tw.png" title="@mredrejo" width="14" height="11"> Twitter</a>.</p>
</section>
<section id="bibliography-and-resources" class="level2">
<h2 class="anchored" data-anchor-id="bibliography-and-resources"><span style="color:cornflowerblue">Bibliography and Resources</span></h2>
<p>Each lesson contains its own specific references, but I wanted to highlight here some curated general open access and open source resources to introduce yourself into R and R Studio.</p>
<ul>
<li><p>Grolemund, G. <a href="https://rstudio-education.github.io/"><em>Hands-on Programming in R</em></a><em>.</em></p></li>
<li><p>Peng, R. D. R <a href="https://bookdown.org/rdpeng/rprogdatascience/"><em>Programming for Data Science.</em></a></p></li>
<li><p>Coulatti, R. I. <a href="https://github.com/ColauttiLab/RCrashCourse_Book"><em>R Crash Course for Biologist</em>.</a></p></li>
<li><p>Chang, W. R. <a href="https://r-graphics.org/">R Graphics Cookbook.</a></p></li>
<li><p>Doyle, M., Chung, J. & Perreau V. <a href="https://melbournebioinformatics.github.io/r-intro-biologists/intro_r_biologists.html">Introduction to R for Biologists.</a></p></li>
<li><p><a href="https://www.learnbyexample.org/r/">Learn R by example</a></p></li>
</ul>
</section>
<section id="contents" class="level2">
<h2 class="anchored" data-anchor-id="contents"><span style="color:cornflowerblue">Contents</span></h2>
<section id="lesson-9-data-input-and-output-in-r" class="level3">
<h3 class="anchored" data-anchor-id="lesson-9-data-input-and-output-in-r"><a href="Lesson_9_input_output/9_input_output.html">Lesson 9: Data input and output in R</a></h3>
</section>
<section id="lesson-10-write-your-own-functions" class="level3">
<h3 class="anchored" data-anchor-id="lesson-10-write-your-own-functions"><a href="Lesson_10_Functions/10_Functions.html">Lesson 10: Write your own functions</a></h3>
</section>
<section id="lesson-11-plots" class="level3">
<h3 class="anchored" data-anchor-id="lesson-11-plots"><a href="Lesson_11_plots/11_basicplotting.html">Lesson 11: Plots</a></h3>
</section>
<section id="lesson-12-data-management" class="level3">
<h3 class="anchored" data-anchor-id="lesson-12-data-management"><a href="Lesson_12_data_management/12_adv_data_management.html">Lesson 12: Data management</a></h3>
</section>
<section id="lesson-13-advanced-plots-with-ggplot" class="level3">
<h3 class="anchored" data-anchor-id="lesson-13-advanced-plots-with-ggplot"><a href="Lesson_13_ggplot/13_ggplotting.html">Lesson 13: Advanced plots with ggplot</a></h3>
</section>
<section id="lesson-14-applications-for-molecular-biology" class="level3">
<h3 class="anchored" data-anchor-id="lesson-14-applications-for-molecular-biology"><a href="Lesson_14_R_for_molbiol/14_R4bqbm.html">Lesson 14: Applications for Molecular Biology</a></h3>
</section>
<section id="extra-lesson-introduction-to-r-projects-r-markdown-and-quarto." class="level3">
<h3 class="anchored" data-anchor-id="extra-lesson-introduction-to-r-projects-r-markdown-and-quarto."><a href="Lesson_E_markdown/E_markdown.html">Extra Lesson: Introduction to R projects, R Markdown and Quarto.</a></h3>
</section>
</section>
</main>
<!-- /main column -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const clipboard = new window.ClipboardJS('.code-copy-button', {
target: function(trigger) {
return trigger.previousElementSibling;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
const findCites = (el) => {
const parentEl = el.parentElement;
if (parentEl) {
const cites = parentEl.dataset.cites;
if (cites) {
return {
el,
cites: cites.split(' ')
};
} else {
return findCites(el.parentElement)
}
} else {
return undefined;
}
};
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const citeInfo = findCites(ref);
if (citeInfo) {
tippyHover(citeInfo.el, function() {
var popup = window.document.createElement('div');
citeInfo.cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// target, if specified
link.setAttribute("target", "_blank");
// default icon
link.classList.add("external");
}
}
});
</script>
</div> <!-- /content -->
</body></html>