skeleton.tex 8.46 KB
Newer Older
Laros's avatar
Laros committed
1
2
\documentclass[slidestop]{beamer}

3
\title{Analysis projects skeleton}
Laros's avatar
Laros committed
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
\providecommand{\myConference}{Git course}
\providecommand{\myDate}{Monday, October 14, 2013}
\author{Jeroen F. J. Laros}
\providecommand{\myGroup}{Leiden Genome Technology Center}
\providecommand{\myDepartment}{Department of Human Genetics}
\providecommand{\myCenter}{Center for Human and Clinical Genetics}
\providecommand{\lastCenterLogo}{
  \raisebox{-0.1cm}{
    \includegraphics[height=1cm]{lgtc_logo}
    %\includegraphics[height=0.7cm]{ngi_logo}
  }
}
\providecommand{\lastRightLogo}{
  %\includegraphics[height=0.7cm]{nbic_logo}
  %\includegraphics[height=0.8cm]{nwo_logo_en}
  %\hspace{1.5cm}\includegraphics[height=0.7cm]{gen2phen_logo}
}

\usetheme{lumc}

\begin{document}

% This disables the \pause command, handy in the editing phase.
%\renewcommand{\pause}{}

% Make the title page.
\bodytemplate

% First page of the presentation.
\section{Introduction}
\begin{frame}
35
36
37
38
39
40
41
42
43
44
45
46
47
  \frametitle{Shared projects.}

  Most of us work on multiple projects with multiple people.
  \bigskip

  That is why is is convenient to:
  \begin{itemize}
    \item Have everything in one place.
    \begin{itemize}
      \item Data.
      \item Code.
      \item Documentation.
    \end{itemize}
Laros's avatar
Laros committed
48
    \pause
49
50
51
52
    \item Have the same structure for all projects.
  \end{itemize}
\end{frame}

53
54
\section{Starting a project}
\begin{fframe}
55
56
57
58
59
60
  \frametitle{Project skeleton.}

  Usage:
  \begin{itemize}
    \item Make a \emph{fork} (copy) of the skeleton project.
    \item Rename the project.
61
    \item Clone your project.
62
63
    \item Start working with it.
  \end{itemize}
64
65
  \bigskip
  \pause
66
67
68
69
70
71
72
73
74
75

  Configure your project.
  \begin{itemize}
    \item Choose to make your project public or not.
    \begin{itemize}
      \item Public by default.
      \item Public really means public.
    \end{itemize}
    \item Add the people that work on this project.
  \end{itemize}
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

  \vfill
  \permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
\end{fframe}

%\begin{fframe}
%  \frametitle{Forking}
%
%  Make a new analysis project.
%  \begin{itemize}
%    \item Go to the ``Project skeleton'' project page on our GitLab server.
%    \item Click ``Fork'' to fork it to a new project.
%    \item Go to ``Settings'' to rename the new project.
%    \begin{itemize}
%      \item Change both the project as well as the repository path.
%    \end{itemize}
%  \end{itemize}
%  
%  \vfill
%  \permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
%\end{fframe}

%\begin{frame}
%  \frametitle{Configuration}
%
%  Configure your project.
%  \begin{itemize}
%    \item Choose to make your project public or not.
%    \begin{itemize}
%      \item Public by default.
%      \item Public really means public.
%    \end{itemize}
%    \item Add the people that work on this project.
%  \end{itemize}
%\end{frame}
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

\section{Project structure}
\begin{frame}
  \frametitle{Global overview.}

  Project layout:
  \begin{itemize}
    \item analysis
    \item data
    \item doc
    \item src
  \end{itemize}
  \bigskip

  Ideally, every directory in the project has a \bt{README} file.
\end{frame}

\begin{frame}
  \frametitle{The toplevel \bt{\,README\,\,} file.}

  This file contains general information about the project, for example:
  \begin{itemize}
    \item Who leads the project.
    \item Who participates in the project.
    \item The amount of hours people have spent on this project.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The \bt{\,doc\,\,} directory.}

  Documentation on the project:
  \begin{itemize}
144
    \item Annotation of the data.
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
    \item Goal of the project.
    \item Related work and literature.
    \begin{itemize}
      \item You may want to note who provided the documentation.
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The \bt{\,data\,\,} directory.}

  Used to store all raw data.
  \bigskip

  The \bt{README} contains:
  \begin{itemize}
    \item Description of the delivered data.
    \begin{itemize}
      \item Sequencing centre.
      \item Platform.
      \item Molecular type.
      \item Owner.
      \item Gatherer.
    \end{itemize}
    \item Description of other data.
    \begin{itemize}
      \item Perhaps you already got BAM files.
      \begin{itemize}
        \item Who aligned it?
        \item Which aligner?
      \end{itemize}
    \end{itemize}
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{The \bt{\,analysis\,\,} directory.}

  All analysis related files are stored here:
  \begin{itemize}
    \item Run scripts.
    \item Make files.
    \item Result files.
  \end{itemize}
  \bigskip

  Try to separate self-contained parts of the analysis in their own
  subdirectories and document dependencies in a \bt{README} file.
  \begin{itemize}
    \item Normal data analysis.
    \item $k$-mer analysis.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The \bt{\,src\,\,} directory.}

  Any custom scripts and specific software versions for this project.
  \bigskip

  When these scripts are useful for other projects, move them to their own
  repository.
