Skip to content

Instantly share code, notes, and snippets.

View ryuzheng's full-sized avatar
🏃‍♂️

Zexin Zheng ryuzheng

🏃‍♂️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryuzheng on github.
  • I am ryuzheng (https://keybase.io/ryuzheng) on keybase.
  • I have a public key whose fingerprint is ED12 7CA4 BF35 7C9D 70B3 9F49 A477 D962 1D1C 5A0F

To claim this, I am signing this object:

@ryuzheng
ryuzheng / 📊 Weekly development breakdown
Last active April 6, 2024 00:53
📊 Weekly development breakdown
HTML 🕓 42m ████████████▏░░░░░░░░░░░░░░░░░░░░░ 35.8%
Bash 🕓 38m ███████████▏░░░░░░░░░░░░░░░░░░░░░░ 32.8%
Text 🕓 14m ████▏░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 12.3%
Python 🕓 10m ██▉░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8.7%
R 🕓 7m ██▏░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.3%
@ryuzheng
ryuzheng / emlog-404.php
Created January 13, 2020 09:46
a github style 404 page for emlog
/**
*把这段代码替换原404.php的<head>后面所有代码就可以了
*感谢github的工程师写出的这段代码
*修改by zhengzexin.com
*/
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page not found &middot; zhengzexin.com</title>
<style type="text/css" media="screen">
body {
background-color: #f1f1f1;
@ryuzheng
ryuzheng / wordpress-404.php
Created January 13, 2020 09:44
a github style 404 page for wordpress
<?php
/**
*把这个php文件覆盖原404.php就可以实现了
*感谢github的工程师写出的这段代码
*修改by zhengzexin.com
*/
get_header(); ?>
@ryuzheng
ryuzheng / tmux-cheatsheet.markdown
Created March 4, 2019 03:14 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@ryuzheng
ryuzheng / Annovar_index.pl
Created December 28, 2018 13:39
ANNOVAR数据库的index脚本 Annovar_index.pl (该脚本在官方文档里面是没有的,by 张求学&周在威)
#!/usr/bin perl;
use warnings;
use strict;
die "$0 <Annovar Database File> <BIN Size>" unless @ARGV == 2;
my $input_file = $ARGV[0];
my $bin_size = $ARGV[1];
if (!-e $input_file) {
die "$input_file not found\n";
@ryuzheng
ryuzheng / notes.md
Created November 30, 2018 03:41 — forked from gregcaporaso/notes.md
vsearch-based sequence dereplication through generation of a biom table

This depends on biom version >= 2.1.5, < 2.2.0 and vsearch >= 1.7.0.

Please note that all of this is highly experimental. I'm keeping these notes as I work with this approach. For published work, I still recommend using standard pipelines, such as those in QIIME 1.9.1.

$ biom --version
biom, version 2.1.5

$ vsearch --version
vsearch v1.7.0_osx_x86_64, 16.0GB RAM, 8 cores
@ryuzheng
ryuzheng / dict_to_namedtuple.py
Created March 23, 2018 09:35 — forked from ashwin/dict_to_namedtuple.py
How to convert Python dict to class object with fields
>>> from collections import namedtuple
>>> d = {"name": "joe", "age": 20}
>>> d
{'age': 20, 'name': 'joe'}
>>> d_named = namedtuple("Employee", d.keys())(*d.values())
>>> d_named
Employee(name='joe', age=20)
>>> d_named.name
'joe'
@ryuzheng
ryuzheng / jupyter.sh
Created December 18, 2017 10:38 — forked from Colelyman/jupyter.sh
Get Jupyter Notebook Running in SSH Tunnel
user@server$ jupyter notebook --no-browser --port=8889
# run client side
user@client$ ssh -N -f -L localhost:8000:localhost:8889 remote_user@remote_host
firefox http://localhost:8000
# source: https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh
# Fast way to count number of reads and number of bases in a fastq file?
# https://bioinformatics.stackexchange.com/questions/935/fast-way-to-count-number-of-reads-and-number-of-bases-in-a-fastq-file
zcat albacored_all.fastq.gz | awk 'NR%4==2{c++; l+=length($0)}
END{
print "Number of reads: "c;
print "Number of bases in reads: "l
}'
Number of reads: 301135
Number of bases in reads: 283902419