Skip to content

Instantly share code, notes, and snippets.

View leipzig's full-sized avatar

Jeremy Leipzig leipzig

View GitHub Profile
@leipzig
leipzig / gb_client.pl
Last active August 29, 2015 14:05
access Haplogrep compatible input from a Genbank id
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request::Common;
my $userAgent = LWP::UserAgent->new(timeout => 1800); #a half-hour
my $request = POST 'http://mitomaster.mitomap.org/cgi-bin/websrvc.cgi', [
gb => $ARGV[0],
fileType => 'id',
output => 'hsd'

title: "Template for writing scientific papers in R markdown" author: "Petr Keil, pkeil@seznam.cz" date: "11/1/2015" output: pdf_document: fig_caption: yes keep_tex: yes number_sections: yes html_document:

---
title: "Template for writing scientific papers in R markdown"
author: "Petr Keil, pkeil@seznam.cz"
date: "11/1/2015"
output:
pdf_document:
fig_caption: yes
keep_tex: yes
number_sections: yes
html_document:
@leipzig
leipzig / Makefile
Created December 6, 2011 21:04
makefile for a mirna deep sequencing project
#Directories
SOURCEDIR := sources
FASTQDIR := fastq
DECODEDDIR := decoded
BAMDIR := bam
SCRIPTDIR := scripts
TRIMMEDDIR := trimmed
#Parameters
MIN_LENGTH := 15
@leipzig
leipzig / microarray.R
Created January 19, 2012 02:19
When can we expect the last damn microarray?
library("plyr")
library("XML")
library("ggplot2")
#Concatenate SQL-style
concat<-function(...,sep="",collapse=NULL){
strings<-list(...)
#NULL, NA
if(
all(unlist(llply(strings,length))>0)
@leipzig
leipzig / seq2haplogrep.pl
Created September 18, 2012 02:45
This program converts mutations in mitochondrial sequences into HaploGrep format using the Mitomaster web service.
#!/usr/bin/perl
use strict;
use Getopt::Std;
use LWP::UserAgent;
use HTTP::Request::Common;
my %opt;
my $opt_string = 'hcms';
getopts( "$opt_string", \%opt ) or &usage();
@leipzig
leipzig / autopass.sh
Created May 14, 2013 16:55
Expect script for Aspera uploads for use when the server chokes on wildcards
#!/usr/bin/expect -f
#Upload a file to an Aspera server, filling in the passphrase field
#Usage: ./autopass.sh mybigassfile
set arg1 [lindex $argv 0]
set timeout -1
spawn ascp -i sra-rsakey-putty.ppk -k 1 -Qr -l300M $arg1 user@asperadomain.ncbi.nlm.nih.gov:protected/
expect "Passphrase for key \"rsa-key-blahblah\":"
send "mypassword\r"
expect "Completed"
#add the file you successfully uploaded to a log
@leipzig
leipzig / Makefile
Last active December 28, 2015 05:49
extract from a VCF known disease loci obtained from Gene Cards
default: vcffilesdone
clean:
rm disease_loci/*/*vcf
rm vcffilesdone
#gene cards list of known disease loci
diseaseloci.html:
curl http://www.genecards.org/cgi-bin/listdiseasecards.pl?type=full > diseaseloci.html
#scrape loci
@leipzig
leipzig / gist:a38fadecdf72ccde02fec1e67c404cf4
Created August 4, 2017 15:07
Installing packages in emacs using Melpa
#requires 24.4 or higher, just use conda version
M-x list-packages
C-v to scroll down
hit return on desired packages
C-x o to switch panes
go to [Install] hit return
{
"input_file": {
"class": "File",
"path": "https://raw.githubusercontent.com/briandoconnor/dockstore-tool-md5sum/master/md5sum.input"
},
"output_file": {
"class": "File",
"path": "s3://panoramabatch/md5sum.txt"
}
}