Skip to content

Instantly share code, notes, and snippets.

@kgori
kgori / dna.tree
Created August 1, 2014 17:01
PLL_partition_segfault_example
(cal:0.1,ctr:0.1,(lel:0.1,(pst:0.1,((dha:0.1,pgu:0.1):0.1,(yli:0.1,((cgl:0.1,(sca:0.1,(sba:0.1,(sku:0.1,(smi:0.1,(sce:0.1,spa:0.1):0.1):0.1):0.1):0.1):0.1):0.1,((kwa:0.1,skl:0.1):0.1,(ago:0.1,kla:0.1):0.1):0.1):0.1):0.1):0.1):0.1):0.1);
@kgori
kgori / bpp-core_Exceptions_patch
Created July 6, 2014 22:10
bpp-core2.1.0_patch
diff --git a/src/Bpp/Exceptions.h b/src/Bpp/Exceptions.h
index 2ac2c53..ce62920 100644
--- a/src/Bpp/Exceptions.h
+++ b/src/Bpp/Exceptions.h
@@ -44,6 +44,7 @@ knowledge of the CeCILL license and that you accept its terms.
#include <stdexcept>
#include <vector>
+#include <string>
@kgori
kgori / mem_alloc_patch
Created May 18, 2014 20:26
Patch for building libpll on Mac: mem_alloc.h
diff --git a/src/mem_alloc.h b/src/mem_alloc.h
index 4dc4ce7..88828e0 100644
--- a/src/mem_alloc.h
+++ b/src/mem_alloc.h
@@ -2,7 +2,9 @@
#define __mem_alloc_h
#include <stddef.h>
#include <stdlib.h>
+#ifdef __linux__
#include <malloc.h>
@kgori
kgori / fasta.py
Last active October 27, 2016 16:41
Fasta parser - python oneliners
import re
# Fasta one-liners
# Parse fasta from a string
def fasta_parse_string(s):
return dict([(lambda x:(x[0].strip(), re.sub(r'\s+','',x[2])))(l.partition('\n')) for l in s.split('>')[1:]])
# Parse fasta from a file
def fasta_parse_file(f):
with open(f) as h:return fasta_parse_string(h.read())
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@kgori
kgori / axml.c
Last active August 29, 2015 13:57
Ambiguity codes in phyml and raxml
// RAXML code for setting up likelihood tip vectors for different characters
//TGCA - notes added KG
meaningDNA['A'] = 1; //0001
meaningDNA['B'] = 14; //1110
meaningDNA['C'] = 2; //0010
meaningDNA['D'] = 13; //1101
meaningDNA['G'] = 4; //0100
meaningDNA['H'] = 11; //1011
meaningDNA['K'] = 12; //1100
meaningDNA['M'] = 3; //0011
@kgori
kgori / simpleEx.orthoxml
Last active August 29, 2015 13:57
FamilyAnalyzer example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgori
kgori / gist:9638521
Created March 19, 2014 09:39
demo ipython notebook
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{