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
|
%global _empty_manifest_terminate_build 0
Name: python-biocommons.seqrepo
Version: 0.6.5
Release: 1
Summary: Non-redundant, compressed, journalled, file-based storage for biological sequences
License: Apache Software License
URL: https://github.com/biocommons/biocommons.seqrepo
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f1/55/7bff2f7bd3971925d18bdfb9e666b6d0bb1abd7f28da7a82a19fc5a6529f/biocommons.seqrepo-0.6.5.tar.gz
BuildArch: noarch
Requires: python3-bioutils
Requires: python3-coloredlogs
Requires: python3-ipython
Requires: python3-pysam
Requires: python3-requests
Requires: python3-requests-html
Requires: python3-six
Requires: python3-tqdm
Requires: python3-yoyo-migrations
Requires: python3-tox
%description
biocommons.seqrepo
!!!!!!!!!!!!!!!!!!
Python package for writing and reading a local collection of
biological sequences. The repository is non-redundant, compressed,
and journalled, making it efficient to store and transfer multiple
snapshots.
Clients refer to sequences and metadata using familiar identifiers,
such as NM_000551.3 or GRCh38:1, or any of several hash-based
identifiers. The interface supports fast slicing of arbitrary regions
of large sequences.
A "fully-qualified" identifier includes a namespace to disambiguate
accessions (e.g., "1" in GRCh37 and GRCh38). If the namespace is
provided, seqrepo uses it as-is. If the namespace is not provided and
the unqualified identifier refers to a unique sequence, it is
returned; otherwise, ambiguous identifiers will raise an error.
SeqRepo favors identifiers from [identifiers.org](identifiers.org)
whenever available. Examples include
[refseq](https://registry.identifiers.org/registry/refseq) and
[ensembl](https://registry.identifiers.org/registry/ensembl).
`seqrepo-rest-service
<https://github.com/biocommons/seqrepo-rest-service>`__ provides a
REST interface and docker image.
Released under the Apache License, 2.0.
|ci_rel| | |cov| | |pypi_rel| | `ChangeLog <https://github.com/biocommons/biocommons.seqrepo/tree/master/docs/changelog/0.5>`_
Citation
!!!!!!!!
| Hart RK, Prlić A (2020)
| SeqRepo: A system for managing local collections of biological sequences.
| PLoS ONE 15(12): e0239883. https://doi.org/10.1371/journal.pone.0239883
Features
!!!!!!!!
* Timestamped, read-only snapshots.
* Space-efficient storage of sequences within a single snapshot and
across snapshots.
* Bandwidth-efficient transfer incremental updates.
* Fast fetching of sequence slices on chromosome-scale sequences.
* Precomputed digests that may be used as sequence aliases.
* Mappings of external aliases (i.e., accessions or identifiers like
NM_013305.4) to sequences.
Deployments Scenarios
!!!!!!!!!!!!!!!!!!!!!
* Local read-only archive, mirrored from public site,
accessed via Python API (see `Mirroring documentation <docs/mirror.rst>`__)
* Local read-write archive, maintained with command
line utility and/or API (see `Command Line Interface documentation
<docs/cli.rst>`__).
* Docker data-only container that may be linked to application container.
* SeqRepo and refget REST API for local or remote access (see `seqrepo-rest-service <https://github.com/biocommons/seqrepo-rest-service>`__)
Technical Quick Peek
!!!!!!!!!!!!!!!!!!!!
Within a single snapshot, sequences are stored *non-redundantly* and
*compressed* in an add-only journalled filesystem structure. A
truncated SHA-512 hash is used to assess uniquness and as an
internal id. (The digest is truncated for space efficiency.)
Sequences are compressed using the Block GZipped Format (`BGZF
<https://samtools.github.io/hts-specs/SAMv1.pdf>`__)), which enables
pysam to provide fast random access to compressed sequences. (Variable
compression typically makes random access impossible.)
Sequence files are immutable, thereby enabling the use of hardlinks
across snapshots and eliminating redundant transfers (e.g., with
rsync).
Each sequence id is associated with a namespaced alias in a sqlite
database. Such as ``<seguid,rvvuhY0FxFLNwf10FXFIrSQ7AvQ>``,
``<NCBI,NP_004009.1>``, ``<gi,5032303>``,
``<ensembl-75ENSP00000354464>``, ``<ensembl-85,ENSP00000354464.4>``.
The sqlite database is mutable across releases.
For calibration, recent releases that include 3 human genome
assemblies (including patches), and full RefSeq sets (NM, NR, NP, NT,
XM, and XP) consumes approximately 8GB. The minimum marginal size for
additional snapshots is approximately 2GB (for the sqlite database,
which is not hardlinked).
For more information, see `<docs/design.rst>`__.
Requirements
!!!!!!!!!!!!
Reading a sequence repository requires several Python packages, all of
which are available from pypi. Installation should be as simple as
`pip install biocommons.seqrepo`.
*Writing* sequence files also requires ``bgzip``, which provided in
the `htslib <https://github.com/samtools/htslib>`__ repo. Ubuntu users
should install the ``tabix`` package with ``sudo apt install tabix``.
Development and deployments are on Ubuntu. Other systems may work but
are not tested. Patches to get other systems working would be
welcomed.
**Mac Developers** If you get "xcrun: error: invalid active developer
path", you need to install XCode. See this `StackOverflow answer
<https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a>`__.
Quick Start
!!!!!!!!!!!
On Ubuntu 16.04::
$ sudo apt install -y python3-dev gcc zlib1g-dev tabix
$ pip install seqrepo
$ sudo mkdir /usr/local/share/seqrepo
$ sudo chown $USER /usr/local/share/seqrepo
$ seqrepo pull -i 2018-11-26
$ seqrepo show-status -i 2018-11-26
seqrepo 0.2.3.post3.dev8+nb8298bd62283
root directory: /usr/local/share/seqrepo/2018-11-26, 7.9 GB
backends: fastadir (schema 1), seqaliasdb (schema 1)
sequences: 773587 sequences, 93051609959 residues, 192 files
aliases: 5579572 aliases, 5480085 current, 26 namespaces, 773587 sequences
# Simple Pythonic interface to sequences
>> from biocommons.seqrepo import SeqRepo
>> sr = SeqRepo("/usr/local/share/seqrepo/latest")
>> sr["NC_000001.11"][780000:780020]
'TGGTGGCACGCGCTTGTAGT'
# Or, use the seqrepo shell for even easier access
$ seqrepo start-shell -i 2018-11-26
In [1]: sr["NC_000001.11"][780000:780020]
Out[1]: 'TGGTGGCACGCGCTTGTAGT'
# N.B. The following output is edited for simplicity
$ seqrepo export -i 2018-11-26 | head -n100
>SHA1:9a2acba3dd7603f... SEGUID:mirLo912A/MppLuS1cUyFMduLUQ Ensembl-85:GENSCAN00000003538 ...
MDSPLREDDSQTCARLWEAEVKRHSLEGLTVFGTAVQIHNVQRRAIRAKGTQEAQAELLCRGPRLLDRFLEDACILKEGRGTDTGQHCRGDARISSHLEA
SGTHIQLLALFLVSSSDTPPSLLRFCHALEHDIRYNSSFDSYYPLSPHSRHNDDLQTPSSHLGYIITVPDPTLPLTFASLYLGMAPCTSMGSSSMGIFQS
QRIHAFMKGKNKWDEYEGRKESWKIRSNSQTGEPTF
>SHA1:ca996b263102b1... SEGUID:yplrJjECsVqQufeYy0HkDD16z58 NCBI:XR_001733142.1 gi:1034683989
TTTACGTCTTTCTGGGAATTTATACTGGAAGTATACTTACCTCTGTGCAAAATTGCAAATATATAAGGTAATTCATTCCAGCATTGCTTATATTAGGTTG
AACTATGTAACATTGACATTGATGTGAATCAAAAATGGTTGAAGGCTGGCAGTTTCATATGATTCAGCCTATAATAGCAAAAGATTGAAAAAATCCATTA
ATACAGTGTGGTTCAAAAAAATTTGTTGTATCAAGGTAAAATAATAGCCTGAATATAATTAAGATAGTCTGTGTATACATCGATGAAAACATTGCCAATA
See `Installation <docs/installation.rst>`__ and `Mirroring
<docs/mirror.rst>`__ for more information.
Environment Variables
!!!!!!!!!!!!!!!!!!!!!
SEQREPO_LRU_CACHE_MAXSIZE sets the lru_cache maxsize for the sqlite query response caching. It defaults to 1 million but can also be set to "none" to be unlimited.
Developing
!!!!!!!!!!
Here's how to get started developing::
python3.6 -m venv
source venv/bin/activate
pip install -U setuptools pip
make develop
.. |pypi_rel| image:: https://badge.fury.io/py/biocommons.seqrepo.png
:target: https://pypi.org/pypi?name=biocommons.seqrepo
:align: middle
.. |ci_rel| image:: https://travis-ci.org/biocommons/biocommons.seqrepo.svg?branch=master
:target: https://travis-ci.org/biocommons/biocommons.seqrepo
:align: middle
.. |cov| image:: https://coveralls.io/repos/github/biocommons/biocommons.seqrepo/badge.svg?branch=
:target: https://coveralls.io/github/biocommons/biocommons.seqrepo?branch=
%package -n python3-biocommons.seqrepo
Summary: Non-redundant, compressed, journalled, file-based storage for biological sequences
Provides: python-biocommons.seqrepo
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-biocommons.seqrepo
biocommons.seqrepo
!!!!!!!!!!!!!!!!!!
Python package for writing and reading a local collection of
biological sequences. The repository is non-redundant, compressed,
and journalled, making it efficient to store and transfer multiple
snapshots.
Clients refer to sequences and metadata using familiar identifiers,
such as NM_000551.3 or GRCh38:1, or any of several hash-based
identifiers. The interface supports fast slicing of arbitrary regions
of large sequences.
A "fully-qualified" identifier includes a namespace to disambiguate
accessions (e.g., "1" in GRCh37 and GRCh38). If the namespace is
provided, seqrepo uses it as-is. If the namespace is not provided and
the unqualified identifier refers to a unique sequence, it is
returned; otherwise, ambiguous identifiers will raise an error.
SeqRepo favors identifiers from [identifiers.org](identifiers.org)
whenever available. Examples include
[refseq](https://registry.identifiers.org/registry/refseq) and
[ensembl](https://registry.identifiers.org/registry/ensembl).
`seqrepo-rest-service
<https://github.com/biocommons/seqrepo-rest-service>`__ provides a
REST interface and docker image.
Released under the Apache License, 2.0.
|ci_rel| | |cov| | |pypi_rel| | `ChangeLog <https://github.com/biocommons/biocommons.seqrepo/tree/master/docs/changelog/0.5>`_
Citation
!!!!!!!!
| Hart RK, Prlić A (2020)
| SeqRepo: A system for managing local collections of biological sequences.
| PLoS ONE 15(12): e0239883. https://doi.org/10.1371/journal.pone.0239883
Features
!!!!!!!!
* Timestamped, read-only snapshots.
* Space-efficient storage of sequences within a single snapshot and
across snapshots.
* Bandwidth-efficient transfer incremental updates.
* Fast fetching of sequence slices on chromosome-scale sequences.
* Precomputed digests that may be used as sequence aliases.
* Mappings of external aliases (i.e., accessions or identifiers like
NM_013305.4) to sequences.
Deployments Scenarios
!!!!!!!!!!!!!!!!!!!!!
* Local read-only archive, mirrored from public site,
accessed via Python API (see `Mirroring documentation <docs/mirror.rst>`__)
* Local read-write archive, maintained with command
line utility and/or API (see `Command Line Interface documentation
<docs/cli.rst>`__).
* Docker data-only container that may be linked to application container.
* SeqRepo and refget REST API for local or remote access (see `seqrepo-rest-service <https://github.com/biocommons/seqrepo-rest-service>`__)
Technical Quick Peek
!!!!!!!!!!!!!!!!!!!!
Within a single snapshot, sequences are stored *non-redundantly* and
*compressed* in an add-only journalled filesystem structure. A
truncated SHA-512 hash is used to assess uniquness and as an
internal id. (The digest is truncated for space efficiency.)
Sequences are compressed using the Block GZipped Format (`BGZF
<https://samtools.github.io/hts-specs/SAMv1.pdf>`__)), which enables
pysam to provide fast random access to compressed sequences. (Variable
compression typically makes random access impossible.)
Sequence files are immutable, thereby enabling the use of hardlinks
across snapshots and eliminating redundant transfers (e.g., with
rsync).
Each sequence id is associated with a namespaced alias in a sqlite
database. Such as ``<seguid,rvvuhY0FxFLNwf10FXFIrSQ7AvQ>``,
``<NCBI,NP_004009.1>``, ``<gi,5032303>``,
``<ensembl-75ENSP00000354464>``, ``<ensembl-85,ENSP00000354464.4>``.
The sqlite database is mutable across releases.
For calibration, recent releases that include 3 human genome
assemblies (including patches), and full RefSeq sets (NM, NR, NP, NT,
XM, and XP) consumes approximately 8GB. The minimum marginal size for
additional snapshots is approximately 2GB (for the sqlite database,
which is not hardlinked).
For more information, see `<docs/design.rst>`__.
Requirements
!!!!!!!!!!!!
Reading a sequence repository requires several Python packages, all of
which are available from pypi. Installation should be as simple as
`pip install biocommons.seqrepo`.
*Writing* sequence files also requires ``bgzip``, which provided in
the `htslib <https://github.com/samtools/htslib>`__ repo. Ubuntu users
should install the ``tabix`` package with ``sudo apt install tabix``.
Development and deployments are on Ubuntu. Other systems may work but
are not tested. Patches to get other systems working would be
welcomed.
**Mac Developers** If you get "xcrun: error: invalid active developer
path", you need to install XCode. See this `StackOverflow answer
<https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a>`__.
Quick Start
!!!!!!!!!!!
On Ubuntu 16.04::
$ sudo apt install -y python3-dev gcc zlib1g-dev tabix
$ pip install seqrepo
$ sudo mkdir /usr/local/share/seqrepo
$ sudo chown $USER /usr/local/share/seqrepo
$ seqrepo pull -i 2018-11-26
$ seqrepo show-status -i 2018-11-26
seqrepo 0.2.3.post3.dev8+nb8298bd62283
root directory: /usr/local/share/seqrepo/2018-11-26, 7.9 GB
backends: fastadir (schema 1), seqaliasdb (schema 1)
sequences: 773587 sequences, 93051609959 residues, 192 files
aliases: 5579572 aliases, 5480085 current, 26 namespaces, 773587 sequences
# Simple Pythonic interface to sequences
>> from biocommons.seqrepo import SeqRepo
>> sr = SeqRepo("/usr/local/share/seqrepo/latest")
>> sr["NC_000001.11"][780000:780020]
'TGGTGGCACGCGCTTGTAGT'
# Or, use the seqrepo shell for even easier access
$ seqrepo start-shell -i 2018-11-26
In [1]: sr["NC_000001.11"][780000:780020]
Out[1]: 'TGGTGGCACGCGCTTGTAGT'
# N.B. The following output is edited for simplicity
$ seqrepo export -i 2018-11-26 | head -n100
>SHA1:9a2acba3dd7603f... SEGUID:mirLo912A/MppLuS1cUyFMduLUQ Ensembl-85:GENSCAN00000003538 ...
MDSPLREDDSQTCARLWEAEVKRHSLEGLTVFGTAVQIHNVQRRAIRAKGTQEAQAELLCRGPRLLDRFLEDACILKEGRGTDTGQHCRGDARISSHLEA
SGTHIQLLALFLVSSSDTPPSLLRFCHALEHDIRYNSSFDSYYPLSPHSRHNDDLQTPSSHLGYIITVPDPTLPLTFASLYLGMAPCTSMGSSSMGIFQS
QRIHAFMKGKNKWDEYEGRKESWKIRSNSQTGEPTF
>SHA1:ca996b263102b1... SEGUID:yplrJjECsVqQufeYy0HkDD16z58 NCBI:XR_001733142.1 gi:1034683989
TTTACGTCTTTCTGGGAATTTATACTGGAAGTATACTTACCTCTGTGCAAAATTGCAAATATATAAGGTAATTCATTCCAGCATTGCTTATATTAGGTTG
AACTATGTAACATTGACATTGATGTGAATCAAAAATGGTTGAAGGCTGGCAGTTTCATATGATTCAGCCTATAATAGCAAAAGATTGAAAAAATCCATTA
ATACAGTGTGGTTCAAAAAAATTTGTTGTATCAAGGTAAAATAATAGCCTGAATATAATTAAGATAGTCTGTGTATACATCGATGAAAACATTGCCAATA
See `Installation <docs/installation.rst>`__ and `Mirroring
<docs/mirror.rst>`__ for more information.
Environment Variables
!!!!!!!!!!!!!!!!!!!!!
SEQREPO_LRU_CACHE_MAXSIZE sets the lru_cache maxsize for the sqlite query response caching. It defaults to 1 million but can also be set to "none" to be unlimited.
Developing
!!!!!!!!!!
Here's how to get started developing::
python3.6 -m venv
source venv/bin/activate
pip install -U setuptools pip
make develop
.. |pypi_rel| image:: https://badge.fury.io/py/biocommons.seqrepo.png
:target: https://pypi.org/pypi?name=biocommons.seqrepo
:align: middle
.. |ci_rel| image:: https://travis-ci.org/biocommons/biocommons.seqrepo.svg?branch=master
:target: https://travis-ci.org/biocommons/biocommons.seqrepo
:align: middle
.. |cov| image:: https://coveralls.io/repos/github/biocommons/biocommons.seqrepo/badge.svg?branch=
:target: https://coveralls.io/github/biocommons/biocommons.seqrepo?branch=
%package help
Summary: Development documents and examples for biocommons.seqrepo
Provides: python3-biocommons.seqrepo-doc
%description help
biocommons.seqrepo
!!!!!!!!!!!!!!!!!!
Python package for writing and reading a local collection of
biological sequences. The repository is non-redundant, compressed,
and journalled, making it efficient to store and transfer multiple
snapshots.
Clients refer to sequences and metadata using familiar identifiers,
such as NM_000551.3 or GRCh38:1, or any of several hash-based
identifiers. The interface supports fast slicing of arbitrary regions
of large sequences.
A "fully-qualified" identifier includes a namespace to disambiguate
accessions (e.g., "1" in GRCh37 and GRCh38). If the namespace is
provided, seqrepo uses it as-is. If the namespace is not provided and
the unqualified identifier refers to a unique sequence, it is
returned; otherwise, ambiguous identifiers will raise an error.
SeqRepo favors identifiers from [identifiers.org](identifiers.org)
whenever available. Examples include
[refseq](https://registry.identifiers.org/registry/refseq) and
[ensembl](https://registry.identifiers.org/registry/ensembl).
`seqrepo-rest-service
<https://github.com/biocommons/seqrepo-rest-service>`__ provides a
REST interface and docker image.
Released under the Apache License, 2.0.
|ci_rel| | |cov| | |pypi_rel| | `ChangeLog <https://github.com/biocommons/biocommons.seqrepo/tree/master/docs/changelog/0.5>`_
Citation
!!!!!!!!
| Hart RK, Prlić A (2020)
| SeqRepo: A system for managing local collections of biological sequences.
| PLoS ONE 15(12): e0239883. https://doi.org/10.1371/journal.pone.0239883
Features
!!!!!!!!
* Timestamped, read-only snapshots.
* Space-efficient storage of sequences within a single snapshot and
across snapshots.
* Bandwidth-efficient transfer incremental updates.
* Fast fetching of sequence slices on chromosome-scale sequences.
* Precomputed digests that may be used as sequence aliases.
* Mappings of external aliases (i.e., accessions or identifiers like
NM_013305.4) to sequences.
Deployments Scenarios
!!!!!!!!!!!!!!!!!!!!!
* Local read-only archive, mirrored from public site,
accessed via Python API (see `Mirroring documentation <docs/mirror.rst>`__)
* Local read-write archive, maintained with command
line utility and/or API (see `Command Line Interface documentation
<docs/cli.rst>`__).
* Docker data-only container that may be linked to application container.
* SeqRepo and refget REST API for local or remote access (see `seqrepo-rest-service <https://github.com/biocommons/seqrepo-rest-service>`__)
Technical Quick Peek
!!!!!!!!!!!!!!!!!!!!
Within a single snapshot, sequences are stored *non-redundantly* and
*compressed* in an add-only journalled filesystem structure. A
truncated SHA-512 hash is used to assess uniquness and as an
internal id. (The digest is truncated for space efficiency.)
Sequences are compressed using the Block GZipped Format (`BGZF
<https://samtools.github.io/hts-specs/SAMv1.pdf>`__)), which enables
pysam to provide fast random access to compressed sequences. (Variable
compression typically makes random access impossible.)
Sequence files are immutable, thereby enabling the use of hardlinks
across snapshots and eliminating redundant transfers (e.g., with
rsync).
Each sequence id is associated with a namespaced alias in a sqlite
database. Such as ``<seguid,rvvuhY0FxFLNwf10FXFIrSQ7AvQ>``,
``<NCBI,NP_004009.1>``, ``<gi,5032303>``,
``<ensembl-75ENSP00000354464>``, ``<ensembl-85,ENSP00000354464.4>``.
The sqlite database is mutable across releases.
For calibration, recent releases that include 3 human genome
assemblies (including patches), and full RefSeq sets (NM, NR, NP, NT,
XM, and XP) consumes approximately 8GB. The minimum marginal size for
additional snapshots is approximately 2GB (for the sqlite database,
which is not hardlinked).
For more information, see `<docs/design.rst>`__.
Requirements
!!!!!!!!!!!!
Reading a sequence repository requires several Python packages, all of
which are available from pypi. Installation should be as simple as
`pip install biocommons.seqrepo`.
*Writing* sequence files also requires ``bgzip``, which provided in
the `htslib <https://github.com/samtools/htslib>`__ repo. Ubuntu users
should install the ``tabix`` package with ``sudo apt install tabix``.
Development and deployments are on Ubuntu. Other systems may work but
are not tested. Patches to get other systems working would be
welcomed.
**Mac Developers** If you get "xcrun: error: invalid active developer
path", you need to install XCode. See this `StackOverflow answer
<https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a>`__.
Quick Start
!!!!!!!!!!!
On Ubuntu 16.04::
$ sudo apt install -y python3-dev gcc zlib1g-dev tabix
$ pip install seqrepo
$ sudo mkdir /usr/local/share/seqrepo
$ sudo chown $USER /usr/local/share/seqrepo
$ seqrepo pull -i 2018-11-26
$ seqrepo show-status -i 2018-11-26
seqrepo 0.2.3.post3.dev8+nb8298bd62283
root directory: /usr/local/share/seqrepo/2018-11-26, 7.9 GB
backends: fastadir (schema 1), seqaliasdb (schema 1)
sequences: 773587 sequences, 93051609959 residues, 192 files
aliases: 5579572 aliases, 5480085 current, 26 namespaces, 773587 sequences
# Simple Pythonic interface to sequences
>> from biocommons.seqrepo import SeqRepo
>> sr = SeqRepo("/usr/local/share/seqrepo/latest")
>> sr["NC_000001.11"][780000:780020]
'TGGTGGCACGCGCTTGTAGT'
# Or, use the seqrepo shell for even easier access
$ seqrepo start-shell -i 2018-11-26
In [1]: sr["NC_000001.11"][780000:780020]
Out[1]: 'TGGTGGCACGCGCTTGTAGT'
# N.B. The following output is edited for simplicity
$ seqrepo export -i 2018-11-26 | head -n100
>SHA1:9a2acba3dd7603f... SEGUID:mirLo912A/MppLuS1cUyFMduLUQ Ensembl-85:GENSCAN00000003538 ...
MDSPLREDDSQTCARLWEAEVKRHSLEGLTVFGTAVQIHNVQRRAIRAKGTQEAQAELLCRGPRLLDRFLEDACILKEGRGTDTGQHCRGDARISSHLEA
SGTHIQLLALFLVSSSDTPPSLLRFCHALEHDIRYNSSFDSYYPLSPHSRHNDDLQTPSSHLGYIITVPDPTLPLTFASLYLGMAPCTSMGSSSMGIFQS
QRIHAFMKGKNKWDEYEGRKESWKIRSNSQTGEPTF
>SHA1:ca996b263102b1... SEGUID:yplrJjECsVqQufeYy0HkDD16z58 NCBI:XR_001733142.1 gi:1034683989
TTTACGTCTTTCTGGGAATTTATACTGGAAGTATACTTACCTCTGTGCAAAATTGCAAATATATAAGGTAATTCATTCCAGCATTGCTTATATTAGGTTG
AACTATGTAACATTGACATTGATGTGAATCAAAAATGGTTGAAGGCTGGCAGTTTCATATGATTCAGCCTATAATAGCAAAAGATTGAAAAAATCCATTA
ATACAGTGTGGTTCAAAAAAATTTGTTGTATCAAGGTAAAATAATAGCCTGAATATAATTAAGATAGTCTGTGTATACATCGATGAAAACATTGCCAATA
See `Installation <docs/installation.rst>`__ and `Mirroring
<docs/mirror.rst>`__ for more information.
Environment Variables
!!!!!!!!!!!!!!!!!!!!!
SEQREPO_LRU_CACHE_MAXSIZE sets the lru_cache maxsize for the sqlite query response caching. It defaults to 1 million but can also be set to "none" to be unlimited.
Developing
!!!!!!!!!!
Here's how to get started developing::
python3.6 -m venv
source venv/bin/activate
pip install -U setuptools pip
make develop
.. |pypi_rel| image:: https://badge.fury.io/py/biocommons.seqrepo.png
:target: https://pypi.org/pypi?name=biocommons.seqrepo
:align: middle
.. |ci_rel| image:: https://travis-ci.org/biocommons/biocommons.seqrepo.svg?branch=master
:target: https://travis-ci.org/biocommons/biocommons.seqrepo
:align: middle
.. |cov| image:: https://coveralls.io/repos/github/biocommons/biocommons.seqrepo/badge.svg?branch=
:target: https://coveralls.io/github/biocommons/biocommons.seqrepo?branch=
%prep
%autosetup -n biocommons.seqrepo-0.6.5
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-biocommons.seqrepo -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6.5-1
- Package Spec generated
|