Skip to content

Instantly share code, notes, and snippets.

View Yixf-Self's full-sized avatar

Yi Xianfu Yixf-Self

View GitHub Profile
@Yixf-Self
Yixf-Self / automation.md
Created June 27, 2016 06:36 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@Yixf-Self
Yixf-Self / clock.R
Created July 9, 2016 00:41 — forked from drewconway/clock.R
Generate an animated clock in R with ggplot2
# Generate digitial clock face
first.nine <- c('00', '01', '02', '03', '04', '05', '06', '07', '08', '09')
hours <- c(first.nine, as.character(seq(10,23,1)))
mins <- c(first.nine, as.character(seq(10,59,1)))
time.chars.l <- lapply(hours, function(h) paste(h, ':', mins, sep=''))
time.chars <- do.call(c, time.chars.l)
# Generate analog clock face
hour.pos <- seq(0, 12, 12/(12*60))[1:720]
min.pos <-seq(0,12, 12/60)[1:60]
#!/usr/bin/python
"""
%prog [options] pair_1.fastq pair_2.fastq
filter reads from paired fastq so that no unmatching reads remain.
output files are pair_1.fastq.trim and pair_2.fastq.trim
see: http://hackmap.blogspot.com/2010/09/filtering-paired-end-reads-high.html
"""
from subprocess import Popen, PIPE
import sys
@Yixf-Self
Yixf-Self / bash-cheatsheet.sh
Created July 20, 2017 00:35 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@Yixf-Self
Yixf-Self / bash-cheat-sheet
Created July 20, 2017 00:43
BASH Cheat Sheet
B A S H C H E A T S H E E T
to page output forward (only): command filename | more
to page output forward & back: command filename | less
to print a dataset: lp datasetname (-d printerid) (-o landscape)
USE OF QUOTATION MARKS
echo "$varname" = echo The value of \$varname is \"$varname\"
= echo "The value of \$varname is \"$varname\"."
$fred='Four spaces between these words.'
task fastqc {
File fastq
command {
fastqc ${fastq}
}
output {
Array[File] results = glob("*html")
}
runtime
@Yixf-Self
Yixf-Self / 000_geom_bag.r
Created September 3, 2017 00:47 — forked from benmarwick/000_geom_bag.r
Basic bagplot geom for ggplot2
#' Bagplot
#'
#' The bag geom is useful for graphical summaries of scatterplots. It
#' is effective at showing the location, spread, skewness, and
#' outliers of a data set.
#'
#' A bagplot is a bivariate generalization of the well known boxplot. It
#' was proposed by Rousseeuw, Ruts, and Tukey. This geom plots bagplots that
#' are very similar to the one described in Rousseeuw et al. and
#' uses code from their bagplot functions in the aplpack pacakge.
@Yixf-Self
Yixf-Self / server.R
Created December 5, 2017 09:48 — forked from duxan/server.R
A Shiny/R app to display the Illumina human body map dataset. I have not included the expression data due to it's size (19Gb) but this should work with any RNA-seq data set analysed with a TopHat->Cufflinks->CuffDiff pipeline.
library(shiny)
library(deSolve)
library(cummeRbund)
# load cuffDiff data, must be in top dir and called cuffData.db:
cuff = readCufflinks()
shinyServer(function(input,output) {
getData = reactive(function() {
@Yixf-Self
Yixf-Self / memusg
Created January 18, 2018 09:46 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <[email protected]>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@Yixf-Self
Yixf-Self / findhao_rss_sources.xml
Created September 26, 2018 01:28 — forked from FindHao/findhao_rss_sources.xml
我的rss订阅源
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<opml version="1.0">
<head>
<title>
Subscriptions of find from Inoreader [https://www.inoreader.com]
</title>
</head>
<body>
<outline text="Blogs" title="Blogs">
<outline text="cgnail's weblog" title="cgnail's weblog" type="rss" xmlUrl="http://cgnail.github.io/atom.xml" htmlUrl="http://cgnail.github.io/"/>