/AminoAcidMatrices.R

http://github.com/sbotond/phylosim · R · 942 lines · 165 code · 49 blank · 728 comment · 0 complexity · 13d32c17283616ebfc6ed0ae0ff30201 MD5 · raw file

  1. ##
  2. ## Copyright 2009 Botond Sipos
  3. ## See the package description for licensing information.
  4. ##
  5. ## cpREV
  6. ##
  7. ##########################################################################/**
  8. #
  9. # @RdocClass cpREV
  10. #
  11. # @title "The cpREV empirical amino acid substitution model"
  12. #
  13. # \description{
  14. #
  15. #
  16. # @classhierarchy
  17. # }
  18. #
  19. # \references{
  20. # Adachi, J., P. J. Waddell, W. Martin, and M. Hasegawa (2000) Plastid
  21. # genome phylogeny and a model of amino acid substitution for proteins
  22. # encoded by chloroplast DNA - Journal of Molecular Evolution 50:348--358
  23. # DOI: 10.1007/s002399910038 \url{http://bit.ly/bnBVLm}
  24. # }
  25. #
  26. # @synopsis
  27. #
  28. # \arguments{
  29. # \item{equ.dist}{Equilibrium distribution.}
  30. # \item{...}{Not used.}
  31. # }
  32. #
  33. # \section{Fields and Methods}{
  34. # @allmethods
  35. # }
  36. #
  37. # \examples{
  38. # # create substitution model object
  39. # p<-cpREV()
  40. # # get object summary
  41. # summary(p)
  42. # # display a bubble plot
  43. # plot(p)
  44. #
  45. # # The following code demonstrates how to use
  46. # # the process in a simulation.
  47. #
  48. # # create a sequence, attach process p
  49. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  50. # # sample states
  51. # sampleStates(s)
  52. # # make the first three positions invariable
  53. # setRateMultipliers(s,p,0,1:3)
  54. # # get rate multipliers
  55. # getRateMultipliers(s,p)
  56. # # create a simulation object
  57. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  58. # # run simulation
  59. # Simulate(sim)
  60. # # print alignment
  61. # sim$alignment
  62. # }
  63. #
  64. # @author
  65. #
  66. # \seealso{
  67. # AminoAcidSubst GeneralSubstitution UNREST
  68. # }
  69. #
  70. #*/###########################################################################
  71. setConstructorS3(
  72. "cpREV",
  73. function(
  74. equ.dist=NA,
  75. ...
  76. ){
  77. this<-AminoAcidSubst$newAAMatrix(
  78. name="cpREV",
  79. paml.file="cpREV.dat",
  80. equ.dist=equ.dist
  81. );
  82. return(this);
  83. },
  84. enforceRCC=FALSE
  85. );
  86. ##
  87. ## PAM
  88. ##
  89. ##########################################################################/**
  90. #
  91. # @RdocClass PAM
  92. #
  93. # @title "The PAM empirical amino acid substitution model"
  94. #
  95. # \description{
  96. #
  97. #
  98. # @classhierarchy
  99. # }
  100. #
  101. # \references{
  102. # Dayhoff, M. O.; Schwartz, R. M.; Orcutt, B. C. (1978). "A model of evolutionary change in proteins" -
  103. # Atlas of Protein Sequence and Structure 5 (3):345-352
  104. #
  105. # }
  106. #
  107. # @synopsis
  108. #
  109. # \arguments{
  110. # \item{equ.dist}{Equilibrium distribution.}
  111. # \item{...}{Not used.}
  112. # }
  113. #
  114. # \section{Fields and Methods}{
  115. # @allmethods
  116. # }
  117. #
  118. # \examples{
  119. # # create substitution model object
  120. # p<-PAM()
  121. # # get object summary
  122. # summary(p)
  123. # # display a bubble plot
  124. # plot(p)
  125. #
  126. # # The following code demonstrates how to use
  127. # # the process in a simulation.
  128. #
  129. # # create a sequence, attach process p
  130. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  131. # # sample states
  132. # sampleStates(s)
  133. # # make the first three positions invariable
  134. # setRateMultipliers(s,p,0,1:3)
  135. # # get rate multipliers
  136. # getRateMultipliers(s,p)
  137. # # create a simulation object
  138. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  139. # # run simulation
  140. # Simulate(sim)
  141. # # print alignment
  142. # sim$alignment
  143. # }
  144. #
  145. # @author
  146. #
  147. # \seealso{
  148. # AminoAcidSubst GeneralSubstitution UNREST
  149. # }
  150. #
  151. #*/###########################################################################
  152. setConstructorS3(
  153. "PAM",
  154. function(
  155. equ.dist=NA,
  156. ...
  157. ){
  158. this<-AminoAcidSubst$newAAMatrix(
  159. name="PAM",
  160. paml.file="dayhoff.dat",
  161. equ.dist=equ.dist
  162. );
  163. return(this);
  164. },
  165. enforceRCC=FALSE
  166. );
  167. ##
  168. ## PAM-dcmut
  169. ##
  170. ##########################################################################/**
  171. #
  172. # @RdocClass PAM.dcmut
  173. #
  174. # @title "The PAM.dcmut empirical amino acid substitution model"
  175. #
  176. # \description{
  177. #
  178. #
  179. # @classhierarchy
  180. # }
  181. #
  182. # \references{
  183. # Kosiol, C, and Goldman, N (2005) Different versions of the Dayhoff rate matrix -
  184. # Molecular Biology and Evolution 22:193-199 \url{http://dx.doi.org/10.1093/molbev/msi005}
  185. # }
  186. #
  187. # @synopsis
  188. #
  189. # \arguments{
  190. # \item{equ.dist}{Equilibrium distribution.}
  191. # \item{...}{Not used.}
  192. # }
  193. #
  194. # \section{Fields and Methods}{
  195. # @allmethods
  196. # }
  197. #
  198. # \examples{
  199. # # create substitution model object
  200. # p<-PAM.dcmut()
  201. # # get object summary
  202. # summary(p)
  203. # # display a bubble plot
  204. # plot(p)
  205. #
  206. # # The following code demonstrates how to use
  207. # # the process in a simulation.
  208. #
  209. # # create a sequence, attach process p
  210. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  211. # # sample states
  212. # sampleStates(s)
  213. # # make the first three invariable
  214. # setRateMultipliers(s,p,0,1:3)
  215. # # get rate multipliers
  216. # getRateMultipliers(s,p)
  217. # # create a simulation object
  218. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  219. # # run simulation
  220. # Simulate(sim)
  221. # # print alignment
  222. # sim$alignment
  223. # }
  224. #
  225. # @author
  226. #
  227. # \seealso{
  228. # AminoAcidSubst GeneralSubstitution UNREST
  229. # }
  230. #
  231. #*/###########################################################################
  232. setConstructorS3(
  233. "PAM.dcmut",
  234. function(
  235. equ.dist=NA,
  236. ...
  237. ){
  238. this<-AminoAcidSubst$newAAMatrix(
  239. name="PAM.dcmut",
  240. paml.file="dayhoff-dcmut.dat",
  241. equ.dist=equ.dist
  242. );
  243. return(this);
  244. },
  245. enforceRCC=FALSE
  246. );
  247. ##
  248. ## JTT
  249. ##
  250. ##########################################################################/**
  251. #
  252. # @RdocClass JTT
  253. #
  254. # @title "The JTT empirical amino acid substitution model"
  255. #
  256. # \description{
  257. #
  258. #
  259. # @classhierarchy
  260. # }
  261. #
  262. # \references{
  263. # Jones, D. T., W. R. Taylor, and J. M. Thornton (1992) The rapid generation of mutation data matrices
  264. # from protein sequences. CABIOS 8:275-282 \url{http://dx.doi.org/10.1093/bioinformatics/8.3.275}
  265. # }
  266. #
  267. # @synopsis
  268. #
  269. # \arguments{
  270. # \item{equ.dist}{Equilibrium distribution.}
  271. # \item{...}{Not used.}
  272. # }
  273. #
  274. # \section{Fields and Methods}{
  275. # @allmethods
  276. # }
  277. #
  278. # \examples{
  279. # # create substitution model object
  280. # p<-JTT()
  281. # # get object summary
  282. # summary(p)
  283. # # display a bubble plot
  284. # plot(p)
  285. #
  286. # # The following code demonstrates how to use
  287. # # the process in a simulation.
  288. #
  289. # # create a sequence, attach process p
  290. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  291. # # sample states
  292. # sampleStates(s)
  293. # # make the first three positions invariable
  294. # setRateMultipliers(s,p,0,1:3)
  295. # # get rate multipliers
  296. # getRateMultipliers(s,p)
  297. # # create a simulation object
  298. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  299. # # run simulation
  300. # Simulate(sim)
  301. # # print alignment
  302. # sim$alignment
  303. # }
  304. #
  305. # @author
  306. #
  307. # \seealso{
  308. # AminoAcidSubst GeneralSubstitution UNREST
  309. # }
  310. #
  311. #*/###########################################################################
  312. setConstructorS3(
  313. "JTT",
  314. function(
  315. equ.dist=NA,
  316. ...
  317. ){
  318. this<-AminoAcidSubst$newAAMatrix(
  319. name="JTT",
  320. paml.file="jones.dat",
  321. equ.dist=equ.dist
  322. );
  323. return(this);
  324. },
  325. enforceRCC=FALSE
  326. );
  327. ##
  328. ## JTT.dcmut
  329. ##
  330. ##########################################################################/**
  331. #
  332. # @RdocClass JTT.dcmut
  333. #
  334. # @title "The JTT.dcmut empirical amino acid substitution model"
  335. #
  336. # \description{
  337. #
  338. #
  339. # @classhierarchy
  340. # }
  341. #
  342. # \references{
  343. # Kosiol, C, and Goldman, N (2005) Different versions of the Dayhoff rate matrix -
  344. # Molecular Biology and Evolution 22:193-199 \url{http://dx.doi.org/10.1093/molbev/msi005}
  345. #
  346. # Jones, D. T., W. R. Taylor, and J. M. Thornton (1992) The rapid generation of mutation data matrices
  347. # from protein sequences. CABIOS 8:275-282 \url{http://dx.doi.org/10.1093/bioinformatics/8.3.275}
  348. # }
  349. #
  350. # @synopsis
  351. #
  352. # \arguments{
  353. # \item{equ.dist}{Equilibrium distribution.}
  354. # \item{...}{Not used.}
  355. # }
  356. #
  357. # \section{Fields and Methods}{
  358. # @allmethods
  359. # }
  360. #
  361. # \examples{
  362. # # create substitution model object
  363. # p<-JTT.dcmut()
  364. # # get object summary
  365. # summary(p)
  366. # # display a bubble plot
  367. # plot(p)
  368. #
  369. # # The following code demonstrates how to use
  370. # # the process in a simulation.
  371. #
  372. # # create a sequence, attach process p
  373. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  374. # # sample states
  375. # sampleStates(s)
  376. # # make the first threee positions invariable
  377. # setRateMultipliers(s,p,0,1:3)
  378. # # get rate multipliers
  379. # getRateMultipliers(s,p)
  380. # # create a simulation object
  381. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  382. # # run simulation
  383. # Simulate(sim)
  384. # # print alignment
  385. # sim$alignment
  386. # }
  387. #
  388. # @author
  389. #
  390. # \seealso{
  391. # AminoAcidSubst GeneralSubstitution UNREST
  392. # }
  393. #
  394. #*/###########################################################################
  395. setConstructorS3(
  396. "JTT.dcmut",
  397. function(
  398. equ.dist=NA,
  399. ...
  400. ){
  401. this<-AminoAcidSubst$newAAMatrix(
  402. name="JTT.dcmut",
  403. paml.file="jones-dcmut.dat",
  404. equ.dist=equ.dist
  405. );
  406. return(this);
  407. },
  408. enforceRCC=FALSE
  409. );
  410. ##
  411. ## LG
  412. ##
  413. ##########################################################################/**
  414. #
  415. # @RdocClass LG
  416. #
  417. # @title "The LG empirical amino acid substitution model"
  418. #
  419. # \description{
  420. #
  421. #
  422. # @classhierarchy
  423. # }
  424. #
  425. # \references{
  426. # Le, S. Q., and O. Gascuel (2008) An improved general amino acid replacement matrix -
  427. # Mol. Biol. Evol. 25:1307-1320 \url{http://dx.doi.org/10.1093/molbev/msn067}
  428. # }
  429. #
  430. # @synopsis
  431. #
  432. # \arguments{
  433. # \item{equ.dist}{Equilibrium distribution.}
  434. # \item{...}{Not used.}
  435. # }
  436. #
  437. # \section{Fields and Methods}{
  438. # @allmethods
  439. # }
  440. #
  441. # \examples{
  442. # # create substitution model object
  443. # p<-LG()
  444. # # get object summary
  445. # summary(p)
  446. # # display a bubble plot
  447. # plot(p)
  448. #
  449. # # The following code demonstrates how to use
  450. # # the process in a simulation.
  451. #
  452. # # create a sequence, attach process p
  453. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  454. # # sample states
  455. # sampleStates(s)
  456. # # make the first three positions invariable
  457. # setRateMultipliers(s,p,0,1:3)
  458. # # get rate multipliers
  459. # getRateMultipliers(s,p)
  460. # # create a simulation object
  461. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  462. # # run simulation
  463. # Simulate(sim)
  464. # # print alignment
  465. # sim$alignment
  466. # }
  467. #
  468. # @author
  469. #
  470. # \seealso{
  471. # AminoAcidSubst GeneralSubstitution UNREST
  472. # }
  473. #
  474. #*/###########################################################################
  475. setConstructorS3(
  476. "LG",
  477. function(
  478. equ.dist=NA,
  479. ...
  480. ){
  481. this<-AminoAcidSubst$newAAMatrix(
  482. name="LG",
  483. paml.file="lg.dat",
  484. equ.dist=equ.dist
  485. );
  486. return(this);
  487. },
  488. enforceRCC=FALSE
  489. );
  490. ##
  491. ## mtArt
  492. ##
  493. ##########################################################################/**
  494. #
  495. # @RdocClass mtArt
  496. #
  497. # @title "The mtArt empirical amino acid substitution model"
  498. #
  499. # \description{
  500. #
  501. #
  502. # @classhierarchy
  503. # }
  504. #
  505. # \references{
  506. # Abascal, F., D. Posada, and R. Zardoya (2007) MtArt: A new Model of
  507. # amino acid replacement for Arthropoda - Mol. Biol. Evol. 24:1-5 \url{http://dx.doi.org/10.1093/molbev/msl136}
  508. #
  509. # }
  510. #
  511. # @synopsis
  512. #
  513. # \arguments{
  514. # \item{equ.dist}{Equilibrium distribution.}
  515. # \item{...}{Not used.}
  516. # }
  517. #
  518. # \section{Fields and Methods}{
  519. # @allmethods
  520. # }
  521. #
  522. # \examples{
  523. # # create substitution model object
  524. # p<-mtArt()
  525. # # get object summary
  526. # summary(p)
  527. # # display a bubble plot
  528. # plot(p)
  529. #
  530. # # The following code demonstrates how to use
  531. # # the process in a simulation.
  532. #
  533. # # create a sequence, attach process p
  534. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  535. # # sample states
  536. # sampleStates(s)
  537. # # make the first three positions invariable
  538. # setRateMultipliers(s,p,0,1:3)
  539. # # get rate multipliers
  540. # getRateMultipliers(s,p)
  541. # # create a simulation object
  542. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  543. # # run simulation
  544. # Simulate(sim)
  545. # # print alignment
  546. # sim$alignment
  547. # }
  548. #
  549. # @author
  550. #
  551. # \seealso{
  552. # AminoAcidSubst GeneralSubstitution UNREST
  553. # }
  554. #
  555. #*/###########################################################################
  556. setConstructorS3(
  557. "mtArt",
  558. function(
  559. equ.dist=NA,
  560. ...
  561. ){
  562. this<-AminoAcidSubst$newAAMatrix(
  563. name="mtArt",
  564. paml.file="mtArt.dat",
  565. equ.dist=equ.dist
  566. );
  567. return(this);
  568. },
  569. enforceRCC=FALSE
  570. );
  571. ##
  572. ## mtMam
  573. ##
  574. ##########################################################################/**
  575. #
  576. # @RdocClass mtMam
  577. #
  578. # @title "The mtMam empirical amino acid substitution model"
  579. #
  580. # \description{
  581. #
  582. #
  583. # @classhierarchy
  584. # }
  585. #
  586. # \references{
  587. # Yang, Z., R. Nielsen, and M. Hasegawa (1998) Models of amino acid
  588. # substitution and applications to Mitochondrial protein evolution,
  589. # Molecular Biology and Evolution 15:1600-1611 \url{http://bit.ly/by4NMb}
  590. # }
  591. #
  592. # @synopsis
  593. #
  594. # \arguments{
  595. # \item{equ.dist}{Equilibrium distribution.}
  596. # \item{...}{Not used.}
  597. # }
  598. #
  599. # \section{Fields and Methods}{
  600. # @allmethods
  601. # }
  602. #
  603. # \examples{
  604. # # create substitution model object
  605. # p<-mtMam()
  606. # # get object summary
  607. # summary(p)
  608. # # display a bubble plot
  609. # plot(p)
  610. #
  611. # # The following code demonstrates how to use
  612. # # the process in a simulation.
  613. #
  614. # # create a sequence, attach process p
  615. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  616. # # sample states
  617. # sampleStates(s)
  618. # # make the first three positions invariable
  619. # setRateMultipliers(s,p,0,1:3)
  620. # # get rate multipliers
  621. # getRateMultipliers(s,p)
  622. # # create a simulation object
  623. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  624. # # run simulation
  625. # Simulate(sim)
  626. # # print alignment
  627. # sim$alignment
  628. # }
  629. #
  630. # @author
  631. #
  632. # \seealso{
  633. # AminoAcidSubst GeneralSubstitution UNREST
  634. # }
  635. #
  636. #*/###########################################################################
  637. setConstructorS3(
  638. "mtMam",
  639. function(
  640. equ.dist=NA,
  641. ...
  642. ){
  643. this<-AminoAcidSubst$newAAMatrix(
  644. name="mtMam",
  645. paml.file="mtmam.dat",
  646. equ.dist=equ.dist
  647. );
  648. return(this);
  649. },
  650. enforceRCC=FALSE
  651. );
  652. ##
  653. ## mtREV24
  654. ##
  655. ##########################################################################/**
  656. #
  657. # @RdocClass mtREV24
  658. #
  659. # @title "The mtREV24 empirical amino acid substitution model"
  660. #
  661. # \description{
  662. #
  663. #
  664. # @classhierarchy
  665. # }
  666. #
  667. # \references{
  668. # Adachi, J. and Hasegawa, M. (1996) MOLPHY version 2.3: programs for
  669. # molecular phylogenetics based on maximum likelihood. Computer Science
  670. # Monographs of Institute of Statistical Mathematics 28:1-150
  671. # }
  672. #
  673. # @synopsis
  674. #
  675. # \arguments{
  676. # \item{equ.dist}{Equilibrium distribution.}
  677. # \item{...}{Not used.}
  678. # }
  679. #
  680. # \section{Fields and Methods}{
  681. # @allmethods
  682. # }
  683. #
  684. # \examples{
  685. # # create substitution model object
  686. # p<-mtREV24()
  687. # # get object summary
  688. # summary(p)
  689. # # display a bubble plot
  690. # plot(p)
  691. #
  692. # # The following code demonstrates how to use
  693. # # the process in a simulation.
  694. #
  695. # # create a sequence, attach process p
  696. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  697. # # sample states
  698. # sampleStates(s)
  699. # # make the first three positions invariable
  700. # setRateMultipliers(s,p,0,1:3)
  701. # # get rate multipliers
  702. # getRateMultipliers(s,p)
  703. # # create a simulation object
  704. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  705. # # run simulation
  706. # Simulate(sim)
  707. # # print alignment
  708. # sim$alignment
  709. # }
  710. #
  711. # @author
  712. #
  713. # \seealso{
  714. # AminoAcidSubst GeneralSubstitution UNREST
  715. # }
  716. #
  717. #*/###########################################################################
  718. setConstructorS3(
  719. "mtREV24",
  720. function(
  721. equ.dist=NA,
  722. ...
  723. ){
  724. this<-AminoAcidSubst$newAAMatrix(
  725. name="mtREV24",
  726. paml.file="mtREV24.dat",
  727. equ.dist=equ.dist
  728. );
  729. return(this);
  730. },
  731. enforceRCC=FALSE
  732. );
  733. ##
  734. ## MtZoa
  735. ##
  736. ##########################################################################/**
  737. #
  738. # @RdocClass MtZoa
  739. #
  740. # @title "The MtZoa empirical amino acid substitution model"
  741. #
  742. # \description{
  743. #
  744. #
  745. # @classhierarchy
  746. # }
  747. #
  748. # \references{
  749. # Rota-Stabelli, O., Z. Yang, and M. Telford. (2009) MtZoa: a general mitochondrial amino acid
  750. # substitutions model for animal evolutionary studies. Mol. Phyl. Evol 52(1):268-72 \url{http://bit.ly/bjZfKi}
  751. # }
  752. #
  753. # @synopsis
  754. #
  755. # \arguments{
  756. # \item{equ.dist}{Equilibrium distribution.}
  757. # \item{...}{Not used.}
  758. # }
  759. #
  760. # \section{Fields and Methods}{
  761. # @allmethods
  762. # }
  763. #
  764. # \examples{
  765. # # create substitution model object
  766. # p<-MtZoa()
  767. # # get object summary
  768. # summary(p)
  769. # # display a bubble plot
  770. # plot(p)
  771. #
  772. # # The following code demonstrates how to use
  773. # # the process in a simulation.
  774. #
  775. # # create a sequence, attach process p
  776. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  777. # # sample states
  778. # sampleStates(s)
  779. # # make the first three positions invariable
  780. # setRateMultipliers(s,p,0,1:3)
  781. # # get rate multipliers
  782. # getRateMultipliers(s,p)
  783. # # create a simulation object
  784. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  785. # # run simulation
  786. # Simulate(sim)
  787. # # print alignment
  788. # sim$alignment
  789. # }
  790. #
  791. # @author
  792. #
  793. # \seealso{
  794. # AminoAcidSubst GeneralSubstitution UNREST
  795. # }
  796. #
  797. #*/###########################################################################
  798. setConstructorS3(
  799. "MtZoa",
  800. function(
  801. equ.dist=NA,
  802. ...
  803. ){
  804. this<-AminoAcidSubst$newAAMatrix(
  805. name="MtZoa",
  806. paml.file="MtZoa.dat",
  807. equ.dist=equ.dist
  808. );
  809. return(this);
  810. },
  811. enforceRCC=FALSE
  812. );
  813. ##
  814. ## WAG
  815. ##
  816. ##########################################################################/**
  817. #
  818. # @RdocClass WAG
  819. #
  820. # @title "The WAG empirical amino acid substitution model"
  821. #
  822. # \description{
  823. #
  824. #
  825. # @classhierarchy
  826. # }
  827. #
  828. # \references{
  829. # Whelan, S. and N. Goldman (2001) A general empirical model of
  830. # protein evolution derived from multiple protein families using a maximum likelihood
  831. # approach - Molecular Biology and Evolution 18:691-699 \url{http://bit.ly/dpTKAd}
  832. # }
  833. #
  834. # @synopsis
  835. #
  836. # \arguments{
  837. # \item{equ.dist}{Equilibrium distribution.}
  838. # \item{...}{Not used.}
  839. # }
  840. #
  841. # \section{Fields and Methods}{
  842. # @allmethods
  843. # }
  844. #
  845. # \examples{
  846. # # create substitution model object
  847. # p<-WAG()
  848. # # get object summary
  849. # summary(p)
  850. # # display a bubble plot
  851. # plot(p)
  852. #
  853. # # The following code demonstrates how to use
  854. # # the process in a simulation.
  855. #
  856. # # create a sequence, attach process p
  857. # s<-AminoAcidSequence(length=10,processes=list(list(p)) )
  858. # # sample states
  859. # sampleStates(s)
  860. # # make the first three positions invariable
  861. # setRateMultipliers(s,p,0,1:3)
  862. # # get rate multipliers
  863. # getRateMultipliers(s,p)
  864. # # create a simulation object
  865. # sim<-PhyloSim(root.seq=s,phylo=rcoal(2))
  866. # # run simulation
  867. # Simulate(sim)
  868. # # print alignment
  869. # sim$alignment
  870. # }
  871. #
  872. # @author
  873. #
  874. # \seealso{
  875. # AminoAcidSubst GeneralSubstitution UNREST
  876. # }
  877. #
  878. #*/###########################################################################
  879. setConstructorS3(
  880. "WAG",
  881. function(
  882. equ.dist=NA,
  883. ...
  884. ){
  885. this<-AminoAcidSubst$newAAMatrix(
  886. name="WAG",
  887. paml.file="wag.dat",
  888. equ.dist=equ.dist
  889. );
  890. return(this);
  891. },
  892. enforceRCC=FALSE
  893. );