-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_organisms_from_ncbi.html
More file actions
1240 lines (1156 loc) · 73.3 KB
/
install_organisms_from_ncbi.html
File metadata and controls
1240 lines (1156 loc) · 73.3 KB
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Jacques van Helden" />
<meta name="date" content="2025-05-17" />
<title>Install organisms from NCBI</title>
<script src="install_organisms_from_ncbi_files/header-attrs-2.29/header-attrs.js"></script>
<script src="install_organisms_from_ncbi_files/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="install_organisms_from_ncbi_files/bootstrap-3.3.5/css/cerulean.min.css" rel="stylesheet" />
<script src="install_organisms_from_ncbi_files/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="install_organisms_from_ncbi_files/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="install_organisms_from_ncbi_files/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="install_organisms_from_ncbi_files/jqueryui-1.13.2/jquery-ui.min.js"></script>
<link href="install_organisms_from_ncbi_files/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="install_organisms_from_ncbi_files/tocify-1.9.1/jquery.tocify.js"></script>
<script src="install_organisms_from_ncbi_files/navigation-1.1/tabsets.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
background-color: #ffffff;
color: #a0a0a0;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #a0a0a0; padding-left: 4px; }
div.sourceCode
{ color: #1f1c1b; background-color: #ffffff; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span { color: #1f1c1b; } /* Normal */
code span.al { color: #bf0303; background-color: #f7e6e6; font-weight: bold; } /* Alert */
code span.an { color: #ca60ca; } /* Annotation */
code span.at { color: #0057ae; } /* Attribute */
code span.bn { color: #b08000; } /* BaseN */
code span.bu { color: #644a9b; font-weight: bold; } /* BuiltIn */
code span.cf { color: #1f1c1b; font-weight: bold; } /* ControlFlow */
code span.ch { color: #924c9d; } /* Char */
code span.cn { color: #aa5500; } /* Constant */
code span.co { color: #898887; } /* Comment */
code span.cv { color: #0095ff; } /* CommentVar */
code span.do { color: #607880; } /* Documentation */
code span.dt { color: #0057ae; } /* DataType */
code span.dv { color: #b08000; } /* DecVal */
code span.er { color: #bf0303; text-decoration: underline; } /* Error */
code span.ex { color: #0095ff; font-weight: bold; } /* Extension */
code span.fl { color: #b08000; } /* Float */
code span.fu { color: #644a9b; } /* Function */
code span.im { color: #ff5500; } /* Import */
code span.in { color: #b08000; } /* Information */
code span.kw { color: #1f1c1b; font-weight: bold; } /* Keyword */
code span.op { color: #1f1c1b; } /* Operator */
code span.ot { color: #006e28; } /* Other */
code span.pp { color: #006e28; } /* Preprocessor */
code span.re { color: #0057ae; background-color: #e0e9f8; } /* RegionMarker */
code span.sc { color: #3daee9; } /* SpecialChar */
code span.ss { color: #ff5500; } /* SpecialString */
code span.st { color: #bf0303; } /* String */
code span.va { color: #0057ae; } /* Variable */
code span.vs { color: #bf0303; } /* VerbatimString */
code span.wa { color: #bf0303; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "\e259";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "\e258";
font-family: 'Glyphicons Halflings';
border: none;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div id="header">
<h1 class="title toc-ignore">Install organisms from NCBI</h1>
<h4 class="author">Jacques van Helden</h4>
<h4 class="date">2025-05-17</h4>
</div>
<div id="introduction" class="section level1" number="1">
<h1><span class="header-section-number">1</span> Introduction</h1>
<p>The goal of this tutorial is to explain how to install genomes from
NCBI in your RSAT server.</p>
</div>
<div id="prerequisite" class="section level1" number="2">
<h1><span class="header-section-number">2</span> Prerequisite</h1>
<p>This protocol assumes that you have a working instance of the RSAT
server, and that you are familar with the Unix terminal.</p>
</div>
<div id="protocol" class="section level1" number="3">
<h1><span class="header-section-number">3</span> Protocol</h1>
<p>We illustrate the installation procedure with a bacterial genome,
since NCBI is the main source of prokaryote genomes for RSAT (<a
href="http://prokaryotes.rsat.eu/"
class="uri">http://prokaryotes.rsat.eu/</a>). The same procedure can
however apply to other taxa, as far as they are available on the NCBI
FTP server (<a href="https://ftp.ncbi.nlm.nih.gov/genomes/"
class="uri">https://ftp.ncbi.nlm.nih.gov/genomes/</a>).</p>
<div id="data-source" class="section level2" number="3.1">
<h2><span class="header-section-number">3.1</span> Data source</h2>
<p>Genomes are downloaded from the refseq repository: <a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq"
class="uri">https://ftp.ncbi.nlm.nih.gov/genomes/refseq</a></p>
</div>
<div id="getting-the-list-of-available-species" class="section level2"
number="3.2">
<h2><span class="header-section-number">3.2</span> Getting the list of
available species</h2>
<p>The first step to perform with the command
<code>ìnstall-organisms</code> is to get the list of organisms available
for a given taxonomic group.</p>
<p>The NCBI FTP genome site is organised by “main” <strong>taxonomic
groups</strong>:</p>
<ul>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/archaea/">archaea</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/bacteria/">bacteria</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/fungi/">fungi</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/invertebrate/">invertebrate</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/plant/">plant</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/mitochondrion/">mitochondrion</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/plasmid">plasmid</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/plastid">plastid</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/protozoa/">protozoa</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/vertebrate_mammalian/">vertebrate_mammalian</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/vertebrate_other/">vertebrate_other</a></li>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/refseq/viral/">viral</a></li>
</ul>
<p>The option <code>-task available</code> returns the complete list of
available species for the specified group.</p>
<p>The command below gets the list of all available bacteria and stores
them in a text file. It can easily be adapted to another group by
changing the environment variable <code>GROUP</code>.</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="co">## Get curret date to use as suffix for output files</span></span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="bu">export</span> <span class="va">TODAY</span><span class="op">=</span><span class="kw">`</span><span class="fu">date</span> +%Y-%m-%d<span class="kw">`</span></span>
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="co">## Choose a taxonomic group of interest</span></span>
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a><span class="bu">export</span> <span class="va">GROUP</span><span class="op">=</span>bacteria</span>
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a></span>
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a><span class="co">## Get the list of bacterial species available on the NCBI FTP site</span></span>
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="at">-task</span> available</span></code></pre></div>
<p>This will download the <strong>assembly summmary</strong> file from
NCBI, for the selected taxonomic group. Beware, for Bacteria this file
is pretty large (153Mb on April 2024). However, this file is downloaded
only if the version on the NCBI server is more recent than the local
version. After the first download, subsequent calls of the
<em>install-organisms</em> command will check if a new version is
present at the NCBI site, and if not it will use the local copy.</p>
<p>The output of <em>install-organisms</em> indicates the local path of
the assembly summary file.</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="kw">;</span> <span class="ex">Assembly</span> summary file <span class="va">$RSAT</span>/downloads/refseq/bacteria/assembly_summary.txt</span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a><span class="kw">;</span> <span class="ex">Assembly</span> summary columns <span class="va">$RSAT</span>/downloads/refseq/bacteria/assembly_summary_colums.tsv</span>
<span id="cb2-3"><a href="#cb2-3" tabindex="-1"></a><span class="kw">;</span> <span class="ex">Available</span> assemblies 350727</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="co">## Count the number of species.</span></span>
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a><span class="co">## Note: grep is used to filter out the comment lines.</span></span>
<span id="cb3-3"><a href="#cb3-3" tabindex="-1"></a><span class="bu">export</span> <span class="va">ASSEMBLY_SUMMARY</span><span class="op">=</span>downloads/refseq/<span class="va">${GROUP}</span>/assembly_summary.txt</span>
<span id="cb3-4"><a href="#cb3-4" tabindex="-1"></a><span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^#'</span> <span class="va">${ASSEMBLY_SUMMARY}</span> <span class="kw">|</span> <span class="fu">wc</span> <span class="at">-l</span></span></code></pre></div>
<div id="getting-lists-of-available-species-for-other-groups"
class="section level3" number="3.2.1">
<h3><span class="header-section-number">3.2.1</span> Getting lists of
available species for other groups</h3>
<p>We can of course do the same for other taxa, for example Archaea,
Fungi or Mammalian.</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" tabindex="-1"></a><span class="bu">export</span> <span class="va">NCBI_GROUPS</span><span class="op">=</span><span class="st">'archaea bacteria fungi invertebrate plant protozoa vertebrate_mammalian vertebrate_other viral'</span></span>
<span id="cb4-2"><a href="#cb4-2" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"NCBI_GROUPS </span><span class="va">${NCBI_GROUPS}</span><span class="st">"</span></span>
<span id="cb4-4"><a href="#cb4-4" tabindex="-1"></a><span class="cf">for</span> ncbi_group <span class="kw">in</span> <span class="va">$NCBI_GROUPS</span><span class="kw">;</span> <span class="cf">do</span> <span class="dt">\</span></span>
<span id="cb4-5"><a href="#cb4-5" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">"Getting list of NCBI species for </span><span class="va">${ncbi_group}</span><span class="st">"</span> <span class="kw">;</span> <span class="dt">\</span></span>
<span id="cb4-6"><a href="#cb4-6" tabindex="-1"></a> <span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${ncbi_group}</span> <span class="at">-task</span> available</span>
<span id="cb4-7"><a href="#cb4-7" tabindex="-1"></a><span class="cf">done</span></span>
<span id="cb4-8"><a href="#cb4-8" tabindex="-1"></a></span>
<span id="cb4-9"><a href="#cb4-9" tabindex="-1"></a></span>
<span id="cb4-10"><a href="#cb4-10" tabindex="-1"></a><span class="co">## Approx count of species per taxa</span></span>
<span id="cb4-11"><a href="#cb4-11" tabindex="-1"></a><span class="co">## (each file starts with 15 comment lines, which are be substracted from each count)</span></span>
<span id="cb4-12"><a href="#cb4-12" tabindex="-1"></a><span class="fu">wc</span> <span class="at">-l</span> <span class="va">$RSAT</span>/downloads/refseq/<span class="pp">*</span>/assembly_summary.txt <span class="dt">\</span></span>
<span id="cb4-13"><a href="#cb4-13" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-nr</span> <span class="dt">\</span></span>
<span id="cb4-14"><a href="#cb4-14" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">awk</span> <span class="st">'{print "|\t"$1-15"\t| "$2"\t|"}'</span> </span></code></pre></div>
<p>Note: for some species, several strains have been sequenced. The
number of genomes available at NCBI thus exceeds by far the number of
distinct species.</p>
</div>
<div id="number-of-species-per-group" class="section level3"
number="3.2.2">
<h3><span class="header-section-number">3.2.2</span> Number of species
per group</h3>
<p>Here is the result on JanFeb 2nd, 2025</p>
<table>
<colgroup>
<col width="25%" />
<col width="75%" />
</colgroup>
<thead>
<tr class="header">
<th>Number of species</th>
<th>Taxonomic group</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>405360</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/bacteria/assembly_summary.txt</td>
</tr>
<tr class="even">
<td>14984</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/viral/assembly_summary.txt</td>
</tr>
<tr class="odd">
<td>2438</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/archaea/assembly_summary.txt</td>
</tr>
<tr class="even">
<td>630</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/fungi/assembly_summary.txt</td>
</tr>
<tr class="odd">
<td>432</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/vertebrate_other/assembly_summary.txt</td>
</tr>
<tr class="even">
<td>428</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/invertebrate/assembly_summary.txt</td>
</tr>
<tr class="odd">
<td>228</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/vertebrate_mammalian/assembly_summary.txt</td>
</tr>
<tr class="even">
<td>173</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/plant/assembly_summary.txt</td>
</tr>
<tr class="odd">
<td>108</td>
<td>/opt/rsat-tools/rsat_bacteria/downloads/refseq/protozoa/assembly_summary.txt</td>
</tr>
<tr class="even">
<td><strong>424901</strong></td>
<td><strong>total</strong></td>
</tr>
</tbody>
</table>
<p><strong>Notes</strong></p>
<ul>
<li><p>The <strong>number of available assemblies</strong> exceeds by
far the number of species, because some species are represented by
different strains, in particular for bacteria (some bacterial species
have several thousands of strains sequenced).</p></li>
<li><p>Some of these genomes are only partly sequenced, or poorly
assembled, and the level of annotation is quite variable. NCBI
subdivided these available genomes in 4 categories depending on the
level of completion of the sequencing project.</p></li>
</ul>
</div>
</div>
<div id="filtering-assemblies" class="section level2" number="3.3">
<h2><span class="header-section-number">3.3</span> Filtering
assemblies</h2>
<p>In order to select a reasonable number of genomes to install, we can
filter the assemblies based on different criteria.</p>
<div id="listing-the-available-assemblies-for-a-species-of-interest"
class="section level3" number="3.3.1">
<h3><span class="header-section-number">3.3.1</span> Listing the
available assemblies for a species of interest</h3>
<p>The option <code>-species</code> enables selecting a subset of
assemblies corresponding to a given species of a given genus. The
argulent <code>-species</code> should be followed by a string
concatenating the Genus (with a leading uppercase) and species (in
lowercase) separated by an underscore character (<code>_</code>), with
exactly the same spelling and cases as on the NCBI FTP refseq site. Note
that special characters (<code>][)(/</code> etc) should be replaced by
an underscore.</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="co">## List the assemblies for a given species, e.g. Rhizobium etli</span></span>
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb5-3"><a href="#cb5-3" tabindex="-1"></a> <span class="at">-species</span> Rhizobium_etli <span class="dt">\</span></span>
<span id="cb5-4"><a href="#cb5-4" tabindex="-1"></a> <span class="at">-task</span> list <span class="at">-list_format</span> org</span></code></pre></div>
<p>Beware, for some species of interest, the number of assemblies can be
quite large. This is for example the case for <em>Escherchia
coli</em>.</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a><span class="co">## List the assemblies for Escherichia coli)</span></span>
<span id="cb6-2"><a href="#cb6-2" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb6-3"><a href="#cb6-3" tabindex="-1"></a> <span class="at">-species</span> Escherichia_coli <span class="dt">\</span></span>
<span id="cb6-4"><a href="#cb6-4" tabindex="-1"></a> <span class="at">-task</span> list <span class="at">-list_format</span> org <span class="dt">\</span></span>
<span id="cb6-5"><a href="#cb6-5" tabindex="-1"></a> <span class="at">-o</span> assemblies_Escherichia_coli.txt</span>
<span id="cb6-6"><a href="#cb6-6" tabindex="-1"></a></span>
<span id="cb6-7"><a href="#cb6-7" tabindex="-1"></a><span class="co">## Count the number of assemblies</span></span>
<span id="cb6-8"><a href="#cb6-8" tabindex="-1"></a><span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^;'</span> assemblies_Escherichia_coli.txt <span class="kw">|</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^#'</span> <span class="kw">|</span> <span class="fu">wc</span> <span class="at">-l</span></span>
<span id="cb6-9"><a href="#cb6-9" tabindex="-1"></a></span>
<span id="cb6-10"><a href="#cb6-10" tabindex="-1"></a><span class="co">## Display the first rows of this file</span></span>
<span id="cb6-11"><a href="#cb6-11" tabindex="-1"></a><span class="fu">head</span> <span class="at">-n</span> 20 assemblies_Escherichia_coli.txt</span></code></pre></div>
<p>For the species <em>Escherichia_coli</em>, we get 38518 assemblies
(2024-02-02).</p>
<p>We generally don’t need to install all these assemblies. We should
thus use additional information in order to narrow down the number of
genomes to install. To this purpose, the next sections explain how to
select genomes labeled either as <strong>reference</strong> or
<strong>representative</strong>, and completely sequenced.</p>
</div>
<div id="selecting-reference-genomes" class="section level3"
number="3.3.2">
<h3><span class="header-section-number">3.3.2</span> Selecting reference
genomes</h3>
<p>The assembly summary includes a field <code>refseq_category</code>,
which is quite convenient</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a><span class="co">## Get the list of organisms</span></span>
<span id="cb7-2"><a href="#cb7-2" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="at">-task</span> list <span class="dt">\</span></span>
<span id="cb7-3"><a href="#cb7-3" tabindex="-1"></a> <span class="at">-list_format</span> org <span class="dt">\</span></span>
<span id="cb7-4"><a href="#cb7-4" tabindex="-1"></a> <span class="at">-filter</span> refseq_category <span class="st">"reference genome"</span> <span class="dt">\</span></span>
<span id="cb7-5"><a href="#cb7-5" tabindex="-1"></a> <span class="at">-o</span> reference_genomes_organisms.txt</span>
<span id="cb7-6"><a href="#cb7-6" tabindex="-1"></a></span>
<span id="cb7-7"><a href="#cb7-7" tabindex="-1"></a><span class="co">## Display the list of organisms</span></span>
<span id="cb7-8"><a href="#cb7-8" tabindex="-1"></a><span class="fu">less</span> reference_genomes_organisms.txt</span>
<span id="cb7-9"><a href="#cb7-9" tabindex="-1"></a></span>
<span id="cb7-10"><a href="#cb7-10" tabindex="-1"></a><span class="co">## Display the list of organisms</span></span>
<span id="cb7-11"><a href="#cb7-11" tabindex="-1"></a><span class="fu">wc</span> <span class="at">-l</span> reference_genomes_organisms.txt</span></code></pre></div>
<p>The commands above list the assemblies labeled “reference genome” in
the column “refseq_category” of the assembly summary file. This
collection was built by “<a
href="https://ncbiinsights.ncbi.nlm.nih.gov/2025/01/14/updated-bacterial-and-archaeal-reference-genome-collection-2/">selecting
the ‘best’ genome assembly for each species</a>”.</p>
<p>On Feb 2, 2025, the reference collection contains 20,578 among the
424,901 available bacterial genomes.</p>
</div>
<div id="selecting-reference-organisms-with-complete-genome"
class="section level3" number="3.3.3">
<h3><span class="header-section-number">3.3.3</span> Selecting reference
organisms with complete genome</h3>
<p>The assembly summary file also contains a column indicating the
sequencing status for each assembly.</p>
<p>This table contains many columns with valuable information for genome
management. The column contain is indicated in a separate file.</p>
<ul>
<li><a
href="https://ftp.ncbi.nlm.nih.gov/genomes/README_assembly_summary.txt"
class="uri">https://ftp.ncbi.nlm.nih.gov/genomes/README_assembly_summary.txt</a></li>
</ul>
<p>Genome assemblies are classified in four levels of chromosome
assembly (<a
href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4702866/">PMCID:
PMC4702866</a>).</p>
<ol style="list-style-type: decimal">
<li><strong>Contig:</strong> Assemblies that include only contigs.</li>
<li><strong>Scaffold:</strong> Includes both scaffolds and contigs.</li>
<li><strong>Chromosome:</strong> Includes chromosome or linkage groups,
plus scaffolds and contigs.</li>
<li><strong>Complete genome:</strong> Assemblies for which all molecules
are fully sequenced.</li>
</ol>
<p>We can use this assembly summary to select only those genomes with
the a completion level that we consider appropriate. The commands below
count the number of genomes per type of chromosome assembly.</p>
<div class="sourceCode" id="cb8"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" tabindex="-1"></a><span class="co">## Choose a taxonomic group of interest</span></span>
<span id="cb8-2"><a href="#cb8-2" tabindex="-1"></a><span class="bu">export</span> <span class="va">GROUP</span><span class="op">=</span>bacteria</span>
<span id="cb8-3"><a href="#cb8-3" tabindex="-1"></a><span class="bu">export</span> <span class="va">ASSEMBLY_SUMMARY</span><span class="op">=</span>downloads/refseq/<span class="va">${GROUP}</span>/assembly_summary.txt</span>
<span id="cb8-4"><a href="#cb8-4" tabindex="-1"></a></span>
<span id="cb8-5"><a href="#cb8-5" tabindex="-1"></a><span class="co">## Count the number of assemblies for each value of the refseq_category</span></span>
<span id="cb8-6"><a href="#cb8-6" tabindex="-1"></a><span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^#'</span> <span class="va">${ASSEMBLY_SUMMARY}</span> <span class="kw">|</span> <span class="fu">cut</span> <span class="at">-f</span> 12 <span class="kw">|</span> <span class="fu">sort</span> <span class="kw">|</span> <span class="fu">uniq</span> <span class="at">-c</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-n</span></span></code></pre></div>
<p>We can now compute the number of assemblies for each combination of
annotations for the two criteria: <strong>refseq_category</strong>
(column 5 of <code>assembly_summary.txt</code>) and
<strong>assembly_level</strong> (column 12).</p>
<p>For the RSAT prokaryote server (<a href="http://prokaryote.rsat.eu"
class="uri">http://prokaryote.rsat.eu</a>), we restrict the installation
to genomes</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" tabindex="-1"></a><span class="co">## Choose a taxonomic group of interest</span></span>
<span id="cb9-2"><a href="#cb9-2" tabindex="-1"></a><span class="bu">export</span> <span class="va">GROUP</span><span class="op">=</span>bacteria</span>
<span id="cb9-3"><a href="#cb9-3" tabindex="-1"></a><span class="bu">export</span> <span class="va">ASSEMBLY_SUMMARY</span><span class="op">=</span>downloads/refseq/<span class="va">${GROUP}</span>/assembly_summary.txt</span>
<span id="cb9-4"><a href="#cb9-4" tabindex="-1"></a></span>
<span id="cb9-5"><a href="#cb9-5" tabindex="-1"></a><span class="co">## Count the number of assemblies for each value of the refseq_category</span></span>
<span id="cb9-6"><a href="#cb9-6" tabindex="-1"></a><span class="fu">cut</span> <span class="at">-f</span> 5,12 <span class="va">${ASSEMBLY_SUMMARY}</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="kw">|</span> <span class="fu">uniq</span> <span class="at">-c</span> <span class="kw">|</span> <span class="fu">sort</span> <span class="at">-n</span> <span class="dt">\</span></span>
<span id="cb9-7"><a href="#cb9-7" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">perl</span> <span class="at">-pe</span> <span class="st">'s/(\d+) /$1\t/'</span> <span class="dt">\</span></span>
<span id="cb9-8"><a href="#cb9-8" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">awk</span> <span class="at">-F</span><span class="st">'\t'</span> <span class="st">'{print "| "$1"\t| "$3"\t| "$2" |"}'</span></span></code></pre></div>
<p>As of Feb 2, 2025, the number of assemblies in these categories is
the following:</p>
<table>
<thead>
<tr class="header">
<th align="right"><strong>Nb</strong></th>
<th align="left"><strong>assembly_level</strong></th>
<th align="left"><strong>refseq_category</strong></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="right">424</td>
<td align="left">Chromosome</td>
<td align="left">reference genome</td>
</tr>
<tr class="even">
<td align="right">5511</td>
<td align="left">Chromosome</td>
<td align="left">na</td>
</tr>
<tr class="odd">
<td align="right">5734</td>
<td align="left">Complete Genome</td>
<td align="left">reference genome</td>
</tr>
<tr class="even">
<td align="right">5952</td>
<td align="left">Scaffold</td>
<td align="left">reference genome</td>
</tr>
<tr class="odd">
<td align="right">8468</td>
<td align="left">Contig</td>
<td align="left">reference genome</td>
</tr>
<tr class="even">
<td align="right">41143</td>
<td align="left">Complete Genome</td>
<td align="left">na</td>
</tr>
<tr class="odd">
<td align="right">125680</td>
<td align="left">Scaffold</td>
<td align="left">na</td>
</tr>
<tr class="even">
<td align="right">212461</td>
<td align="left">Contig</td>
<td align="left">na</td>
</tr>
</tbody>
</table>
<p>For the RSAT bacterial server, we select the assemblies that fit both
of the following criteria :</p>
<ul>
<li>The field <strong>refseq_category</strong> (column 5) is
<em>reference genome</em>.</li>
<li>The field <strong>assembly_level</strong> (column 12) is
<em>Complete genome</em>.</li>
</ul>
<p>We will list the selected organisms in order to make sure that the
filter works properly, with 3 alternative options for the output
format:</p>
<ul>
<li><code>-list_format org</code> exports the organism name. These are
built by concatenating the genus, species and assembly, separated by
underscore characters.</li>
<li><code>-list_format table</code> exports a subset of the table
<code>assembly_summary.txt</code>, restricted to the assemblies passing
the filters</li>
<li><code>-list_format bash</code> exports a bash script with all the
commands for installing the selected genomes. <strong>Beware:</strong>
depending on the group of interest, the number of reference genomes can
amount to a few tens, or several thousands. In the latter case, you
should better see the section <strong><em>Managing installation tasks
with a task scheduler</em></strong>.</li>
</ul>
<div class="sourceCode" id="cb10"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a><span class="bu">export</span> <span class="va">GROUP</span><span class="op">=</span>bacteria</span>
<span id="cb10-2"><a href="#cb10-2" tabindex="-1"></a><span class="bu">export</span> <span class="va">REFERENCE_COMPLETE</span><span class="op">=</span><span class="va">${GROUP}</span>_reference_complete</span>
<span id="cb10-3"><a href="#cb10-3" tabindex="-1"></a></span>
<span id="cb10-4"><a href="#cb10-4" tabindex="-1"></a><span class="co">## Select the reference genomes with complete genome</span></span>
<span id="cb10-5"><a href="#cb10-5" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb10-6"><a href="#cb10-6" tabindex="-1"></a> <span class="at">-filter</span> refseq_category <span class="st">"reference genome"</span> <span class="dt">\</span></span>
<span id="cb10-7"><a href="#cb10-7" tabindex="-1"></a> <span class="at">-filter</span> assembly_level <span class="st">"Complete Genome"</span> <span class="dt">\</span></span>
<span id="cb10-8"><a href="#cb10-8" tabindex="-1"></a> <span class="at">-task</span> list <span class="at">-list_format</span> org <span class="dt">\</span></span>
<span id="cb10-9"><a href="#cb10-9" tabindex="-1"></a> <span class="at">-o</span> <span class="va">${REFERENCE_COMPLETE}</span>.txt</span>
<span id="cb10-10"><a href="#cb10-10" tabindex="-1"></a></span>
<span id="cb10-11"><a href="#cb10-11" tabindex="-1"></a><span class="co">## Count the number of complete reference genomes</span></span>
<span id="cb10-12"><a href="#cb10-12" tabindex="-1"></a><span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^;'</span> <span class="va">${REFERENCE_COMPLETE}</span>.txt <span class="dt">\</span></span>
<span id="cb10-13"><a href="#cb10-13" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">'^#'</span> <span class="dt">\</span></span>
<span id="cb10-14"><a href="#cb10-14" tabindex="-1"></a> <span class="kw">|</span> <span class="fu">wc</span> <span class="at">-l</span></span>
<span id="cb10-15"><a href="#cb10-15" tabindex="-1"></a></span>
<span id="cb10-16"><a href="#cb10-16" tabindex="-1"></a><span class="co">## Export the metadata table for the reference genomes with complete genome</span></span>
<span id="cb10-17"><a href="#cb10-17" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb10-18"><a href="#cb10-18" tabindex="-1"></a> <span class="at">-filter</span> refseq_category <span class="st">"reference genome"</span> <span class="dt">\</span></span>
<span id="cb10-19"><a href="#cb10-19" tabindex="-1"></a> <span class="at">-filter</span> assembly_level <span class="st">"Complete Genome"</span> <span class="dt">\</span></span>
<span id="cb10-20"><a href="#cb10-20" tabindex="-1"></a> <span class="at">-task</span> list <span class="at">-list_format</span> table <span class="dt">\</span></span>
<span id="cb10-21"><a href="#cb10-21" tabindex="-1"></a> <span class="at">-o</span> <span class="va">${REFERENCE_COMPLETE}</span>.tsv</span>
<span id="cb10-22"><a href="#cb10-22" tabindex="-1"></a></span>
<span id="cb10-23"><a href="#cb10-23" tabindex="-1"></a><span class="co">## Export a bash file with the installation tasks</span></span>
<span id="cb10-24"><a href="#cb10-24" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="at">-task</span> list <span class="dt">\</span></span>
<span id="cb10-25"><a href="#cb10-25" tabindex="-1"></a> <span class="at">-list_format</span> bash <span class="dt">\</span></span>
<span id="cb10-26"><a href="#cb10-26" tabindex="-1"></a> <span class="at">-filter</span> refseq_category <span class="st">"reference genome"</span> <span class="dt">\</span></span>
<span id="cb10-27"><a href="#cb10-27" tabindex="-1"></a> <span class="at">-filter</span> assembly_level <span class="st">"Complete Genome"</span> <span class="dt">\</span></span>
<span id="cb10-28"><a href="#cb10-28" tabindex="-1"></a> <span class="at">-o</span> <span class="va">${REFERENCE_COMPLETE}</span>.bash</span></code></pre></div>
</div>
</div>
<div
id="installing-one-assembly-for-a-given-species-and-strain-of-interest"
class="section level2" number="3.4">
<h2><span class="header-section-number">3.4</span> Installing one
assembly for a given species and strain of interest</h2>
<div id="downloading-a-selected-assembly" class="section level3"
number="3.4.1">
<h3><span class="header-section-number">3.4.1</span> Downloading a
selected assembly</h3>
<p>We will now download the genome of a selected assembly, and install
it on the RSAT server. As an illustration, we will install the reference
strain K-12 of <em>Escherichia coli</em>.</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" tabindex="-1"></a><span class="co">## Select a species and assembly of interest </span></span>
<span id="cb11-2"><a href="#cb11-2" tabindex="-1"></a><span class="co">## (can be adapted to your needs)</span></span>
<span id="cb11-3"><a href="#cb11-3" tabindex="-1"></a><span class="fu">grep</span> Escherichia reference_genomes.tsv <span class="kw">|</span> <span class="fu">grep</span> K-12</span>
<span id="cb11-4"><a href="#cb11-4" tabindex="-1"></a><span class="fu">grep</span> Escherichia reference_genomes.tsv <span class="kw">|</span> <span class="fu">grep</span> K-12 <span class="kw">|</span> <span class="fu">cut</span> <span class="at">-f</span> 8</span>
<span id="cb11-5"><a href="#cb11-5" tabindex="-1"></a></span>
<span id="cb11-6"><a href="#cb11-6" tabindex="-1"></a><span class="bu">export</span> <span class="va">ASSEMBLY</span><span class="op">=</span>GCF_000005845.2</span>
<span id="cb11-7"><a href="#cb11-7" tabindex="-1"></a></span>
<span id="cb11-8"><a href="#cb11-8" tabindex="-1"></a></span>
<span id="cb11-9"><a href="#cb11-9" tabindex="-1"></a><span class="co">## List the selected assemblies for a given species </span></span>
<span id="cb11-10"><a href="#cb11-10" tabindex="-1"></a><span class="co">## (e.g. Escherichia_coli) </span></span>
<span id="cb11-11"><a href="#cb11-11" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb11-12"><a href="#cb11-12" tabindex="-1"></a> <span class="at">-filter</span> assembly_accession <span class="va">${ASSEMBLY}</span> <span class="dt">\</span></span>
<span id="cb11-13"><a href="#cb11-13" tabindex="-1"></a> <span class="at">-task</span> list</span>
<span id="cb11-14"><a href="#cb11-14" tabindex="-1"></a></span>
<span id="cb11-15"><a href="#cb11-15" tabindex="-1"></a><span class="co">## Download the selected assemblies </span></span>
<span id="cb11-16"><a href="#cb11-16" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb11-17"><a href="#cb11-17" tabindex="-1"></a> <span class="at">-filter</span> assembly_accession <span class="va">${ASSEMBLY}</span> <span class="dt">\</span></span>
<span id="cb11-18"><a href="#cb11-18" tabindex="-1"></a> <span class="at">-task</span> download</span>
<span id="cb11-19"><a href="#cb11-19" tabindex="-1"></a> </span></code></pre></div>
<p><strong>Note</strong>: downloaded genomes will be installed in a
folder <code>$RSAT/downloads/refseq</code> on your computer. Each strain
is stored in a specific subfolder built from the group, genus, species,
and assembly.</p>
<p>For example, the reference assembly for <em>Escherichia coli</em> is
stored in</p>
<p><code>downloads/refseq/bacteria//Escherichia/Escherichia_coli_str._K-12_substr._MG1655/GCF_000005845.2_ASM584v2/</code></p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" tabindex="-1"></a>ls <span class="sc">-</span><span class="dv">1</span> downloads<span class="sc">/</span>refseq<span class="sc">/</span>bacteria<span class="sc">/</span>Escherichia<span class="sc">/</span>Escherichia_coli_str._K<span class="dv">-12</span>_substr._MG1655<span class="sc">/</span>GCF_000005845<span class="fl">.2</span>_ASM584v2</span></code></pre></div>
</div>
<div id="parsing-a-selected-genome-from-ncbi" class="section level3"
number="3.4.2">
<h3><span class="header-section-number">3.4.2</span> Parsing a selected
genome from NCBI</h3>
<p>Parsing consists in extracting the information from a text-formatted
file, in order to organise it in a computable structure.</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" tabindex="-1"></a><span class="co">## Parse a given strain of a given genome </span></span>
<span id="cb13-2"><a href="#cb13-2" tabindex="-1"></a><span class="co">## (e.g. strain GCF_000016185.1_ASM1618v1 of Rhodospirillum centenum) </span></span>
<span id="cb13-3"><a href="#cb13-3" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 2 <span class="at">-group</span> <span class="va">${GROUP}</span> <span class="dt">\</span></span>
<span id="cb13-4"><a href="#cb13-4" tabindex="-1"></a> <span class="at">-filter</span> assembly_accession <span class="va">${ASSEMBLY}</span> <span class="dt">\</span></span>
<span id="cb13-5"><a href="#cb13-5" tabindex="-1"></a> <span class="at">-task</span> parse</span></code></pre></div>
</div>
<div id="organism-names" class="section level3" number="3.4.3">
<h3><span class="header-section-number">3.4.3</span> Organism names</h3>
<p>For each parsed genome, the program creates a folder whose name is
the concatenation of the genus, species, strain accession and assembly
name, separated by undescore characters.</p>
<p><code>$RSAT/public_html/data/[Genus]_[species]_[assembly_accession]_[asm_name]</code></p>
<p>For <em>Escherichia coli K12</em> reference strain, this gives:</p>
<p><code>Escherichia_coli_str._K-12_substr._MG1655_GCF_000005845.2_ASM584v2</code></p>
<p>From now on we will directly refer to this concatenated name as the
<strong><em>Organism name</em></strong> (generally denoted by the option
<code>-org</code> in RSAT commands.</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" tabindex="-1"></a></span>
<span id="cb14-2"><a href="#cb14-2" tabindex="-1"></a><span class="bu">export</span> <span class="va">ORG</span><span class="op">=</span>Escherichia_coli_str._K-12_substr._MG1655_GCF_000005845.2_ASM584v2</span>
<span id="cb14-3"><a href="#cb14-3" tabindex="-1"></a></span>
<span id="cb14-4"><a href="#cb14-4" tabindex="-1"></a><span class="co">## Check the parsing result</span></span>
<span id="cb14-5"><a href="#cb14-5" tabindex="-1"></a><span class="fu">ls</span> <span class="at">-l</span> <span class="va">${RSAT}</span>/public_html/data/genomes/<span class="va">${ORG}</span>/genome/</span>
<span id="cb14-6"><a href="#cb14-6" tabindex="-1"></a></span>
<span id="cb14-7"><a href="#cb14-7" tabindex="-1"></a><span class="co">## Measure the disk space occupied by this genome (note: this will be increased in the subsequent steps)</span></span>
<span id="cb14-8"><a href="#cb14-8" tabindex="-1"></a><span class="fu">du</span> <span class="at">-sm</span> <span class="va">${RSAT}</span>/public_html/data/genomes/<span class="va">${ORG}</span>/genome/</span></code></pre></div>
<p>This gives the number of megabases occupied by the genome folder.</p>
</div>
<div id="adding-the-parsed-genome-to-the-list-of-supported-genomes"
class="section level3" number="3.4.4">
<h3><span class="header-section-number">3.4.4</span> Adding the parsed
genome to the list of supported genomes</h3>
<p>In order to make the parsed genome available for RSAT, you need to
run the configuration task.</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" tabindex="-1"></a><span class="co">## Configure the organism for RSAT</span></span>
<span id="cb15-2"><a href="#cb15-2" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-org</span> <span class="va">${ORG}</span> <span class="at">-source</span> NCBI <span class="at">-task</span> config</span>
<span id="cb15-3"><a href="#cb15-3" tabindex="-1"></a></span>
<span id="cb15-4"><a href="#cb15-4" tabindex="-1"></a></span>
<span id="cb15-5"><a href="#cb15-5" tabindex="-1"></a><span class="co">## Check that the organism has wel been declared</span></span>
<span id="cb15-6"><a href="#cb15-6" tabindex="-1"></a><span class="ex">supported-organisms</span> <span class="at">-return</span> ID,source,last_update <span class="kw">|</span> <span class="fu">grep</span> <span class="va">${ORG}</span></span></code></pre></div>
</div>
<div id="finalizing-the-installation" class="section level3"
number="3.4.5">
<h3><span class="header-section-number">3.4.5</span> Finalizing the
installation</h3>
<p>Several more tasks need to be performed before we can consider this
organism as “installed”.</p>
<p>The simplest way to run it is to select the “default” tasks.</p>
<div class="sourceCode" id="cb16"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" tabindex="-1"></a><span class="co">## Run the installation task (retrieve upstream sequences compute background oligo and dyad frequencies, index fasta genome for bedtols, ...)</span></span>
<span id="cb16-2"><a href="#cb16-2" tabindex="-1"></a><span class="ex">install-organism</span> <span class="at">-v</span> 1 <span class="at">-org</span> <span class="va">${ORG}</span> <span class="at">-task</span> default</span></code></pre></div>
</div>
<div
id="detailed-list-of-supported-installation-tasks-default-and-others"
class="section level3" number="3.4.6">
<h3><span class="header-section-number">3.4.6</span> Detailed list of
supported installation tasks (default and others)</h3>
<table>
<colgroup>
<col width="20%" />
<col width="79%" />
</colgroup>
<thead>
<tr class="header">
<th>Task</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>default</td>
<td>run all the default tasks useful for the installation of a genome
(this is a subset of the tasks specified below)</td>
</tr>
<tr class="even">
<td>start_stop</td>
<td>compute trinucleotide frequencies in all the start and stop codons
(validation of the correspondance between genome sequences and gene
coordinates)</td>
</tr>
<tr class="odd">
<td>allup</td>
<td>Retrieve all upstream sequences in order to compute the background
models (oligonucleotide and dyad frequencies)</td>
</tr>
<tr class="even">
<td>seq_len_distrib</td>
<td>Compute the distribution of upstream sequences</td>
</tr>
<tr class="odd">
<td>genome_segments</td>
<td>SPlit the genome into segments corresponding to different genomic
region types: genic, intergenic, …</td>
</tr>
<tr class="even">
<td>upstream_freq</td>
<td>Compute oligonucleotide or/and dyad frequencies in upstream
sequences (must be combined with tasks oligos and/or dyads)</td>
</tr>
<tr class="odd">
<td>genome_freq</td>
<td>Compute oligonucleotide or/and dyad frequencies in the whole genome
(must be combined with tasks oligos and/or dyads)</td>
</tr>
<tr class="even">
<td>protein_freq</td>
<td>Compute amino acid, di- and tri-peptide frequencies in all protein
sequences</td>
</tr>
<tr class="odd">
<td>protein_len</td>
<td>Compute distribution of protein lengths</td>
</tr>
<tr class="even">
<td>oligos</td>
<td>Compute oligonucleotide frequencies (size 1 to 8) in a given type of
sequences. Must be combined with stasks upstream or genomic</td>
</tr>
<tr class="odd">
<td>dyads</td>
<td>Idem for dyads, i.e. spaced pairs of trinucleotides</td>
</tr>
<tr class="even">
<td>fasta_genome</td>
<td>convert genome sequence in fasta in order to make it usable by
bedtools</td>
</tr>
<tr class="odd">
<td>chrom_sizes</td>
<td>compute chromosome sizes from genomic sequences</td>
</tr>
<tr class="even">
<td>index_bedtools</td>
<td>index genome to enable its ultra-fast processing by bedtools</td>
</tr>
<tr class="odd">
<td>uninstall</td>
<td>uninstall a genome, i.e. stop displaying it as available. Beware,
this does not erase the genome folder, for this you can use the option
<code>-task erase</code></td>
</tr>
<tr class="even">
<td>erase</td>
<td>Erase the whole folder of your organism in
<code>$RSAT/public_html/data</code></td>
</tr>
</tbody>
</table>
</div>
<div id="checking-that-the-organism-is-well-supported"
class="section level3" number="3.4.7">
<h3><span class="header-section-number">3.4.7</span> Checking that the
organism is well supported</h3>
<div class="sourceCode" id="cb17"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" tabindex="-1"></a><span class="co">## Get all the supported organisms</span></span>
<span id="cb17-2"><a href="#cb17-2" tabindex="-1"></a><span class="ex">supported-organisms</span> <span class="kw">|</span> <span class="fu">grep</span> <span class="va">${ORG}</span></span></code></pre></div>
</div>
<div
id="checking-the-correctness-of-gene-annotations-by-computing-startstop-codon-frequencies"
class="section level3" number="3.4.8">
<h3><span class="header-section-number">3.4.8</span> Checking the
correctness of gene annotations by computing start/stop codon
frequencies</h3>
<div class="sourceCode" id="cb18"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" tabindex="-1"></a><span class="co">## Retrieve all the start codon sequences</span></span>
<span id="cb18-2"><a href="#cb18-2" tabindex="-1"></a><span class="ex">retrieve-seq</span> <span class="at">-all</span> <span class="at">-org</span> <span class="va">${ORG}</span> <span class="at">-from</span> 0 <span class="at">-to</span> 2 <span class="at">-o</span> start_seq.fasta</span>
<span id="cb18-3"><a href="#cb18-3" tabindex="-1"></a></span>
<span id="cb18-4"><a href="#cb18-4" tabindex="-1"></a><span class="co">## Check the result</span></span>
<span id="cb18-5"><a href="#cb18-5" tabindex="-1"></a><span class="fu">head</span> <span class="at">-n</span> 20 start_seq.fasta</span>
<span id="cb18-6"><a href="#cb18-6" tabindex="-1"></a></span>
<span id="cb18-7"><a href="#cb18-7" tabindex="-1"></a><span class="co">## Check that most genes have ATG as start codon</span></span>
<span id="cb18-8"><a href="#cb18-8" tabindex="-1"></a><span class="ex">oligo-analysis</span> <span class="at">-v</span> 1 <span class="at">-i</span> start_seq.fasta <span class="at">-l</span> 3 <span class="at">-1str</span> <span class="at">-return</span> occ,freq <span class="at">-sort</span> <span class="kw">|</span> <span class="fu">more</span></span></code></pre></div>
<p>You can do the similar test with the stop codon frequencies. Note
that nothing forces you to store the stop codong sequences in a local
file, you can use the pipe symbol <code>|</code> to concatenate two
commands.</p>
<div class="sourceCode" id="cb19"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" tabindex="-1"></a><span class="co">## Compute all trinucleotide frequencies in the stop codons</span></span>
<span id="cb19-2"><a href="#cb19-2" tabindex="-1"></a><span class="ex">retrieve-seq</span> <span class="at">-all</span> <span class="at">-org</span> <span class="va">${ORG}</span> <span class="dt">\</span></span>
<span id="cb19-3"><a href="#cb19-3" tabindex="-1"></a> <span class="at">-type</span> downstream <span class="at">-from</span> <span class="at">-1</span> <span class="at">-to</span> <span class="at">-3</span> <span class="at">-o</span> stop_seq.fasta</span>
<span id="cb19-4"><a href="#cb19-4" tabindex="-1"></a></span>
<span id="cb19-5"><a href="#cb19-5" tabindex="-1"></a><span class="co">## Check the beginning of the result file</span></span>
<span id="cb19-6"><a href="#cb19-6" tabindex="-1"></a><span class="fu">head</span> <span class="at">-20</span> stop_seq.fasta</span>
<span id="cb19-7"><a href="#cb19-7" tabindex="-1"></a></span>
<span id="cb19-8"><a href="#cb19-8" tabindex="-1"></a><span class="co">## Check that most genes have ATG as start codon</span></span>
<span id="cb19-9"><a href="#cb19-9" tabindex="-1"></a><span class="ex">oligo-analysis</span> <span class="at">-v</span> 1 <span class="at">-i</span> stop_seq.fasta <span class="at">-l</span> 3 <span class="at">-1str</span> <span class="dt">\</span></span>
<span id="cb19-10"><a href="#cb19-10" tabindex="-1"></a> <span class="at">-return</span> occ,freq <span class="at">-sort</span> <span class="kw">|</span> <span class="fu">more</span></span></code></pre></div>
<hr />
</div>
</div>
<div id="installing-multiple-genomes" class="section level2"