Skip to content

Commit

Permalink
Merge branch 'release/v0.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranOMara committed Jun 22, 2020
2 parents 551a590 + bde477d commit dfa5a32
Show file tree
Hide file tree
Showing 18 changed files with 562 additions and 609 deletions.
33 changes: 6 additions & 27 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,16 @@ name: CompatHelper

on:
schedule:
- cron: '00 * * * *'
- cron: '0 0 * * *'

jobs:
CompatHelper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.3.0]
julia-arch: [x86]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Add CompatHelper
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main
run: julia --color=yes -e 'using Pkg; Pkg.add("CompatHelper")'
- name: Run CompatHelper
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e '
using CompatHelper, Pkg;
my_registries = [
Pkg.RegistrySpec(
name = "BioJuliaRegistry",
uuid = "ccbd2cc2-2954-11e9-1ccf-f3e7900901ca",
url = "https://github.com/BioJulia/BioJuliaRegistry.git"
),
Pkg.RegistrySpec(
name = "General",
uuid = "23338594-aafe-5451-b93e-139f81909106",
url = "https://github.com/JuliaRegistries/General.git"
)
];
CompatHelper.main(; registries = my_registries, master_branch = "master");'
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
run: julia --color=yes -e 'using CompatHelper; CompatHelper.main(master_branch = "master")'
40 changes: 16 additions & 24 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
name: Documentation
name: Build Documentation

