diegozea/BioSeq.jl — pull request #2 by kmsquire (2013-02-27 16:49:48+00:00)
Title: Change alphabet conversion dictionaries to arrays.

I get a reasonably good speedup with this for longer nucleotide strings:

Current dict-based `reversecomplement`:

```julia
julia> test_rev_compl(n::Int) = reversecomplement(nt"ATCG"[rand(1:4, n)], DNA_COMPLEMENT)
# method added to generic function test_rev_compl

julia> compare([()->test_rev_compl(100), ()->test_rev_compl(1000), ()->test_rev_compl(10000), ()->test_rev_compl(100000)], 10000)
4x4 DataFrame:
Function Elapsed Relative Replications
[1,] "# function" 0.10635 1.0 10000
[2,] "# function" 0.821165 7.72134 10000
[3,] "# function" 7.23151 67.9973 10000
[4,] "# function" 72.7856 684.397 10000
```

Array-based `reversecomplement`:

```julia
julia> compare([()->test_rev_compl(100), ()->test_rev_compl(1000), ()->test_rev_compl(10000), ()->test_rev_compl(100000)], 10000)
4x4 DataFrame:
Function Elapsed Relative Replications
[1,] "# function" 0.0758033 1.0 10000
[2,] "# function" 0.511049 6.74177 10000
[3,] "# function" 4.53903 59.8791 10000
[4,] "# function" 45.3301 597.996 10000
```

BTW, nice work on this package!

Cheers,

Kevin