-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathantevolo_manual.html
468 lines (377 loc) · 16.5 KB
/
antevolo_manual.html
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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>AntEvolo 0.1 manual</title>
<style type="text/css">
.code {
background-color: lightgray;
}
</style>
<style>
</style>
</head>
<h1>AntEvolo v0.1 manual</h1>
1. <a href="#intro">About AntEvolo</a><br>
1.1 <a href = "#about_antevolo">About AntEvolo</a><br>
1.2 <a href = "#about_tree_visualizer">About TreeVisualizer</a><br>
2. <a href="#install">Installation</a><br>
2.1. <a href="#test_datasets">Verifying your installation</a><br>
3. <a href="#antevolo_usage">AntEvolo usage</a><br>
3.1. <a href="#antevolo_basic">Basic options</a><br>
3.2. <a href="#antevolo_advanced">Advanced options</a><br>
3.3. <a href="#antevolo_examples">Examples</a><br>
3.4. <a href="#antevolo_output">Output files</a><br>
4. <a href = "#treevisualizer_usage">TreeVisualizer usage</a><br>
4.1. <a href = "#visualizer_basic">Basic options</a><br>
4.2. <a href = "#visualizer_examples">Examples</a><br>
4.3. <a href = "#visualizer_output">Output files</a><br>
5. <a href = "#examples">Examples</a><br>
6. <a href="#output_files">Antibody repertoire representation</a><br>
6.1. <a href="#clusters_fasta">CLUSTERS.FASTA file format</a><br>
6.2. <a href="#read_cluster_map">RCM file format</a><br>
6.3. <a href="#alignment_info">Alignment Info file format</a><br>
7. <a href="#feedback">Feedback and bug reports</a><br>
7.1. <a href="#citation">Citation</a><br>
<!--- ----------------- -->
<a id="intro"></a>
<h2>1. About AntEvolo</h2>
AntEvolo is a tool for reconstruction of B-cell clonal lineages. The pipeline consists of two parts:
<ul>
<li><b>AntEvolo</b> itself.</li>
<li><b>TreeVisualizer</b> — a tool for drawing clonal trees images using <b>dot</b>.</li>
</ul>
<!--- ---------------------------------------------------------------- -->
<h3 id = "about_antevolo">About AntEvolo</h3>
IgReC pipeline in shown below:<br>
<p align = center>
<img src="docs/manual_figs/igrec.png" alt="igrec_pipeline" width = 70%>
</p>
<h4>Input:</h4>
<p align="justify">
AntEvolo takes as an input corrected Illumina reads.
<b>Please note that AntEvolo constructs expects that input reads cover variable region of antibody.</b>
</p>
<h4>Output:</h4>
<p align = justify>
AntEvolo partitions reads into clusters corresponding to clonal lineages and in each cluster reconstructs clonal forest.
AntEvolo provides user with the following information about constructed forests:
</p>
<ul>
<li>Clonal lineage clusters:</li>
<ul>
<li><i>clonal_trees</i> dir contains tsv dataframes with informaton about in-cluster edges,</li>
<li><i>clonal_trees_vertices</i> dir contains tsv dataframes with informaton about cluster's vertices;</li>
</ul>
Please note that tsv files are named in the following format: <b>clonal_tree_VJCLASSINDEX_CONNECTEDCOMPONENTINDEX_TREEINDEX.tree</b>
<li>CDRs information: a tsv dataframe cdr_details.txt</li>
<li>SHMs information: shm_details.txt</li>
<li>Some trees statistics: a tsv dataframe tree_details.txt</li>
</ul>
<h4>Stages:</h4>
AntEvolo pipeline consists of the following steps:
<ol>
<li><b>VJ Finder</b>: cleaning input reads using alignment against Ig germline genes</li>
<li><b>IG Trie Compressorr</b>: collects unique prefixes of the cleaned reads</li>
<li><b>Clonal trees construction</b> </li>
</ol>
<!--- ---------------------------------------------------------------- -->
<h3 id = "about_tree_visualizer">About TreeVisualizer</h3>
<h4>Input:</h4>
<p align="justify">
TreeVisualizer takes as an input a directory with AntEvolo results (or any directory containing consistent clonal_trees and clonal_trees_vertices subdirectories).
</p>
<h4>Output:</h4>
<p align = justify>
For each tree, TreeVisualizer creates a file with graph information in <b>dot</b> format and a pdf image.
</p>
<!--- ---------------------------------------------------------------- -->
<!--- ---------------------------------------------------------------- -->
<a id="install"></a>
<h2>2. Installation</h2>
AntEvolo has the following dependencies:
<ul>
<li>64-bit Linux system</li>
<li>g++ (version 4.7 or higher)</li>
<li>cmake (version 2.8.8 or higher)</li>
<li>Python 2 (version 2.7 or higher), including:</li>
<ul>
<li><a href = "http://biopython.org/wiki/Download">BioPython</a></li>
<li><a href = "http://matplotlib.org/users/installing.html">Matplotlib</a></li>
<li><a href = "http://www.numpy.org/">NumPy</a></li>
<li><a href = "http://www.scipy.org/install.html">SciPy</a></li>
</ul>
</ul>
TreeVisualizer also has a dependence on
<ul>
<li><a href = "http://www.graphviz.org/Download..php">Graphviz</a>'s dot (the command-line tool, not Python package) </li>
</ul>
To install AntEvolo, type:
<pre class="code">
<code>
./prepare_cfg
</code>
</pre>
and:
<pre class="code">
<code>
make ant
</code>
</pre>
<a id="test_datasets"></a>
<h3>2.1. Verifying your installation</h3>
For testing purposes, AntEvolo comes with toy data set. <br><br>
► To try AntEvolo on the test data set, run:
<pre class="code"><code>
./antevolo.py --test
</code>
</pre>
If the installation of AntEvolo is successful, you will find the following information at the end of the log:
<pre class="code">
<code>
Thank you for using AntEvolo!
Log was written to installation_directory/antevolo_test/antevolo.log
</code>
</pre>
<!--- ---------------------------------------------------------------- -->
<!--- ---------------------------------------------------------------- -->
<a id="antevolo_usage"></a>
<h2>3. AntEvolo usage</h2>
<p>
AntEvolo takes as an input Illumina reads covering variable region of antibody, splits them into clonal lineages and reconstructs child-parent relations.
</p>
To run AntEvolo, type:
<pre class="code">
<code>
./antevolo.py [options] -i <input_reads.fastq> -o <output_dir>
</code>
</pre>
<!--- --------------------- -->
<a id="antevolo_basic"></a>
<h3>3.1. Basic options:</h3>
<code>-i <input_reads.fastq></code><br>
FASTQ file with single Illumina reads (required).
<br><br>
<code>-o / --output <output_dir></code><br>
Output directory (required).
<br><br>
<code>-t / --threads <int></code><br>
The number of parallel threads. The default value is <code>16</code>.
<br><br>
<code>--test</code><br>
Running on the toy test dataset. Command line corresponding to the test run is equivalent to the following:
<pre class = "code">
<code>
./antevolo.py -i test_dataset/merged_reads.fastq -l IG -o antevolo_test
</code>
</pre>
<code>--help</code><br>
Printing help.
<br><br>
<!--- --------------------- -->
<a id="antevolo_advanced"></a>
<h3>3.2. Advanced options:</h3>
<code>--loci / -l <str></code><br>
Immunological loci to align input reads and discard reads with low score (required). <br>
Available values are <code>IGH</code> / <code>IGL</code> / <code>IGK</code> / <code>IG</code> (for all BCRs)</code>.
<br><br>
<code>--tau <int></code><br>
Maximum allowed number of mismatches between two reads corresponding to identical antibodies. The default (and recommended) value is 3.
Reasonable value of <code>tau</code> lies between <code>1</code> and <code>6</code>.
<br>
<b>This option is temporarily disabled!</b>
<br><br>
<!--- --------------------- -->
<a id="antevolo_examples"></a>
<h3>3.3. Examples</h3>
To reconconstruct clonal trees from single reads <code>reads.fastq</code>, type:
<pre class="code">
<code>
./antevolo.py -i reads.fastq -o output_dir
</code>
</pre>
<!--- --------------------- -->
<a id="antevolo_output"></a>
<h3>3.4. Output files</h3>
AntEvolo creates working directory (which name was specified using option <code>-o</code>)
and outputs the following files there:
<ul>
<li>Subdirectories with information about trees:</li>
<ul>
<li><b>clonal_trees/</b>
<ul>
<li> clonal_trees/clonal_tree_1-14-2.tree — a tsv dataframe for each cluster/tree containing all its edges (details in <a href= "#output_files">Clonal trees representation</a>).</li>
</ul>
</li>
<li><b>clonal_trees_vertices/</b>
<ul>
<li> clonal_trees_vertices/clonal_tree_1-14-2.tree — a tsv dataframe for each cluster/tree containing all its vertices (details in <a href= "#output_files">Clonal trees representation</a>).</li>
</ul>
</li>
<li><b>cdr3_graphs/ ===========TODO===========</b>
</li>
</ul><br>
<li>Statistics:</li>
<ul>
<li>
<b>cdr_details.txt</b> — tsv file with information about all three CDRs of each clone.
</li>
<li>
<b>shm_details.txt</b> — file with information about all SHMs of each clone.
</li>
<li>
<b>tree_details.txt</b> — tsv file with information about size, depth etc. of all connected trees.
</li>
</ul><br>
<li><b>antevolo.log</b> — full log of AntEvolo run.</li>
</ul>
<br>
<!-- -------------------------------------------------------------------- -->
<!-- -------------------------------------------------------------------- -->
<a id="treevisualizer_usage"></a>
<h2>4. TreeVisualizer usage</h2>
TreeVisualizer takes as an input a directory with AntEvolo results (or any directory containing consistent clonal_trees and clonal_trees_vertices subdirectories). </br></br>
► To run TreeVisualizer, type:
<pre class="code">
<code>
./tree_visualizer.py -i <input_dir> -o <output_dir> -s topk -k <K>
</code>
</pre>
to draw <code><K></code> top-sized trees
</br></br>
<b>OR</b>
</br></br>
<pre class="code">
<code>
./tree_visualizer.py -i <input_dir> -o <output_dir> -s single -n <tree_name>
</code>
</pre>
to draw single tree where <code><tree_name></code> is the name of the needed file within the <code><input_dir>/clonal_trees/</code>
<!-- --------------------- -->
<a id = "visualizer_basic"></a>
<h3>4.1. Basic options:</h3>
<code>-i <input_dir></code></br>
input directory with consistent <code>clonal_trees</code> and <code>clonal_trees_vertices</code> subdirectories (required).</br></br>
<code>-o <output_dir></code></br>
output directory (required).</br></br>
<code>-s <str></code></br>
strategy. Available values are <code>single</code> / <code>topk</code> (required).</br></br>
<code>-k <int></code></br>
number of top-sized trees to draw (required if <code>strategy</code> is <code>topk</code>).</br></br>
<code>-n <str></code></br>
file name of the tree to draw (required if <code>strategy</code> is <code>single</code>).</br></br>
<code>--help, -h</code></br>
Printing help.</br>
<!--- --------------------- -->
<a id="visualizer_examples"></a>
<h3>4.2. Examples</h3>
To draw the clonal tree from file <code>AntEvolo_results_dir/clonal_trees/clonal_tree_14-193-4_Vsize_40_Esize_39.tree</code>, type:
<pre class="code">
<code>
./tree_visualizer.py -i AntEvolo_results_dir -o output_dir -s single -n clonal_tree_14-193-4_Vsize_40_Esize_39.tree
</code>
</pre>
<!-- --------------------- -->
<a id = "visualizer_output"></a>
<h3>4.3. Output files:</h3>
<ul>
<li><tree_name>.dot — file with graph information in <b>dot</b> format</li>
<li><tree_name>.dot.pdf — a pdf image of the tree</li>
</ul>
<!-- -------------------------------------------------------------------- -->
<a id="examples"></a>
<h2>5. Examples</h2>
Example shows IgRepertoireConstructor pipeline in action for merged paired-end Illumina MiSeq library including reads <b>reads.fastq</b> and mass spectra <b>AspN_CID.mzXML</b> corresponding to the same antibody repertoire.<br><br>
► To run IgReC with standard settings, type the following command:
<pre class = "code">
<code>
./igrec.py -s reads.fastq -o repertoire_constructing
</code>
</pre>
Sequences of the constructed repertoire are located in <b>repertoire_constructing/constructed_repertoire.clusters.fa</b>. They can be converted into amino acid sequences and used as a database for matching mass spectra <b>AspN_CID.mzXML</b> (e.g., using MS-GF+ tool). Let result of MS-GF+ tool be a file <b>AspN_CID.mzId</b>.<br><br>
► To run MassSpectraAnalyzer on <b>AspN_CID.mzId</b> file, type the following command:
<pre class = "code">
<code>
./mass_spectra_analyzer.py -o ms_analysis AspN_CID.mzId
</code>
</pre>
Statistics for mass spectra alignment can be found in <b>ms_analysis</b> directory.
<br><br>
<!-- -------------------------------------------------------------------- -->
<a id="output_files"></a>
<h2>6. Antibody repertoire representation</h2>
We used two files for representation of repertoire for the set of clustered reads: CLUSTERS.FASTA and RCM.
<a id="clusters_fasta"></a>
<h3>6.1. CLUSTERS.FASTA file format</h3>
CLUSTERS.FASTA is a FASTA file, where sequences correspond to the assembled antibodies.
Each header contains information about corresponding antibody cluster (id and size):
<pre class="code"> <code>
>cluster___1___size___3
CCCCTGCAATTAAAATTGTTGACCACCTACATACCAAAGACGAGCGCCTTTACGCTTGCCTTTAGTACCTCGCAACGGCTGCGGACG
>cluster___2___size___2
CCCCTGCAATTAAAATTGTTGACCACCTACATACCAAAGACGAGCGCCTTTACGCTTGCCTTTAGTACCTCGCAACGGCTGCGG
>cluster___3___size___1
CCCCTGCAATTAAAATTGTTGACCACCTACATACCAAAGACGAGCGCCTTTACGCTTGCCTTTAGTACCTCGCAACGGCTGCGGAC
</code>
</pre>
<a id="read_cluster_map"></a>
<h3>6.2. RCM file format</h3>
Every line of RCM (read-cluster map) file contains information about read name and corresponding cluster ID:
<pre class="code"> <code>
MISEQ@:53:000000000-A2BMW:1:2114:14345:28882 1
MISEQ@:53:000000000-A2BMW:1:2114:14374:28884 1
MISEQ@:53:000000000-A2BMW:1:2114:14393:28886 1
MISEQ@:53:000000000-A2BMW:1:2114:16454:28882 2
MISEQ@:53:000000000-A2BMW:1:2114:16426:28886 2
MISEQ@:53:000000000-A2BMW:1:2114:15812:28886 3
</code>
</pre>
<br>
Reperoire described in the example above consists of three antibodies. E.g., the antibody with ID 1 has abundancy 3, since it was constructed from three reads:<br>
MISEQ@:53:000000000-A2BMW:1:2114:14345:28882<br>
MISEQ@:53:000000000-A2BMW:1:2114:14374:28884<br>
MISEQ@:53:000000000-A2BMW:1:2114:14393:28886<br><br>
<b>NOTE:</b> IDs in CLUSTERS.FASTA and RCM files are consistent.
<br><br>
<a id = "alignment_info"></a>
<h3 >6.3 Alignment Info file format</h3>
File <b>alignment_info.csv</b> contains the following information about the closest V and J gene segments
in tab-separated view.<br>
Read ids are consistent with headers in file <b>cleaned_reads.fastq</b>.<br>
Ids of V and J gene segments are taken from IMGT database.
<table width = 100%>
<tr align="center">
<td><b>Read id</b></td>
<td><b>V start</b></td>
<td><b>V end</b></td>
<td><b>V score </br>(% identity)</b></td>
<td><b>V id</b></td>
<td><b>J start</b></td>
<td><b>J end</b></td>
<td><b>J score </br>(% identity)</b></td>
<td><b>J id</b></td>
</tr>
<tr align="center">
<td>read1</td> <td>1</td> <td>296</td> <td>100.0</td> <td>IGHV3-20*01</td> <td>321</td>
<td>366</td> <td>89.0</td> <td>IGHJ5*02</td>
</tr>
<tr align="center">
<td>read2</td> <td>1</td> <td>294</td> <td>98.64</td> <td>IGHV3-9*01</td> <td>309</td>
<td>354</td> <td>100.0</td> <td>IGHJ2*01</td>
</tr>
<tr align="center">
<td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td> <td>...</td>
<td>...</td> <td>...</td> <td>...</td>
</tr>
</table>
<!--- -------------------------------------------------------------------- --->
<a id="feedback"></a>
<h2>7. Feedback and bug reports</h2>
Your comments, bug reports, and suggestions are very welcome.
They will help us to further improve AntEvolo.
<br><br>
If you have any trouble running AntEvolo, please send us the log file from the output directory.
<br><br>
Address for communications: <a href="mailto:[email protected]">[email protected]</a>.
<a id = "citation"></a>
<h3>7.1. Citation</h3>
If you use AntEvolo in your research, please refer to
<a href="..."></a>.
</body></html>