Пример #1
0
    #
    ##### generate disease by PAR
    #s = Sample()
    #s.seed(0)
    #s.set(**powerdata.data)
    #L.GenotypeGenerator().apply(s.data)
    #L.PARModel(powerdata.data['par'], powerdata.data['PAR_variable']).apply(s.data)#L.ORModel(powerdata.data['odds_ratio']).apply(s.data)
    #L.DiseaseEffectGenerator(powerdata.data['baseline_effect']).apply(s.data)
    #L.DiseaseStatusGenerator().apply(s.data)
    #print powerdata.data['maf']
    #print s.get('haplotype1'), s.get('haplotype2')
    #print s.get('effect'),
    #print s.get('phenotype')

    #### generate qt
    s = Sample()
    s.seed(0)

    print dir(s)

    s.set(**powerdata.data)
    #L.GenotypeGenerator().apply(s.data)
    s.set(haplotype1=[0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0],
          haplotype2=[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1])
    L.MeanShiftModel(powerdata.data['mean_shift']).apply(s.data)
    L.QtEffectGenerator().apply(s.data)
    L.QtValueGenerator().apply(s.data)
    print s.get('haplotype1'), s.get('haplotype2')
    print s.get('effect')
    print s.get('phenotype')