Ghost/make_figs.py
def calculate_average(self,data):
        """Calculate the average ghost observed and the standard deviation"""
        for datatype in data.keys():
            for diel in data[datatype].keys():
                for TG in data[datatype][diel].keys():
                    for residue in data[datatype][diel][TG].keys():
                        for nucleus in data[datatype][diel][TG][residue].keys():
                            try:
                                values=data[datatype][diel][TG][residue][nucleus]
                            except KeyError:
                                print 'Skipping %d for %s' %(diel)
                                continue
                            import stats
                            avg=stats.average(values)
                            SD=stats.stddev(values)
                            data[datatype][diel][TG][residue][nucleus]=[avg,SD]
        return data
Calculate the average ghost observed and the standard deviation
Calculate the average ghost observed and the standard deviation
Calculate the average ghost observed and the standard deviation
def calculate_average(self,data):
        for datatype in data.keys():
            for diel in data[datatype].keys():
                for TG in data[datatype][diel].keys():
                    for residue in data[datatype][diel][TG].keys():
                        for nucleus in data[datatype][diel][TG][residue].keys():
                            try:
                                values=data[datatype][diel][TG][residue][nucleus]
                            except KeyError:
                                print 'Skipping %d for %s' %(diel)
                                continue
                            import stats
                            avg=stats.average(values)
                            SD=stats.stddev(values)
                            data[datatype][diel][TG][residue][nucleus]=[avg,SD]
        return data
def calculate_average ( self , data ) : for datatype in data . keys ( ) : for diel in data [ datatype ] . keys ( ) : for TG in data [ datatype ] [ diel ] . keys ( ) : for residue in data [ datatype ] [ diel ] [ TG ] . keys ( ) : for nucleus in data [ datatype ] [ diel ] [ TG ] [ residue ] . keys ( ) : try : values = data [ datatype ] [ diel ] [ TG ] [ residue ] [ nucleus ] except KeyError : print 'Skipping %d for %s' % ( diel ) continue import stats avg = stats . average ( values ) SD = stats . stddev ( values ) data [ datatype ] [ diel ] [ TG ] [ residue ] [ nucleus ] = [ avg , SD ] return data
Calculate the average ghost observed and the standard deviation
Calculate the average ghost observed and the standard deviation
"""Calculate the average ghost observed and the standard deviation"""
self
data