This file contains 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: Public Domain | |
import requests | |
def panther(species, genelist, ontology='biological_process', | |
correction='fdr', format='html', resource='PANTHER', timeout=15): | |
"""Post a over/under-representation test request to PANTHER.""" | |
# NOTE: The species parameter seems to be different from conventional |
This file contains 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
# Install packages in system | |
# ========================== | |
# License: Public Domain | |
# Usage: julia setup-system.jl package1 package2 ... | |
# Also, don't forget to add '@system' to your LOAD_PATH like this way: | |
# $ env JULIA_LOAD_PATH='@:@v#.#:@system:@stdlib' julia | |
using Pkg |
This file contains 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
# Utilities to read output files of Alevin. | |
# ----------------------------------------- | |
# | |
# Copyright 2020 Kenta Sato | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains 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
#include <iostream> | |
#include <chrono> | |
#include <cmath> | |
#include <xbyak/xbyak.h> | |
const size_t INIT_CODE_BUF_SIZE = 1 >> 10; | |
struct Code : Xbyak::CodeGenerator | |
{ | |
Code(size_t n) : CodeGenerator(INIT_CODE_BUF_SIZE, Xbyak::AutoGrow) |
This file contains 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 LinearAlgebra: qr | |
function equilibrium(Q::AbstractMatrix) | |
@assert size(Q, 1) == size(Q, 2) | |
R = qr(Q').R | |
n = size(Q, 1) | |
v = zeros(eltype(Q), n) | |
v[end] = 1 | |
for i in n-1:-1:1 | |
s = zero(eltype(Q)) |
This file contains 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
macro par(expr) | |
thunk = esc(:(()->($expr))) | |
quote | |
local task = Task($thunk) | |
task.sticky = false | |
schedule(task) | |
task | |
end | |
end |
This file contains 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
const a = (1, 2, 3, 4) | |
function func(b) | |
sum = 0 | |
for i in 1:4 | |
sum += a[i] * b[i] | |
end | |
return sum | |
end |
This file contains 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 types | |
class SafeNaN(types.ModuleType): | |
def __setattr__(self, attr, value): | |
if attr == "nan": | |
raise RuntimeError("cannot reassign 'nan'") | |
super().__setattr__(attr, value) | |
import sys | |
import numpy |
This file contains 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
module CallStack | |
export @callstack | |
using Cassette | |
mutable struct CallState | |
depth::Int | |
end |
This file contains 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> |