skeleton.tex 7.95 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
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
    \item Have the same structure for all projects.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Project skeleton.}

  That is why we made a \emph{skeleton} project.
  \bigskip

  Usage:
  \begin{itemize}
    \item Make a \emph{fork} (copy) of the skeleton project.
    \item Rename the project.
    \item Do a checkout.
    \item Start working with it.
  \end{itemize}
\end{frame}

\section{Starting a project}
\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}

\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}
    \item Annotated sample lists.
    \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

  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
219
  Manage files with git, without checking their contents in.
220
221
222
223
224
225
226
227
228
  \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
229
  \bigskip
230
231
232
233
234
235
236
237
238

  \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
239
240
241
  In our master repository, we annex a file.
  \bigskip

242
243
244
245
246
  \begin{lstlisting}[language=none, caption=Adding files.]
    $ git annex add <filename>
    $ git commit
  \end{lstlisting}
  \bigskip
Laros's avatar
Laros committed
247
  \pause
248
249

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

252
253
254
255
256
257
258
259
260
261
262
  \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
263
264
  \bigskip

265
266
267
268
269
270
  \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
271
  \pause
272
273

  It is actually quite well protected.
Laros's avatar
Laros committed
274
275
  \bigskip

276
277
278
279
280
281
282
  \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
283
  \frametitle{Synchronise your results.}
284
285

  Let the other repositories know what you have done.
Laros's avatar
Laros committed
286
287
288
  \bigskip

  \begin{lstlisting}[language=none, caption=Synchronise with all repositories.]
289
290
    $ git annex sync
  \end{lstlisting}
Laros's avatar
Laros committed
291
292
293
294
295
296
297
298
299
  \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}
300
301
302
303
\end{frame}

\begin{frame}[fragile]
  \frametitle{Working together on the same clone.}
Laros's avatar
Laros committed
304
305
306
307
308
309
310
311
312
313
314

  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.]
315
316
317
    $ find -type d -exec chmod 775 {} \;
    $ find -type f -exec chmod 664 {} \;
  \end{lstlisting}
Laros's avatar
Laros committed
318
319
320
321
\end{frame}

\section{Questions?}
\lastpagetemplate
322
\begin{fframe}
Laros's avatar
Laros committed
323
324
325
326
327
328
329
330
331
332
  \begin{center}
    Acknowledgements:
    \bigskip
    \bigskip

    Martijn Vermaat

    Zuotian Tatum

  \end{center}
333
334
335
336
337

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

\end{document}