Skip to content

Commit

Permalink
Ignore .DS_Store files and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben J. Ward committed Sep 18, 2018
1 parent a936274 commit 54319fd
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.jl.mem
/docs/build
/docs/site/
.DS_Store
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ os:
- osx
julia:
- 0.7
- 1.0
- nightly
matrix:
allow_failures:
Expand All @@ -13,5 +14,6 @@ notifications:
email: false
after_success:
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("BioAlignments")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
- julia -e 'cd(Pkg.dir("BioAlignments")); Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))'
- julia -e 'using Pkg; Pkg.add("Documenter"); Pkg.add("Coverage"); Pkg.add("BioAlignments"); Pkg.add("BioSequences")'
- julia -e 'using Coverage; import BioAlignments; cd(dirname(dirname(pathof(BioAlignments)))); Codecov.submit(Codecov.process_folder())'
- julia --color=yes -e 'import BioAlignments; cd(dirname(dirname(pathof(BioAlignments)))); include(joinpath("docs", "make.jl"))'
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.0] - 2018-09-18
### Added
- Support for julia v0.7 / v1.0.

### Removed
- :exclamation: Support for julia v0.6 has been dropped.

## [0.3.0] - 2018-06-15
### Added
- Contributing files were added to this project.
Expand All @@ -27,7 +34,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- This initial release extracted the alignment utilities out from Bio.jl into
this dedicated package.

[Unreleased]: https://github.com/BioJulia/BioAlignments.jl/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/BioJulia/BioAlignments.jl/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/BioJulia/BioAlignments.jl/compare/v0.3.0...v1.0.0
[0.3.0]: https://github.com/BioJulia/BioAlignments.jl/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/BioJulia/BioAlignments.jl/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/BioJulia/BioAlignments.jl/tree/v0.1.0
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ check out the master branch to try new features before release.

## Testing

BioAlignments is tested against julia `0.6` and current `0.7-dev` on
Linux, OS X, and Windows.
BioAlignments is tested against julia `0.7` and `1.X` on Linux, OS X, and Windows.

