/* These programs were obtained from Liang et al along with the original (fortran) version of GENEFINDER. These programs manipulate genehunter output to create input files needed to run the original GENEFINDER and the GEE2loc programs written by Biernacka et al */ * Make changes to the file below as needed; * In particular, enter your directory path and file names; *first program: pre.sas; options ps=60 ls=70; dm 'log' clear; dm 'output' clear; /* this program takes out all unaffecteds sibs within each family */ data bar; **; * 1. change input file; **; infile '/home/.../peds.txt' lrecl=400; **; * 2. change the number of input variables (there are 56 variables here); **; input x1-x28; if x6 ^=2 and (x3^=0 and x4^=0) then delete; file '/home/.../pedfile.sib.pre'; put x1-x28; proc print; run; *second program: calibd.sas; options ps=60 ls=70; dm 'log' clear; dm 'output' clear; /* This program creates the data files for running gee.f (upgrated on September 15, 2000). Four places in comments as shown below need to be changed before getting this program run. */ data ibd; retain marker 0; **; * 1. change the input file (and path) to your IBD sharing file; **; infile '/home/.../ibd.dump' expandtabs firstobs=2; input cm famid id1 id2 x1 x2 x3 z0 z1 z2; ibd=z1+2*z2; marker=marker+1; if cm=0.0 then marker=1; keep cm marker famid id1 id2 ibd; *proc print; proc sort; by famid id1 id2 cm; data bar; **; * 2. change the linkage pedigree file; **; infile '/home/.../pedfile.sib.pre' lrecl=400; input x1-x16; famid=x1; indid=x2; if x3=0 and x4=0; keep famid indid x3 x4; proc sort; by famid indid; *proc print; data bar1; set bar; by famid; if first.famid; indid1=indid; drop indid; data bar2; set bar; by famid; if last.famid; indid2=indid; drop indid; data bar; merge bar1 bar2; by famid; data ibdbar; merge ibd bar; by famid; if id1=. or id2=. then delete; if id1=indid1 then delete; if id2=indid1 then delete; if id1=indid2 then delete; if id2=indid2 then delete; *proc print; proc sort; by famid; data ibdbar; retain count 0; set ibdbar; by famid; if first.famid then count=count+1; proc sort; by count id1 id2 marker; data ibdbar; retain pairs 0 npairs 0; set ibdbar; by count; if marker=1 then npairs=npairs+1; if first.count then pairs=1; else if marker=1 then pairs=pairs+1; keep count pairs marker ibd; **; * 3. the data file with IBD sharing for gee.f.; **; file '/home/.../sharing'; put @1 count 3.0 @5 pairs 3.0 @9 marker 3.0 @13 ibd 6.4; proc print; proc sort; by count marker; proc means data=ibdbar noprint; var ibd; by count marker;output out=chr mean=m1; proc sort;by count; data ibdbar; set chr; by count; **; * 4. the data file with number of affected sib pairs each family for gee.f.; **; if first.count; file '/home/.../numsibs'; put @1 count 3.0 @5 _freq_ 3.0; proc print; **; * record the maximum of pairs (per family) (maximum _freq_); * and change the parameter "npair" in gee.f. **; proc means; var _freq_; run;