Skip to content

Instantly share code, notes, and snippets.

View spond's full-sized avatar

Sergei Pond spond

View GitHub Profile
@spond
spond / README.md
Last active August 29, 2015 14:24
Radial tree layout

Different tree layouts.

In addition to linear/cladogram layouts, phylotree.js also implements a radial or cicrular layout. Invoking it is a matter of overriding the default setting.

It is important to set the radial option prior to binding Newick data to the tree, because at that time nodes are mapped to screen coordinates using current settings.

The layout mode can be changed after the tree has been rendered, but then it is

@spond
spond / README.md
Created July 13, 2015 22:21
Multiple trees on page

Multiple trees on a single page

/* 1. include a file to define the genetic code
Note the use of base directory and path forming variables to make this analysis
independent of directory placement
*/
/*incFileName = HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"TemplateModels"+DIRECTORY_SEPARATOR+"chooseGeneticCode.def"; */
/* ExecuteCommands ("#include \""+incFileName+"\";"); */
/* #include "functions.txt";*/ /*functions.txt has the genetic code*/
@spond
spond / EDEPS.bf
Created August 15, 2015 18:23
EDEPS HBL files
RequireVersion ("2.22");
VERBOSITY_LEVEL = 1;
// namespace 'io' for interactive/datamonkey i/o functions
LoadFunctionLibrary("lib2014/IOFunctions.bf");
// namespace 'utility' for convenience functions
LoadFunctionLibrary("lib2014/UtilityFunctions.bf");
io.displayAnalysisBanner ({"info" : "EDEPS is a modification of DEPS to look for directional evolution along all or
@spond
spond / dNdS.bf
Created August 21, 2015 19:50
Pairwise dN/dS estimation
/*
THIS HyPhy BATCH LANGUAGE FILE IS PROVIDED AS AN EXAMPLE/TOOL FOR
THE 2nd EDITION OF 'The Phylogenetic Handbook'
Written by
Sergei L Kosakovsky Pond (spond@ucsd.edu)
Art FY Poon (apoon@ucsd.edu)
Simon DW Frost (sdfrost@ucsd.edu)
@spond
spond / README.md
Last active March 10, 2016 18:38
FUBAR estimates of dN-dS

Plot site-by-site estimates of dN-dS from FUBAR .csv files

Take the output (main .CSV) of FUBAR, and create a D3 plot over sites. Optionally, partition the plot into chunks of different color (e.g. gene/genome regions), and annotate them with horizontal bars.

@spond
spond / README.md
Last active March 11, 2016 21:42
Color terminal branches based on user-specified clustering; style interior branches based on bootstrap support.

Annotated tree

An example that shows how to use styling call-backs to

  1. Color terminal branches based on an externally supplied annotation (cluster assignment)
  2. Adjust thickness of interior branches based on their bootstrap support
  3. Label interior nodes (for the cladogram layout) with bootstrap values
@spond
spond / README.md
Last active March 30, 2016 20:42
MEME vs MEME-internal [chart]

Compare the results of MEME and MEME-internal on the same dataset

The two charts show mean ω (internal branches only, for MEME-internal, and the entire tree for MEME) over sites. Sites with evidence for episodic diversifying selection are shown as circles along the x-axis.

@spond
spond / README.md
Last active March 30, 2016 20:45
MEME vs MEME-internal [table]

Compare the results of MEME and MEME-internal on the same dataset

The table shows any site which was found significant (p ≤ 0.05) by either version of MEME.

@spond
spond / README.md
Last active May 18, 2016 18:48
How to add custom menu items to phylotree.js

How to add custom context menu items to tree nodes

This is accomplished via a call to d3_add_custom_menu which adds a menu to a specific node with callback defining

  1. What text is displayed (based on the node object and associated data)
  2. What happens on click (pass nodes and other data through transitive closure, because standard d3 .on handlers will be called on the menu item, not the node object).
  3. When the menu item is shown (a boolean callback based on the node object and associated data)