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 / gist:a4c8c2b127789919901443c1537860ff
Created January 2, 2020 04:49 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@Yixf-Self
Yixf-Self / exome-coverage-multi.sh
Created December 27, 2018 02:26 — forked from stephenturner/exome-coverage-multi.sh
run bedtools coverage on multiple files using GNU parallel
# Set up to run in GNU parallel.
find *bam | parallel 'bedtools coverage -hist -abam {} -b target_regions.bed | grep ^all > {}.hist.all.txt'
# What this actually runs:
bedtools coverage -hist -abam samp.01.bam -b target_regions.bed | grep ^all > samp.01.bam.hist.all.txt
bedtools coverage -hist -abam samp.02.bam -b target_regions.bed | grep ^all > samp.02.bam.hist.all.txt
bedtools coverage -hist -abam samp.03.bam -b target_regions.bed | grep ^all > samp.03.bam.hist.all.txt
bedtools coverage -hist -abam samp.05.bam -b target_regions.bed | grep ^all > samp.05.bam.hist.all.txt
bedtools coverage -hist -abam samp.06.bam -b target_regions.bed | grep ^all > samp.06.bam.hist.all.txt
bedtools coverage -hist -abam samp.10.bam -b target_regions.bed | grep ^all > samp.10.bam.hist.all.txt
@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/"/>
@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 / 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 / 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.
task fastqc {
File fastq
command {
fastqc ${fastq}
}
output {
Array[File] results = glob("*html")
}
runtime
@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.'
@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