-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.Rmd
172 lines (102 loc) · 3.19 KB
/
README.Rmd
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
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
---
title: ""
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, comment = "", engine.opts = list(bash = "-l"))
```
# HLApers
## License
HLApers integrates software such as kallisto, Salmon and STAR. Before using it, please read the license notices [here](https://github.com/genevol-usp/HLApers/blob/Latest/license.txt)
## Getting started
### Install required software
##### 1. HLApers
```
git clone https://github.com/genevol-usp/HLApers.git
```
##### 2. R v3.4+
##### 3. In R, install the following packages
- from Bioconductor:
```
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Biostrings")
```
- from GitHub:
```
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("genevol-usp/hlaseqlib")
```
##### 4. For STAR-Salmon-based pipeline, install:
- STAR v2.5.3a+
- Salmon v0.8.2+
- samtools 1.3+
- seqtk
##### 5. For kallisto-based pipeline, install:
- kallisto
### Download data:
##### 1. IMGT database
```
git clone https://github.com/ANHIG/IMGTHLA.git
```
##### 2. Gencode:
- transcripts fasta (e.g., Gencode v37 fasta)
- corresponding annotations GTF (e.g., Gencode v37 GTF)
## HLApers usage
Link the hlapers executable in your execution path, or change to the HLApers directory and execute the program with `./hlapers`.
### Getting help
HLApers is composed of the following modes:
```{bash}
hlapers --help
```
### 1. Building a transcriptome supplemented with HLA sequences
The first step is to use `hlapers prepare-ref` to build an index composed of
Gencode transcripts, where we replace the HLA transcripts with IMGT HLA allele
sequences.
```{bash}
hlapers prepare-ref --help
```
Example:
```
hlapers prepare-ref -t gencode.v37.transcripts.fa.gz -a gencode.v37.annotation.gtf.gz -i IMGTHLA -o hladb
```
### 2. Creating an index for read alignment
```{bash}
hlapers index --help
```
Example:
```
hlapers index -t hladb/transcripts_MHC_HLAsupp.fa -p 4 -o index
```
### 3. HLA genotyping
Given a BAM file from a previous alignment to the genome, we first need to extract the reads mapped to the MHC region and those which are unmapped. For this, we can use the `bam2fq` utility.
```{bash}
hlapers bam2fq --help
```
Example:
```
hlapers bam2fq -b HG00096.bam -m ./hladb/mhc_coords.txt -o HG00096
```
Then we run the genotyping module.
```{bash}
hlapers genotype --help
```
Example:
```
hlapers genotype -i index/STARMHC -t ./hladb/transcripts_MHC_HLAsupp.fa -1 HG00096_mhc_1.fq -2 HG00096_mhc_2.fq -p 8 -o results/HG00096
```
### 4. Quantify HLA expression
In order to quantify expression, we use the `quant` module. If the original fastq files are available, we can proceed directly to the quantification step. If only a BAM file of a previous alignment to the genome is available, we first need to convert the BAM to fastq using the `bam2fq` utility.
Example:
```
hlapers bam2fq -b HG00096.bam -o HG00096
```
Proceed to the quantification step.
```{bash}
hlapers quant --help
```
Example:
```
hlapers quant -t ./hladb -g ./results/HG00096_genotypes.tsv -1 HG00096_1.fq.gz -2 HG00096_2.fq.gz -o ./results/HG00096 -p 8
```