To make a Haskell function accessible from the command line, you must add a JSON file to the directory bindings/
that registers the Haskell function.
For example, the file bindings/models/hky85.json
allows the user to specify (for example) -S hky85[kappa=2]
as a substitution model. The JSON looks like this:
{
"name": "hky85",
"title": "The Hasegawa-Kishino-Yano (1985) nucleotide rate matrix",
"deprecated-synonyms": ["HKY","hky","HKY85"],
"result_type": "RevCTMC[a]",
"constraints": ["Nucleotides[a]"],
"citation":{"type": "article",
"title": "Dating of the human-ape splitting by a molecular clock of mitochondrial DNA",
"year": "1985",
"author": [{"name": "Hasegawa, Masami"}, {"name": "Kishino, Hirohisa"}, {"name": "Yano, Taka-aki"}],
"journal": {"name": "Journal of molecular evolution", "volume": "22", "number": "2", "pages": "160--174"},
"identifier": [{"type":"doi","id":"10.1007/BF02101694"}]
},
"call": "hky85[@kappa,frequencies_from_dict[@a,@pi],@a]",
"import": ["SModel"],
"args": [
{
"arg_name": "kappa",
"arg_type": "Double",
"default_value": "~log_normal[log[2],0.25]",
"description": "Transition\/transversion ratio"
},
{
"arg_name": "pi",
"arg_type": "List[Pair[String,Double]]",
"default_value": "~dirichlet_on[letters[@a],1]",
"description": "Letter frequencies"
},
{
"arg_name": "a",
"arg_type": "a",
"default_value": "getAlphabet",
"description": "The alphabet"
}
],
"description":"The HKY85 model",
"extract": "all"
}
The fields are defined as follows:
name
call
import
hky85
is in scope.
result_type
args
The list of named arguments
arg_name
arg_type
default_value
description
title
description