skeleton_handouts.tex 2.04 KB
Newer Older
1 2
\documentclass{article}

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
3
\providecommand{\handoutsTitle}{Project skeleton}
4

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
5 6
\usepackage{handouts}
\input{../shared/shared}
7

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
8 9
\begin{document}
\makeHeader
10

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
11
\subsubsection*{Project skeleton}
12 13 14 15 16 17 18 19 20 21
Search for the ``Project skeleton''.
\begin{itemize}
  \item \emph{Hint:} Click the ``Public area'' icon and use the search option.
\end{itemize}
\bigskip

Follow the README to make your own analysis project.
\bigskip

Suppose you are going to do an RNASeq analysis. Retrieve the file
Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
22 23 24
``\lstinline{data.tgz}'' from the
wiki\footnote{\url{https://humgenprojects.lumc.nl/trac/humgenprojects/wiki/git}}
and populate your analysis project.
25

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
26
\subsubsection*{Git annex}
27 28 29 30 31 32 33 34 35
Check whether Git annex is installed, and install it if this is not the case.
\begin{lstlisting}
  $ git annex
  git: 'annex' is not a git command. See 'git --help'.
  $ sudo apt-get update
  $ sudo apt-get install git-annex
\end{lstlisting}
\bigskip

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
First, we make an empty repository:
\begin{lstlisting}
  $ mkdir annex_project
  $ cd annex_project
  $ git init
  $ git annex init "Original repository."
\end{lstlisting}
\bigskip

Now add a ``big file'' and annex it.
\begin{lstlisting}
  $ dd if=/dev/urandom of=bigfile.dat count=1024
  $ git annex add bigfile.dat
  $ git commit -m "Added big file."
\end{lstlisting}
\bigskip

Now, we clone the project and let this repository know where the clone is.
\begin{lstlisting}
  $ git clone . ../annex_clone
  $ git remote add annex_clone ../annex_clone
  $ cd ../annex_clone
  $ git annex init "Cloned repository."
\end{lstlisting}
\bigskip

Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
62 63
With the ``\lstinline{file}'' command you can now see that
``\lstinline{bigdata.dat}'' is not present in this repository.
64 65 66 67
\begin{lstlisting}
  $ git pull
  $ git annex get bigfile.dat
\end{lstlisting}
68 69 70 71 72 73 74

\newpage

Let the original repository know that you have a copy.
\begin{lstlisting}
  $ git annex sync
\end{lstlisting}
75 76 77 78 79 80 81 82 83
\bigskip

You can now remove the big data file from the original repository.
\begin{lstlisting}
  $ cd ../annex_project
  $ git annex drop bigfile.dat
\end{lstlisting}

But you can not remove it from the clone.
Jeroen F.J. Laros's avatar
Jeroen F.J. Laros committed
84

85
\end{document}