Version 0.0 This program is created by YongYong Shi for estimating how the correlation of samples affects the detecting power changes from geographically structured samples (SH, NH) to genetically structured samples (NSHC, NNHC). Firstly .. to simulate the correlation in samples, we introduced 768 'samples' in the program, and their ascription has been predefined; Secondly .. we randomly distribute genotypers to each 'sample' based on the input of allele frequencies in SH's control, SH's case, NH's control & NH's case. Then, calculate the Chi-square value in SH, NH .. also in NSHC and NNHC, as we could reallocate samples into them ny the predefinition -- which reflects the correlation. Thirdly .. we compare the Chi-sqare values betweeen SH/NSHC, SH/NNHC, NH/NSHC, NH/NNHC. Finally .. by do this simulation to a large number, we can estimate the probability of that .. under random cases, Chi-square in SH > Chi-sqare in NSHC ... etc. -------------------------- Compile (under Linux) -------------------------- make -o simulate.c simulate -------------------------- Running -------------------------- ./simulate -------------------------- Input file format -------------------------- [allele frequency in SH's control] [allele frequency in SH's case] [allele frequency in NH's control] [allele frequency in NH's case] [simulation number] [random seed] -------------------------- for example 0.2350 0.2614 0.2553 0.2876 1000000 7686 -------------------------- -------------------------- Output file -------------------------- A means SH B means NH C means NSHC D means NNHC A>C: [the number of cases that chi-square in SH is larger than chi-square in NSHC] ..... analogy Finally, P(SH>NSHC)=N(A>C)/Number of simulation .. when the number of simulation is large enough!