README.md 4.34 KB
Newer Older
peguerin's avatar
peguerin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# STACKS2 using SNAKEMAKE Workflow

RADseq workflow using [STACKS2](http://creskolab.uoregon.edu/stacks/)
This was designed to process RADseq data from [RESERVEBENEFIT](https://www.biodiversa.org/1023) project.



# Table of contents

1. [Introduction](#1-introduction)
2. [Installation](#2-installation)
  1. [Prerequisite](#21-prerequisite)
  2. [Data Files](#22-data-files)
  3. [Set up](#23-set-up)
peguerin's avatar
peguerin committed
15
3. [Reporting bugs](#3-reporting-bugs)
peguerin's avatar
peguerin committed
16
4. [Running the pipeline](#5-running-the-pipeline)
peguerin's avatar
peguerin committed
17
18
19
20
  1. [Initialisation](#41-initialisation)
  2. [Configuration](#42-configuration)
  3. [Run the pipeline into a single command](#43-run-the-pipeline-into-a-single-command)
  4. [Run the pipeline step by step](#44-run-the-pipeline-step-by-step)
peguerin's avatar
peguerin committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34


# 1. Introduction

blablabla


# 2. Installation


## 2.1 Prerequisite
You must install the following softwares and packages :

- [SNAKEMAKE 5.3.0](https://snakemake.readthedocs.io/en/stable/getting_started/installation.html)
peguerin's avatar
peguerin committed
35
    * Check version and if the program is correctly installed by typing :
peguerin's avatar
peguerin committed
36

peguerin's avatar
peguerin committed
37
38
39
40
41
    ```
    snakemake --version
    ## should give you the output
    5.3.0
    ```
peguerin's avatar
peguerin committed
42
43

- [STACKS 2.0b](http://catchenlab.life.illinois.edu/stacks/)
peguerin's avatar
peguerin committed
44
   * Check version and if programs are correctly installed by typing :
peguerin's avatar
peguerin committed
45

peguerin's avatar
peguerin committed
46
47
48
49
50
51
52
53
    ```
    process_radtags --version
    clone_filter --version
    gstacks --version
    populations --version
    ## should give you the output
    2.0b
    ```
peguerin's avatar
peguerin committed
54
55

- [BWA 0.7.17](https://icb.med.cornell.edu/wiki/index.php/Elementolab/BWA_tutorial)
peguerin's avatar
peguerin committed
56
    * Download `bwa` at: http://sourceforge.net/projects/bio-bwa/files/
peguerin's avatar
peguerin committed
57

peguerin's avatar
peguerin committed
58
59
60
61
62
63
64
    ```
    tar -xvf bwa-x.x.x.tar.bz2   
    cd bwa-x.x.x
    ./configure --prefix=/where/to/install
    make  
    make install
    ```
peguerin's avatar
peguerin committed
65
    * Check version and if programs are correctly installed by typing :
peguerin's avatar
peguerin committed
66

peguerin's avatar
peguerin committed
67
68
69
70
71
72
73
    ```
    bwa
    ## should give you the output
    Program: bwa (alignment via Burrows-Wheeler transformation)
    Version: 0.7.17-r1188
    ...
    ```
peguerin's avatar
peguerin committed
74
75
76
- [SAMTOOLS 1.9 ](http://www.htslib.org/)
    * Download `htslib` and `samtools` at : http://www.htslib.org/download/
    * Building each desired package from source is very simple:
peguerin's avatar
peguerin committed
77

peguerin's avatar
peguerin committed
78
79
80
81
82
83
84
85
86
87
88
89
90
    ```
    cd htslib-1.x
    ./configure --prefix=/where/to/install
    make
    make install
    cd ..
    ## and similarly for samtools :
    cd samtools-1.x
    ./configure --prefix=/where/to/install
    make
    make install
    ```
    * Check version and if programs are correctly installed by typing :
peguerin's avatar
peguerin committed
91

peguerin's avatar
peguerin committed
92
93
94
95
96
97
98
    ```
    samtools --version
    ## should give you the output
    samtools 1.9
    Using htslib 1.9
    Copyright (C) 2018 Genome Research Ltd.
    ```
peguerin's avatar
peguerin committed
99
100
101
102
103
104
105
106
107
108
109
110
111

## 2.2 Data Files
The included data files are :

* [config.yaml](01-info_files/config.yaml) :
* [barcodes.txt](01-info_files/barcodes.txt) :
* [infos.csv](01-info_files) :
* [populations_map.txt](01-info_files) :

## 2.3 Set Up

clone the project and switch to the main folder, it's your working directory
```
peguerin's avatar
peguerin committed
112
git clone http://gitlab.mbb.univ-montp2.fr/reservebenefit/snakemake_stacks2.git
peguerin's avatar
peguerin committed
113
114
cd snakemake_stacks2
```
peguerin's avatar
peguerin committed
115
116
117
You will see the following folders :


peguerin's avatar
peguerin committed
118

peguerin's avatar
peguerin committed
119
# 3. Reporting bugs
peguerin's avatar
peguerin committed
120
121
122
123
124

If you're sure you've found a bug — e.g. if one of my programs crashes
with an obscur error message, or if the resulting file is missing part
of the original data, then by all means submit a bug report.

peguerin's avatar
peguerin committed
125
I use [GitLab's issue system](https://gitlab.com/reservebenefit/snakemake_stacks2/issues)
peguerin's avatar
peguerin committed
126
127
128
129
130
131
as my bug database. You can submit your bug reports there. Please be as
verbose as possible — e.g. include the command line, etc


# 4. Running the pipeline

peguerin's avatar
peguerin committed
132
## 4.1 Initialisation
peguerin's avatar
peguerin committed
133
134
135
136
137
138
139
140
141
142
143

* open a shell
* make a folder, name it yourself, I named it workdir

```
mkdir workdir
cd workdir
```
* clone the project and switch to the main folder, it's your working directory

```
peguerin's avatar
peguerin committed
144
git clone http://gitlab.mbb.univ-montp2.fr/reservebenefit/snakemake_stacks2.git
peguerin's avatar
peguerin committed
145
146
cd snakemake_stacks2
```
peguerin's avatar
peguerin committed
147
148
149
150
## 4.2 Configuration
WORK IN PROGRESS !!!!

## 4.3 Run the pipeline into a single command
peguerin's avatar
peguerin committed
151
One you finished [Initialisation](#41-initialisation) and [Configuration](#42-configuration) steps. You can run the whole pipeline simply typing :
peguerin's avatar
peguerin committed
152
153
154
155
156
157
```
## number of CPU cores available for running the pipeline (for instance here 64 cores)
N_CORES=64
## run the pipeline into a single command
bash main.sh $CORES
```
peguerin's avatar
peguerin committed
158
159


peguerin's avatar
peguerin committed
160
## 4.4 Run the pipeline step by step
peguerin's avatar
peguerin committed
161
162
163
164
WORK IN PROGRESS !!!!

that's it ! The pipeline is running and crunching your data. Look for the log folder output folder after the pipeline is finished.

peguerin's avatar
peguerin committed
165
166
167