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
@jasonsychau
jasonsychau / this_file_path.R
Last active July 2, 2023 01:35
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 May 24, 2024 14:17
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
#!/bin/bash
# function Extract for common file formats
function extract {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
else
if [ -f "$1" ] ; then
NAME=${1%.*}