Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
if (length(args)<1) {
stop("A Rmarkdown file has to be specified\n", call.=FALSE)
} else if (length(args)>0) {
# default output file
markdownFile = args[1]
for (markdownFile in args){
rmarkdown::render(markdownFile)
@wckdouglas
wckdouglas / cleanBib.py
Last active January 27, 2016 16:38
cleaning bibtex file for correct upper case title and remove url record. Running by: PYTHONIOENCODING=utf-8 python cleanBib.py
#!/bin/env python
import bibtexparser
import argparse
import sys
import re
from bibtexparser.bibdatabase import BibDatabase
from bibtexparser.bwriter import BibTexWriter
def modifiedTitle(title):
#!/bin/env Rscript
library(RMySQL)
library(dplyr)
library(stringr)
library(readr)
conn <- dbConnect(MySQL(),
user='genome',
dbname='hg38',
#!/bin/bash
BAMPATH=.
RESULTPATH=.
GENESFILE=allRegions.SAF
STRANDENESS=1
THREADS=20
featureCounts -a $GENESFILE -F SAF \
-o /dev/stdout -O -s $STRANDENESS -Q 5 \
#!/bin/env Rscript
library(readr)
library(DESeq2)
library(BiocParallel)
library(dplyr)
library(stringr)
library(tidyr)
library(cowplot)
library(ggrepel)
#!/bin/bash
if ! [ -x $(command -v conda) ]
then
echo Conda not installed in PATH
exit
else
if ! [ -x $(command -v pip) ]
then
@wckdouglas
wckdouglas / gvimrc
Created March 23, 2016 23:09
for macvim
set guioptions=T
colorscheme onedark
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='onedark'
set laststatus=2
"tab
noremap <D-1> :tabn 1<CR>
#!/bin/bash
#install pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo '
execute pathogen#infect()
syntax on
filetype plugin indent on
@wckdouglas
wckdouglas / conda-packages.txt
Created June 1, 2016 04:51
package list for conda
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
backports=1.0=py27_0
backports_abc=0.4=py27_0
bamtools=2.4.0=3
bcftools=1.3=0
bedops=2.4.19=0
bedtools=2.25.0=1
bioconductor-annotationdbi=1.32.3=0
@wckdouglas
wckdouglas / flag_filter.json
Created August 7, 2016 01:12
bamtools filter script for paried end sequences
{
"filters":[
{ "id":"firstPairForward",
"alignmentFlag" : "99" },
{"id":"firstPairReverse",
"alignmentFlag" : "83"},
{"id":"secondPairForward",
"alignmentFlag" : "163"},
{"id":"secondPairReverse",
"alignmentFlag" : "147"}