File: shared.bf

package info (click to toggle)
hyphy 2.5.69%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,728 kB
  • sloc: cpp: 81,964; xml: 467; lisp: 341; python: 166; javascript: 117; sh: 106; makefile: 87; ansic: 86
file content (55 lines) | stat: -rw-r--r-- 1,491 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* This is an example HY-PHY Batch File.

	This file contains the shared part of "ReplicateConstraint" examples.
	
   Sergei L. Kosakovsky Pond and Spencer V. Muse 
   June 2001. 
*/


/* 1. Read in the data and store the result in a DataSet variable.*/

DataSet 		nucleotideSequences = ReadDataFile ("data/hiv.seq");

   
/* 2. Filter the data, specifying that all of the data is to be used
	  and that it is to be treated as nucleotides. */

	  
DataSetFilter	filteredData = CreateFilter (nucleotideSequences,1);



/* 3. Collect observed nucleotide frequencies from the filtered data. observedFreqs will
	  store the vector of frequencies. */

HarvestFrequencies (observedFreqs, filteredData, 1, 1, 1);



/* 4. Define the HKY substitution matrix. '*' is defined to be -(sum of off-diag row elements) */

HKY85RateMatrix  = 

		{{*,trvs,trst,trvs}
		 {trvs,*,trvs,trst}
		 {trst,trvs,*,trvs}
		 {trvs,trst,trvs,*}};

		 

/*5.  Define the HKY85 model, by combining the substitution matrix with the vector of observed (equilibrium)
	  frequencies. */

Model HKY85	 = (HKY85RateMatrix , observedFreqs);

/*6.  Use the tree from the data file:
 (((317,6767),((135,(529,105r))iNode1,(719,136))),6760,((113,9939),(256,(822,159))iNode2))
 */

Tree	hivTree = DATAFILE_TREE;

/*7.  Since all the likelihood function ingredients (data, tree, equilibrium frequencies)
	  have been defined we are ready to construct the likelihood function. */

LikelihoodFunction  hivLik = (filteredData, hivTree);