Skip to content

Instantly share code, notes, and snippets.

View brantfaircloth's full-sized avatar

Brant Faircloth brantfaircloth

View GitHub Profile
@brantfaircloth
brantfaircloth / gist:895282
Created March 30, 2011 20:55
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)

@brantfaircloth
brantfaircloth / bed_from_genbank.py
Created March 29, 2011 23:41
BED file from Genbank (*.gb) file
#!/usr/bin/env python
# encoding: utf-8
"""
bed_from_genbank.py
grab the gene records from a genbank file (edit for other record types).
- requires: biopython
"""

Proper Setup of Py2App

This assumes you have a proper Framework'd Python installation.

brew install python --framework 

Install Qt v4.7.1

@brantfaircloth
brantfaircloth / setup.md
Last active September 25, 2015 00:47
beast and beagle-lib on amazon ec2 HPC-GPU instance
  • TODO: need to check block device mapping flags

  • crank up an instance

      ec2-run-instances --key ec2-keypair ami-aa30c7c3 --instance-type=cg1.4xlarge \
      --block-device-mapping '/dev/sdb=ephemeral0' \
      --block-device-mapping '/dev/sdc=ephemeral1'
    
  • check for instance status and to get ip address for ssh

@brantfaircloth
brantfaircloth / beast_subs_models.xml
Created February 17, 2011 21:56
Alternate substitution models for BEAST and *BEAST (xml fragments)
<!-- Juke it, baby, Juke it -->
<gtrModel id="JC69">
<frequencies>
<frequencyModel dataType="nucleotide">
<frequencies>
<!-- JC69 frequencies are equal -->
<parameter id="JC69.frequencies" value="0.25 0.25 0.25 0.25"/>
</frequencies>
</frequencyModel>
</frequencies>
@brantfaircloth
brantfaircloth / gist:823271
Created February 11, 2011 23:39
Running 454 assembly on ec2 (using gsAssembler/newbler/runAssembly)
  • make sure we map the ephemeral storage to the instance on the instance start. This uses a 64-bit Amazon Linux AMI, which is modeled on Fedora. So, the typical Fedora install commands work (e.g. yum install whatever):

      ec2-run-instances --key keypair ami-74f0061d \
      --instance-type=m2.2xlarge \
      --block-device-mapping '/dev/sda2=ephemeral0' \
      --block-device-mapping '/dev/sda3=ephemeral1'
    
  • dont think we actually need them, but i like to have them around, in case we do - they also install glibc.x86_64

yum groupinstall "Development Tools"

@brantfaircloth
brantfaircloth / check_enzymes.py
Created February 2, 2011 00:17
Iterate over restriction enzymes, finding those with 3' overhang and no ambiguous cut sites
import pdb
from Bio import SeqIO
from Bio import Restriction
seq = SeqIO.read(open('araTha9/chr5.fas','rU'),'fasta')
for attr,value in Restriction.__dict__.iteritems():
if not attr.startswith('_'):
if attr not in ['Restriction', 'RestrictionBatch',
'Restriction_Dictionary', 'AllEnzymes', 'Analysis', 'CommOnly',
@brantfaircloth
brantfaircloth / get_species_taxonomy.py
Created January 29, 2011 18:53
Lookup NCBI taxonomy for species by name
import sys
from Bio import Entrez
def get_taxid(species):
"""to get data from ncbi taxomomy, we need to have the taxid. we can
get that by passing the species name to esearch, which will return
the tax id"""
species = species.replace(" ", "+").strip()
search = Entrez.esearch(term = species, db = "taxonomy", retmode = "xml")
record = Entrez.read(search)
@brantfaircloth
brantfaircloth / gist:800838
Created January 28, 2011 19:58
Finding Angiosperm chloroplast genomes on Genbank
# setup filter (my require MyNCBI signup) for Angiosperms. Choose "Browse Filters". Go to:
Filters » Nucleotide » Properties » Taxonomic Groups » Plants
# select
"Flowering Plants"
# run this query in nucleotide
@brantfaircloth
brantfaircloth / sphinx_to_github.sh
Created January 23, 2011 02:40
Sphinx documentation to github gh-pages without submodules
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
#
# proj/
# source/
# doc/
# remove doc/_build/html if present