6 print "perl $0 <In_file> <Out_File>\n";
10 # choose Kosambi, which is slower than Haldane, for density markers
15 $smallr=0.5*$bigRth/(1-$bigRth);
22 # applies the distance function
23 my $RILdist = 25 * log((1 + 2 * $smallr) / (1 - 2 * $smallr));
27 open I
,'<',$ARGV[0] or die $!;
28 open O
,'>',$ARGV[1] or die $!;
30 $t=~s/\tPos\t/\tPos\tcM\tΔcM\tkB\/cM
\t/;
32 print O
"#ChrID\tPos\tcM\tΔcM\tkB/cM\tR_RIL\n";
37 ($chr,$pos,$dat)=split /\t/;
44 print O
"$chr\t$Pos[0]\t$LastcM\t0\tNA\t0\n"; #,join(' ',@{$Dat{$Pos[0]}}),"\n";
45 for my $i (1..$#Pos) {
46 my $ary_a=$Dat{$Pos[$i-1]};
47 my $ary_b=$Dat{$Pos[$i]};
48 my ($cross,$cnt)=(0,0);
49 for my $p (0..$#$ary_a) {
50 next if $ary_a->[$p] eq '-' or $ary_b->[$p] eq '-';
51 ++$cross if $ary_a->[$p] ne $ary_b->[$p];
54 my $cross0 = $cross/$cnt;
55 $cross = &corRIL
($cross0);
57 $ratio=$cross?
int(0.5+100*($Pos[$i]-$Pos[$i-1])/(1000*$cross)) : 'NA';
58 $ratio='Error' if $Error == 1;
59 print O
"$chr\t$Pos[$i]\t",int(0.5+100*$LastcM)/100,"\t",int(0.5+100*$cross)/100,"\t"
60 ,$ratio,"\t",100*$cross0,"\n"; #,join(' ',@{$Dat{$Pos[$i]}}),"\n";
66 cat chrorder
| while read a
; do ./clinkage
.pl
$a.ccq cm
$a.ccq
;done
&
68 cat chrorder
| while read a
; do ./linkage/clinkage
.pl dat20101214
/$a.marker dat20101214/$a.cm
;done
&