Skip to content

Instantly share code, notes, and snippets.

@samesense
samesense / dev.sh
Last active March 27, 2019 02:22
dev
docker run -it --detach-keys="ctrl-@" -v /mnt/isilon/:/mnt/isilon/ --user $(id -u) quay.research.chop.edu/evansj/evansj-dev-box zsh
@samesense
samesense / bg-github
Created February 12, 2019 21:32
gh-query
SELECT
repos.repo_name
FROM
`bigquery-public-data.github_repos.sample_repos` repos
LEFT JOIN
`bigquery-public-data.github_repos.sample_files` files
ON
repos.repo_name = files.repo_name
LEFT JOIN
`bigquery-public-data.github_repos.sample_contents` contents
@samesense
samesense / nf-core_pipelines.md
Last active October 22, 2018 16:58
nf-core_pipelines
@samesense
samesense / pi_max.R
Last active July 23, 2018 14:52
pausing-index-max-by-gene.R
require(dplyr)
require(magrittr)
in_file = "WT_JC4.pausing.2018_05_31.csv"
df = read.delim(in_file, header=TRUE, sep="\t")
maxes <- group_by(df, .dots=c("exp", "gene")) %>% summarize(pausing_index=max(pausing_index))
m = merge(as.data.frame(maxes), df, by=c("exp", "gene", "pausing_index"))
write.table(m, "out.tmp", row.names=FALSE, sep="\t", quote=F)
@samesense
samesense / run-phenoxome.md
Last active October 15, 2019 13:51
Run docker phenoxome

Data download; put data in /absolute/local/data/, called YOUR_DIR below

  • Make a directory to hold data (/absolute/local/data/).
  • Make these folders under your data dir: phenoxome_data/
  • Put data in {YOUR_DIR}/phenoxome_data/
    • human_g1k_v37.fasta
    • HGMD.vcf.gz and HGMD.vcf.gz.tbi (rename HGMD file in vcfanno toml file)
    • gnomad.exomes.r2.0.1.sites.vcf.gz and gnomad.exomes.r2.0.1.sites.vcf.gz.tbi

Start the phenoxome container with a mount to your local data.

@samesense
samesense / docker_ngs.plot_usage.sh
Last active February 19, 2023 21:24
script to run inside docker hub image samesense/ngs_plot
# Use this inside https://hub.docker.com/r/samesense/ngs_plot/
# set env variables
alias python='/condas/miniconda3/bin/python'
export PATH=/condas/miniconda3/bin/:$PATH
export NGSPLOT=/bin/ngsplot
export PATH=/bin/ngsplot/bin/:$PATH
source /condas/miniconda3/bin/activate py27
# cannot write in default dir
@samesense
samesense / python_argparse
Created April 29, 2017 21:05
python main
import argparse
def main(args):
giabBaseCounts(d, args.giabCountFile)
if __name__ == "__main__":
desc = 'Pull data for report.'
parser = argparse.ArgumentParser(description=desc)
argLs = ('giabCountFile', 'outFile',)
for param in argLs:
@samesense
samesense / local.pbcopy.9999.plist
Created March 22, 2017 14:24
macOS plist file for launchclt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.pbcopy.9999</string>
<key>UserName</key>
<string>joe</string>
<key>Program</key>
<string>/usr/bin/pbcopy</string>
@samesense
samesense / remote_to_local_clipboard.md
Last active May 15, 2019 11:32
Copy to local machiine clipboard from iteractive remote session

Copy to local machine clipboard from iteractive remote session

  • Works with macOS and remote linux machine
  • On local machine, make this plist file to use with launchclt
  • On local machine launchctl load local.pbcopy.9999.plist. This must remain running for remote copy to work.
  • On remote machine cat "message or file" | nc localhost 9997 -w1
  • nc is at /mnt/isilon/cbmi/variome/perry/bin/nc
  • On local machine, use paste or pbpaste as usual

Extra

  • On my locate machine, p is aliased to the launchctl command
@samesense
samesense / targetTodo
Last active January 15, 2016 14:55
TARGET todo list for mtg
* Data checksums
* Collapse variants by chrom
* Pull reads of all variant positions across bam files
* Pull mapping qualities
* Apply cutoffs
* Annotate collapsed variants w/ function and pop info
* Mk tables