示例#1
0
 def checkSanity(self):
     """
     Place asserts in this function that should be checked before anything substantive
     is done during a call of a SS object.
     """
     cf = CommonFunctions(self)
     cf.phycassert(mcmc.ncycles > 0, 'mcmc.ncycles cannot be less than 1 for path sampling')
示例#2
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes ParamSummarizer object.
     
     """
     CommonFunctions.__init__(self, opts)
示例#3
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     
     """
     CommonFunctions.__init__(self, opts)
     self.opts       = opts
     self.detailsf   = None
示例#4
0
文件: SS.py 项目: danielfan/Phycas
 def checkSanity(self):
     """
     Place asserts in this function that should be checked before anything substantive
     is done during a call of a SS object.
     """
     cf = CommonFunctions(self)
     cf.phycassert(mcmc.ncycles > 0, 'mcmc.ncycles cannot be less than 1 for the stepping-stone method')
     if not self.override_fixed_topology_restriction:
         cf.phycassert(mcmc.fix_topology == True, "mcmc.fix_topology must be True to use the stepping-stone method (we're working on relaxing this requirement)")
示例#5
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes MCMCImpl object by assigning supplied phycas object
     to a data member variable.
     
     """
     CommonFunctions.__init__(self, opts)
     self.opts = opts
     self.sitelikef = None
示例#6
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes the SimulateImpl object by assigning supplied phycas object
     to a data member variable.
     
     """
     CommonFunctions.__init__(self, opts)
     self.starting_tree_source = None
     self.starting_tree        = None
     #self.ntax                 = None
     self.sim_model_tree       = None
     self.data_matrix          = None
示例#7
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes the LikeImpl object by assigning supplied phycas object
     to a data member variable.
     
     """
     CommonFunctions.__init__(self, opts)
     self.starting_tree         = None
     self.taxon_labels          = None
     self.data_matrix           = None
     self.ntax                  = None
     self.nchar                 = None
     self.reader                = NexusReader()
     self.npatterns          = []        # Will hold the actual number of patterns for each subset after data file has been read
示例#8
0
 def __init__(self, opts):
     #---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes TreeSummarizer object.
     
     """
     CommonFunctions.__init__(self, opts)
     
     self.pdf_page_width = 8.5       # should be an option
     self.pdf_page_height = 11.0     # should be an option
     self.pdf_ladderize = 'right'    # should be an option - valid values are 'right', 'left' or None
     self.rooted_trees = opts.rooted
     self.outgroup = opts.outgroup_taxon
     if self.rooted_trees and opts.outgroup_taxon:
         self.outgroup = None
         self.warning('Specifying True for sumt_rooted is incompatible with specifying\nsumt_outgroup_taxon; I will pretend that you set sumt_outgroup_taxon to None')
示例#9
0
 def __init__(self, opts):
     # ---+----|----+----|----+----|----+----|----+----|----+----|----+----|
     """
     Initializes TreeSummarizer object by assigning supplied phycas object
     to a data member variable.
     
     """
     CommonFunctions.__init__(self, opts)
     self.r = self._getLot()
     eld = self.edgelen_dist
     self._current = 0
     self.trees = []
     if eld is None:
         if self.distribution.lower() != "yule":
             raise ValueError("edgelen_dist must be set if the tree simulator's distribution is not Yule")
         if self.speciation_rate is None:
             raise ValueError(
                 "edgelen_dist or the speciation_rate must be set to generate trees from the Yule process"
             )
     else:
         eld.setLot(self.r)
     self.stdout.debugging("Generating %s" % str(self))
示例#10
0
 def __init__(self):
     CommonFunctions.__init__(self, None)
     self.pdf_splits_to_plot = None
     # Variables associated with PDF tree drawing (used in pdftree() function)
     # The 14 standard fonts guaranteed to be available in all PDF consumer applications:
     #   Times-Roman      Helvetica             Courier             Symbol
     #   Times-Bold       Helvetica-Bold        Courier-Bold        ZapfDingbats
     #   Times-Italic     Helvetica-Oblique     Courier-Oblique
     #   Times-BoldItalic Helvetica-BoldOblique Courier-BoldOblique
     self.pdf_filename                 = 'trees.pdf'    # Set to desired name of pdf file to create
     self.pdf_edge_support_file        = None           # File containing PAUP* output with table of support values; if specified, the support values will be shown on trees plotted
     self.pdf_tip_label_font           = 'Times-Italic' # Font used for tip node names; should be one of the 14 standard fonts listed above
     self.pdf_tip_label_height         = 12             # Height in points of tip node name font
     self.pdf_plot_label_font          = 'Helvetica'    # Font used for plot axis labels; should be one of the 14 standard fonts listed above
     self.pdf_plot_label_height        = 12             # Height in points of plot axis label font
     self.pdf_title_font               = 'Helvetica'    # Font used for scalebar text; should be one of the 14 standard fonts listed above
     self.pdf_title_height             = 14             # Height in points of scalebar text font
     self.pdf_scalebar_position        = 'bottom'       # Valid values are 'top', 'bottom' or None
     self.pdf_scalebar_label_font      = 'Helvetica'    # Font used for scalebar text; should be one of the 14 standard fonts listed above
     self.pdf_scalebar_label_height    = 10             # Height in points of scalebar text font
     self.pdf_support_label_font       = 'Times-Roman'  # Font used for edge support values; should be one of the 14 standard fonts listed above
     self.pdf_support_label_height     = 8              # Height in points of edge support font
     self.pdf_support_as_percent       = True           # If True, support values will be shown as percentages (e.g. 93.1) rather than proportions (e.g. 0.931)
     self.pdf_support_decimals         = 1              # The number of decimal places shown in support values (e.g. to get 93.7, specify 1; to round up to 94, specify 0)
     self.pdf_ladderize                = 'right'        # Valid values are 'right', 'left' or None
     self.pdf_page_width               = 8.5            # Page width in inches
     self.pdf_page_height              = 11.0           # Page length in inches
     self.pdf_line_width               = 1.0            # Width of lines representing edges in the tree
     self.pdf_left_margin              = 1.0            # Left margin in inches (1 inch = 72 points)
     self.pdf_right_margin             = 1.0            # Right margin in inches (1 inch = 72 points)
     self.pdf_top_margin               = 1.0            # Top margin in inches (1 inch = 72 points)
     self.pdf_bottom_margin            = 1.0            # Bottom margin in inches (1 inch = 72 points)
     self.keep_xy_proportional         = True           # If True, vertical dimension of each tree in a collection will be kept proportional to its horizontal dimension
     self.keep_tip_labels_proportional = True           # If True, tip label height will be kept commensurate with size of tree for each tree in a printed collection (smaller trees will have smaller tip labels)
     self.pdf_treefile                 = None           # Set to tree file name if you want to make one pdf file with each tree from tree file on a separate page
     self.pdf_newick                   = None           # Set to the tree description to print if only want to save one tree to a pdf file
     self.pdf_outgroup_taxon           = None           # Set to taxon name of tip serving as the outgroup for display rooting purposes (note: at this time outgroup can consist of just one taxon)