#!/usr/local/bin/perl -w # Example 6: ehplus_cc.pl # Run fpmp in FASTEH+ for each marker # # Ref: Li and Haghighi, "Perl as a tool for linkage analysis", # Am J Hum Genet, suppl,65: A260 (1999) # # Contact: perl@linkage.rockefeller.edu # # Last update: November 27, 2001 # # Usage: ehplus_cc.pl [.dat file] # # Format for .dat file: # col1: person ID # col2: affection status ( unaffected and 1 affected) # col3,4: genotype of marker 1 # col5,6: genotype of marker 2 # .... # # Format for .par file # line1: (# markers) (case-control study?) (if case-control, permute label?) # (# label permutations) # line2: (# alleles for marker1) (# allele for marker2)... # line3: (.dat contains "single genotype identifier"?) # (print "single genotype identifier"?) # line4: (use marker 1?) (use marker 2?).... # line5: (permute marker 1 within a block?) (permute marker 2 in a block?)... # line6: (disease allele D freq) (penetrance for ++) (penetrance for +D) (..for DD) # $usage="Usage: ehplus_cc.pl [.dat file]"; if( $#ARGV != 0){ print "$usage\n"; exit; } $datafile=$ARGV[0]; $nmarkers=38; # number of markers (for this data set) $m1=1; # starting marker. can be changed $m2=$nmarkers; # ending marker. can be changed for($i=$m1; $i<=$m2; $i++){ $parfile= "m".$i."."."par"; open(PAR, "> $parfile"); # preparing .par file for each marker # particular information (e.g. total number of markers, number of # alleles for each marker...) is used here. for your own data, # change accordingly. print PAR <<"EOF"; 38 1 1 500 << num markers, case-control?, label-permutation? how many times? 13 13 12 13 3 9 15 8 8 16 17 5 16 7 14 3 3 7 8 20 12 12 12 8 6 13 6 11 9 27 5 13 9 11 10 16 20 5 << number of alleles for each marker 0 0 << something on printing output EOF # marker selection. 1 if the marker is selected, 0 not. for($j=1; $j<=$nmarkers; $j++){ if($j != $i){ print PAR "0 ";} else{ print PAR "1 ";} } print PAR "\n"; # 0 for all because we are not doing marker-marker LD analysis for($j=1; $j<=$nmarkers; $j++){ print PAR "0 "; } print PAR "\n"; # this particular line doesn't matter, because fpmp carries out # model-free analysis. print PAR "0.001 0.05 0.2 0.8 << disease all-freq, 3 penetrances\n"; close(PAR); $arg=" ".$parfile." ".$datafile." m".$i."."."out"; system("fpmp $arg"); } exit;