Codon Optimal Likelihood Discoverer


Utilities

The package also provides the following utility programs for converting files in formats not compatible with cold, into formats that can be used by the program:

readmatricesfromcols

Converts lists of lower triangular elements into symmetric matrices with rows summing to zero.

usage: readmatricesfromcols inputfile outputfile

inputfile consists of a matrix whose columns are vectors listing the strictly lower triangular entries of a matrix, listed in order of rows (i.e. the entries of the vector are in the following positions of the matrix:

..........
1.........
23........
456.......

and so on). The output file is a list of symmetric matrices whose rows sum to 0. The output file can be used as a matrix file by cold.

reordermatrix

Reorders the rows and columns of matrices to agree with the order used in cold.

usage:reordermatrix codonfile inputfile outputfile

codonfile (see codonlistexample.txt for an example) lists the codons in the the order of the rows and columns of the matrices in inputfile, which consists of just a list of matrices. ReorderMatrix then reorders the rows and columns to the order used by cold (see coldcodonorder.txt), in the file called outputfile.

summats

Forms new matrices by adding up matrices from a file.

usage:summats filename selection [subtractionselection]

filename is the file containing the matrices to be added. selection is a list (which can include ranges) of the numbers of the matrices to be added in the file. 0 has a special significance - it refers to a matrix whose off diagonal elements are all 1 (and whose diagonal elements are chosen to make the rows sum to 0). 0 cannot be the only element in the selection. subtractionselection is another optional list of matrices, which are subtracted from the result of adding the matrices in selection.

The resulting matrix is printed to standard output. It can be saved by redirecting standard output to a file. (Cutting and pasting is also possible, provided your screen is wide enough.)

Examples:

summats matrices 0,3,5-9

prints the sum of the matrices numbered 3,5,6,7,8,9 and the matrix all of whose off-diagonal entries are 1, from the file matrices.

summats matrices 1,2,4 9-36

prints the sum of the matrices numbered 1,2 and 4 minus the sum of all the matrices from 9 to 39 (inclusive) in the file matrices.

summats matrices 0,5 5,1,3,8

prints the result of subtracting the sum of matrices 1,3 and 8 from the matrix all of whose off-diagonal elements are 1.

[Bug: summats ignores the first matrix in the input file. This is useful for parameter matrix files, where the line that gives the number of matrices in the file is interpreted as a matrix.]

stripambiguous

Removes ambiguous sites from a data file.

usage:stripambiguous sequencefile [selection] [outputfile]

sequencefile is the file containing the sequence data. selection is a list (which can include ranges) of the numbers of species in the file to have ambiguous sites removed. outputfile is the filename to save the result. The default is the sequencefile name with .noamb appended.


Back to home page