コード例 #1
0
ファイル: analyze_genetrees.py プロジェクト: siping/cgat
    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))))
コード例 #2
0
ファイル: analyze_genetrees.py プロジェクト: yangjl/cgat
    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))))
コード例 #3
0
ファイル: analyze_genetrees.py プロジェクト: siping/cgat
    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]))))
コード例 #4
0
ファイル: analyze_genetrees.py プロジェクト: yangjl/cgat
    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]))))