This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Nelder-Mead algorithm | |
nelder_mead(f, x0, n) | |
Arguments | |
--------- | |
* `f`: target function to optimize | |
* `x0`: initial value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Bio.Seq | |
# Utils for Benchmark | |
# ------------------- | |
function random_seq(n, nts, probs) | |
cumprobs = cumsum(probs) | |
x = Array(Char, n) | |
for i in 1:n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Bio.Seq | |
let | |
str = "ACGT"^10000 | |
seq = DNASequence(str) | |
seq′ = DNASequence("AAA" * str)[4:end] | |
@assert hash(seq) === hash(seq′) | |
println("ASCIIString") | |
hash(str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Approximate String Search | |
# ========================= | |
# | |
# Myers, Gene. "A fast bit-vector algorithm for approximate string matching | |
# based on dynamic programming." Journal of the ACM (JACM) 46.3 (1999): 395-415. | |
# | |
""" | |
approx_search(text, query, k) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Toy Regular Expression Engine Written in Julia | |
# ============================================== | |
# Example | |
# ------- | |
# | |
# julia> include("re.jl") | |
# run (generic function with 1 method) | |
# | |
# julia> ast = parse("foo*|ba*r") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PhyNode{I,T<:Tuple} | |
id::I | |
metadata::T | |
children::Vector{PhyNode{I,T}} | |
parent::PhyNode{I,T} | |
# root | |
function PhyNode(id, metadata, children) | |
node = new(id, metadata, children) | |
node.parent = node |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nested Containment List | |
# ======================= | |
# | |
# Alekseyenko, A. V., & Lee, C. J. (2007). "Nested Containment List (NCList): A | |
# new algorithm for accelerating interval query of genome alignment and interval | |
# databases." Bioinformatics, 23(11), 1386–1393. | |
# doi:10.1093/bioinformatics/btl647 | |
# An interval type (inclusive). | |
immutable Interval{T} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.