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
" General | |
syntax enable | |
set nocompatible | |
set noswapfile | |
if executable("rg") | |
set grepprg=rg\ --vimgrep\ --no-heading | |
set grepformat=%f:%l:%c:%m,%f:%l:%m | |
endif | |
autocmd QuickFixCmdPost * copen | |
nnoremap <silent> <C-n> :cn<CR> |
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
# Randomized SVD | |
# -------------- | |
# | |
# H. Li, G. C. Linderman, et al. "Algorithm 971: An Implementation of a | |
# Randomized Algorithm for Principal Component Analysis", ACM Transactions on | |
# Mathematical Software (TOMS), 2017 | |
# DOI: https://doi.org/10.1145/3004053 | |
# | |
# N. Halko, P. G. Martinsson, and J. A. Tropp, "Finding Structure with | |
# Randomness: Probabilistic Algorithms for Constructing Approximate Matrix |
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
quote | |
if p > p_end | |
@goto exit | |
end | |
##667 = (Automa.SizedMemory)(data) | |
if cs == 1 | |
@goto state_case_1 | |
else | |
if cs == 2 | |
@goto state_case_2 |
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
# License: MIT | |
module Base64 | |
export | |
Base64EncodePipe, | |
base64encode | |
# Data buffer for pipes. | |
mutable struct Buffer |
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
import NamedTuples: NamedTuples, @NT | |
# Atom | |
# ---- | |
# NOTE: This must be synchronized with `AtomCoords`. | |
struct Atom | |
id::Int32 | |
x::Float32 | |
y::Float32 |
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 CodecZlib | |
using BioSequences | |
function readfasta(filepath) | |
open(GzipDecompressionStream, filepath) do stream | |
reader = FASTA.Reader(stream) | |
for record in reader | |
id = FASTA.identifier(record) | |
seq = FASTA.sequence(record) | |
@show id, seq |
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 | |
import DataStructures: SortedSet | |
immutable MinHashSketch | |
sketch::Vector{UInt64} | |
kmersize::Int | |
function MinHashSketch(sketch::Vector, kmersize::Int) | |
length(sketch) > 0 || error("Sketch cannot be empty") | |
kmersize > 0 || error("Kmersize must be greater than 0") |
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
import Automa | |
import Automa.RegExp: @re_str | |
import BufferedStreams | |
import BufferedStreams: BufferedInputStream | |
import Bio | |
const fastq_machine = (function () | |
re = Automa.RegExp | |
cat = re.cat | |
rep = re.rep |
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
import Automa | |
import Automa.RegExp: @re_str | |
const re = Automa.RegExp | |
# VCF v4.2 | |
const vcf_machine = (function () | |
delim(x, sep) = re.opt(re.cat(x, re.rep(re.cat(sep, x)))) | |
nl = re"\n" | |
newline = re"\r?" * nl |
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 Automa | |
using Automa.RegExp | |
const re = Automa.RegExp | |
length = re"[0-9]+\.[0-9]+" | |
name = re.rep1(re"[!-~]" \ re"[,:;()[\]]") | |
spaces = re" +" | |
const newick = compile( | |
re"\(" => :(emit(:lparen)), |