rsbio-seq 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,887 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "adler2"
7
+ version = "2.0.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
10
+
11
+ [[package]]
12
+ name = "aho-corasick"
13
+ version = "1.1.3"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
16
+ dependencies = [
17
+ "memchr",
18
+ ]
19
+
20
+ [[package]]
21
+ name = "anyhow"
22
+ version = "1.0.86"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
25
+
26
+ [[package]]
27
+ name = "approx"
28
+ version = "0.5.1"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
31
+ dependencies = [
32
+ "num-traits",
33
+ ]
34
+
35
+ [[package]]
36
+ name = "autocfg"
37
+ version = "1.3.0"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
40
+
41
+ [[package]]
42
+ name = "bio"
43
+ version = "2.0.1"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "e8cbd545253762ecf9ef741f2c49f07c06a0ce4d041d74ee9c3f1ce0e2d5446e"
46
+ dependencies = [
47
+ "anyhow",
48
+ "approx",
49
+ "bio-types",
50
+ "bit-set",
51
+ "bv",
52
+ "bytecount",
53
+ "csv",
54
+ "custom_derive",
55
+ "editdistancek",
56
+ "enum-map",
57
+ "fxhash",
58
+ "itertools",
59
+ "itertools-num",
60
+ "lazy_static",
61
+ "multimap",
62
+ "ndarray",
63
+ "newtype_derive",
64
+ "num-integer",
65
+ "num-traits",
66
+ "ordered-float",
67
+ "petgraph",
68
+ "rand",
69
+ "regex",
70
+ "serde",
71
+ "serde_derive",
72
+ "statrs",
73
+ "strum",
74
+ "strum_macros",
75
+ "thiserror",
76
+ "triple_accel",
77
+ "vec_map",
78
+ ]
79
+
80
+ [[package]]
81
+ name = "bio-types"
82
+ version = "1.0.4"
83
+ source = "registry+https://github.com/rust-lang/crates.io-index"
84
+ checksum = "f4dcf54f8b7f51450207d54780bab09c05f30b8b0caa991545082842e466ad7e"
85
+ dependencies = [
86
+ "derive-new",
87
+ "lazy_static",
88
+ "regex",
89
+ "strum_macros",
90
+ "thiserror",
91
+ ]
92
+
93
+ [[package]]
94
+ name = "bit-set"
95
+ version = "0.8.0"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
98
+ dependencies = [
99
+ "bit-vec",
100
+ ]
101
+
102
+ [[package]]
103
+ name = "bit-vec"
104
+ version = "0.8.0"
105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
106
+ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
107
+
108
+ [[package]]
109
+ name = "bv"
110
+ version = "0.11.1"
111
+ source = "registry+https://github.com/rust-lang/crates.io-index"
112
+ checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
113
+ dependencies = [
114
+ "feature-probe",
115
+ "serde",
116
+ ]
117
+
118
+ [[package]]
119
+ name = "bytecount"
120
+ version = "0.6.8"
121
+ source = "registry+https://github.com/rust-lang/crates.io-index"
122
+ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce"
123
+
124
+ [[package]]
125
+ name = "bytemuck"
126
+ version = "1.17.1"
127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
128
+ checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2"
129
+
130
+ [[package]]
131
+ name = "byteorder"
132
+ version = "1.5.0"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
135
+
136
+ [[package]]
137
+ name = "cfg-if"
138
+ version = "1.0.0"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
141
+
142
+ [[package]]
143
+ name = "crc32fast"
144
+ version = "1.4.2"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
147
+ dependencies = [
148
+ "cfg-if",
149
+ ]
150
+
151
+ [[package]]
152
+ name = "csv"
153
+ version = "1.3.0"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
156
+ dependencies = [
157
+ "csv-core",
158
+ "itoa",
159
+ "ryu",
160
+ "serde",
161
+ ]
162
+
163
+ [[package]]
164
+ name = "csv-core"
165
+ version = "0.1.11"
166
+ source = "registry+https://github.com/rust-lang/crates.io-index"
167
+ checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
168
+ dependencies = [
169
+ "memchr",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "custom_derive"
174
+ version = "0.1.7"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"
177
+
178
+ [[package]]
179
+ name = "derive-new"
180
+ version = "0.6.0"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad"
183
+ dependencies = [
184
+ "proc-macro2",
185
+ "quote",
186
+ "syn",
187
+ ]
188
+
189
+ [[package]]
190
+ name = "editdistancek"
191
+ version = "1.0.2"
192
+ source = "registry+https://github.com/rust-lang/crates.io-index"
193
+ checksum = "3e02df23d5b1c6f9e69fa603b890378123b93073df998a21e6e33b9db0a32613"
194
+
195
+ [[package]]
196
+ name = "either"
197
+ version = "1.13.0"
198
+ source = "registry+https://github.com/rust-lang/crates.io-index"
199
+ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
200
+
201
+ [[package]]
202
+ name = "enum-map"
203
+ version = "2.7.3"
204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
205
+ checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9"
206
+ dependencies = [
207
+ "enum-map-derive",
208
+ ]
209
+
210
+ [[package]]
211
+ name = "enum-map-derive"
212
+ version = "0.17.0"
213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
214
+ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb"
215
+ dependencies = [
216
+ "proc-macro2",
217
+ "quote",
218
+ "syn",
219
+ ]
220
+
221
+ [[package]]
222
+ name = "equivalent"
223
+ version = "1.0.1"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
226
+
227
+ [[package]]
228
+ name = "feature-probe"
229
+ version = "0.1.1"
230
+ source = "registry+https://github.com/rust-lang/crates.io-index"
231
+ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
232
+
233
+ [[package]]
234
+ name = "fixedbitset"
235
+ version = "0.4.2"
236
+ source = "registry+https://github.com/rust-lang/crates.io-index"
237
+ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
238
+
239
+ [[package]]
240
+ name = "flate2"
241
+ version = "1.0.33"
242
+ source = "registry+https://github.com/rust-lang/crates.io-index"
243
+ checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253"
244
+ dependencies = [
245
+ "crc32fast",
246
+ "miniz_oxide",
247
+ ]
248
+
249
+ [[package]]
250
+ name = "fxhash"
251
+ version = "0.2.1"
252
+ source = "registry+https://github.com/rust-lang/crates.io-index"
253
+ checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
254
+ dependencies = [
255
+ "byteorder",
256
+ ]
257
+
258
+ [[package]]
259
+ name = "getrandom"
260
+ version = "0.2.15"
261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
262
+ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
263
+ dependencies = [
264
+ "cfg-if",
265
+ "libc",
266
+ "wasi",
267
+ ]
268
+
269
+ [[package]]
270
+ name = "hashbrown"
271
+ version = "0.14.5"
272
+ source = "registry+https://github.com/rust-lang/crates.io-index"
273
+ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
274
+
275
+ [[package]]
276
+ name = "heck"
277
+ version = "0.5.0"
278
+ source = "registry+https://github.com/rust-lang/crates.io-index"
279
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
280
+
281
+ [[package]]
282
+ name = "indexmap"
283
+ version = "2.4.0"
284
+ source = "registry+https://github.com/rust-lang/crates.io-index"
285
+ checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c"
286
+ dependencies = [
287
+ "equivalent",
288
+ "hashbrown",
289
+ ]
290
+
291
+ [[package]]
292
+ name = "indoc"
293
+ version = "2.0.5"
294
+ source = "registry+https://github.com/rust-lang/crates.io-index"
295
+ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
296
+
297
+ [[package]]
298
+ name = "itertools"
299
+ version = "0.13.0"
300
+ source = "registry+https://github.com/rust-lang/crates.io-index"
301
+ checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
302
+ dependencies = [
303
+ "either",
304
+ ]
305
+
306
+ [[package]]
307
+ name = "itertools-num"
308
+ version = "0.1.3"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "a872a22f9e6f7521ca557660adb96dd830e54f0f490fa115bb55dd69d38b27e7"
311
+ dependencies = [
312
+ "num-traits",
313
+ ]
314
+
315
+ [[package]]
316
+ name = "itoa"
317
+ version = "1.0.11"
318
+ source = "registry+https://github.com/rust-lang/crates.io-index"
319
+ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
320
+
321
+ [[package]]
322
+ name = "lazy_static"
323
+ version = "1.5.0"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
326
+
327
+ [[package]]
328
+ name = "libc"
329
+ version = "0.2.158"
330
+ source = "registry+https://github.com/rust-lang/crates.io-index"
331
+ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
332
+
333
+ [[package]]
334
+ name = "libm"
335
+ version = "0.2.8"
336
+ source = "registry+https://github.com/rust-lang/crates.io-index"
337
+ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
338
+
339
+ [[package]]
340
+ name = "matrixmultiply"
341
+ version = "0.3.9"
342
+ source = "registry+https://github.com/rust-lang/crates.io-index"
343
+ checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a"
344
+ dependencies = [
345
+ "autocfg",
346
+ "rawpointer",
347
+ ]
348
+
349
+ [[package]]
350
+ name = "memchr"
351
+ version = "2.7.4"
352
+ source = "registry+https://github.com/rust-lang/crates.io-index"
353
+ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
354
+
355
+ [[package]]
356
+ name = "memoffset"
357
+ version = "0.9.1"
358
+ source = "registry+https://github.com/rust-lang/crates.io-index"
359
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
360
+ dependencies = [
361
+ "autocfg",
362
+ ]
363
+
364
+ [[package]]
365
+ name = "miniz_oxide"
366
+ version = "0.8.0"
367
+ source = "registry+https://github.com/rust-lang/crates.io-index"
368
+ checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
369
+ dependencies = [
370
+ "adler2",
371
+ ]
372
+
373
+ [[package]]
374
+ name = "multimap"
375
+ version = "0.10.0"
376
+ source = "registry+https://github.com/rust-lang/crates.io-index"
377
+ checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03"
378
+ dependencies = [
379
+ "serde",
380
+ ]
381
+
382
+ [[package]]
383
+ name = "nalgebra"
384
+ version = "0.32.6"
385
+ source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4"
387
+ dependencies = [
388
+ "approx",
389
+ "matrixmultiply",
390
+ "nalgebra-macros",
391
+ "num-complex",
392
+ "num-rational",
393
+ "num-traits",
394
+ "rand",
395
+ "rand_distr",
396
+ "simba",
397
+ "typenum",
398
+ ]
399
+
400
+ [[package]]
401
+ name = "nalgebra-macros"
402
+ version = "0.2.2"
403
+ source = "registry+https://github.com/rust-lang/crates.io-index"
404
+ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc"
405
+ dependencies = [
406
+ "proc-macro2",
407
+ "quote",
408
+ "syn",
409
+ ]
410
+
411
+ [[package]]
412
+ name = "ndarray"
413
+ version = "0.15.6"
414
+ source = "registry+https://github.com/rust-lang/crates.io-index"
415
+ checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32"
416
+ dependencies = [
417
+ "matrixmultiply",
418
+ "num-complex",
419
+ "num-integer",
420
+ "num-traits",
421
+ "rawpointer",
422
+ ]
423
+
424
+ [[package]]
425
+ name = "newtype_derive"
426
+ version = "0.1.6"
427
+ source = "registry+https://github.com/rust-lang/crates.io-index"
428
+ checksum = "ac8cd24d9f185bb7223958d8c1ff7a961b74b1953fd05dba7cc568a63b3861ec"
429
+ dependencies = [
430
+ "rustc_version",
431
+ ]
432
+
433
+ [[package]]
434
+ name = "num-complex"
435
+ version = "0.4.6"
436
+ source = "registry+https://github.com/rust-lang/crates.io-index"
437
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
438
+ dependencies = [
439
+ "num-traits",
440
+ ]
441
+
442
+ [[package]]
443
+ name = "num-integer"
444
+ version = "0.1.46"
445
+ source = "registry+https://github.com/rust-lang/crates.io-index"
446
+ checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
447
+ dependencies = [
448
+ "num-traits",
449
+ ]
450
+
451
+ [[package]]
452
+ name = "num-rational"
453
+ version = "0.4.2"
454
+ source = "registry+https://github.com/rust-lang/crates.io-index"
455
+ checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
456
+ dependencies = [
457
+ "num-integer",
458
+ "num-traits",
459
+ ]
460
+
461
+ [[package]]
462
+ name = "num-traits"
463
+ version = "0.2.19"
464
+ source = "registry+https://github.com/rust-lang/crates.io-index"
465
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
466
+ dependencies = [
467
+ "autocfg",
468
+ "libm",
469
+ ]
470
+
471
+ [[package]]
472
+ name = "once_cell"
473
+ version = "1.19.0"
474
+ source = "registry+https://github.com/rust-lang/crates.io-index"
475
+ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
476
+
477
+ [[package]]
478
+ name = "ordered-float"
479
+ version = "4.2.2"
480
+ source = "registry+https://github.com/rust-lang/crates.io-index"
481
+ checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6"
482
+ dependencies = [
483
+ "num-traits",
484
+ ]
485
+
486
+ [[package]]
487
+ name = "paste"
488
+ version = "1.0.15"
489
+ source = "registry+https://github.com/rust-lang/crates.io-index"
490
+ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
491
+
492
+ [[package]]
493
+ name = "petgraph"
494
+ version = "0.6.5"
495
+ source = "registry+https://github.com/rust-lang/crates.io-index"
496
+ checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
497
+ dependencies = [
498
+ "fixedbitset",
499
+ "indexmap",
500
+ ]
501
+
502
+ [[package]]
503
+ name = "portable-atomic"
504
+ version = "1.7.0"
505
+ source = "registry+https://github.com/rust-lang/crates.io-index"
506
+ checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
507
+
508
+ [[package]]
509
+ name = "ppv-lite86"
510
+ version = "0.2.20"
511
+ source = "registry+https://github.com/rust-lang/crates.io-index"
512
+ checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
513
+ dependencies = [
514
+ "zerocopy",
515
+ ]
516
+
517
+ [[package]]
518
+ name = "proc-macro2"
519
+ version = "1.0.86"
520
+ source = "registry+https://github.com/rust-lang/crates.io-index"
521
+ checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
522
+ dependencies = [
523
+ "unicode-ident",
524
+ ]
525
+
526
+ [[package]]
527
+ name = "pyo3"
528
+ version = "0.22.2"
529
+ source = "registry+https://github.com/rust-lang/crates.io-index"
530
+ checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433"
531
+ dependencies = [
532
+ "cfg-if",
533
+ "indoc",
534
+ "libc",
535
+ "memoffset",
536
+ "once_cell",
537
+ "portable-atomic",
538
+ "pyo3-build-config",
539
+ "pyo3-ffi",
540
+ "pyo3-macros",
541
+ "unindent",
542
+ ]
543
+
544
+ [[package]]
545
+ name = "pyo3-build-config"
546
+ version = "0.22.2"
547
+ source = "registry+https://github.com/rust-lang/crates.io-index"
548
+ checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8"
549
+ dependencies = [
550
+ "once_cell",
551
+ "target-lexicon",
552
+ ]
553
+
554
+ [[package]]
555
+ name = "pyo3-ffi"
556
+ version = "0.22.2"
557
+ source = "registry+https://github.com/rust-lang/crates.io-index"
558
+ checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6"
559
+ dependencies = [
560
+ "libc",
561
+ "pyo3-build-config",
562
+ ]
563
+
564
+ [[package]]
565
+ name = "pyo3-macros"
566
+ version = "0.22.2"
567
+ source = "registry+https://github.com/rust-lang/crates.io-index"
568
+ checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206"
569
+ dependencies = [
570
+ "proc-macro2",
571
+ "pyo3-macros-backend",
572
+ "quote",
573
+ "syn",
574
+ ]
575
+
576
+ [[package]]
577
+ name = "pyo3-macros-backend"
578
+ version = "0.22.2"
579
+ source = "registry+https://github.com/rust-lang/crates.io-index"
580
+ checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372"
581
+ dependencies = [
582
+ "heck",
583
+ "proc-macro2",
584
+ "pyo3-build-config",
585
+ "quote",
586
+ "syn",
587
+ ]
588
+
589
+ [[package]]
590
+ name = "quote"
591
+ version = "1.0.37"
592
+ source = "registry+https://github.com/rust-lang/crates.io-index"
593
+ checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
594
+ dependencies = [
595
+ "proc-macro2",
596
+ ]
597
+
598
+ [[package]]
599
+ name = "rand"
600
+ version = "0.8.5"
601
+ source = "registry+https://github.com/rust-lang/crates.io-index"
602
+ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
603
+ dependencies = [
604
+ "libc",
605
+ "rand_chacha",
606
+ "rand_core",
607
+ ]
608
+
609
+ [[package]]
610
+ name = "rand_chacha"
611
+ version = "0.3.1"
612
+ source = "registry+https://github.com/rust-lang/crates.io-index"
613
+ checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
614
+ dependencies = [
615
+ "ppv-lite86",
616
+ "rand_core",
617
+ ]
618
+
619
+ [[package]]
620
+ name = "rand_core"
621
+ version = "0.6.4"
622
+ source = "registry+https://github.com/rust-lang/crates.io-index"
623
+ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
624
+ dependencies = [
625
+ "getrandom",
626
+ ]
627
+
628
+ [[package]]
629
+ name = "rand_distr"
630
+ version = "0.4.3"
631
+ source = "registry+https://github.com/rust-lang/crates.io-index"
632
+ checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31"
633
+ dependencies = [
634
+ "num-traits",
635
+ "rand",
636
+ ]
637
+
638
+ [[package]]
639
+ name = "rawpointer"
640
+ version = "0.2.1"
641
+ source = "registry+https://github.com/rust-lang/crates.io-index"
642
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
643
+
644
+ [[package]]
645
+ name = "regex"
646
+ version = "1.10.6"
647
+ source = "registry+https://github.com/rust-lang/crates.io-index"
648
+ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
649
+ dependencies = [
650
+ "aho-corasick",
651
+ "memchr",
652
+ "regex-automata",
653
+ "regex-syntax",
654
+ ]
655
+
656
+ [[package]]
657
+ name = "regex-automata"
658
+ version = "0.4.7"
659
+ source = "registry+https://github.com/rust-lang/crates.io-index"
660
+ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
661
+ dependencies = [
662
+ "aho-corasick",
663
+ "memchr",
664
+ "regex-syntax",
665
+ ]
666
+
667
+ [[package]]
668
+ name = "regex-syntax"
669
+ version = "0.8.4"
670
+ source = "registry+https://github.com/rust-lang/crates.io-index"
671
+ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
672
+
673
+ [[package]]
674
+ name = "rsbio-seq"
675
+ version = "0.1.0"
676
+ dependencies = [
677
+ "bio",
678
+ "flate2",
679
+ "pyo3",
680
+ ]
681
+
682
+ [[package]]
683
+ name = "rustc_version"
684
+ version = "0.1.7"
685
+ source = "registry+https://github.com/rust-lang/crates.io-index"
686
+ checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
687
+ dependencies = [
688
+ "semver",
689
+ ]
690
+
691
+ [[package]]
692
+ name = "rustversion"
693
+ version = "1.0.17"
694
+ source = "registry+https://github.com/rust-lang/crates.io-index"
695
+ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
696
+
697
+ [[package]]
698
+ name = "ryu"
699
+ version = "1.0.18"
700
+ source = "registry+https://github.com/rust-lang/crates.io-index"
701
+ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
702
+
703
+ [[package]]
704
+ name = "safe_arch"
705
+ version = "0.7.2"
706
+ source = "registry+https://github.com/rust-lang/crates.io-index"
707
+ checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a"
708
+ dependencies = [
709
+ "bytemuck",
710
+ ]
711
+
712
+ [[package]]
713
+ name = "semver"
714
+ version = "0.1.20"
715
+ source = "registry+https://github.com/rust-lang/crates.io-index"
716
+ checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
717
+
718
+ [[package]]
719
+ name = "serde"
720
+ version = "1.0.209"
721
+ source = "registry+https://github.com/rust-lang/crates.io-index"
722
+ checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
723
+ dependencies = [
724
+ "serde_derive",
725
+ ]
726
+
727
+ [[package]]
728
+ name = "serde_derive"
729
+ version = "1.0.209"
730
+ source = "registry+https://github.com/rust-lang/crates.io-index"
731
+ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
732
+ dependencies = [
733
+ "proc-macro2",
734
+ "quote",
735
+ "syn",
736
+ ]
737
+
738
+ [[package]]
739
+ name = "simba"
740
+ version = "0.8.1"
741
+ source = "registry+https://github.com/rust-lang/crates.io-index"
742
+ checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae"
743
+ dependencies = [
744
+ "approx",
745
+ "num-complex",
746
+ "num-traits",
747
+ "paste",
748
+ "wide",
749
+ ]
750
+
751
+ [[package]]
752
+ name = "statrs"
753
+ version = "0.17.1"
754
+ source = "registry+https://github.com/rust-lang/crates.io-index"
755
+ checksum = "f697a07e4606a0a25c044de247e583a330dbb1731d11bc7350b81f48ad567255"
756
+ dependencies = [
757
+ "approx",
758
+ "nalgebra",
759
+ "num-traits",
760
+ "rand",
761
+ ]
762
+
763
+ [[package]]
764
+ name = "strum"
765
+ version = "0.26.3"
766
+ source = "registry+https://github.com/rust-lang/crates.io-index"
767
+ checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
768
+
769
+ [[package]]
770
+ name = "strum_macros"
771
+ version = "0.26.4"
772
+ source = "registry+https://github.com/rust-lang/crates.io-index"
773
+ checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
774
+ dependencies = [
775
+ "heck",
776
+ "proc-macro2",
777
+ "quote",
778
+ "rustversion",
779
+ "syn",
780
+ ]
781
+
782
+ [[package]]
783
+ name = "syn"
784
+ version = "2.0.76"
785
+ source = "registry+https://github.com/rust-lang/crates.io-index"
786
+ checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525"
787
+ dependencies = [
788
+ "proc-macro2",
789
+ "quote",
790
+ "unicode-ident",
791
+ ]
792
+
793
+ [[package]]
794
+ name = "target-lexicon"
795
+ version = "0.12.16"
796
+ source = "registry+https://github.com/rust-lang/crates.io-index"
797
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
798
+
799
+ [[package]]
800
+ name = "thiserror"
801
+ version = "1.0.63"
802
+ source = "registry+https://github.com/rust-lang/crates.io-index"
803
+ checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
804
+ dependencies = [
805
+ "thiserror-impl",
806
+ ]
807
+
808
+ [[package]]
809
+ name = "thiserror-impl"
810
+ version = "1.0.63"
811
+ source = "registry+https://github.com/rust-lang/crates.io-index"
812
+ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
813
+ dependencies = [
814
+ "proc-macro2",
815
+ "quote",
816
+ "syn",
817
+ ]
818
+
819
+ [[package]]
820
+ name = "triple_accel"
821
+ version = "0.4.0"
822
+ source = "registry+https://github.com/rust-lang/crates.io-index"
823
+ checksum = "22048bc95dfb2ffd05b1ff9a756290a009224b60b2f0e7525faeee7603851e63"
824
+
825
+ [[package]]
826
+ name = "typenum"
827
+ version = "1.17.0"
828
+ source = "registry+https://github.com/rust-lang/crates.io-index"
829
+ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
830
+
831
+ [[package]]
832
+ name = "unicode-ident"
833
+ version = "1.0.12"
834
+ source = "registry+https://github.com/rust-lang/crates.io-index"
835
+ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
836
+
837
+ [[package]]
838
+ name = "unindent"
839
+ version = "0.2.3"
840
+ source = "registry+https://github.com/rust-lang/crates.io-index"
841
+ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
842
+
843
+ [[package]]
844
+ name = "vec_map"
845
+ version = "0.8.2"
846
+ source = "registry+https://github.com/rust-lang/crates.io-index"
847
+ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
848
+ dependencies = [
849
+ "serde",
850
+ ]
851
+
852
+ [[package]]
853
+ name = "wasi"
854
+ version = "0.11.0+wasi-snapshot-preview1"
855
+ source = "registry+https://github.com/rust-lang/crates.io-index"
856
+ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
857
+
858
+ [[package]]
859
+ name = "wide"
860
+ version = "0.7.28"
861
+ source = "registry+https://github.com/rust-lang/crates.io-index"
862
+ checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690"
863
+ dependencies = [
864
+ "bytemuck",
865
+ "safe_arch",
866
+ ]
867
+
868
+ [[package]]
869
+ name = "zerocopy"
870
+ version = "0.7.35"
871
+ source = "registry+https://github.com/rust-lang/crates.io-index"
872
+ checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
873
+ dependencies = [
874
+ "byteorder",
875
+ "zerocopy-derive",
876
+ ]
877
+
878
+ [[package]]
879
+ name = "zerocopy-derive"
880
+ version = "0.7.35"
881
+ source = "registry+https://github.com/rust-lang/crates.io-index"
882
+ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
883
+ dependencies = [
884
+ "proc-macro2",
885
+ "quote",
886
+ "syn",
887
+ ]
@@ -0,0 +1,14 @@
1
+ [package]
2
+ name = "rsbio-seq"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+
6
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
+ [lib]
8
+ name = "rsbio_seq"
9
+ crate-type = ["cdylib"]
10
+
11
+ [dependencies]
12
+ bio = "2.0.1"
13
+ flate2 = "1.0.33"
14
+ pyo3 = { version = "0.22.0", features = ["abi3-py39"] }
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.3
2
+ Name: rsbio-seq
3
+ Version: 0.1.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ Requires-Python: >=3.9
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = ["maturin>=1.7,<2.0"]
3
+ build-backend = "maturin"
4
+
5
+ [project]
6
+ name = "rsbio-seq"
7
+ requires-python = ">=3.9"
8
+ classifiers = [
9
+ "Programming Language :: Rust",
10
+ "Programming Language :: Python :: Implementation :: CPython",
11
+ "Programming Language :: Python :: Implementation :: PyPy",
12
+ ]
13
+ dynamic = ["version", "readme", "description", "license", "authors"]
14
+
15
+ [tool.maturin]
16
+ features = ["pyo3/extension-module"]
@@ -0,0 +1,42 @@
1
+ from typing import Iterator
2
+
3
+ class Sequence:
4
+ """
5
+ Sequence entry.
6
+
7
+ Attributes
8
+ id (str): record id of the sequence.
9
+ desc (str): description of the record if available.
10
+ seq (str): content of the sequence.
11
+ qual (str): quality string of the sequence if available.
12
+ """
13
+
14
+ id: str
15
+ desc: str
16
+ seq: str
17
+ qual: str
18
+
19
+ class SeqIO:
20
+ """
21
+ Sequence reader.
22
+ """
23
+
24
+ def __init__(self, path: str) -> None:
25
+ """
26
+ Initialise the reader with path of the file.
27
+
28
+ Args:
29
+ path (str): The path to file fasta, fastq, fa, fq and compressed formats with gz are supported.
30
+ """
31
+ ...
32
+
33
+ def __iter__(self) -> Iterator[Sequence]:
34
+ """
35
+ Return an iterator of Sequence objects.
36
+
37
+ Returns:
38
+ Iterator[Sequence]: An iterator over sequences in the file.
39
+ """
40
+ ...
41
+
42
+ __all__ = ["Sequence", "SeqIO"]
@@ -0,0 +1,43 @@
1
+ mod seq;
2
+ use pyo3::prelude::*;
3
+ use seq::{get_reader, SeqFormat, Sequence, Sequences};
4
+ use std::io::Read;
5
+
6
+ /// Sequence reader
7
+ #[pyclass]
8
+ pub struct SeqIO {
9
+ records: Sequences<std::io::BufReader<Box<dyn Read + Send + Sync>>>,
10
+ }
11
+
12
+ #[pymethods]
13
+ impl SeqIO {
14
+ /// Initialise a sequence reader for a file in some destination
15
+ #[new]
16
+ #[pyo3(signature = (path))]
17
+ pub fn new(path: String) -> Self {
18
+ let reader = get_reader(&path).unwrap();
19
+ let format = SeqFormat::get(&path).expect("Unable to detect file format");
20
+
21
+ Self {
22
+ records: Sequences::new(format, reader).unwrap(),
23
+ }
24
+ }
25
+
26
+ /// Iterator object
27
+ pub fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
28
+ slf
29
+ }
30
+
31
+ /// Iterate through sequences
32
+ pub fn __next__(mut slf: PyRefMut<'_, Self>) -> Option<Sequence> {
33
+ slf.records.next()
34
+ }
35
+ }
36
+
37
+ /// Sequence reader for rust
38
+ #[pymodule]
39
+ fn rsbio_seq(m: &Bound<'_, PyModule>) -> PyResult<()> {
40
+ m.add_class::<Sequence>()?;
41
+ m.add_class::<SeqIO>()?;
42
+ Ok(())
43
+ }
@@ -0,0 +1,228 @@
1
+ use bio::io::fasta::{Reader as FastaReader, Records as FastaRecords};
2
+ use bio::io::fastq::{Reader as FastqReader, Records as FastqRecords};
3
+ use pyo3::prelude::*;
4
+ use std::fs::File;
5
+ use std::io::{BufRead, BufReader, Read};
6
+
7
+ // Record set entries of type R, which implement BufRead trait (stdin/file)
8
+ pub enum RecordSet<R: BufRead> {
9
+ Fasta(FastaRecords<BufReader<R>>),
10
+ Fastq(FastqRecords<BufReader<R>>),
11
+ }
12
+
13
+ /// Sequence entry
14
+ #[pyclass]
15
+ pub struct Sequence {
16
+ /// sequence id
17
+ #[pyo3(get, set)]
18
+ pub id: String,
19
+ /// sequence description
20
+ #[pyo3(get, set)]
21
+ pub desc: String,
22
+ /// sequence string
23
+ #[pyo3(get, set)]
24
+ pub seq: String,
25
+ /// sequence quality string (for FASTQ)
26
+ #[pyo3(get, set)]
27
+ pub qual: String,
28
+ }
29
+
30
+ #[derive(Debug, Clone, Copy)]
31
+ pub enum SeqFormat {
32
+ Fasta,
33
+ Fastq,
34
+ }
35
+
36
+ impl SeqFormat {
37
+ pub fn get(path: &str) -> Option<SeqFormat> {
38
+ let mut path = path;
39
+ if path.ends_with(".gz") {
40
+ path = path.trim_end_matches(".gz");
41
+ }
42
+ if path.ends_with(".fq") || path.ends_with(".fastq") {
43
+ return Some(SeqFormat::Fastq);
44
+ } else if path.ends_with(".fasta") || path.ends_with(".fa") || path.ends_with(".fna") {
45
+ return Some(SeqFormat::Fasta);
46
+ }
47
+ None
48
+ }
49
+ }
50
+
51
+ pub struct Sequences<R: BufRead> {
52
+ pub records: RecordSet<R>,
53
+ }
54
+
55
+ impl<R: BufRead> Sequences<R> {
56
+ pub fn new(format: SeqFormat, reader: R) -> Result<Self, String> {
57
+ match format {
58
+ SeqFormat::Fastq => {
59
+ let fastq_reader = FastqReader::new(reader);
60
+ Ok(Sequences {
61
+ records: RecordSet::Fastq(fastq_reader.records()),
62
+ })
63
+ }
64
+ SeqFormat::Fasta => {
65
+ let fasta_reader = FastaReader::new(reader);
66
+ Ok(Sequences {
67
+ records: RecordSet::Fasta(fasta_reader.records()),
68
+ })
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ impl<R: BufRead> Iterator for Sequences<R> {
75
+ type Item = Sequence;
76
+
77
+ fn next(&mut self) -> Option<Self::Item> {
78
+ // records do not have a common trait to get id and seq, we can create one
79
+ // but this looks simpler for the time being
80
+ match self.records {
81
+ RecordSet::Fastq(ref mut records) => {
82
+ let next_record = records.next();
83
+ if let Some(record) = next_record {
84
+ let record = record.unwrap();
85
+ return Some(Sequence {
86
+ id: record.id().to_string(),
87
+ desc: record.desc().unwrap_or("").to_string(),
88
+ seq: String::from_utf8_lossy(record.seq()).to_string(),
89
+ qual: String::from_utf8_lossy(record.qual()).to_string(),
90
+ });
91
+ }
92
+ None
93
+ }
94
+ RecordSet::Fasta(ref mut records) => {
95
+ let next_record = records.next();
96
+ if let Some(record) = next_record {
97
+ let record = record.unwrap();
98
+ return Some(Sequence {
99
+ id: record.id().to_string(),
100
+ desc: record.desc().unwrap_or("").to_string(),
101
+ seq: String::from_utf8_lossy(record.seq()).to_string(),
102
+ qual: "".into(),
103
+ });
104
+ }
105
+ None
106
+ }
107
+ }
108
+ }
109
+
110
+ fn count(self) -> usize
111
+ where
112
+ Self: Sized,
113
+ {
114
+ unimplemented!("Count cannot be performed without always having a rewindable input stream, stdin is not!");
115
+ }
116
+ }
117
+
118
+ pub fn get_reader(path: &str) -> Result<BufReader<Box<dyn Read + Sync + Send>>, String> {
119
+ let is_zip = path.ends_with(".gz");
120
+ let file = File::open(path).map_err(|_| format!("Unable to open: {}", path))?;
121
+ if is_zip {
122
+ let decoder = flate2::read::GzDecoder::new(file);
123
+ Ok(BufReader::new(Box::new(decoder)))
124
+ } else {
125
+ Ok(BufReader::new(Box::new(file)))
126
+ }
127
+ }
128
+
129
+ #[cfg(test)]
130
+ mod tests {
131
+ use super::*;
132
+ const PATH_FQ: &str = "test_data/reads.fq";
133
+ const PATH_FA: &str = "test_data/reads.fa";
134
+ const PATH_FQ_GZ: &str = "test_data/reads.fq.gz";
135
+ const PATH_FA_GZ: &str = "test_data/reads.fa.gz";
136
+
137
+ #[test]
138
+ fn load_fq_file_test() {
139
+ let reader = get_reader(PATH_FQ).unwrap();
140
+ let mut seqs = Sequences::new(SeqFormat::Fastq, reader).unwrap();
141
+ let record_1 = seqs.next().unwrap();
142
+ assert_eq!("Read_1", record_1.id);
143
+ assert_eq!(
144
+ "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA",
145
+ record_1.seq
146
+ );
147
+ let record_2 = seqs.next().unwrap();
148
+ assert_eq!("Read_2", record_2.id);
149
+ assert_eq!(
150
+ "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT",
151
+ record_2.seq
152
+ );
153
+ let finish = seqs.next();
154
+ assert!(finish.is_none());
155
+ }
156
+
157
+ #[test]
158
+ fn load_fq_gz_file_test() {
159
+ let reader = get_reader(PATH_FQ_GZ).unwrap();
160
+ let mut seqs = Sequences::new(SeqFormat::Fastq, reader).unwrap();
161
+ let record_1 = seqs.next().unwrap();
162
+ assert_eq!("Read_1", record_1.id);
163
+ assert_eq!(
164
+ "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA",
165
+ record_1.seq
166
+ );
167
+ let record_2 = seqs.next().unwrap();
168
+ assert_eq!("Read_2", record_2.id);
169
+ assert_eq!(
170
+ "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT",
171
+ record_2.seq
172
+ );
173
+ let finish = seqs.next();
174
+ assert!(finish.is_none());
175
+ }
176
+
177
+ #[test]
178
+ fn load_fa_file_test() {
179
+ let reader = get_reader(PATH_FA).unwrap();
180
+ let mut seqs = Sequences::new(SeqFormat::Fasta, reader).unwrap();
181
+ let record_1 = seqs.next().unwrap();
182
+ assert_eq!("Record_1", record_1.id);
183
+ assert_eq!(
184
+ "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA",
185
+ record_1.seq
186
+ );
187
+ let record_2 = seqs.next().unwrap();
188
+ assert_eq!("Record_2", record_2.id);
189
+ assert_eq!(
190
+ "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT",
191
+ record_2.seq
192
+ );
193
+ let finish = seqs.next();
194
+ assert!(finish.is_none());
195
+ }
196
+
197
+ #[test]
198
+ fn load_fa_gz_file_test() {
199
+ let reader = get_reader(PATH_FA_GZ).unwrap();
200
+ let mut seqs = Sequences::new(SeqFormat::Fasta, reader).unwrap();
201
+ let record_1 = seqs.next().unwrap();
202
+ assert_eq!("Record_1", record_1.id);
203
+ assert_eq!(
204
+ "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA",
205
+ record_1.seq
206
+ );
207
+ let record_2 = seqs.next().unwrap();
208
+ assert_eq!("Record_2", record_2.id);
209
+ assert_eq!(
210
+ "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT",
211
+ record_2.seq
212
+ );
213
+ let finish = seqs.next();
214
+ assert!(finish.is_none());
215
+ }
216
+
217
+ #[test]
218
+ fn parser_test() {
219
+ let input = ">Record_1\nACGTACGTACGT";
220
+ let reader = BufReader::new(input.as_bytes());
221
+ let mut seqs = Sequences::new(SeqFormat::Fasta, reader).unwrap();
222
+ let record_1 = seqs.next().unwrap();
223
+ assert_eq!("Record_1", record_1.id);
224
+ assert_eq!("ACGTACGTACGT", record_1.seq);
225
+ let finish = seqs.next();
226
+ assert!(finish.is_none());
227
+ }
228
+ }
@@ -0,0 +1,5 @@
1
+ >Record_1
2
+ GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA
3
+ >Record_2
4
+ GTTCAGGGATACGACGTTTGTATTTTAAGAATC
5
+ TGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT
Binary file
@@ -0,0 +1,8 @@
1
+ @Read_1
2
+ GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA
3
+ +Read_1
4
+ IIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IG9ICIIIIIIIIIIIIIIIIIIIIDIIIIIII>IIIIII/
5
+ @Read_2
6
+ GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT
7
+ +Read_2
8
+ IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII6IBIIIIIIIIIIIIIIIIIIIIIIIGII>IIIII-I)8I
Binary file
@@ -0,0 +1,22 @@
1
+ from tqdm import tqdm
2
+ from Bio import SeqIO as BioSeqIO
3
+ import sys
4
+ from rsbio_seq import SeqIO as RsSeqIO
5
+
6
+
7
+ if __name__ == "__main__":
8
+ assert len(sys.argv) == 3, "Must provide a valid sequence file and format"
9
+ for seq in tqdm(
10
+ RsSeqIO(sys.argv[1]),
11
+ desc="Rs-iteration",
12
+ ):
13
+ pass
14
+
15
+ for seq in tqdm(
16
+ BioSeqIO.parse(sys.argv[1], sys.argv[2]),
17
+ desc="Bio-iteration",
18
+ ):
19
+ pass
20
+
21
+ # Rs-iteration: 28963522it [01:16, 379747.32it/s]
22
+ # Bio-iteration: 28963522it [02:43, 177329.69it/s]
@@ -0,0 +1,84 @@
1
+ from rsbio_seq import SeqIO, Sequence
2
+ import pathlib
3
+
4
+ dir = pathlib.Path(__file__).parent
5
+
6
+
7
+ def test_fa():
8
+ seqs = SeqIO(dir.joinpath("../test_data/reads.fa").as_posix())
9
+ seq: Sequence = next(seqs)
10
+ assert seq.id == "Record_1"
11
+ assert (
12
+ seq.seq
13
+ == "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA"
14
+ )
15
+ seq = next(seqs)
16
+ assert seq.id == "Record_2"
17
+ assert (
18
+ seq.seq
19
+ == "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT"
20
+ )
21
+
22
+
23
+ def test_fa_gz():
24
+ seqs = SeqIO(dir.joinpath("../test_data/reads.fa.gz").as_posix())
25
+ seq: Sequence = next(seqs)
26
+ assert seq.id == "Record_1"
27
+ assert (
28
+ seq.seq
29
+ == "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA"
30
+ )
31
+ seq: Sequence = next(seqs)
32
+ assert seq.id == "Record_2"
33
+ assert (
34
+ seq.seq
35
+ == "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT"
36
+ )
37
+
38
+
39
+ def test_fq():
40
+ seqs = SeqIO(dir.joinpath("../test_data/reads.fq").as_posix())
41
+ seq: Sequence = next(seqs)
42
+ assert seq.id == "Read_1"
43
+ assert (
44
+ seq.seq
45
+ == "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA"
46
+ )
47
+ assert (
48
+ seq.qual
49
+ == "IIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IG9ICIIIIIIIIIIIIIIIIIIIIDIIIIIII>IIIIII/"
50
+ )
51
+ seq: Sequence = next(seqs)
52
+ assert seq.id == "Read_2"
53
+ assert (
54
+ seq.seq
55
+ == "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT"
56
+ )
57
+ assert (
58
+ seq.qual
59
+ == "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII6IBIIIIIIIIIIIIIIIIIIIIIIIGII>IIIII-I)8I"
60
+ )
61
+
62
+
63
+ def test_fq_gz():
64
+ seqs = SeqIO(dir.joinpath("../test_data/reads.fq.gz").as_posix())
65
+ seq: Sequence = next(seqs)
66
+ assert seq.id == "Read_1"
67
+ assert (
68
+ seq.seq
69
+ == "GGGTGATGGCCGCTGCCGATGGCGTCAAATCCCACCAAGTTACCCTTAACAACTTAAGGGTTTTCAAATAGA"
70
+ )
71
+ assert (
72
+ seq.qual
73
+ == "IIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IG9ICIIIIIIIIIIIIIIIIIIIIDIIIIIII>IIIIII/"
74
+ )
75
+ seq: Sequence = next(seqs)
76
+ assert seq.id == "Read_2"
77
+ assert (
78
+ seq.seq
79
+ == "GTTCAGGGATACGACGTTTGTATTTTAAGAATCTGAAGCAGAAGTCGATGATAATACGCGTCGTTTTATCAT"
80
+ )
81
+ assert (
82
+ seq.qual
83
+ == "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII6IBIIIIIIIIIIIIIIIIIIIIIIIGII>IIIII-I)8I"
84
+ )