This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
86 lines (85 loc) · 4.69 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<title>Software Carpentry: Programming with Perl</title>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/bootstrap/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="css/swc.css" />
<link rel="alternate" type="application/rss+xml" title="Software Carpentry Blog" href="http://software-carpentry.org/feed.xml"/>
<meta charset="UTF-8" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="banner">
<a href="http://software-carpentry.org" title="Software Carpentry">
<img alt="Software Carpentry banner" src="img/software-carpentry-banner.png" />
</a>
</div>
<div class="row-fluid">
<div class="span10 offset1">
<h1 class="title">Programming with Perl</h1>
<p>The best way to learn how to program is to do something useful, so this introduction to Perl is built around a common scientific task: data analysis.</p>
<p>Our real goal isn't to teach you Perl, but to teach you the basic concepts that all programming depends on. We use Perl in our lessons because:</p>
<ol style="list-style-type: decimal">
<li>we have to use <em>something</em> for examples;</li>
<li>it's free, well-documented, and runs almost everywhere;</li>
<li>it has a large (and growing) user base among scientists; and</li>
<li>experience shows that it's easier for novices to pick up than most other languages.</li>
</ol>
<p>But the two most important things are to use whatever language your colleagues are using, so that you can share you work with them easily, and to use that language <em>well</em>.</p>
<p>We are studying inflammation in patients who have been given a new treatment for arthritis, and need to analyze the first dozen data sets. The data sets are stored in <strong>comma-separated values</strong> (CSV) format: each row holds information for a single patient, and the columns represent successive days. The first few rows of our first file look like this:</p>
<pre><code>0,0,1,3,1,2,4,7,8,3,3,3,10,5,7,4,7,7,12,18,6,13,11,11,7,7,4,6,8,8,4,4,5,7,3,4,2,3,0,0
0,1,2,1,2,1,3,2,2,6,10,11,5,9,4,4,7,16,8,6,18,4,12,5,12,7,11,5,11,3,3,5,4,4,5,5,1,1,0,1
0,1,1,3,3,2,6,2,5,9,5,7,4,5,4,15,5,11,9,10,19,14,12,17,7,12,11,7,4,2,10,5,4,2,2,3,2,2,1,1
0,0,2,0,4,2,2,1,6,7,10,7,9,13,8,8,15,10,10,7,17,4,4,7,6,15,6,4,9,11,3,5,6,3,3,4,2,3,2,1
0,1,1,3,3,1,3,5,2,4,4,7,6,5,3,10,8,10,6,17,9,14,9,7,13,9,12,6,7,7,9,6,3,2,2,4,2,0,1,1</code></pre>
<p>We want to:</p>
<ul>
<li>load that data into memory,</li>
<li>calculate the average inflammation per day across all patients, and</li>
<li>plot the result.</li>
</ul>
<p>To do all that, we'll have to learn a little bit about programming.</p>
<div id="prerequisites" class="prereq">
<h2>Prerequisites</h2>
<p>FIXME A short paragraph describing what learners need to know before tackling this lesson.</p>
</div>
<h2 id="topics">Topics</h2>
<ol style="list-style-type: decimal">
<li><a href="01-pdl.html">Analyzing Patient Data</a></li>
<li><a href="02-func.html">Creating Functions</a></li>
<li><a href="03-loop.html">Analyzing Multiple Data Sets</a></li>
<li><a href="04-cond.html">Making Choices</a></li>
<li><a href="05-defensive.html">Defensive Programming</a></li>
<li><a href="06-cmdline.html">Command-Line Programs</a></li>
<li><a href="07-errors.html">Errors and Exceptions</a></li>
</ol>
<h2 id="other-resources">Other Resources</h2>
<ul>
<li><a href="motivation.html">Motivation</a></li>
<li><a href="reference.html">Reference</a></li>
<li><a href="discussion.html">Discussion</a></li>
<li><a href="instructors.html">Instructor's Guide</a></li>
</ul>
</div>
</div>
<div class="footer">
<a class="label swc-blue-bg" href="http://software-carpentry.org">Software Carpentry</a>
<a class="label swc-blue-bg" href="https://github.com/swcarpentry/lesson-template">Source</a>
<a class="label swc-blue-bg" href="mailto:[email protected]">Contact</a>
<a class="label swc-blue-bg" href="LICENSE.html">License</a>
</div>
</div>
<!-- Javascript placed at the end of the document so the pages load faster -->
<script src="http://software-carpentry.org/v5/js/jquery-1.9.1.min.js"></script>
<script src="http://software-carpentry.org/v5/js/bootstrap/bootstrap.min.js"></script>
</body>
</html>