Skip to content

Instantly share code, notes, and snippets.

@sahilseth
sahilseth / gist:78721eada1f0007c7afd
Created November 12, 2015 16:40
db nfsp information
dbNSFP version 3.0b2a
Release:
April 12, 2015
Major sources:
Variant determination:
Gencode release 22/Ensembl 79, released March, 2015 (hg38)
Functional predictions:
SIFT ensembl 66, released Jan, 2015 http://provean.jcvi.org/index.php
@sahilseth
sahilseth / git_cmds
Last active November 13, 2015 17:27
My list of git commands
# clone
git clone source
# add changes to be committed
git add .
git commit -m "my message"
git push
@sahilseth
sahilseth / custom R funcs.R
Created November 13, 2015 22:02
list or functions in R
a<-1:5
fn<-lapply(a, function(i) {
force(i)
function(x) {
x * i
}
})
@sahilseth
sahilseth / keynote theme
Created November 16, 2015 14:32
keynote themes folder
cd ~/Library/Containers/com.apple.iWork.Keynote/Data/Library/Application\ Support/User\ Templates/
@sahilseth
sahilseth / gzip_files.sh
Created November 18, 2015 18:01
gunzip files
fqs=$(find . -name '*.fastq')
for fq in $fqs; do
echo "zipping $fq ...."
gzip $fq
done
@sahilseth
sahilseth / gist:c0d305e8981274228c6b
Created November 22, 2015 21:56
solving issues with GCC/ruby on apple
# issue: http://stackoverflow.com/questions/10575679/bundle-update-fails-on-ffi
# install apple commandline tools:
xcode-select --install
@sahilseth
sahilseth / bioawk.sh
Last active May 5, 2018 21:21
bioawk/flowr tutorial
# install this cool tools from Heng Li (https://github.com/lh3/bioawk)
brew install bioawk
# information regarding exit_code:
# - NA: not started yet
# show lines where job started and had errors
bioawk -tc hdr '{if($exit_code!=0 && $started=="TRUE") print $jobname, $cmd, $exit_code}' flow_details.txt
# show lines which did not start
@sahilseth
sahilseth / highlight
Created November 30, 2015 19:46
highlight code for keynote etc
Do you want to display some code in a Keynote presentation?
It's easy. All you need is Homebrew installed.
First you need to install the program highlight.
brew install highlight
So you have a piece of code. For example some Python code. The take that snippet of code and save it to a file like code.py. Now all you need to do is run this:
highlight -O rtf code.py | pbcopy
@sahilseth
sahilseth / git_submodules.sh
Created December 1, 2015 06:41
git submodules
# here is scratchpad on various steps which are helpful in using git submodules
# holy grail of details: https://git-scm.com/book/en/v2/Git-Tools-Submodules
# adding a submodule
git submodule add <URL>
# clone a repo with submodules
git clone --recursive <URL>
@sahilseth
sahilseth / send_mail.R
Last active April 9, 2016 02:18
sending mail from R with attachments
library(sendmailR)
send_mail <- function(msg="", subject, tos = c("[email protected]"), attachment}
from <- sprintf("<abc@%s.inst.edu>", Sys.info()[4])
if(missing(subject))
subject <- paste("morning!")
salute <- paste("Hello there\n I just ran the tracker on ")
body <- c(salute, "\n", msg, "\n", mime_part(attachment))