(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 53005, 1313] NotebookOptionsPosition[ 51559, 1280] NotebookOutlinePosition[ 52049, 1298] CellTagsIndexPosition[ 52006, 1295] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[{ RowBox[{ RowBox[{"Chr3Dir", "=", RowBox[{ "$HomeDirectory", "<>", "\"\<\\\\Desktop\\\\AfterDisert.Work\\\\ChrThreeFullHaplosFiles\\\\\>\""}]\ }], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"PopulFiles", "=", RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", "Chr3Dir"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NewSNPsDir", "=", RowBox[{ "$HomeDirectory", "<>", "\"\<\\\\Desktop\\\\AfterDisert.Work\\\\Chr3SNPsPotentials\\\\\>\""}]}], ";"}]}], "Input", CellChangeTimes->{{3.742151544863489*^9, 3.7421515946199617`*^9}, 3.742151735711901*^9, {3.7421518292406425`*^9, 3.7421518612018595`*^9}, { 3.7421523929316206`*^9, 3.742152403460208*^9}, 3.7421524455755267`*^9, { 3.742154868453641*^9, 3.7421548875274377`*^9}, {3.74230661649625*^9, 3.7423066168397474`*^9}, {3.831346375526889*^9, 3.8313464251271315`*^9}, 3.884221191333452*^9}, CellLabel->"In[1]:=",ExpressionUUID->"166713f7-b1e7-4fb3-acb7-1e4dc0bf6e1a"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"PopulSnps", "[", "Populno_", "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"HaplocationFiles", "=", RowBox[{"FileNames", "[", RowBox[{"\"\\"", ",", RowBox[{"PopulFiles", "[", RowBox[{"[", "Populno", "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"OnePopulSNPs", "[", "Populno", "]"}], "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"Snp", "=", "1"}], ",", RowBox[{"Snp", "\[LessEqual]", RowBox[{"Length", "[", "HaplocationFiles", "]"}]}], ",", RowBox[{"Snp", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"ImSNPs", "=", RowBox[{"Import", "[", RowBox[{ RowBox[{"HaplocationFiles", "[", RowBox[{"[", "Snp", "]"}], "]"}], ",", "\"\\""}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"DroImSNPs", "=", RowBox[{"Drop", "[", RowBox[{"ImSNPs", ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"OnePopulSNPsLocations", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"DroImSNPs", "[", RowBox[{"[", RowBox[{"loc", ",", "2"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"loc", ",", "1", ",", RowBox[{"Length", "[", "DroImSNPs", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", RowBox[{ RowBox[{"OnePopulSNPs", "[", "Populno", "]"}], ",", "OnePopulSNPsLocations"}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"OnePopulSNPs", "[", "Populno", "]"}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"AllSNPS", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"PopulSnps", "[", "Populno", "]"}], ",", RowBox[{"{", RowBox[{"Populno", ",", "1", ",", RowBox[{"Length", "[", "PopulFiles", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"RepetedSNPs", "=", RowBox[{"Intersection", "[", RowBox[{ RowBox[{"PopulSnps", "[", "1", "]"}], ",", RowBox[{"PopulSnps", "[", "2", "]"}], ",", RowBox[{"PopulSnps", "[", "3", "]"}], ",", RowBox[{"PopulSnps", "[", "4", "]"}], ",", RowBox[{"PopulSnps", "[", "5", "]"}], ",", RowBox[{"PopulSnps", "[", "6", "]"}], ",", RowBox[{"PopulSnps", "[", "7", "]"}], ",", RowBox[{"PopulSnps", "[", "8", "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.7421526799163733`*^9, 3.7421527431046147`*^9}, { 3.7421528467209682`*^9, 3.742152862311039*^9}, {3.74215297034949*^9, 3.7421530351154737`*^9}, {3.742153068451167*^9, 3.742153088962161*^9}, { 3.742153130495077*^9, 3.7421531716257505`*^9}, {3.742153206367852*^9, 3.742153478218234*^9}, {3.7421541918550525`*^9, 3.7421542276434155`*^9}, { 3.7421543197594695`*^9, 3.742154409207102*^9}, {3.7421544895410075`*^9, 3.742154670753282*^9}, 3.74215474773501*^9, 3.742154790378549*^9, { 3.742154822323886*^9, 3.7421548340711226`*^9}, {3.7421647983216677`*^9, 3.742164803757717*^9}, {3.7422484151535788`*^9, 3.742248459736832*^9}, { 3.7422485202381945`*^9, 3.742248583582647*^9}, {3.742249006186181*^9, 3.74224905604943*^9}, 3.7422491668358135`*^9, 3.7423000210089984`*^9, { 3.7423070108643064`*^9, 3.7423070178743544`*^9}, {3.83180876103933*^9, 3.8318087675072746`*^9}}, CellLabel->"In[4]:=",ExpressionUUID->"93dd23bc-e8df-42ce-ae2a-f4b5c2150e13"], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"RsBlockfilename", "[", "popno_", "]"}], ":=", RowBox[{"FileNames", "[", RowBox[{"\"\\"", ",", RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", "Chr3Dir"}], "]"}], "[", RowBox[{"[", "popno", "]"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"RsLocationfilename", "[", "popno_", "]"}], ":=", RowBox[{"FileNames", "[", RowBox[{"\"\\"", ",", RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", "Chr3Dir"}], "]"}], "[", RowBox[{"[", "popno", "]"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"popslashposition", "[", "popno_", "]"}], ":=", RowBox[{ RowBox[{"StringPosition", "[", RowBox[{ RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", "Chr3Dir"}], "]"}], "[", RowBox[{"[", "popno", "]"}], "]"}], ",", "\"\<\\\\\>\""}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"popname", "[", "popno_", "]"}], ":=", RowBox[{"StringDrop", "[", RowBox[{ RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", "Chr3Dir"}], "]"}], "[", RowBox[{"[", "popno", "]"}], "]"}], ",", RowBox[{"popslashposition", "[", "popno", "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"SNPname", "[", "snpno_", "]"}], ":=", RowBox[{"RepetedSNPs", "[", RowBox[{"[", "snpno", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"AllpopTEs", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\"\\"", ",", "1.1255766729746808`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1255515144314452`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1107920563525304`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1088685528507198`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1065608191416791`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.2377165220900395`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1087444589495752`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1959850154565101`"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\"\\"", ",", "1.2251228197944872`", ",", "1.7`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.122627188367992`", ",", "1.35`"}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "1.1088685528507198`", ",", "1.31`"}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"SNPLocator", " ", "has", " ", "output", " ", "imported"}], "=", RowBox[{"{", RowBox[{ RowBox[{"location", " ", "file", " ", "no"}], ",", " ", RowBox[{"location", " ", "data"}], ",", " ", RowBox[{"block", " ", "data"}]}], "}"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"SNPLocator", "[", RowBox[{"snpno_", ",", "popno_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"pos", "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"jj", "=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{"pos", "\[Equal]", RowBox[{"{", "}"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"jj", "=", RowBox[{"jj", "+", "1"}]}], ";", "\[IndentingNewLine]", RowBox[{"locdata", "=", RowBox[{"Import", "[", RowBox[{ RowBox[{ RowBox[{"RsLocationfilename", "[", "popno", "]"}], "[", RowBox[{"[", "jj", "]"}], "]"}], ",", "\"\\""}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"pos", "=", RowBox[{"Position", "[", RowBox[{"locdata", ",", RowBox[{"ToString", "[", RowBox[{"RepetedSNPs", "[", RowBox[{"[", "snpno", "]"}], "]"}], "]"}]}], "]"}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"jj", ",", "locdata", ",", RowBox[{"Import", "[", RowBox[{ RowBox[{"StringReplace", "[", RowBox[{ RowBox[{ RowBox[{"RsLocationfilename", "[", "popno", "]"}], "[", RowBox[{"[", "jj", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"\"\\"", "->", "\"\\""}], "}"}]}], "]"}], ",", "\"\\""}], "]"}]}], "}"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"SNPelem", " ", "takes", " ", "imported", " ", RowBox[{"SNPLocator", "[", RowBox[{"snpno", ",", "popno"}], "]"}]}], " ", "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"SNPelem", "[", RowBox[{"snpno_", ",", "imported_"}], "]"}], ":=", " ", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"SNPLocationdata", "=", "imported"}], ";", "\[IndentingNewLine]", RowBox[{"SNPpos", "=", RowBox[{ RowBox[{"Position", "[", RowBox[{ RowBox[{"SNPLocationdata", "[", RowBox[{"[", "2", "]"}], "]"}], ",", RowBox[{"ToString", "[", RowBox[{"RepetedSNPs", "[", RowBox[{"[", "snpno", "]"}], "]"}], "]"}]}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"SNPLocationdata", "[", RowBox[{"[", "2", "]"}], "]"}], "[", RowBox[{"[", "SNPpos", "]"}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"SNPinfo", " ", "extracts", " ", "information", " ", "from", " ", RowBox[{"SNPelem", "[", RowBox[{"snpno", ",", RowBox[{"SNPLocator", "[", RowBox[{"snpno", ",", "popno"}], "]"}]}], "]"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"SNPinfo", "[", "snpelem_", "]"}], ":=", " ", RowBox[{"(", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"snpelem", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"snpelem", "[", RowBox[{"[", "2", "]"}], "]"}], ",", RowBox[{"snpelem", "[", RowBox[{"[", "3", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"snpelem", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], ",", RowBox[{"snpelem", "[", RowBox[{"[", RowBox[{"-", "2"}], "]"}], "]"}]}], "}"}]}], "}"}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"SNPInfoList", "[", RowBox[{"snpno_", ",", "imported_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"Infolist", "=", RowBox[{"SNPinfo", "[", RowBox[{"SNPelem", "[", RowBox[{"snpno", ",", "imported"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"blockdata", "=", RowBox[{"imported", "[", RowBox[{"[", "3", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Markerpos", "=", RowBox[{"Position", "[", RowBox[{"blockdata", ",", "\"\\""}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Markerblock", "=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"jj", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"jj", "<=", RowBox[{"Length", "[", "Markerpos", "]"}]}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"Position", "[", RowBox[{ RowBox[{"blockdata", "[", RowBox[{"[", RowBox[{"Markerpos", "[", RowBox[{"[", RowBox[{"jj", ",", "1"}], "]"}], "]"}], "]"}], "]"}], ",", RowBox[{"Infolist", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "]"}], "==", " ", RowBox[{"{", "}"}]}], ")"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{"jj", "++"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "jj"}], "\[IndentingNewLine]", ")"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "WE", " ", "NEED", " ", "TO", " ", "BYPASS", " ", "WHAT", " ", "FOLLOWS", " ", "IF", " ", "SNP", " ", "NOT", " ", "IN", " ", "LD", " ", "Markerblock"}], ">", RowBox[{"Length", "[", "Markerpos", "]"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"LDlist", ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"MarkerblockReal", "=", RowBox[{"1.0", "*", "Markerblock"}]}], ";", "\[IndentingNewLine]", RowBox[{"Actualblkline", "=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"kk", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{"blkno", "=", RowBox[{"Position", "[", RowBox[{"blockdata", ",", "MarkerblockReal"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"kk", "\[LessEqual]", RowBox[{"Length", "[", "blkno", "]"}]}], ")"}], "&&", RowBox[{"(", RowBox[{ RowBox[{"blockdata", "[", RowBox[{"[", RowBox[{ RowBox[{"blkno", "[", RowBox[{"[", RowBox[{"kk", ",", "1"}], "]"}], "]"}], ",", "1"}], "]"}], "]"}], "\[NotEqual]", "\"\\""}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{"kk", "++"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"blkno", "[", RowBox[{"[", RowBox[{"kk", ",", "1"}], "]"}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";", "\[IndentingNewLine]", RowBox[{"Finaldatalineno", "=", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Length", "[", "Markerpos", "]"}], ">", RowBox[{ RowBox[{"Position", "[", RowBox[{"Markerpos", ",", "Actualblkline"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ",", RowBox[{ RowBox[{"Markerpos", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Position", "[", RowBox[{"Markerpos", ",", "Actualblkline"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", "1"}], "]"}], "]"}], "-", "2"}], ",", "\[IndentingNewLine]", "True", ",", RowBox[{"Length", "[", "blockdata", "]"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Markersno", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"blockdata", "[", RowBox[{"[", "Actualblkline", "]"}], "]"}], ",", "3"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Haplist", "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"hn", "=", RowBox[{"Actualblkline", "+", "1"}]}], ",", RowBox[{"hn", "<=", "Finaldatalineno"}], ",", RowBox[{"hn", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"AppendTo", "[", RowBox[{"Haplist", ",", " ", RowBox[{"{", RowBox[{ RowBox[{"ToString", "[", RowBox[{"blockdata", "[", RowBox[{"[", RowBox[{"hn", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"ToExpression", "[", RowBox[{"blockdata", "[", RowBox[{"[", RowBox[{"hn", ",", "2"}], "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"Infolist", ",", "Markersno", ",", "Haplist"}], "}"}]}], "\[IndentingNewLine]", ")"}]}], ";", "\[IndentingNewLine]", RowBox[{"Which", "[", RowBox[{ RowBox[{"Markerblock", ">", RowBox[{"Length", "[", "Markerpos", "]"}]}], ",", RowBox[{"{", "Infolist", "}"}], ",", RowBox[{"Markerblock", "<=", RowBox[{"Length", "[", "Markerpos", "]"}]}], ",", "LDlist"}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Print", "[", "\"\< Defining Entropy\>\"", "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"NonLinkEntropy", "[", "infoln_", "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"maf", "=", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Which", "[", RowBox[{ RowBox[{"maf", "\[Equal]", "0"}], ",", "0", ",", "\[IndentingNewLine]", "True", ",", RowBox[{ RowBox[{ RowBox[{"-", " ", "maf"}], "*", RowBox[{"Log", "[", RowBox[{"2", ",", "maf"}], "]"}]}], "-", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "maf"}], ")"}], "*", RowBox[{"Log", "[", RowBox[{"2", ",", RowBox[{"(", RowBox[{"1", "-", "maf"}], ")"}]}], "]"}]}]}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"LDEntropy", "[", "infoln_", "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "n", ",", "2"}], "]"}], "]"}], " ", "is", " ", "the", " ", "nth", " ", "probability"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"-", " ", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "n", ",", "2"}], "]"}], "]"}]}], "*", RowBox[{"Log", "[", RowBox[{"2", ",", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "n", ",", "2"}], "]"}], "]"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", RowBox[{"Length", "[", RowBox[{"infoln", "[", RowBox[{"[", "3", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"BlockEntropy", "[", "infoln_", "]"}], ":=", " ", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Length", "[", "infoln", "]"}], "\[Equal]", "1"}], ",", RowBox[{"NonLinkEntropy", "[", "infoln", "]"}], ",", "\[IndentingNewLine]", "True", ",", " ", RowBox[{"LDEntropy", "[", "infoln", "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Print", "[", "\"\< Defining Genodynamic Potentials \>\"", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"SNP", " ", "Potential"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"NonLinkSNPpotential", "[", RowBox[{"infoln_", ",", "TE_"}], "]"}], ":=", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], "\[Equal]", "0"}], ",", RowBox[{"1", "-", "TE"}], ",", "\[IndentingNewLine]", "True", ",", RowBox[{"1", "-", "TE", "+", RowBox[{"TE", "*", RowBox[{"NonLinkEntropy", "[", "infoln", "]"}]}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Block", " ", "Potential"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"LDblockpotential", "[", RowBox[{"infoln_", ",", "TE_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"numSNPs", "=", RowBox[{"StringLength", "[", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "1", ",", "1"}], "]"}], "]"}], "]"}]}], ";", RowBox[{"(*", " ", RowBox[{"same", " ", "for", " ", "all", " ", "Haplotypes"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}], "*", "numSNPs"}], "+", RowBox[{"TE", "*", RowBox[{"LDEntropy", "[", "infoln", "]"}]}]}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Blockpotential", "[", RowBox[{"infoln_", ",", "TE_"}], "]"}], ":=", " ", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Length", "[", "infoln", "]"}], "\[Equal]", "1"}], ",", RowBox[{"NonLinkSNPpotential", "[", RowBox[{"infoln", ",", "TE"}], "]"}], ",", "\[IndentingNewLine]", "True", ",", RowBox[{"LDblockpotential", "[", RowBox[{"infoln", ",", "TE"}], "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Allelic", " ", "Potential"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"NonLinkMu", "[", RowBox[{"infoln_", ",", "TE_", ",", "alno_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"maf", "=", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"alno", "\[Equal]", "2"}], ",", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}], "-", RowBox[{"TE", " ", "*", RowBox[{"Log", "[", RowBox[{"2", ",", "maf"}], "]"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"alno", "\[Equal]", "1"}], ",", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}], "-", RowBox[{"TE", " ", "*", RowBox[{"Log", "[", RowBox[{"2", ",", RowBox[{"(", RowBox[{"1", "-", "maf"}], ")"}]}], "]"}]}]}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Haplotype", " ", "Potential"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"LDMu", "[", RowBox[{"infoln_", ",", "TE_", ",", "Hnum_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"numSNPs", "=", RowBox[{"StringLength", "[", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "1", ",", "1"}], "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}], "*", "numSNPs"}], "-", RowBox[{"TE", "*", RowBox[{"Log", "[", RowBox[{"2", ",", RowBox[{"infoln", "[", RowBox[{"[", RowBox[{"3", ",", "Hnum", ",", "2"}], "]"}], "]"}]}], "]"}]}]}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"MAFs", "[", RowBox[{"snpno_", ",", "popno_"}], "]"}], " ", "gives", " ", "outcome", " ", RowBox[{"{", RowBox[{ RowBox[{"maf", " ", "of", " ", "snpno"}], ",", RowBox[{"sum", " ", "mafs", " ", "in", " ", "the", " ", "block"}]}], "}"}]}], " ", "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"MAFs", "[", RowBox[{"snpno_", ",", "imported_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"locdata", "=", RowBox[{"imported", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"snpinflst", "=", RowBox[{"SNPInfoList", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"markernums", "=", RowBox[{"snpinflst", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"snpmaf", "=", RowBox[{"snpinflst", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"locmarkers", "=", RowBox[{ RowBox[{"Drop", "[", RowBox[{"locdata", ",", "1"}], "]"}], "[", RowBox[{"[", RowBox[{"markernums", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"StringLength", "[", RowBox[{"snpinflst", "[", RowBox[{"[", RowBox[{"3", ",", "1", ",", "1"}], "]"}], "]"}], "]"}], "!=", RowBox[{"Length", "[", "markernums", "]"}]}], ",", RowBox[{ "Print", "[", "\"\\"", "]"}], ",", "\[IndentingNewLine]", RowBox[{"locmarkers", "\[Equal]", "markernums"}], ",", RowBox[{"{", RowBox[{"snpmaf", ",", RowBox[{"Tr", "[", RowBox[{ RowBox[{"Drop", "[", RowBox[{"locdata", ",", "1"}], "]"}], "[", RowBox[{"[", RowBox[{"markernums", ",", RowBox[{"-", "2"}]}], "]"}], "]"}], "]"}], ",", RowBox[{"Length", "[", "markernums", "]"}]}], "}"}], ",", "\[IndentingNewLine]", "True", ",", RowBox[{"Print", "[", "\"\\"", "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "DistributedSNPPotenial", " ", "gives", " ", "the", " ", "distributed", " ", "potential", " ", "of", " ", "snpno", " ", "in", " ", "a", " ", "Haploblock"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"DistributedSNPPotenial", "[", RowBox[{"snpno_", ",", "imported_", ",", "TE_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"mafvalue", "=", RowBox[{"MAFs", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"snplist", "=", RowBox[{"SNPInfoList", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}], "+", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Blockpotential", "[", RowBox[{"snplist", ",", "TE"}], "]"}], "-", RowBox[{ RowBox[{"mafvalue", "[", RowBox[{"[", "3", "]"}], "]"}], RowBox[{"(", RowBox[{"1", "-", "TE"}], ")"}]}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{"mafvalue", "[", RowBox[{"[", "1", "]"}], "]"}], "/", RowBox[{"mafvalue", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"BindingEnergy", " ", "=", " ", RowBox[{"DistributedSNPPotenial", "-", "NonLinkSNPpotential"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"BindingEnergy", "[", RowBox[{"snpno_", ",", "imported_", ",", "TE_"}], "]"}], ":=", " ", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"snplist", "=", RowBox[{"SNPInfoList", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"DistributedSNPPotenial", "[", RowBox[{"snpno", ",", "imported", ",", "TE"}], "]"}], "-", " ", RowBox[{"NonLinkSNPpotential", "[", RowBox[{"snplist", ",", "TE"}], "]"}]}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"DistributedAllelicpotential", "[", RowBox[{"snpno", ",", "popno", ",", "TE", ",", RowBox[{"allele", " ", "string"}]}], "]"}], " ", "gives", " ", "NonLinkMu"}], "+", "BindingEnergy"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"DistributedAllelicpotential", "[", RowBox[{"snpno_", ",", "imported_", ",", "TE_", ",", "al_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"snplist", "=", RowBox[{"SNPInfoList", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"alleleno", "=", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{ RowBox[{"snplist", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", "al"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "\[Equal]", "3"}], ",", "2", ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{ RowBox[{"snplist", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", "al"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "\[Equal]", "1"}], ",", "1", ",", "\[IndentingNewLine]", "True", ",", " ", RowBox[{"Print", "[", "\"\< Not an allele in this SNP \>\"", "]"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nldMu", "=", RowBox[{"NonLinkMu", "[", RowBox[{"snplist", ",", "TE", ",", "alleleno"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"benergy", "=", RowBox[{"BindingEnergy", "[", RowBox[{"snpno", ",", "imported", ",", "TE"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nldMu", "+", "benergy"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"SinglePopSNPInformation", "[", RowBox[{"snpno", ",", "imported"}], "]"}], " ", "has", " ", "output", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"popno", ",", "chrno", ",", "rs"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"TE", ",", RowBox[{"1000", "G"}]}], "}"}], ",", RowBox[{"{", RowBox[{"TE", ",", RowBox[{"1000", "G"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a1", ":", "a2"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SNP", " ", "pot"}], ",", " ", RowBox[{"a1", " ", "pot"}], ",", " ", RowBox[{"2", " ", "pot"}], ",", " ", RowBox[{"binding", " ", "E"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"a1", ":", "a2"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SNP", " ", "pot"}], ",", " ", RowBox[{"a1", " ", "pot"}], ",", " ", RowBox[{"2", " ", "pot"}], ",", " ", RowBox[{"binding", " ", "E"}]}], "}"}]}], "}"}], "}"}]}], "}"}]}], " "}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"SinglePopSNPInformation", "[", RowBox[{"snpno_", ",", "popno_", ",", "imported_"}], "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"Inflst", "=", RowBox[{"SNPInfoList", "[", RowBox[{"snpno", ",", "imported"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"TE", "=", RowBox[{ RowBox[{"AllpopTEs", "[", RowBox[{"[", RowBox[{ RowBox[{"Position", "[", RowBox[{"AllpopTEs", ",", RowBox[{"popname", "[", "popno", "]"}]}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"InfoPots", "=", RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", "Inflst", "]"}], "\[LessEqual]", "1"}], ",", RowBox[{"{", RowBox[{ RowBox[{"NonLinkSNPpotential", "[", RowBox[{"Inflst", ",", "TE"}], "]"}], ",", RowBox[{"NonLinkMu", "[", RowBox[{"Inflst", ",", "TE", ",", "1"}], "]"}], ",", RowBox[{"NonLinkMu", "[", RowBox[{"Inflst", ",", "TE", ",", "2"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", "True", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"DistributedSNPPotenial", "[", RowBox[{"snpno", ",", "imported", ",", "TE"}], "]"}], ",", RowBox[{"DistributedAllelicpotential", "[", RowBox[{"snpno", ",", "imported", ",", "TE", ",", RowBox[{"StringDrop", "[", RowBox[{ RowBox[{"Inflst", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", RowBox[{"-", "2"}]}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(", RowBox[{"DistributedAllelicpotential", "[", RowBox[{"snpno", ",", "imported", ",", "TE", ",", RowBox[{"StringDrop", "[", RowBox[{ RowBox[{"Inflst", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", "2"}], "]"}]}], "]"}], ")"}], ",", RowBox[{"BindingEnergy", "[", RowBox[{"snpno", ",", "imported", ",", "TE"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"popname", "[", "popno", "]"}], ",", "\"\\"", ",", RowBox[{"Inflst", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"TE", ",", "\"\<1000Genome\>\""}], "}"}], ",", RowBox[{"{", RowBox[{"TE", ",", "\"\<1000Genome\>\""}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Inflst", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", "InfoPots"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Inflst", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "1"}], "]"}], "]"}], ",", "InfoPots"}], "}"}]}], "}"}]}], "}"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"SNPInformation", "[", "snpno", "]"}], " ", "gives", " ", "SinglePopSNPInformation", " ", "for", " ", "all", " ", "populations"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"SNPInformation", "[", "snpno_", "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"InformTable", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"SNPLocator", "[", RowBox[{"snpno", ",", "popno"}], "]"}], ",", RowBox[{"{", RowBox[{"popno", ",", "1", ",", RowBox[{"Length", "[", "PopulFiles", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"SinglePopSNPInformation", "[", RowBox[{"snpno", ",", "popno", ",", RowBox[{"InformTable", "[", RowBox[{"[", "popno", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"popno", ",", "1", ",", RowBox[{"Length", "[", "PopulFiles", "]"}]}], "}"}]}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"NewInfoSNPslist", "[", "snpno", "]"}], " ", "saves", " ", "SNPInformation", " ", "into", " ", RowBox[{"NewSNPsDir", "<>", RowBox[{"SNPname", "[", "snpno", "]"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "It", " ", "takes", " ", "12", " ", "min", " ", "for", " ", "10", " ", "SNPs"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"NewInfoSNPslist", "[", "snpno_", "]"}], ":=", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"SNPname", "[", "snpno", "]"}], ";", "\[IndentingNewLine]", RowBox[{"NewInfolist", "=", RowBox[{"SNPInformation", "[", "snpno", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Put", "[", RowBox[{"NewInfolist", ",", RowBox[{"NewSNPsDir", "<>", RowBox[{"SNPname", "[", "snpno", "]"}]}]}], "]"}]}], "\[IndentingNewLine]", ")"}]}], ";"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.8330152544223204`*^9, 3.8330153252759185`*^9}, { 3.833015423074385*^9, 3.8330154323765326`*^9}, {3.833016799915124*^9, 3.833016814512576*^9}, {3.833059027990632*^9, 3.8330590288473606`*^9}}, CellLabel->"In[7]:=",ExpressionUUID->"77484d08-4718-4a0f-a64a-9b2fee2c57b4"], Cell[CellGroupData[{ Cell[BoxData["\<\" Defining Entropy\"\>"], "Print", CellChangeTimes->CompressedData[" 1:eJwVzFkowwEcwPH9HSULD3/KwxxLrhS5cvQv/ZYnRK5YERYTaXOVF3Kf8bco Rx5Q4sEkkatIyDKhhtRMDZPhN8nchJ+Hb5+3r1imTCtiBAJBKJVTY9V/8giL fkLTv7pZERvbi1C6PyjNI0suN7oeSNM5s6ZUIXDa7odrNYLHoK7Zdg6hZVPO /2seSPG0I3Vh2s7iRQR2Jqt5axkhfipOHrqCEBA4F85uIsj4iJ4lPUKceDiE PUPYyJ5+6yaPUDzlbUB4ruvfniDLpInakSuEqsAPhdiEUNn6NPZ9g5ArizFK zQgdReq2HjKqX53lf4vQa5xXSkkFJ7moJRt+nKsd7xCSbXbX28ljpwzj2D2C w2rQtZX89BHWqx4RmBOoKH9CuPNKiNaTVWWnboVWBJWSey9/QciJ3WX6SIsX 42z/ijDESYQFZJtLV23mF/01V2bZN8Lkzrh7PZnq28jPkIq97EjRL0LwgoHj yYbLJHuJwALumpiDdNYClW6jTdGuFjiMz5cYyD9MZNZ6 "], CellLabel-> "During evaluation of \ In[7]:=",ExpressionUUID->"ef7b2acd-3720-4311-a207-a290c24314b6"], Cell[BoxData["\<\" Defining Genodynamic Potentials \"\>"], "Print", CellChangeTimes->CompressedData[" 1:eJwVzFkowwEcwPH9HSULD3/KwxxLrhS5cvQv/ZYnRK5YERYTaXPmhdxn/C3K kQeUeDBJ5CoSIhMPQ2pGw2T4TTI34efh2+ftK5YpUwoYgUAQTGVVW3SfPMKC j9D4r3ZGxEb3IBTvD0hzyKLL9c4H0njGrCpVCJym6+FajeA2oG2ynkVo3pDz /5r6k9xtSG2IpqNwAYGdzmjaXEKInYyRBy8j+PnPhrIbCDI+rHtRhxAjHgpi TxHWM6feushDFE966hGea/u2xskSabxm+Aqhwv9DITYilLc8jX7fIGTLogxS E0J7gbq1m4zoU2f43iL0GOaUUlLBSS5qyPofx0r7O4REq921NvLIIc0weo9g txJwbSE/vYR1qkcE5hjKSp8Q7jziInVkRcmJS74FQaXk3ktfELKid5le0uzB ONq+IgxyEmEe2erUWZP+Rf+dK5PsG2Fie8y1jkz2buCnScVeZrjoFyFwXs/x ZP1lgq1EYAbXnaiDVNYM5S4jjZHOZjivypXoyT9OM9a6 "], CellLabel-> "During evaluation of \ In[7]:=",ExpressionUUID->"0b2c3dad-5ef7-475e-a071-beeca8d20a49"] }, Open ]] }, Open ]], Cell[BoxData[""], "Input", CellChangeTimes->{{3.8330151566220846`*^9, 3.833015157187939*^9}, { 3.833015190514755*^9, 3.833015191052003*^9}, {3.8330158243997393`*^9, 3.833015825532811*^9}, {3.8330158559450693`*^9, 3.8330158610607123`*^9}, { 3.833016034928133*^9, 3.833016035858788*^9}, {3.833016161666931*^9, 3.833016162496608*^9}, {3.833016749034867*^9, 3.833016754738757*^9}, { 3.8330175664183717`*^9, 3.833017567011038*^9}, 3.833017774559539*^9, { 3.833018477353692*^9, 3.8330184784073925`*^9}, {3.8330187153028097`*^9, 3.83301876574676*^9}, {3.833018851421576*^9, 3.833018864626869*^9}, { 3.8330189120771*^9, 3.8330189892152357`*^9}, {3.8330198715468884`*^9, 3.833019894599582*^9}, 3.8330590228733454`*^9},ExpressionUUID->"4c2238a6-49bd-4702-b9d1-\ 790aab3ea1ff"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ "Every", " ", "time", " ", "add", " ", "one", " ", "to", " ", "the", " ", "previous", " ", "RunNo"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"As", " ", "there", " ", "is", " ", "375769", " ", "SNPs"}], ",", " ", RowBox[{ RowBox[{ "the", " ", "last", " ", "run", " ", "is", " ", "375000", " ", "to", " ", "375769"}], " ", "-", " ", RowBox[{"Do", " ", "it", " ", "by", " ", "hand"}], "-"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"RunNo", "=", "106"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NoSNPs", "=", "1000"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", " ", RowBox[{"1", "+", RowBox[{"RunNo", "*", "NoSNPs"}]}], ",", "\"\< to \>\"", ",", " ", RowBox[{ RowBox[{"(", RowBox[{"RunNo", "+", "1"}], ")"}], "*", "NoSNPs"}]}], " ", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"strt", "=", RowBox[{"Date", "[", "]"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"snpno", "=", RowBox[{ RowBox[{"(", RowBox[{"NoSNPs", "*", "RunNo"}], ")"}], "+", "1"}]}], ",", RowBox[{"snpno", "\[LessEqual]", RowBox[{"NoSNPs", "*", RowBox[{"(", RowBox[{"RunNo", "+", "1"}], ")"}]}]}], ",", RowBox[{"snpno", "++"}], ",", RowBox[{"NewInfoSNPslist", "[", "snpno", "]"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"fin", "=", RowBox[{"Date", "[", "]"}]}], ",", "\"\<. Time Elapsed=\>\"", ",", RowBox[{"fin", "-", "strt"}]}], " ", "]"}], ";"}]}]}]], "Input", CellChangeTimes->{{3.8330198632406464`*^9, 3.833019864986718*^9}, { 3.8330200165270844`*^9, 3.833020096792529*^9}, {3.833020147262088*^9, 3.8330204162496405`*^9}, {3.8330204881843276`*^9, 3.833020615483966*^9}, { 3.8330206500077305`*^9, 3.833020891640799*^9}, 3.833188448143538*^9, 3.8332645961713753`*^9, {3.8333909199808407`*^9, 3.833390920081355*^9}, 3.833557806965316*^9, 3.8336276724612236`*^9, {3.8336936976695848`*^9, 3.8336936982737274`*^9}, {3.833822416092243*^9, 3.833822417112274*^9}, { 3.8355312767794647`*^9, 3.8355312781852746`*^9}, {3.837519328403634*^9, 3.837519328538484*^9}, {3.84787435049712*^9, 3.847874352095292*^9}, 3.848744306424163*^9, 3.8509026387420177`*^9, {3.8523090051698866`*^9, 3.8523090060126324`*^9}, {3.8537281255055437`*^9, 3.8537281256770864`*^9}, 3.854965223811664*^9, {3.85511197538165*^9, 3.85511197624634*^9}, { 3.8553798985873804`*^9, 3.855379899188773*^9}, {3.859098698137293*^9, 3.859098699480693*^9}, {3.8598470110563483`*^9, 3.8598470117764225`*^9}, 3.8611055347212906`*^9, {3.8727665217205267`*^9, 3.872766522560527*^9}, { 3.872910228817582*^9, 3.8729102292975826`*^9}, {3.873103275512435*^9, 3.873103276683303*^9}, {3.8735059967275524`*^9, 3.8735059977359877`*^9}, { 3.8736834809869394`*^9, 3.873683487954775*^9}, {3.873944801976654*^9, 3.8739448029568086`*^9}, 3.8748109206444464`*^9, {3.877428174049328*^9, 3.8774281747420254`*^9}, 3.8777015910717525`*^9, 3.879724201156333*^9, 3.8799150273968697`*^9, {3.880020786986949*^9, 3.8800207875029573`*^9}, { 3.8801585564498816`*^9, 3.8801585568095756`*^9}, {3.880335846901046*^9, 3.880335847218665*^9}, {3.8804360906651816`*^9, 3.8804360922654963`*^9}, 3.8805110147204556`*^9, {3.880588307847471*^9, 3.8805883079417744`*^9}, { 3.880801007406996*^9, 3.880801008317395*^9}, 3.8808570880894213`*^9, { 3.8810575645553217`*^9, 3.881057564665366*^9}, {3.881118470896212*^9, 3.8811184713961906`*^9}, {3.881196527175239*^9, 3.881196527945918*^9}, 3.881306803388996*^9, 3.8813913157145033`*^9, {3.881717618876221*^9, 3.8817176189717474`*^9}, {3.8818033182089415`*^9, 3.8818033183199654`*^9}, {3.8842212533800807`*^9, 3.8842212536021376`*^9}, 3.885204144513031*^9, {3.8854207762125874`*^9, 3.885420776593753*^9}, { 3.885607171366353*^9, 3.8856071718510356`*^9}, {3.885805177327176*^9, 3.8858051779862614`*^9}, {3.8860486605032325`*^9, 3.8860486623233113`*^9}, {3.886777720685704*^9, 3.8867777214931545`*^9}, { 3.8868457416287136`*^9, 3.8868457417229*^9}, 3.8870813338748693`*^9, { 3.887269744231636*^9, 3.887269744380865*^9}, 3.887345242765319*^9, { 3.8899338576610594`*^9, 3.88993385780006*^9}, {3.8904769393147073`*^9, 3.8904769397566533`*^9}, {3.8905721499693766`*^9, 3.8905721506762514`*^9}, {3.891847355875657*^9, 3.891847356456541*^9}, { 3.892080910118542*^9, 3.892080910715126*^9}, {3.892345103524781*^9, 3.892345104112106*^9}, {3.8924490895856547`*^9, 3.892449089760393*^9}, { 3.902446481226774*^9, 3.902446481896983*^9}, {3.9029148623731203`*^9, 3.9029148776362886`*^9}, {3.9032502869853907`*^9, 3.903250288820484*^9}, { 3.9034145039237185`*^9, 3.9034145044712553`*^9}},ExpressionUUID->"1274acfe-5346-4905-8d48-\ 9d34dac45207"], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Running SNP no \"\>", "\[InvisibleSpace]", "105001", "\[InvisibleSpace]", "\<\" to \"\>", "\[InvisibleSpace]", "106000"}], SequenceForm["Running SNP no ", 105001, " to ", 106000], Editable->False]], "Print", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmVkYGAwB+JD1ZVML/reOMY9Oi1s1f/GsemDYVQ8kJ5QFfRyDpC2 eRTR/Q5Il1gWNgtMeOPoszPtgAGQbl49ZW8+kJZe0vfu6Zo3jhVVq/uYN75x 3BQbJMcCpDfwnOlM3/bGkfNPXPPhHW8cTxU4phnufOPIZ7LZWPjQG8cHlWa9 22+9cfymPFtf+PYbx1tWa7/3AGnW68rLFe68cXTun3pkCZCuy/E9NfvxG8cj B/7kKT4B2mv5ecGf528cvZKsHkS+eOPY8HRNWy+Q/hGzLlz95RvHtoQt+ZFA Om+P08MaIF1Wx1/C9eqNY1G3+wFVIO3fdHJfO5DeNZczcSmQDm9zrzsNpCNM VoQxvn7j6CAY+mABkC5rX/HuJJBedErn6Wcg7baEu37ChzeOn644FRZ8euN4 TNnH4haQ1nxzQzTl8xvH7nzbHwVf3zgusz3FOAlIf8hi4mP9BgwPL2fuRCCt xN9dE/r7jSPT6Scvkv68cVQ7tUiiHkhLfGjqWwuk7WojTWX+v3FsMbln0wek a5J8WZ0Y3jrOXGdzLlj4reOZsEVNFiJvHVMWJjndAdIA5eLxKQ== "], CellLabel-> "During evaluation of \ In[34]:=",ExpressionUUID->"748b5cea-5ee7-4b5e-9b7e-01eb0e5fcda4"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"start date =\"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{ "2023", ",", "9", ",", "9", ",", "15", ",", "22", ",", "43.0762175`9.38681243300633"}], "}"}]}], SequenceForm[ "start date =", {2023, 9, 9, 15, 22, 43.0762175`9.38681243300633}], Editable->False]], "Print", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmVkYGAwB+JD1ZVML/reOMY9Oi1s1f/GsemDYVQ8kJ5QFfRyDpC2 eRTR/Q5Il1gWNgtMeOPoszPtgAGQbl49ZW8+kJZe0vfu6Zo3jhVVq/uYN75x 3BQbJMcCpDfwnOlM3/bGkfNPXPPhHW8cTxU4phnufOPIZ7LZWPjQG8cHlWa9 22+9cfymPFtf+PYbx1tWa7/3AGnW68rLFe68cXTun3pkCZCuy/E9NfvxG8cj B/7kKT4B2mv5ecGf528cvZKsHkS+eOPY8HRNWy+Q/hGzLlz95RvHtoQt+ZFA Om+P08MaIF1Wx1/C9eqNY1G3+wFVIO3fdHJfO5DeNZczcSmQDm9zrzsNpCNM VoQxvn7j6CAY+mABkC5rX/HuJJBedErn6Wcg7baEu37ChzeOn644FRZ8euN4 TNnH4haQ1nxzQzTl8xvH7nzbHwVf3zgusz3FOAlIf8hi4mP9BgwPL2fuRCCt xN9dE/r7jSPT6Scvkv68cVQ7tUiiHkhLfGjqWwuk7WojTWX+v3FsMbln0wek a5J8WZ0Y3jrOXGdzLlj4reOZsEVNFiJvHQ89SnK6A6QB6pnxyA== "], CellLabel-> "During evaluation of \ In[34]:=",ExpressionUUID->"13a404b4-82f0-419f-a065-f1a56f9766b3"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Finish date =\"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{ "2023", ",", "9", ",", "11", ",", "11", ",", "49", ",", "13.8608442`8.894364635654368"}], "}"}], "\[InvisibleSpace]", "\<\". Time Elapsed=\"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "2", ",", RowBox[{"-", "4"}], ",", "27", ",", RowBox[{"-", "29.2153733`8.91715635701306"}]}], "}"}]}], SequenceForm[ "Finish date =", {2023, 9, 11, 11, 49, 13.8608442`8.894364635654368}, ". Time Elapsed=", {0, 0, 2, -4, 27, -29.2153733`8.91715635701306}], Editable->False]], "Print", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmVkYGAwB+JD1ZVML/reOMY9Oi1s1f/GsemDYVQ8kJ5QFfRyDpC2 eRTR/Q5Il1gWNgtMeOPoszPtgAGQbl49ZW8+kJZe0vfu6Zo3jhVVq/uYN75x 3BQbJMcCpDfwnOlM3/bGkfNPXPPhHW8cTxU4phnufOPIZ7LZWPjQG8cHlWa9 22+9cfymPFtf+PYbx1tWa7/3AGnW68rLFe68cXTun3pkCZCuy/E9NfvxG8cj B/7kKT4B2mv5ecGf528cvZKsHkS+eOPY8HRNWy+Q/hGzLlz95RvHtoQt+ZFA Om+P08MaIF1Wx1/C9eqNY1G3+wFVIO3fdHJfO5DeNZczcSmQDm9zrzsNpCNM VoQxvn7j6CAY+mABkC5rX/HuJJBedErn6Wcg7baEu37ChzeOn644FRZ8euN4 TNnH4haQ1nxzQzTl8xvH7nzbHwVf3zgusz3FOAlIf8hi4mP9BgwPL2fuRCCt xN9dE/r7jSPT6Scvkv68cVQ7tUiiHkhLfGjqWwuk7WojTWX+v3FsMbln0wek a5J8WZ0Y3jrOXGdzLlj4reOZsEVNFiJvHSsnOiVqib51BADjMPB8 "], CellLabel-> "During evaluation of \ In[34]:=",ExpressionUUID->"a2c3a11e-62e4-4159-8f78-09b71b22a0c6"] }, Open ]] }, Open ]] }, WindowSize->{1350, 669}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, TaggingRules->{ "WelcomeScreenSettings" -> {"FEStarting" -> False}, "TryRealOnly" -> False}, FrontEndVersion->"12.3 for Microsoft Windows (64-bit) (July 9, 2021)", StyleDefinitions->"Default.nb", ExpressionUUID->"9860b431-463c-4631-8956-ff286e7b2418" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 1015, 24, 70, "Input",ExpressionUUID->"166713f7-b1e7-4fb3-acb7-1e4dc0bf6e1a"], Cell[1576, 46, 3794, 84, 290, "Input",ExpressionUUID->"93dd23bc-e8df-42ce-ae2a-f4b5c2150e13"], Cell[CellGroupData[{ Cell[5395, 134, 34979, 906, 3410, "Input",ExpressionUUID->"77484d08-4718-4a0f-a64a-9b2fee2c57b4"], Cell[CellGroupData[{ Cell[40399, 1044, 731, 14, 23, "Print",ExpressionUUID->"ef7b2acd-3720-4311-a207-a290c24314b6"], Cell[41133, 1060, 747, 14, 23, "Print",ExpressionUUID->"0b2c3dad-5ef7-475e-a071-beeca8d20a49"] }, Open ]] }, Open ]], Cell[41907, 1078, 802, 12, 29, "Input",ExpressionUUID->"4c2238a6-49bd-4702-b9d1-790aab3ea1ff"], Cell[CellGroupData[{ Cell[42734, 1094, 5254, 100, 170, "Input",ExpressionUUID->"1274acfe-5346-4905-8d48-9d34dac45207"], Cell[CellGroupData[{ Cell[48013, 1198, 1014, 20, 23, "Print",ExpressionUUID->"748b5cea-5ee7-4b5e-9b7e-01eb0e5fcda4"], Cell[49030, 1220, 1092, 24, 23, "Print",ExpressionUUID->"13a404b4-82f0-419f-a065-f1a56f9766b3"], Cell[50125, 1246, 1406, 30, 23, "Print",ExpressionUUID->"a2c3a11e-62e4-4159-8f78-09b71b22a0c6"] }, Open ]] }, Open ]] } ] *)