\end{frame}

\section{Working with large files}
\begin{fframe}
  \frametitle{Git is not designed for massive files.}

  Some problems with large files:
  \begin{itemize}
    \item Limited storage on the server.
    \item Checking out a repository would take a long time.
  \end{itemize}
  \bigskip

221
222
223
224
225
226
227
228
  It also does not make much sense:
  \begin{itemize}
    \item These files are usually \emph{static}.
    \item And probably \emph{binary}.
  \end{itemize}
  \bigskip
  \pause

229
230
231
232
233
234
235
236
237
238
  We do want to have some way to track our input and output data. This can be
  done with \bt{git-annex}.

  \vfill
  \permfoot{http://git-annex.branchable.com/}
\end{fframe}

\begin{frame}[fragile]
  \frametitle{Git annex.}

Laros's avatar
Laros committed
239
  Manage files with git, without checking their contents in.
240
241
242
243
244
245
246
247
248
  \begin{itemize}
    \item Manage large files without storing them.
    \item Store file checksums.
    \item Prevent files from being deleted accidentally.
  \end{itemize}
  \bigskip
  \pause

  You first have to enable this for your repository.
Laros's avatar
Laros committed
249
  \bigskip
250
251
252
253
254
255
256
257
258

  \begin{lstlisting}[language=none, caption=Enable git-annex.]
    $ git annex init "<name>"
  \end{lstlisting}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Adding big files.}

Laros's avatar
Laros committed
259
260
261
  In our master repository, we annex a file.
  \bigskip

262
263
264
265
266
  \begin{lstlisting}[language=none, caption=Adding files.]
    $ git annex add <filename>
    $ git commit
  \end{lstlisting}
  \bigskip
Laros's avatar
Laros committed
267
  \pause
268
269

  In a clone, this file will visible, but not really present.
Laros's avatar
Laros committed
270
271
  \bigskip

272
273
274
275
276
277
278
279
280
281
282
  \begin{lstlisting}[language=none, caption=Make a file available.]
    $ file <filename>
    <filename>: broken symbolic link to ...
    $ git annex get <filename>
  \end{lstlisting}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Removing files.}

  As long as there are enough copies available, you can remove files.
Laros's avatar
Laros committed
283
284
  \bigskip

285
286
287
288
289
290
  \begin{lstlisting}[language=none, caption=A failing drop command.]
    $ git annex drop <filename>
    drop bigfile (unsafe)
    git-annex: drop: 1 failed
  \end{lstlisting}
  \bigskip
Laros's avatar
Laros committed
291
  \pause
292
293

  It is actually quite well protected.
Laros's avatar
Laros committed
294
295
  \bigskip

296
297
298
299
300
301
302
  \begin{lstlisting}[language=none, caption=rm fails too.]
    $ rm -rf <repository>
    rm: cannot remove <repository>/.git/annex/objects/...
  \end{lstlisting}
\end{frame}

\begin{frame}[fragile]
Laros's avatar
Laros committed
303
  \frametitle{Synchronise your results.}
304
305

  Let the other repositories know what you have done.
Laros's avatar
Laros committed
306
307
308
  \bigskip

  \begin{lstlisting}[language=none, caption=Synchronise with all repositories.]
309
310
    $ git annex sync
  \end{lstlisting}
Laros's avatar
Laros committed
311
312
313
314
315
316
317
318
319
  \bigskip
  \pause

  You can choose to sync with a selection of repositories.
  \bigskip

  \begin{lstlisting}[language=none, caption=Synchronise with a selection.]
    $ git annex sync origin
  \end{lstlisting}
320
321
322
323
\end{frame}

\begin{frame}[fragile]
  \frametitle{Working together on the same clone.}
Laros's avatar
Laros committed
324
325
326
327
328
329
330
331
332
333
334

  Sometimes you need to work with other people on the same repository clone.
  \begin{itemize}
    \item Where the large files are stored.
  \end{itemize}
  \bigskip

  Use the following command to give group access:
  \bigskip

  \begin{lstlisting}[language=none, caption=Make everyting group writable.]
335
336
337
    $ find -type d -exec chmod 775 {} \;
    $ find -type f -exec chmod 664 {} \;
  \end{lstlisting}
Laros's avatar
Laros committed
338
339
340
341
\end{frame}

\section{Questions?}
\lastpagetemplate
342
\begin{fframe}
Laros's avatar
Laros committed
343
344
345
346
347
348
349
350
351
352
  \begin{center}
    Acknowledgements:
    \bigskip
    \bigskip

    Martijn Vermaat

    Zuotian Tatum

  \end{center}
353
354
355
356
357

  \vfill
  \permfoot{http://git-annex.branchable.com/}
  \permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
\end{fframe}
Laros's avatar
Laros committed
358
359

\end{document}