Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
from __future__ import print_function
try:
from setuptools import setup, find_packages, Extension
except ImportError:
from distutils.core import setup, Extension
def find_packages():
return ['treeCl']
try:
from Cython.Distutils import build_ext
@kgori
kgori / pll.c
Created November 11, 2014 15:37
Basic tree builder using PLL, outputs all parameters
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <pll/pll.h>
#define EXIT_NO_OVERWRITE 4
#define EXIT_INCOMPATIBLE_TREE_ALIGNMENT 3
#define EXIT_PARTITIONS_PARSE_FAILURE 2
#define EXIT_ALIGNMENT_PARSE_FAILURE 1
#define EXIT_SUCCESS 0
@kgori
kgori / gene_tree_tracer_example.ipynb
Created March 10, 2015 13:37
gene_tree_tracer_example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgori
kgori / parse_orthoxml.ipynb
Created March 10, 2015 14:07
Parse OrthoXML
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgori
kgori / pll_h_patch
Last active August 29, 2015 14:21
pll.h patch
diff --git a/src/pll.h b/src/pll.h
index 6941efb..572179c 100644
--- a/src/pll.h
+++ b/src/pll.h
@@ -123,7 +123,7 @@ extern "C" {
#define PLL_BADREAR -1
-#define PLL_NUM_BRANCHES 50
+#define PLL_NUM_BRANCHES 5000
@kgori
kgori / search_algo_patch
Last active August 29, 2015 14:21
Patch searchAlgo.c
diff --git a/src/searchAlgo.c b/src/searchAlgo.c
index c0547b0..3c1a578 100644
--- a/src/searchAlgo.c
+++ b/src/searchAlgo.c
@@ -2711,7 +2711,7 @@ pllComputeTBR (pllInstance * tr, partitionList * pr, nodeptr p, int mintrav,
@return
The likelihood yielded from the NNI
*/
-static double
+double
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgori
kgori / biopython--concatenate.ipynb
Created June 17, 2015 11:51
Concatenate alignments with biopython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgori
kgori / discrete_gamma.c
Created July 6, 2015 15:25
Cython wrapper of PAML discrete gamma rates function
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "discrete_gamma.h"
// PAML code for discrete gamma
// Forward decs
double QuantileChi2(double prob, double v);
double LnGammaFunction(double alpha);
double IncompleteGamma(double x, double alpha, double ln_gamma_alpha);
@kgori
kgori / pairdist.py
Last active September 10, 2015 09:14
Maximum likelihood distance between pairs of sequences
import numpy as np
def setup_logger():
import logging
logger = logging.getLogger()
for handler in logger.handlers:
logger.removeHandler(handler)
ch=logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)