| **Latest release** | **Latest build status** |
|:------------------:|:-----------------------:|
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ makedocs(
)
deploydocs(
repo = "github.com/BioJulia/BioAlignments.jl.git",
julia = "0.6",
julia = "1.0",
osname = "linux",
target = "build",
deps = nothing,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/alignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ julia> Alignment([
AlignmentAnchor(4, 8, OP_MATCH),
AlignmentAnchor(4, 12, OP_DELETE)
])
BioAlignments.Alignment:
Alignment:
aligned range:
seq: 0-4
ref: 4-12
Expand Down
14 changes: 7 additions & 7 deletions docs/src/hts-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,19 @@ For example, to create the following simple header:

```julia
julia> a = SAM.MetaInfo("HD", ["VN" => 1.6, "SO" => "coordinate"])
BioAlignments.SAM.MetaInfo:
SAM.MetaInfo:
tag: HD
value: VN=1.6 SO=coordinate

julia> b = SAM.MetaInfo("SQ", ["SN" => "ref", "LN" => 45])
BioAlignments.SAM.MetaInfo:
SAM.MetaInfo:
tag: SQ
value: SN=ref LN=45

julia> h = SAM.Header([a, b])
BioAlignments.SAM.Header(BioAlignments.SAM.MetaInfo[BioAlignments.SAM.MetaInfo:
SAM.Header(SAM.MetaInfo[SAM.MetaInfo:
tag: HD
value: VN=1.6 SO=coordinate, BioAlignments.SAM.MetaInfo:
value: VN=1.6 SO=coordinate, SAM.MetaInfo:
tag: SQ
value: SN=ref LN=45])

Expand All @@ -314,18 +314,18 @@ header and an `IO` type:

```julia
julia> samw = SAM.Writer(open("my-data.sam", "w"), h)
BioAlignments.SAM.Writer(IOStream(<file my-data.sam>))
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 [BGZFStreams](bgzfstreams) package:
stream type from the [BGZFStreams][bgzfstreams] package:

```julia
julia> using BGZFStreams

julia> bamw = BAM.Writer(BGZFStream(open("my-data.bam", "w"), "w"))
BioAlignments.BAM.Writer(BGZFStreams.BGZFStream{IOStream}(<mode=write>))
BAM.Writer(BGZFStreams.BGZFStream{IOStream}(<mode=write>))

```

Expand Down
1 change: 0 additions & 1 deletion docs/src/index.md

This file was deleted.

87 changes: 87 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# BioAlignments

[![Latest release](https://img.shields.io/github/release/BioJulia/BioAlignments.jl.svg?style=flat-square)](https://github.com/BioJulia/BioAlignments.jl/releases/latest)
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/BioJulia/BioAlignments.jl/blob/master/LICENSE)
[![Stable documentation](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://biojulia.github.io/BioAlignments.jl/stable)
[![Latest documentation](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://biojulia.github.io/BioAlignments.jl/latest/)
![Lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg?style=flat-square)
[![Chat on Discord](https://img.shields.io/badge/discord-chat-blue.svg?style=flat-square&logo=discord&colorB=%237289DA)](https://discord.gg/z73YNFz)


## Description

BioAlignments provides alignment algorithms, data structures, and I/O
tools for SAM and BAM file formats.


## Installation

Install BioAlignments from the Julia REPL:

```julia
using Pkg
add("BioAlignments")
#Pkg.add("BioAlignments") for julia prior to v0.7
```

If you are interested in the cutting edge of the development, please
check out the master branch to try new features before release.


## Testing

BioAlignments is tested against julia `0.7` and `1.x` on Linux, OS X, and Windows.

| **Latest release** | **Latest build status** |
|:------------------:|:-----------------------:|
| [![julia07](https://pkg.julialang.org/badges/BioAlignments_0.7.svg)](https://pkg.julialang.org/?pkg=BioAlignments) | [![travis](https://img.shields.io/travis/BioJulia/BioAlignments.jl/master.svg?label=Linux+/+macOS)](https://travis-ci.org/BioJulia/BioAlignments.jl) [![appveyor](https://ci.appveyor.com/api/projects/status/klkynmkr1tgd30gq/branch/master?svg=true)](https://ci.appveyor.com/project/Ward9250/bioalignments-jl/branch/master) [![coverage](https://codecov.io/github/BioJulia/BioAlignments.jl/coverage.svg?branch=master)](https://codecov.io/github/BioJulia/BioAlignments.jl?branch=master) |


## Contributing

We appreciate contributions from users including reporting bugs, fixing
issues, improving performance and adding new features.

Take a look at the [CONTRIBUTING](https://github.com/BioJulia/BioAlignments.jl/blob/master/CONTRIBUTING.md) file provided with
every BioJulia package package for detailed contributor and maintainer
guidelines.


### Financial contributions

We also welcome financial contributions in full transparency on our
[open collective](https://opencollective.com/biojulia).
Anyone can file an expense. If the expense makes sense for the development
of the community, it will be "merged" in the ledger of our open collective by
the core contributors and the person who filed the expense will be reimbursed.


## Backers & Sponsors

Thank you to all our backers and sponsors!

Love our work and community? [Become a backer](https://opencollective.com/biojulia#backer).

[![backers](https://opencollective.com/biojulia/backers.svg?width=890)](https://opencollective.com/biojulia#backers)

Does your company use BioJulia? Help keep BioJulia feature rich and healthy by
[sponsoring the project](https://opencollective.com/biojulia#sponsor)
Your logo will show up here with a link to your website.

[![](https://opencollective.com/biojulia/sponsor/0/avatar.svg)](https://opencollective.com/biojulia/sponsor/0/website)
[![](https://opencollective.com/biojulia/sponsor/1/avatar.svg)](https://opencollective.com/biojulia/sponsor/1/website)
[![](https://opencollective.com/biojulia/sponsor/2/avatar.svg)](https://opencollective.com/biojulia/sponsor/2/website)
[![](https://opencollective.com/biojulia/sponsor/3/avatar.svg)](https://opencollective.com/biojulia/sponsor/3/website)
[![](https://opencollective.com/biojulia/sponsor/4/avatar.svg)](https://opencollective.com/biojulia/sponsor/4/website)
[![](https://opencollective.com/biojulia/sponsor/5/avatar.svg)](https://opencollective.com/biojulia/sponsor/5/website)
[![](https://opencollective.com/biojulia/sponsor/6/avatar.svg)](https://opencollective.com/biojulia/sponsor/6/website)
[![](https://opencollective.com/biojulia/sponsor/7/avatar.svg)](https://opencollective.com/biojulia/sponsor/7/website)
[![](https://opencollective.com/biojulia/sponsor/8/avatar.svg)](https://opencollective.com/biojulia/sponsor/8/website)
[![](https://opencollective.com/biojulia/sponsor/9/avatar.svg)](https://opencollective.com/biojulia/sponsor/9/website)


## Questions?

If you have a question about contributing or using BioJulia software, come
on over and chat to us on [Discord](https://discord.gg/z73YNFz), or you can try the
[Bio category of the Julia discourse site](https://discourse.julialang.org/c/domain/bio).
12 changes: 6 additions & 6 deletions docs/src/pairalign.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cost of substitution, insertion, and deletion:
julia> costmodel = CostModel(match=0, mismatch=1, insertion=1, deletion=1);
julia> pairalign(EditDistance(), "abcd", "adcde", costmodel)
BioAlignments.PairwiseAlignmentResult{Int64,String,String}:
PairwiseAlignmentResult{Int64,String,String}:
distance: 2
seq: 1 abcd- 4
| ||
Expand All @@ -74,7 +74,7 @@ julia> s2 = dna"ACCTGGTATGATAGCG";
julia> scoremodel = AffineGapScoreModel(EDNAFULL, gap_open=-5, gap_extend=-1);
julia> res = pairalign(GlobalAlignment(), s1, s2, scoremodel) # run pairwise alignment
BioAlignments.PairwiseAlignmentResult{Int64,BioSequences.BioSequence{BioSequences.DNAAlphabet{4}},BioSequences.BioSequence{BioSequences.DNAAlphabet{4}}}:
PairwiseAlignmentResult{Int64,BioSequences.BioSequence{BioSequences.DNAAlphabet{4}},BioSequences.BioSequence{BioSequences.DNAAlphabet{4}}}:
score: 13
seq: 0 -CCTAGG------AGGG 10
||| || || |
Expand All @@ -85,7 +85,7 @@ julia> score(res) # get the achieved score of this alignment
13
julia> aln = alignment(res)
BioAlignments.PairwiseAlignment{BioSequences.BioSequence{BioSequences.DNAAlphabet{4}},BioSequences.BioSequence{BioSequences.DNAAlphabet{4}}}:
PairwiseAlignment{BioSequences.BioSequence{BioSequences.DNAAlphabet{4}},BioSequences.BioSequence{BioSequences.DNAAlphabet{4}}}:
seq: 0 -CCTAGG------AGGG 10
||| || || |
ref: 1 ACCT-GGTATGATAGCG 16
Expand Down Expand Up @@ -152,7 +152,7 @@ defined:

```jldoctest
julia> EDNAFULL
BioAlignments.SubstitutionMatrix{BioSymbols.DNA,Int64}:
SubstitutionMatrix{BioSymbols.DNA,Int64}:
A C M G R S V T W Y H K D B N
A 5 -4 1 -4 1 -4 -1 -4 1 -4 -1 -4 -1 -4 -2
C -4 5 1 -4 -4 1 -1 -4 -4 1 -1 -4 -4 -1 -2
Expand All @@ -177,7 +177,7 @@ For amino acids, PAM (Point Accepted Mutation) and BLOSUM (BLOcks SUbstitution M

```jldoctest
julia> BLOSUM62
BioAlignments.SubstitutionMatrix{BioSymbols.AminoAcid,Int64}:
SubstitutionMatrix{BioSymbols.AminoAcid,Int64}:
A R N D C Q E G H I L K M F P S T W Y V O U B J Z X *
A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0 0̲ 0̲ -2 0̲ -1 0 -4
R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3 0̲ 0̲ -1 0̲ 0 -1 -4
Expand Down Expand Up @@ -244,7 +244,7 @@ important than flexibility because looking up score is faster than

```jldoctest
julia> submat = DichotomousSubstitutionMatrix(1, -1)
BioAlignments.DichotomousSubstitutionMatrix{Int64}:
DichotomousSubstitutionMatrix{Int64}:
match = 1
mismatch = -1
Expand Down
15 changes: 8 additions & 7 deletions src/submat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,30 @@ function Base.show(io::IO, submat::SubstitutionMatrix{T,S}) where {T,S}
for (i, x) in enumerate(alpha), (j, y) in enumerate(alpha)
i′ = index(x)
j′ = index(y)
mat[i,j] = string(submat.data[i′,j′])
if !submat.defined[i′,j′]
mat[i,j] = underline(mat[i,j])
mat[i, j] = string(submat.data[i′, j′])
if !submat.defined[i′, j′]
mat[i, j] = underline(mat[i, j])
end
end

# add rows and columns
rows = map(string, alpha)
cols = vcat("", rows)
cols = vcat(" ", rows)
mat = hcat(rows, mat)
mat = vcat(reshape(cols, 1, length(cols)), mat)

println(io, summary(submat), ':')
width = maximum(map(x -> length(x), mat))
for i in 1:n+1
for j in 1:n+1
print(io, lpad(mat[i,j], width + 1))
for i in 1:n + 1
for j in 1:n + 1
print(io, lpad(mat[i, j], width + ifelse(last(mat[i, j]) == '\U0332', 2, 1)))
end
println(io)
end
print(io, "(underlined values are default ones)")
end


underline(s) = join([string(c, '\U0332') for c in s])

# Return a vector of all symbols of `T` except the gap symbol.
Expand Down

0 comments on commit 54319fd

Please sign in to comment.