Skip to content

Instantly share code, notes, and snippets.

View ShixiangWang's full-sized avatar
🀄
Open Source Better Science

Shixiang Wang (王诗翔) ShixiangWang

🀄
Open Source Better Science
View GitHub Profile
@Yunuuuu
Yunuuuu / rsync-resume.sh
Last active July 6, 2026 10:03
面向弱网和不稳定 SSH 连接的 rsync 自动重试脚本, 支持无限重连, SSH 配置与 ssh-agent, 以及可选临时 SSH 密钥.
#!/usr/bin/env bash
# rsync-resume 是一个面向不稳定网络环境的 rsync 传输包装脚本。
#
# 它负责在 rsync 因网络、SSH 或协议连接问题中断后自动等待并重新执行传输,
# 适合跨公网、弱网、高延迟或连接容易中断的服务器之间进行长时间数据同步。
#
# 脚本本身不会为 rsync 添加默认同步参数。所有归档、删除、压缩、断点文件、
# 进度显示、限速和排除规则等传输行为, 均由用户直接通过 rsync 参数控制。
#
# 对于 SSH 远程传输, 脚本默认使用现有 SSH 配置、IdentityFile 或 ssh-agent
@jasonsychau
jasonsychau / this_file_path.R
Last active October 13, 2024 16:19
R - get this file path
# a combination of
# https://stackoverflow.com/questions/1815606/determine-path-of-the-executing-script/15373917#15373917
# https://stackoverflow.com/questions/1815606/determine-path-of-the-executing-script/7585599#7585599
# https://stackoverflow.com/questions/47044068/get-the-path-of-current-script/47045368#47045368
# https://stackoverflow.com/questions/53512868/how-to-automatically-include-filepath-in-r-markdown-document/53516876#53516876
stub <- function() {}
thisPath <- function() {
cmdArgs <- commandArgs(trailingOnly = FALSE)
if (length(grep("^-f$", cmdArgs)) > 0) {
# R console option
@grst
grst / rsession.sh
Created November 30, 2018 08:27
Use conda-env for rstudio-server
#!/bin/bash
USER=`whoami`
source /etc/profile
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
source /storage/apps/dotfiles/bashrc.sh
@ShixiangWang
ShixiangWang / tcga_replicateFilter.R
Last active November 1, 2023 07:25
A R function used to Filter TCGA Replicate Samples
#---------------------------------------------------
# Filter TCGA Replicate Samples
# Author: ShixiangWang <w_shixiang@163.com>
# ooooooo
# The filter rule following broad institute says:
#
# In many instances there is more than one aliquot for a given combination of individual, platform, and data type. However, only one aliquot may be ingested into Firehose. Therefore, a set of precedence rules are applied to select the most scientifically advantageous one among them. Two filters are applied to achieve this aim: an Analyte Replicate Filter and a Sort Replicate Filter.
#
# Analyte Replicate Filter
# The following precedence rules are applied when the aliquots have differing analytes. For RNA aliquots, T analytes are dropped in preference to H and R analytes, since T is the inferior extraction protocol. If H and R are encountered, H is the chosen analyte. This is somewhat arbitrary and subject to change, since it is not clear at present whether H or R is the better protocol. If there are multiple aliquots as
@ckandoth
ckandoth / ensembl_vep_95_with_offline_cache.md
Last active October 4, 2022 21:49
Install Ensembl's VEP v95 with various caches for running offline

Ensembl's VEP (Variant Effect Predictor) is popular for how it picks a single effect per gene as detailed here, its CLIA-compliant HGVS variant format, and Sequence Ontology nomenclature for variant effects.

To follow these instructions, we'll assume you have these packaged essentials installed:

## For Debian/Ubuntu system admins ##
sudo apt-get install -y build-essential git libncurses-dev

## For RHEL/CentOS system admins ##
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y git ncurses-devel
@seandavi
seandavi / Genome_Informatics_2017_software.csv
Last active November 8, 2018 14:33
Software list mined from twitter feed for CSHL Genome Informatics meeting, 2017
url name user type
https://github.com/dewyman/TranscriptClean TranscriptClean dewyman github
https://github.com/dewyman/TALON TALON dewyman github
https://github.com/Illumina/strelka strelka Illumina github
https://github.com/gymreklab/GangSTR GangSTR gymreklab github
https://github.com/dewyman/talon talon dewyman github
https://github.com/haghshenas/PhISCS PhISCS haghshenas github
https://github.com/alshai/r-index r-index alshai github
https://github.com/shenwei356/bwt bwt shenwei356 github
https://github.com/gymreklab/gangstr gangstr gymreklab github
# ---------------------------
# Accessing the material
# https://tinyurl.com/bioc2017-ELMER
# ---------------------------
library("Bioc2017.TCGAbiolinks.ELMER")
Biobase::openVignette("Bioc2017.TCGAbiolinks.ELMER")
# ---------------------------
# Section 1:
# Aims:
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 30, 2026 15:39
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@ckandoth
ckandoth / ensembl_vep_85_with_offline_cache.md
Last active May 15, 2018 08:50
Install Ensembl's VEP v85 with various caches for running offline

Ensembl's VEP (Variant Effect Predictor) is popular for how it picks a single effect per gene as detailed here, its CLIA-compliant HGVS variant format, and Sequence Ontology nomenclature for variant effects.

To follow these instructions, we'll assume you have these packaged essentials installed:

## For Debian/Ubuntu system admins ##
sudo apt-get install -y build-essential git libncurses-dev

## For RHEL/CentOS system admins ##
sudo yum groupinstall -y 'Development Tools'

sudo yum install -y git ncurses-devel

@renkun-ken
renkun-ken / product-info.csv
Created July 25, 2016 13:18
Demo data of products
id name type class released
T01 SupCar toy vehicle yes
T02 SupPlane toy vehicle no
M01 JeepX model vehicle yes
M02 AircraftX model vehicle yes
M03 Runner model people yes
M04 Dancer model people no