Skip to content

Commit b1713a5

Browse files
author
Ben J. Ward
authored
Support Julia LTS versions (#15)
1 parent eda468b commit b1713a5

File tree

7 files changed

+95
-73
lines changed

7 files changed

+95
-73
lines changed

.github/workflows/docs.yml

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
name: Documentation
22

33
on:
4-
push:
5-
branches:
6-
- 'master'
7-
- 'release-'
8-
tags: '*'
9-
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- release/.*
8+
tags: '*'
9+
pull_request:
1010

1111
jobs:
12-
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
julia-version: [1.3.0]
17-
julia-arch: [x86]
18-
os: [ubuntu-latest]
19-
steps:
20-
- uses: actions/[email protected]
21-
- uses: julia-actions/setup-julia@latest
22-
with:
23-
version: ${{ matrix.julia-version }}
24-
- name: Install dependencies
25-
run: |
26-
julia --project=docs -e 'using Pkg; Pkg.add(PackageSpec(path="./")); Pkg.instantiate(); Pkg.update()'
27-
- name: Build and deploy
28-
env:
29-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
30-
run: julia --project=docs --color=yes docs/make.jl
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: julia-actions/setup-julia@v1
17+
with:
18+
version: '1'
19+
- name: Install dependencies
20+
run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
21+
- name: Build and deploy
22+
env:
23+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
24+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
25+
run: julia --color=yes --project=docs/ docs/make.jl

.github/workflows/testing.yml

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
1-
name: Unit testing
2-
on: [push, pull_request]
1+
name: Unit tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
37
jobs:
4-
test:
5-
runs-on: ${{ matrix.os }}
6-
strategy:
7-
matrix:
8-
julia-version: [1.2, 1.3]
9-
julia-arch: [x64]
10-
os: [ubuntu-latest, macOS-latest]
11-
steps:
12-
- uses: actions/[email protected]
13-
- uses: julia-actions/setup-julia@latest
14-
with:
15-
version: ${{ matrix.julia-version }}
16-
- name: Install dependencies
17-
- uses: julia-actions/julia-runtest@latest
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
continue-on-error: ${{ matrix.experimental }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
julia-version:
15+
- '1.0' # LTS
16+
- '1'
17+
julia-arch: [x86]
18+
os: [ubuntu-latest, windows-latest, macOS-latest] # TODO: Work on windows-latest
19+
experimental: [false]
20+
include:
21+
- julia-version: nightly
22+
julia-arch: x86
23+
os: ubuntu-latest
24+
experimental: true
25+
26+
steps:
27+
- name: Checkout Repository
28+
uses: actions/checkout@v2
29+
- name: Setup Julia
30+
uses: julia-actions/setup-julia@v1
31+
with:
32+
version: ${{ matrix.julia-version }}
33+
- name: Run Tests
34+
uses: julia-actions/julia-runtest@latest
35+
- name: Create CodeCov
36+
uses: julia-actions/julia-processcoverage@v1
37+
- name: Upload CodeCov
38+
uses: codecov/codecov-action@v1
39+
with:
40+
file: ./lcov.info
41+
flags: unittests
42+
name: codecov-umbrella
43+
fail_ci_if_error: false
44+
token: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FASTX = "c2308a5c-f048-11e8-3e8a-31650f418d12"
1010
[compat]
1111
BioSequences = "2"
1212
FASTX = "1.1"
13-
julia = "1.1"
13+
julia = "1"
1414

1515
[extras]
1616
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/linked-reads.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,15 @@ function LinkedReads{A}(fwq::FASTQ.Reader, rvq::FASTQ.Reader, outfile::String, n
127127
# Read in `chunksize` read pairs.
128128
chunkfill = 0
129129
while !eof(fwq) && !eof(rvq) && chunkfill < chunksize
130-
read!(fwq, fwrec)
131-
read!(rvq, rvrec)
130+
try # TODO: Get to the bottom of why this is nessecery to fix Windows issues.
131+
read!(fwq, fwrec)
132+
read!(rvq, rvrec)
133+
catch ex
134+
if isa(ex, EOFError)
135+
break
136+
end
137+
rethrow()
138+
end
132139
cd_i = chunk_data[chunkfill + 1]
133140
_extract_tag_and_sequences!(cd_i, fwrec, rvrec, max_read_len, format)
134141
if cd_i.tag != zero(UInt32)
@@ -232,7 +239,7 @@ function Base.open(::Type{LinkedReads{A}}, filename::String, name::Union{Symbol,
232239

233240
read_tags = read_flat_vector(fd, UInt32)
234241

235-
return LinkedReads{A}(filename, isnothing(name) ? default_name : Symbol(name), default_name, max_read_len, chunksize, position(fd), read_tags, fd)
242+
return LinkedReads{A}(filename, name === nothing ? default_name : Symbol(name), default_name, max_read_len, chunksize, position(fd), read_tags, fd)
236243
end
237244

238245
@inline _read_data_begin(prds::LinkedReads) = prds.readpos_offset

src/long-reads.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ function LongReads{A}(rdr::FASTQ.Reader, outfile::String, name::Union{String,Sym
101101
@info "Writing long reads to datastore"
102102

103103
while !eof(rdr)
104-
read!(rdr, record)
104+
try # TODO: Get to the bottom of why this is nessecery to fix Windows issues.
105+
read!(rdr, record)
106+
catch ex
107+
if isa(ex, EOFError)
108+
break
109+
end
110+
rethrow()
111+
end
105112
seq_len = FASTQ.seqlen(record)
106113
if seq_len < min_size
107114
discarded = discarded + 1
@@ -143,7 +150,7 @@ function Base.open(::Type{LongReads{A}}, filename::String, name::Union{String,Sy
143150
default_name = Symbol(readuntil(fd, '\0'))
144151
seek(fd, fpos)
145152
read_to_file_position = read_flat_vector(fd, ReadPosSize)
146-
return LongReads{A}(filename, isnothing(name) ? default_name : Symbol(name), default_name, read_to_file_position, fd)
153+
return LongReads{A}(filename, name === nothing ? default_name : Symbol(name), default_name, read_to_file_position, fd)
147154
end
148155

149156
###

src/paired-reads.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,22 @@ function PairedReads{A}(rdrx::FASTQ.Reader, rdry::FASTQ.Reader,
126126
readpos = write(fd, UInt64(0)) + sizepos
127127

128128
pairs = discarded = truncated = 0
129+
p = 1
129130

130131
@info "Building paired read datastore from FASTQ files"
131132
@info "Writing paired reads to datastore"
132133

133134
while !eof(rdrx) && !eof(rdry)
134135
# Read in the two records.
135-
read!(rdrx, lread)
136-
read!(rdry, rread)
136+
try # TODO: Get to the bottom of why this is nessecery to fix Windows issues.
137+
read!(rdrx, lread)
138+
read!(rdry, rread)
139+
catch ex
140+
if isa(ex, EOFError)
141+
break
142+
end
143+
rethrow()
144+
end
137145

138146
llen = UInt64(FASTQ.seqlen(lread))
139147
rlen = UInt64(FASTQ.seqlen(rread))
@@ -178,7 +186,7 @@ function PairedReads{A}(rdrx::FASTQ.Reader, rdry::FASTQ.Reader,
178186

179187
seek(fd, sizepos)
180188
write(fd, nreads)
181-
189+
flush(fd)
182190
close(fd)
183191

184192
@info "Done writing paired read sequences to datastore"
@@ -205,7 +213,7 @@ function Base.open(::Type{PairedReads{A}}, filename::String, name::Union{String,
205213
nreads = read(fd, UInt64)
206214
readpos_offset = position(fd)
207215

208-
return PairedReads{A}(filename, isnothing(name) ? default_name : Symbol(name), default_name,
216+
return PairedReads{A}(filename, name === nothing ? default_name : Symbol(name), default_name,
209217
max_read_len, chunksize, fragsize,
210218
readpos_offset, nreads, orientation, fd)
211219
end

0 commit comments

Comments
 (0)