on:
push:
branches:
- 'master'
- 'develop'
- 'release/.*'
tags: '*'
pull_request:
push:
branches:
- master
- develop
- release/*
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.3.0]
julia-arch: [x86]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
- uses: julia-actions/setup-julia@latest
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- name: Install dependencies
run: |
julia ci_prep.jl;
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
version: '1'
- name: Install Dependencies
run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and Deploy
env:
# https://github.com/JuliaDocs/Documenter.jl/issues/1177
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ --color=yes docs/make.jl
run: julia --color=yes --project=docs/ docs/make.jl
3 changes: 1 addition & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: TagBot
on:
schedule:
- cron: '0 * * * *'
- cron: '0 0 * * *'
jobs:
TagBot:
runs-on: ubuntu-latest
Expand All @@ -10,4 +10,3 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.TAGBOT_KEY }}
registry: BioJulia/BioJuliaRegistry
42 changes: 32 additions & 10 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
name: Unit tests
name: Unit Tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.1', '1.2', '1.3']
julia-arch: [x64]
julia-version:
- '1.0' # LTS
- '1'
julia-arch: [x64, x86]
os: [ubuntu-latest, windows-latest, macOS-latest]
experimental: [false]
include:
- julia-version: nightly
julia-arch: x64
os: ubuntu-latest
experimental: true

steps:
- uses: actions/[email protected]
- uses: julia-actions/setup-julia@v1
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- name: Install dependencies
run: julia ci_prep.jl
- uses: julia-actions/julia-runtest@master
- name: Run Tests
uses: julia-actions/julia-runtest@latest
- name: Create CodeCov
uses: julia-actions/julia-processcoverage@v1
- name: Upload CodeCov
uses: codecov/codecov-action@v1
with:
file: ./lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "XAM"
uuid = "d759349c-bcba-11e9-07c2-5b90f8f05f7c"
authors = ["Kenta Sato <[email protected]>", "Ben J. Ward <[email protected]>", "Ciarán O'Mara <[email protected]>"]
version = "0.2.4"
version = "0.2.5"

[deps]
Automa = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b"
Expand All @@ -19,11 +19,11 @@ Automa = "0.7, 0.8"
BGZFStreams = "0.3"
BioAlignments = "2"
BioGenerics = "0.1"
BioSequences = "2"
BioSequences = "2.0.4"
GenomicFeatures = "2"
Indexes = "0.1"
TranscodingStreams = "0.6, 0.7, 0.8, 0.9"
julia = "1.1"
julia = "1"

[extras]
FormatSpecimens = "3372ea36-2a1a-11e9-3eb7-996970b6ffbd"
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@
blog post").

## Description
XAM provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.
The XAM package provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.

## Installation
The latest version of XAM is made available to install through BioJulia's package registry.
By default, Julia's package manager only includes the "General" package registry.

To add the BioJulia registry from the [Julia REPL](https://docs.julialang.org/en/v1/manual/getting-started/), press `]` to enter [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/), then enter the following command:
```julia
registry add https://github.com/BioJulia/BioJuliaRegistry.git
```

Once the registry is added to your configuration, you can install XAM while in [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/) with the following:
You can install the XAM package from the [Julia REPL](https://docs.julialang.org/en/v1/manual/getting-started/).
Press `]` to enter [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/), then enter the following command:
```julia
add XAM
```
Expand Down
3 changes: 0 additions & 3 deletions ci_prep.jl

This file was deleted.

2 changes: 0 additions & 2 deletions coverage/Project.toml

This file was deleted.

11 changes: 0 additions & 11 deletions coverage/coverage.jl

This file was deleted.

15 changes: 3 additions & 12 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,11 @@
> This project follows the [semver](http://semver.org) pro forma and uses the [git-flow branching model](https://nvie.com/posts/a-successful-git-branching-model/).
## Description

XAM provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.

The XAM package provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.

## Installation
The latest version of XAM is made available to install through BioJulia's package registry.
By default, Julia's package manager only includes the "General" package registry.

To add the BioJulia registry from the [Julia REPL](https://docs.julialang.org/en/v1/manual/getting-started/), press `]` to enter [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/), then enter the following command:
```julia
registry add https://github.com/BioJulia/BioJuliaRegistry.git
```

Once the registry is added to your configuration, you can install XAM while in [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/) with the following:
You can install the XAM package from the [Julia REPL](https://docs.julialang.org/en/v1/manual/getting-started/).
Press `]` to enter [pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/), then enter the following command:
```julia
add XAM
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/man/hts-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ SAM.Writer(IOStream(<file my-data.sam>))

```

To make a BAM Writer is slightly different, as you need to use a specific stream type from the (https://github.com/BioJulia/BGZFStreams.jl)[https://github.com/BioJulia/BGZFStreams.jl] package:
To make a BAM Writer is slightly different, as you need to use a specific stream type from the [https://github.com/BioJulia/BGZFStreams.jl](https://github.com/BioJulia/BGZFStreams.jl) package:

```julia
julia> using BGZFStreams
Expand Down
4 changes: 2 additions & 2 deletions src/sam/metainfo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Create a SAM metainfo from `str`.
"""
function MetaInfo(str::AbstractString)
return MetaInfo(Vector{UInt8}(str))
return MetaInfo(collect(UInt8, str))
end

"""
Expand Down Expand Up @@ -198,7 +198,7 @@ function keyvalues(metainfo::MetaInfo)::Vector{Pair{String,String}}
if iscomment(metainfo)
throw(ArgumentError("not a dictionary"))
end
return Pair{String,String}[key => val for (key, val) in zip(keys(metainfo), values(metainfo))]
return Pair{String, String}.(keys(metainfo), values(metainfo))
end

function Base.keys(metainfo::MetaInfo)
Expand Down
32 changes: 13 additions & 19 deletions src/sam/readrecord.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Automa.jl generated readrecord! and readmetainfo! functions
# ========================================

import Automa
import Automa.RegExp: @re_str
import Automa.Stream: @mark, @markpos, @relpos, @abspos

# file = header . body
# header = metainfo*
# body = record*
const sam_machine_metainfo, sam_machine_record, sam_machine_header, sam_machine_body, sam_machine = (function ()

isinteractive() && info("compiling SAM")
isinteractive() && @info "compiling SAM"

cat = Automa.RegExp.cat
rep = Automa.RegExp.rep
Expand Down Expand Up @@ -161,21 +165,15 @@ function appendfrom!(dst, dpos, src, spos, n)
if length(dst) < dpos + n - 1
resize!(dst, dpos + n - 1)
end
copyto!(dst, dpos, src, spos, n)
unsafe_copyto!(dst, dpos, src, spos, n)
return dst
end

const action_metainfo = quote
appendfrom!(metainfo.data, 1, data, @markpos, p-@markpos)
metainfo.filled = 1:(p-@markpos)

let markpos = @markpos()

appendfrom!(metainfo.data, 1, data, markpos, length(markpos:p-1))

metainfo.filled = @relpos(markpos):@relpos(p-1)

found_metainfo = true
end

found_metainfo = true
end

const sam_actions_metainfo = Dict(
Expand Down Expand Up @@ -227,15 +225,11 @@ const sam_actions_record = Dict(
:record_qual => :(record.qual = pos:@relpos(p-1)),
:record_field => :(push!(record.fields, pos:@relpos(p-1))),
:record => quote
let markpos = @markpos()

appendfrom!(record.data, 1, data, markpos, length(markpos:p-1))

record.filled = @relpos(markpos):@relpos(p-1)
appendfrom!(record.data, 1, data, @markpos, p-@markpos)
record.filled = 1:(p-@markpos)

found_record = true
@escape
end
found_record = true
@escape
end
)

Expand Down
4 changes: 2 additions & 2 deletions src/sam/record.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function Record(str::AbstractString)
end

function Base.convert(::Type{Record}, str::AbstractString)
return Record(Vector{UInt8}(str))
return Record(collect(UInt8, str))
end

function Base.:(==)(a::Record, b::Record)
Expand Down Expand Up @@ -399,7 +399,7 @@ function sequence(record::Record)::BioSequences.LongDNASeq
end
seqlen = length(record.seq)
ret = BioSequences.LongDNASeq(seqlen)
BioSequences.encode_copy!(ret, 1, record.data, first(record.seq), seqlen)
copyto!(ret, 1, record.data, first(record.seq), seqlen)
return ret
end

Expand Down
3 changes: 0 additions & 3 deletions src/sam/sam.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module SAM

using BioGenerics

import Automa
import Automa.RegExp: @re_str
import Automa.Stream: @mark, @markpos, @relpos, @abspos
import BioAlignments
import BioGenerics: BioGenerics, isfilled, header
import BioGenerics.Exceptions: missingerror
Expand Down
Loading

2 comments on commit dfa5a32

@CiaranOMara
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/16725

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.5 -m "<description of version>" dfa5a3217f67f7efbdb41770cb73f65edb6c922d
git push origin v0.2.5

Please sign in to comment.