Skip to content

Instantly share code, notes, and snippets.

@y9c
y9c / color.py
Created January 19, 2019 08:52
some common config for seaborn ploting
sns.set(
context="paper",
style="ticks",
font_scale=1,
rc={
"xtick.labelsize": 16,
"ytick.labelsize": 16,
"axes.labelsize": 14,
"legend.fontsize": 16,
"lines.linewidth": 1.25,
@y9c
y9c / main.dart
Last active March 8, 2020 17:29
list comprehension by dart
void main() {
print([
if (2 > 1) 222 else 333,
if (2 > 3) 444,
for (int i in Iterable.generate(10)) if (i % 3 == 1) i,
for (int i in Iterable.generate(10, (x) => x + 100)) if (i % 2 == 0) i
]);
}
@y9c
y9c / quasiquotation_metaprogramming.R
Created April 7, 2020 07:02
Quasiquotation of R is terrible.
#!/usr/bin/env Rscript
# -*- coding: utf-8 -*-
#
# Copyright © 2020 Ye Chang <yech1990@gmail.com>
# Distributed under terms of the MIT license.
#
# Created: 2020-04-07 14:27
f <- function(x) {
" Automatically generated packer.nvim plugin loader code
if !has('nvim-0.5')
echohl WarningMsg
echom "Invalid Neovim version for packer.nvim!"
echohl None
finish
endif
packadd packer.nvim
@y9c
y9c / test_APA.R
Last active April 3, 2023 01:33
alternative polyadenylation (APA)
source("./utils_APA.R")
## How ot use?
##
## Change the path of tsv and gtf file
## `chr_name` is the column name of chromosome in the tsv file, default is "Chromosome"
## `pos_name` is the column name of position in the tsv file, default is "End"
## `strand_name` is the column name of strand in the tsv file, default is "Strand"
tsv <- "./test_sites.tsv"