Exemple #1
0
    def printHeightsPerTree( values, section, options, prefix_header, prefix_row ):

        if not values: return
        
        outfile, is_new = TreeReconciliation.getFile( options, section )
        if is_new:    
            outfile.write("%s%s\theights\n" % (prefix_header, "\t".join(Stats.DistributionalParameters().getHeaders())))

        s = Stats.DistributionalParameters( values )
        s.setFormat( options.format_branch_length )
        outfile.write("%s%s\t%s\n" % (prefix_row,
                                      str(s),
                                      ",".join(map(lambda x: options.format_branch_length % x, values))))
Exemple #2
0
    def printHeightsPerTree(values, section, options, prefix_header,
                            prefix_row):

        if not values: return

        outfile, is_new = TreeReconciliation.getFile(options, section)
        if is_new:
            outfile.write("%s%s\theights\n" % (prefix_header, "\t".join(
                Stats.DistributionalParameters().getHeaders())))

        s = Stats.DistributionalParameters(values)
        s.setFormat(options.format_branch_length)
        outfile.write("%s%s\t%s\n" % (prefix_row, str(s), ",".join(
            map(lambda x: options.format_branch_length % x, values))))
Exemple #3
0
    def printHeightsPerSpecies( values, section, options, prefix_header, prefix_row):

        if not values: return
        
        ## distributions of distance to node
        outfile, is_new = TreeReconciliation.getFile( options, section )
        if is_new:    
            outfile.write("%sspecies\t%s\theights\n" % (prefix_header, "\t".join(Stats.DistributionalParameters().getHeaders())))

        for species in sorted(values.keys()):
            s = Stats.DistributionalParameters( values[species] )
            s.setFormat( options.format_branch_length )
            outfile.write("%s%s\t%s\t%s\n" % (prefix_row,
                                              species,
                                              str(s),
                                              ",".join(map(lambda x: options.format_branch_length % x, values[species]))))
Exemple #4
0
    def printHeightsPerSpecies(values, section, options, prefix_header,
                               prefix_row):

        if not values: return

        ## distributions of distance to node
        outfile, is_new = TreeReconciliation.getFile(options, section)
        if is_new:
            outfile.write("%sspecies\t%s\theights\n" %
                          (prefix_header, "\t".join(
                              Stats.DistributionalParameters().getHeaders())))

        for species in sorted(values.keys()):
            s = Stats.DistributionalParameters(values[species])
            s.setFormat(options.format_branch_length)
            outfile.write("%s%s\t%s\t%s\n" %
                          (prefix_row, species, str(s), ",".join(
                              map(lambda x: options.format_branch_length % x,
                                  values[species]))))