command | description |
---|---|
ctrl + a | Goto BEGINNING of command line |
# Last updated May, 2024 for Apple silicon Macs | |
# Install Homebrew if you don't already have it: https://brew.sh | |
# install nano from homebrew | |
brew install nano nanorc | |
# update your nanorc file | |
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc | |
# close and re-open your terminal and you'll have syntax highlighting |
def explode_hstore(df, column): | |
"""Explode a column of a dataframe containing PostgreSQL hstore k-v pairs in the format of: | |
"foo"=>"bar", "baz"=>"quux", ... | |
Every key becomes a column. If a given row's pairs doesn't have a key, then the resulting column's value | |
will contain NaN. | |
""" | |
# split the tags column out as a new series, and break up each k=>v pair | |
s = df[column].str.split(', ').apply(pd.Series, 1).stack() |
This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.
To use the script, follow the instructions given in the script's docstring.
For further details, read this blogpost.
The procedure outlined here is inspired by this answer on Stack Overflow.
Byobu is a suite of enhancements to tmux, as a command line | |
tool providing live system status, dynamic window management, | |
and some convenient keybindings: | |
F1 * Used by X11 * | |
Shift-F1 Display this help | |
F2 Create a new window | |
Shift-F2 Create a horizontal split | |
Ctrl-F2 Create a vertical split | |
Ctrl-Shift-F2 Create a new session |
Clone this gist into the working directory
git clone [email protected]:96670d2eb66a8ad9854b6f52a2b5339c.git vagrant-ansible-neo
cd vagrant-ansible-neo
Install the neo4j role into the working directory
ansible-galaxy install julienroubieu.neo4j -p .
Bring up the vagrant box
#!/bin/bash | |
## Wrapper to interact with NCBI SRA using aspera ascp command line interface | |
## v 2.5 | 04/2017 | |
## @sbamin | |
# More info: http://download.asperasoft.com/download/docs/ascp/2.7/html/ | |
# usage | |
show_help() { |
{ | |
"mongod_log": { | |
"title": "MongoDB server log format", | |
"regex": { | |
"main": { | |
"pattern": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[,\\.]\\d+\\+\\d+)\\s+(?<level>\\w)\\s+(?<component>\\w+|-)\\s+\\[?(?<context>-?\\w+)?\\]\\s+(?<body>.*)$" | |
} | |
}, | |
"level": { | |
"critical": "F", |
*bcftools filter | |
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2) | |
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz | |
*printing out info for only 2 samples: | |
bcftools view -s NA20818,NA20819 filename.vcf.gz | |
*printing stats only for variants passing the filter: | |
bcftools view -f PASS filename.vcf.gz |
Read the Sanger How-to page to make sure your vcf file meets all the requirements for Sanger imputation.
The preimputation steps for UMichigan and Sanger are relatively similar. The main difference is that VCF files are not split by chromosome under sanger imputation. I recommend carrying out the Michigan preimputation steps anyways. If you have already carried out the preimputation steps for U Mich imputation then the only other requirement will be to merge the chr.vcf files into one vcf file and sort the result.
#merge vcf files from list of files
bcftools concat --file-list ~/preimputation/vcf_list.txt -o merged.vcf
gzip merged.vcf