//DD_BS_Setup_Reference_Arrays //RAM, Nov 1, 2015 // put all the imported data into arrays from the table records to make it go faster //arrays of allele positions ALL RECORDS([Alleles]) SELECTION TO ARRAY([Alleles]Allel_label;aAllele;[Alleles]Locus;aLocus;[Alleles]Orig_Position;aOPos) ARRAY INTEGER(aNewPos;Size of array(aOPos)) ARRAY REAL(aRand1;Size of array(aOPos)) //Which indiv do you want? $Type:="Big_A@" //indivdiuals with alleles QUERY([Individuals];[Individuals]Phase=$Type) SELECTION TO ARRAY([Individuals]ID;aID;[Individuals]L1A1;aL11;[Individuals]L1A2;aL12;[Individuals]L2A1;aL21;[Individuals]L2A2;aL22) //the $N:=Size of array(aID) ARRAY INTEGER(aLoc11;$N) ARRAY INTEGER(aLoc12;$N) ARRAY INTEGER(aLoc21;$N) ARRAY INTEGER(aLoc22;$N) ARRAY INTEGER(aL1_ID;11) ARRAY INTEGER(aL1_Loc;11) ARRAY REAL(aL1_Rand;11) ARRAY INTEGER(aL2_ID;13) ARRAY INTEGER(aL2_Loc;13) ARRAY REAL(aL2_Rand;13) $N:=Size of array(aOPos) //get the Locus 1 locations and the Locus 2 lcoations For ($i;1;$N) If ($i<12) //L1 location aL1_ID{$i}:=aAllele{$i} aL1_Loc{$i}:=aOPos{$i} Else aL2_ID{$i-11}:=aAllele{$i} aL2_Loc{$i-11}:=aOPos{$i} End if End for