Cogent3 Cookbook¶
Contents:
- Introduction
- Manipulating biological data
- Sequences and Alignments
- Genetic code
- Available genetic codes
- Getting a genetic code with
get_code() - Translate DNA sequences
- Translate all six frames
- Find out how many stops in a frame
- Translate a codon
- Look up the amino acid corresponding to a single codon
- Or get all the codons for one amino acid
- For a group of amino acids
- Converting the
CodonAlphabetto codon series - Obtaining the codons from a
DnaSequenceobject
- Trees
- Tables
- Building alignments
- Genetic distance calculation
- Building phylogenies
- Evolutionary Analysis Using Likelihood
- Specifying substitution models
- Making a likelihood function
- Providing an alignment to a likelihood function
- Scoping parameters on trees – time heterogeneous models
- Specifying a parameter as constant
- Providing a starting value for a parameter
- Setting parameter bounds for optimisation
- Setting an upper bound for branch length
- Specifying rate heterogeneity functions
- Specifying Phylo-HMMs
- Fitting likelihood functions - Choice of optimisers
- How to check your optimisation was successful
- Overview of the fitted likelihood function
- Testing Hypotheses - Using Likelihood Ratio Tests
- Determining confidence intervals on MLEs
- Saving results
- Reconstructing ancestral sequences
- Tips for improved performance – sequentially build the fitting
- Useful Utilities
UnionDict– a dict with set like operations and keys as attributes- Using Cogent3’s optimisers for your own functions
- Miscellaneous functions
- Identity testing
- Force a variable to be iterable
- Curry a function
- Test to see if an object is iterable
- Test to see if an object is a single char
- Flatten a deeply nested iterable
- Test to determine if
listoftuple - Create a case-insensitive iterable
- Construct a distance matrix lookup function
- Check class types
- Delegate to a separate object
- Wrap a function to hide from a class
- Construct a constrained container