This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -s "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/refFlat.txt.gz" \ | |
| | gunzip -c \ | |
| | awk '{n=int($9); split($10,S,/,/);split($11,E,/,/); for(i=1;i<=n;++i) {printf("%s\t%s\t%s\t%s\n",$3,S[i],E[i],$1);} }' \ | |
| > refFlat.exons.hg19.bed | |
| bedtools sort -i refFlat.exons.hg19.bed > refFlat.exons.hg19.sorted.bed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import numpy as np | |
| from scipy import ndimage | |
| from scipy.cluster.vq import kmeans | |
| from scipy.misc import imsave | |
| def rgb2hex(r, g, b): | |
| return '#{:02x}{:02x}{:02x}'.format(r, g, b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.core.magic import (Magics, magics_class, line_magic, | |
| cell_magic, line_cell_magic, needs_local_scope) | |
| # The class MUST call this class decorator at creation time | |
| @magics_class | |
| class ProgressMagic(Magics): | |
| @line_magic | |
| @needs_local_scope | |
| def progress(self, line, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #As an example, get all ".fa.gz" files from a directory | |
| wget -r -np --spider ftp://ftp.ncbi.nlm.nih.gov/genomes/Sus_scrofa/CHR* 2>&1 | grep -Eo "ftp\:.*\.fa\.gz" | uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requires `tree` package | |
| alias lst='tree -CAL 2 $1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias lst='tree -L 2 $1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function csv() { cat "$@" | column -t -s, | less -S; } | |
| function tsv() { cat "$@" | column -t -s"\t" | less -S; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shopt -s histappend | |
| export HISTSIZE=100000 | |
| export HISTFILESIZE=100000 | |
| export HISTCONTROL=ignoredups:erasedups | |
| export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put in ~/.bash_profile or similar. | |
| # PS1 (prompt) | |
| # Reset | |
| Color_Off="\[\033[0m\]" # Text Reset | |
| # Regular Colors | |
| Black="\[\033[0;30m\]" # Black | |
| Red="\[\033[0;31m\]" # Red | |
| Green="\[\033[0;32m\]" # Green |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.