Skip to content

Commit 3278e1b

Browse files
authored
Merge branch 'release/v0.2.0'
2 parents b0da4b7 + f1281db commit 3278e1b

File tree

7 files changed

+199
-99
lines changed

7 files changed

+199
-99
lines changed

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name = "GFF3"
22
uuid = "af1dc308-cb6b-11e8-32f0-31192efa90f6"
33
authors = ["Kenta Sato <bicycle1885@gmail.com>", "Daniel C. Jones <dcjones@cs.washington.edu>", "Ben J. Ward <ward9250@gmail.com>", "Ciarán O’Mara <Ciaran.OMara@utas.edu.au>"]
4-
version = "0.1.1"
4+
version = "0.2.0"
55

66
[deps]
77
Automa = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b"
88
BGZFStreams = "28d598bf-9b8f-59f1-b38c-5a06b4a0f5e6"
9-
BioCore = "37cfa864-2cd6-5c12-ad9e-b6597d696c81"
9+
BioGenerics = "47718e42-2ac5-11e9-14af-e5595289c2ea"
1010
BioSequences = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
11-
BufferedStreams = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
1211
FASTX = "c2308a5c-f048-11e8-3e8a-31650f418d12"
1312
GenomicFeatures = "899a7d2d-5c61-547b-bef9-6698a8d05446"
1413
Indexes = "4ffb77ac-cb80-11e8-1b35-4b78cc642f6d"
14+
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
1515
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
1616

1717
[compat]
1818
Automa = "0.7, 0.8"
1919
BGZFStreams = "0.3"
20-
BioCore = "2"
20+
BioGenerics = "0.1"
2121
BioSequences = "2"
22-
BufferedStreams = "1"
2322
FASTX = "1"
2423
GenomicFeatures = "2"
2524
Indexes = "0.1"
25+
TranscodingStreams = "0.9.5"
2626
URIParser = "0.4"
2727
julia = "1"
2828

docs/src/man/gff3.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@ end
3434
close(reader)
3535
```
3636

37+
The iterator interface demonstrated above allocates an object for each record and that may be a bottleneck of reading data from a file.
38+
In-place reading reuses a pre-allocated object for every record and less memory allocation happens in reading:
39+
40+
```julia
41+
# Import the GFF3 module.
42+
using GFF3
43+
44+
# Open a GFF3 file.
45+
reader = open(GFF3.Reader, "data.gff3")
46+
47+
# Pre-allocate record.
48+
record = GFF3.Record()
49+
50+
# Iterate over records.
51+
while !eof(reader)
52+
empty!(record)
53+
read!(reader, record)
54+
# do something
55+
end
56+
57+
# Finally, close the reader.
58+
close(reader)
59+
```
60+
3761
If you are interested in directives (which starts with '#') in addition to genomic features, you need to pass `skip_directives=false` when initializing a GFF3 constructor:
3862
```julia
3963
# Set skip_directives to true (this is set to false by default).

src/GFF3.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
module GFF3
55

6-
using BioCore
6+
using BioGenerics
77
using Indexes
88
using FASTX.FASTA #TODO: move responsibility to FASTX.jl.
9+
using TranscodingStreams
910

1011
import Automa
1112
import Automa.RegExp: @re_str
13+
import Automa.Stream: @mark, @markpos, @relpos, @abspos
14+
1215
import BGZFStreams
13-
import BioCore.Exceptions: missingerror
16+
import BioGenerics.Exceptions: missingerror
1417
import BioSequences
15-
import BufferedStreams
1618
import GenomicFeatures: GenomicFeatures, Interval, IntervalCollection
1719
import URIParser
1820

0 commit comments

Comments
 (0)