#!/usr/local/bin/perl -w # Example 4: no_lcp.pl # Setting up two-point analysis with LINKAGE without LCP # # 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: October 15, 1999 # # Usage: no_lcp.pl # [chromosome number] # [starting marker] (e.g. 1,2...) # [ending marker] # $usage ="Usage: no_lcp.pl [chr #] [starting marker] [ending marker]"; if($#ARGV != 2 ){ print "$usage\n"; exit; } $chr=$ARGV[0]; $start_marker=$ARGV[1]; $end_marker=$ARGV[2]; $start_marker++; # use the convention 1,2,...N $end_marker++; $prog="mlink"; $ukn="unknown"; $lsp="lsp"; $pedfile="chr".$chr.".ped"; # the name of the pedigree file $datfile="chr".$chr.".dat"; # the name of the parameter file $first_4_lines="$prog\n $pedfile\n $datfile\n 2\n"; $last_6_lines="0\n 0\n 1\n 0.05\n 0.4\n 0\n"; for($i=$start_marker;$i<=$end_marker;$i++){ $arg= "$first_4_lines"."1 $i\n".$last_6_lines; open(INPUT, "| $lsp >/dev/null"); print INPUT $arg; # feed inputs to LSP program close(INPUT); system("cat lsp.log >> final.out"); system("cat lsp.stm>> stream.out"); system($ukn); # run UNKNOWN program system($prog); # run MLINK program system("cat outfile.dat>> final.out"); system("cat stream.dat>> stream.out"); }