Skip to content

Instantly share code, notes, and snippets.

@peterdfields
peterdfields / hack.sh
Created March 31, 2012 20:07 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
import gzip
import csv
import argparse
import sys
parser = argparse.ArgumentParser(description="script to convert an all sites vcf to sweepfinder format. FASTA description will be the sample name in the VCF header.Only does one chromosome/region at a time.")
parser.add_argument("-v", "--vcf", action="store", required=True, help="Input VCF file. Should be a multisample vcf, though it should theoretically work with a single sample.")
parser.add_argument("-o", "--out", action="store", required=True, help="Output filename")
parser.add_argument("-c", "--chromosome", action="store", required=True, help="Chromosome to output. Should be something in the first column of the vcf.")
parser.add_argument("-g", "--gzip", action="store_true", required=False, help="Set if the VCF is gzipped.")
@peterdfields
peterdfields / vcf2FASTA.py
Created September 10, 2016 16:27 — forked from arundurvasula/vcf2FASTA.py
A script to extract a chromosome from a multisample VCF and create a fasta file
import gzip
import csv
import argparse
import sys
parser = argparse.ArgumentParser(description="script to convert an all sites vcf to FASTA format. FASTA description will be the sample name in the VCF header.Only does one chromosome/region at a time.")
parser.add_argument("-v", "--vcf", action="store", required=True, help="Input VCF file. Should be a multisample vcf, though it should theoretically work with a single sample.")
parser.add_argument("-o", "--out", action="store", required=True, help="Output filename")
parser.add_argument("-c", "--chromosome", action="store", required=True, help="Chromosome to output. Should be something in the first column of the vcf.")
parser.add_argument("-g", "--gzip", action="store_true", required=False, help="Set if the VCF is gzipped.")
@peterdfields
peterdfields / gist:795e7b1317745491bab55dea8d45811d
Created February 21, 2017 09:55 — forked from brantfaircloth/gist:895282
Substitution models in mrbayes

##GTR lset applyto=() nst=6 # GTR lset applyto=() nst=6 rates=propinv # GTR + I lset applyto=() nst=6 rates=gamma # GTR + gamma lset applyto=() nst=6 rates=invgamma # GTR + I + gamma

##SYM

lset applyto=() nst=6                           # SYM

prset applyto=() statefreqpr=fixed(equal)