diff --git a/Manifest.toml b/Manifest.toml index 0e660a83..0d45951c 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,366 +1,485 @@ # This file is machine-generated - editing it directly is not advised -[[ArgTools]] +julia_version = "1.8.5" +manifest_format = "2.0" +project_hash = "ac6ebba018b65f82c647ad70ed4a9574f1c15734" + +[[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" -[[Artifacts]] +[[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -[[Automa]] -deps = ["DataStructures", "Printf", "Random", "Test", "TranscodingStreams"] -git-tree-sha1 = "c81526bf5f6fb4616b4e22a3cd62ac20e255fd3c" +[[deps.Automa]] +deps = ["TranscodingStreams"] +git-tree-sha1 = "ef9997b3d5547c48b41c7bd8899e812a917b409d" uuid = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b" -version = "0.8.0" +version = "0.8.4" -[[BGZFStreams]] -deps = ["CodecZlib", "Test"] -git-tree-sha1 = "b0e322aef9f1895a09a0c48a118111fd509f666a" +[[deps.BGZFStreams]] +deps = ["CodecZlib"] +git-tree-sha1 = "3aca54d25f8c30056577aa37ea68184da68df685" uuid = "28d598bf-9b8f-59f1-b38c-5a06b4a0f5e6" -version = "0.3.0" +version = "0.3.2" -[[Base64]] +[[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[BioCore]] +[[deps.BioCore]] deps = ["Automa", "BufferedStreams", "YAML"] git-tree-sha1 = "476edbf4ef94594fff430a84ca96f86cb2327a71" uuid = "37cfa864-2cd6-5c12-ad9e-b6597d696c81" version = "2.0.5" -[[BufferedStreams]] -deps = ["Compat", "Test"] -git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f" +[[deps.BufferedStreams]] +git-tree-sha1 = "4ae47f9a4b1dc19897d3743ff13685925c5202ec" uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" -version = "1.0.0" +version = "1.2.1" + +[[deps.Calculus]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" +uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" +version = "0.5.1" -[[ChainRulesCore]] +[[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "ad613c934ec3a3aa0ff19b91f15a16d56ed404b5" +git-tree-sha1 = "e0af648f0692ec1691b5d094b8724ba1346281cf" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.0.2" +version = "1.18.0" + +[[deps.ChangesOfVariables]] +deps = ["InverseFunctions", "LinearAlgebra", "Test"] +git-tree-sha1 = "2fba81a302a7be671aefe194f0525ef231104e7f" +uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" +version = "0.1.8" -[[CodecZlib]] +[[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" +git-tree-sha1 = "cd67fc487743b2f0fd4380d4cbd3a24660d0eec8" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.0" +version = "0.7.3" -[[Combinatorics]] +[[deps.Combinatorics]] git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" version = "1.0.2" -[[CommonSolve]] -git-tree-sha1 = "68a0743f578349ada8bc911a5cbd5a2ef6ed6d1f" +[[deps.CommonSolve]] +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.0" +version = "0.2.4" -[[Compat]] -deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "dc7dedc2c2aa9faf59a55c622760a25cbefbe941" +[[deps.Compat]] +deps = ["Dates", "LinearAlgebra", "UUIDs"] +git-tree-sha1 = "8a62af3e248a8c4bad6b32cbbe663ae02275e32c" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.31.0" +version = "4.10.0" -[[CompilerSupportLibraries_jll]] +[[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.1+0" + +[[deps.ConstructionBase]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "c53fc348ca4d40d7b371e71fd52251839080cbc9" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.5.4" -[[DataAPI]] -git-tree-sha1 = "ee400abb2298bd13bfc3df1c412ed228061a2385" +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.7.0" +version = "1.15.0" -[[DataStructures]] +[[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" +version = "0.18.15" -[[Dates]] +[[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" -[[DelimitedFiles]] +[[deps.DelimitedFiles]] deps = ["Mmap"] uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" -[[Distributed]] +[[deps.DensityInterface]] +deps = ["InverseFunctions", "Test"] +git-tree-sha1 = "80c3e8639e3353e5d2912fb3a1916b8455e2494b" +uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d" +version = "0.4.0" + +[[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" -[[Distributions]] -deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"] -git-tree-sha1 = "3889f646423ce91dd1055a76317e9a1d3a23fff1" +[[deps.Distributions]] +deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns", "Test"] +git-tree-sha1 = "3d5873f811f582873bb9871fc9c451784d5dc8c7" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.25.11" +version = "0.25.102" -[[DocStringExtensions]] +[[deps.DocStringExtensions]] deps = ["LibGit2"] -git-tree-sha1 = "a32185f5428d3986f47c2ab78b1f216d5e6cc96f" +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.5" +version = "0.9.3" -[[Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" -[[FillArrays]] +[[deps.DualNumbers]] +deps = ["Calculus", "NaNMath", "SpecialFunctions"] +git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" +uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" +version = "0.6.8" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.FillArrays]] deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"] -git-tree-sha1 = "8c8eac2af06ce35973c3eadb4ab3243076a408e7" +git-tree-sha1 = "35f0c0f345bff2c6d636f95fdb136323b5a796ef" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "0.12.1" +version = "1.7.0" -[[HypothesisTests]] -deps = ["Combinatorics", "Distributions", "LinearAlgebra", "Random", "Rmath", "Roots", "Statistics", "StatsBase"] -git-tree-sha1 = "a82a0c7e790fc16be185ce8d6d9edc7e62d5685a" +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.GeneticVariantBase]] +deps = ["StatsBase"] +path = "/Users/kaitlyn/.julia/dev/GeneticVariantBase" +uuid = "2447270c-d849-4bf9-ac0d-b5c0b265991c" +version = "0.1.2" + +[[deps.HypergeometricFunctions]] +deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] +git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" +uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" +version = "0.3.23" + +[[deps.HypothesisTests]] +deps = ["Combinatorics", "Distributions", "LinearAlgebra", "Printf", "Random", "Rmath", "Roots", "Statistics", "StatsAPI", "StatsBase"] +git-tree-sha1 = "4b5d5ba51f5f473737ed9de6d8a7aa190ad8c72f" uuid = "09f84164-cd44-5f33-b23f-e6b0d136a0d5" -version = "0.10.4" +version = "0.11.0" -[[InteractiveUtils]] +[[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -[[JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "68772f49f54b479fa88ace904f6127f0a3bb2e46" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.12" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.3.0" +version = "1.5.0" -[[LibCURL]] +[[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" -[[LibCURL_jll]] +[[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" -[[LibGit2]] +[[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" -[[LibSSH2_jll]] +[[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" -[[Libdl]] +[[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -[[Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "42b62845d70a619f063a7da093d995ec8e15e778" +[[deps.Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.1+1" +version = "1.17.0+0" -[[LinearAlgebra]] -deps = ["Libdl"] +[[deps.LinearAlgebra]] +deps = ["Libdl", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -[[LogExpFunctions]] -deps = ["DocStringExtensions", "LinearAlgebra"] -git-tree-sha1 = "7bd5f6565d80b6bf753738d2bc40a5dfea072070" +[[deps.LogExpFunctions]] +deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.2.5" +version = "0.3.26" -[[Logging]] +[[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" -[[Markdown]] +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.11" + +[[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" -[[MbedTLS_jll]] +[[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.0+0" -[[Missings]] +[[deps.Missings]] deps = ["DataAPI"] -git-tree-sha1 = "4ea90bd5d3985ae1f9a908bd4500ae88921c5ce7" +git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "1.0.0" +version = "1.1.0" -[[Mmap]] +[[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" -[[MozillaCACerts_jll]] +[[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.2.1" -[[NetworkOptions]] +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + +[[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.20+0" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+0" -[[OpenSpecFun_jll]] +[[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" -[[OrderedCollections]] -git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c" +[[deps.OrderedCollections]] +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.4.1" +version = "1.6.2" -[[PDMats]] +[[deps.PDMats]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "4dd403333bcf0909341cfe57ec115152f937d7d8" +git-tree-sha1 = "66b2fcd977db5329aa35cac121e5b94dd6472198" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" -version = "0.11.1" +version = "0.11.28" -[[Pkg]] +[[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.8.0" -[[Preferences]] +[[deps.Preferences]] deps = ["TOML"] -git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a" +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.2.2" +version = "1.4.1" -[[Printf]] +[[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -[[ProgressMeter]] +[[deps.ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "afadeba63d90ff223a6a48d2009434ecee2ec9e8" +git-tree-sha1 = "00099623ffee15972c16111bcf84c58a0051257c" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.7.1" +version = "1.9.0" -[[QuadGK]] +[[deps.QuadGK]] deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b" +git-tree-sha1 = "9ebcd48c498668c7fa0e97a9cae873fbee7bfee1" uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.4.1" +version = "2.9.1" -[[REPL]] +[[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" -[[Random]] -deps = ["Serialization"] +[[deps.Random]] +deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -[[Rmath]] +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.Rmath]] deps = ["Random", "Rmath_jll"] -git-tree-sha1 = "bf3188feca147ce108c76ad82c2792c57abe7b1f" +git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.7.0" +version = "0.7.1" -[[Rmath_jll]] +[[deps.Rmath_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "68db32dff12bb6127bac73c209881191bf0efbb7" +git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.3.0+0" +version = "0.4.0+0" -[[Roots]] -deps = ["CommonSolve", "Printf"] -git-tree-sha1 = "32c9115a425ca807215c04a0baedb36d47379643" +[[deps.Roots]] +deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] +git-tree-sha1 = "06b5ac80ff1b88bd82df92c1c1875eea3954cd6e" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "1.0.11" +version = "2.0.20" -[[SHA]] +[[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" -[[Serialization]] +[[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -[[SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" -[[Sockets]] +[[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" -[[SortingAlgorithms]] +[[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508" +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.0.1" +version = "1.2.0" -[[SparseArrays]] +[[deps.SparseArrays]] deps = ["LinearAlgebra", "Random"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -[[SpecialFunctions]] -deps = ["ChainRulesCore", "LogExpFunctions", "OpenSpecFun_jll"] -git-tree-sha1 = "508822dca004bf62e210609148511ad03ce8f1d8" +[[deps.SpecialFunctions]] +deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "1.6.0" +version = "2.3.1" -[[Statistics]] +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -[[StatsAPI]] -git-tree-sha1 = "1958272568dc176a1d881acb797beb909c785510" +[[deps.StatsAPI]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" -version = "1.0.0" +version = "1.7.0" -[[StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] -git-tree-sha1 = "2f6792d523d7448bbe2fec99eca9218f06cc746d" +[[deps.StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "1d77abd07f617c4868c33d4f5b9e1dbb2643c9cf" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.33.8" +version = "0.34.2" -[[StatsFuns]] -deps = ["LogExpFunctions", "Rmath", "SpecialFunctions"] -git-tree-sha1 = "30cd8c360c54081f806b1ee14d2eecbef3c04c49" +[[deps.StatsFuns]] +deps = ["ChainRulesCore", "HypergeometricFunctions", "InverseFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] +git-tree-sha1 = "f625d686d5a88bcd2b15cd81f18f98186fdc0c9a" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "0.9.8" +version = "1.3.0" -[[StringEncodings]] +[[deps.StringEncodings]] deps = ["Libiconv_jll"] -git-tree-sha1 = "50ccd5ddb00d19392577902f0079267a72c5ab04" +git-tree-sha1 = "b765e46ba27ecf6b44faf70df40c57aa3a547dcb" uuid = "69024149-9ee7-55f6-a4c4-859efe599b68" -version = "0.3.5" +version = "0.3.7" -[[SuiteSparse]] +[[deps.SuiteSparse]] deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" -[[TOML]] +[[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.0" -[[Tar]] +[[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.1" -[[Test]] +[[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -[[TranscodingStreams]] +[[deps.TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.5" +version = "0.9.13" -[[UUIDs]] +[[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" -[[Unicode]] +[[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" -[[VariantCallFormat]] +[[deps.VariantCallFormat]] deps = ["Automa", "BGZFStreams", "BioCore", "BufferedStreams"] -git-tree-sha1 = "eb060e20d9d8594112396334eb1e9561a34c964b" +git-tree-sha1 = "f73ea34d3085cdbf6a18fa4c4b690e0f4a147730" uuid = "28eba6e3-a997-4ad9-87c6-d933b8bca6c1" -version = "0.5.1" +version = "0.5.5" -[[YAML]] +[[deps.YAML]] deps = ["Base64", "Dates", "Printf", "StringEncodings"] -git-tree-sha1 = "3c6e8b9f5cdaaa21340f841653942e1a6b6561e5" +git-tree-sha1 = "e6330e4b731a6af7959673621e91645eb1356884" uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" -version = "0.4.7" +version = "0.4.9" -[[Zlib_jll]] +[[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.12+3" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.1.1+0" -[[nghttp2_jll]] +[[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" -[[p7zip_jll]] +[[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" diff --git a/Project.toml b/Project.toml index 48208dec..36d5c222 100644 --- a/Project.toml +++ b/Project.toml @@ -9,9 +9,11 @@ CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +GeneticVariantBase = "2447270c-d849-4bf9-ac0d-b5c0b265991c" HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5" ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" +TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" VariantCallFormat = "28eba6e3-a997-4ad9-87c6-d933b8bca6c1" [compat] diff --git a/src/VCFTools.jl b/src/VCFTools.jl index 3e2f9600..d538f925 100644 --- a/src/VCFTools.jl +++ b/src/VCFTools.jl @@ -8,11 +8,13 @@ using DelimitedFiles using Dates using SpecialFunctions using VariantCallFormat +using GeneticVariantBase +using GeneticVariantBase: n_samples, n_variants import VariantCallFormat.findgenokey export conformgt_by_id, conformgt_by_pos, gtstats, geno_ismissing, - nrecords, nsamples, openvcf, + nrecords, nsamples, openvcf, VCFData, sampleID, grm, # convert functions @@ -32,6 +34,7 @@ export conformgt_by_id, conformgt_by_pos, write_vcf # package code goes here + include("gtstats.jl") include("conformgt.jl") include("convert.jl") @@ -39,6 +42,7 @@ include("filter.jl") include("aim_select.jl") include("grm.jl") include("write.jl") +include("iterator.jl") # test data directory datadir(parts...) = joinpath(@__DIR__, "..", "test", parts...) diff --git a/src/VCFTools.jl.31574.mem b/src/VCFTools.jl.31574.mem new file mode 100644 index 00000000..f0cb2f79 --- /dev/null +++ b/src/VCFTools.jl.31574.mem @@ -0,0 +1,50 @@ + 3534212 module VCFTools + - + - using CodecZlib + - using Distributions + - using HypothesisTests + - using ProgressMeter + - using DelimitedFiles + - using Dates + - using SpecialFunctions + - using VariantCallFormat + - using GeneticVariantBase + - import VariantCallFormat.findgenokey + - + - export conformgt_by_id, conformgt_by_pos, + - gtstats, geno_ismissing, + - nrecords, nsamples, openvcf, + - n_samples, n_variants, + - sampleID, + - grm, + - # convert functions + - save_snpinfo, + - convert_gt, copy_gt!, + - convert_ht, copy_ht!, + - convert_ds, copy_ds!, + - copy_gt_trans!, copy_ht_trans!, copy_ds_trans!, + - # filter functions + - filter_genotype, + - filter, filter_header, + - filter_chr, filter_range, + - mask_gt, find_duplicate_marker, + - # aim selection + - aim_select, + - # write routines + - write_vcf + - + - # package code goes here + - + - include("gtstats.jl") + - include("conformgt.jl") + - include("convert.jl") + - include("filter.jl") + - include("aim_select.jl") + - include("grm.jl") + - include("write.jl") + - include("iterator.jl") + - + - # test data directory + - datadir(parts...) = joinpath(@__DIR__, "..", "test", parts...) + - + - end # module diff --git a/src/VCFTools.jl.31602.mem b/src/VCFTools.jl.31602.mem new file mode 100644 index 00000000..cad1a6a7 --- /dev/null +++ b/src/VCFTools.jl.31602.mem @@ -0,0 +1,50 @@ + 3238747 module VCFTools + - + - using CodecZlib + - using Distributions + - using HypothesisTests + - using ProgressMeter + - using DelimitedFiles + - using Dates + - using SpecialFunctions + - using VariantCallFormat + - using GeneticVariantBase + - import VariantCallFormat.findgenokey + - + - export conformgt_by_id, conformgt_by_pos, + - gtstats, geno_ismissing, + - nrecords, nsamples, openvcf, + - n_samples, n_variants, + - sampleID, + - grm, + - # convert functions + - save_snpinfo, + - convert_gt, copy_gt!, + - convert_ht, copy_ht!, + - convert_ds, copy_ds!, + - copy_gt_trans!, copy_ht_trans!, copy_ds_trans!, + - # filter functions + - filter_genotype, + - filter, filter_header, + - filter_chr, filter_range, + - mask_gt, find_duplicate_marker, + - # aim selection + - aim_select, + - # write routines + - write_vcf + - + - # package code goes here + - + - include("gtstats.jl") + - include("conformgt.jl") + - include("convert.jl") + - include("filter.jl") + - include("aim_select.jl") + - include("grm.jl") + - include("write.jl") + - include("iterator.jl") + - + - # test data directory + - datadir(parts...) = joinpath(@__DIR__, "..", "test", parts...) + - + - end # module diff --git a/src/VCFTools.jl.31604.mem b/src/VCFTools.jl.31604.mem new file mode 100644 index 00000000..f0cb2f79 --- /dev/null +++ b/src/VCFTools.jl.31604.mem @@ -0,0 +1,50 @@ + 3534212 module VCFTools + - + - using CodecZlib + - using Distributions + - using HypothesisTests + - using ProgressMeter + - using DelimitedFiles + - using Dates + - using SpecialFunctions + - using VariantCallFormat + - using GeneticVariantBase + - import VariantCallFormat.findgenokey + - + - export conformgt_by_id, conformgt_by_pos, + - gtstats, geno_ismissing, + - nrecords, nsamples, openvcf, + - n_samples, n_variants, + - sampleID, + - grm, + - # convert functions + - save_snpinfo, + - convert_gt, copy_gt!, + - convert_ht, copy_ht!, + - convert_ds, copy_ds!, + - copy_gt_trans!, copy_ht_trans!, copy_ds_trans!, + - # filter functions + - filter_genotype, + - filter, filter_header, + - filter_chr, filter_range, + - mask_gt, find_duplicate_marker, + - # aim selection + - aim_select, + - # write routines + - write_vcf + - + - # package code goes here + - + - include("gtstats.jl") + - include("conformgt.jl") + - include("convert.jl") + - include("filter.jl") + - include("aim_select.jl") + - include("grm.jl") + - include("write.jl") + - include("iterator.jl") + - + - # test data directory + - datadir(parts...) = joinpath(@__DIR__, "..", "test", parts...) + - + - end # module diff --git a/src/iterator.jl b/src/iterator.jl new file mode 100644 index 00000000..bf323ed0 --- /dev/null +++ b/src/iterator.jl @@ -0,0 +1,276 @@ +abstract type VariantIterator end +abstract type GeneticData end + +mutable struct VCFIterator <: VariantIterator + vcffile::AbstractString + vcf::VCF.Reader + sample_num::Int +end + +function VCFIterator(vcffile::AbstractString; sample_num::Int=VCFTools.nsamples(VCF.Reader(openvcf(vcffile, "r")))) + vcf = VCF.Reader(openvcf(vcffile, "r")) + return VCFIterator(vcffile, vcf, sample_num) #then returns an iostream +end + +mutable struct VCFData <: GeneticData # feed VCFData VCFIterator function output output of openvcf function + file_name::AbstractString +end +# placeholder because other genotype files need that + +mutable struct VCFRow <: GeneticVariantBase.Variant + CHROM::String + POS::Int64 + ID::Vector{String} + REF::String + ALT::Vector{String} + QUAL::Float64 + GENOTYPE::Vector{Union{Float64, Missing}} + DOSAGES::Union{Nothing, Vector{Union{Missing, Float64}}} +end + +# for dosages there is a key DS +# copy_gt! and copy_ds! +# for genotypes taking values from GT + +# return VCFRow item from the iterate function + +@inline function Base.eltype(::Type{<:VariantIterator}) # vector of string + VCFRow +end + +function Base.iterate(itr::VCFIterator, state=nothing) + result = isnothing(state) ? iterate(itr.vcf) : iterate(itr.vcf, state) + + if result === nothing + return nothing + end + + rec, next_state = result + + chr = VCF.chrom(rec) + pos = VCF.pos(rec) + ref = VCF.ref(rec) + alt = VCF.alt(rec) + geno = gt_key(rec, impute=true) + ds = ds_key(rec, impute=true) + ids = nothing + qual = nothing + + try + ids = VCF.id(rec) + catch e + println("Missing ID at record") + ids = Vector{String}() + end + + try + qual = VCF.qual(rec) + catch e + println("Missing QUAL at record") + qual = 0.0 + end + + vcf_row = VCFRow(chr, pos, ids, ref, alt, qual, geno, ds) + + return(vcf_row, next_state) + +end + + # out = zeros(Union{Missing, Float64}, nsamples(itr.vcffile)) + # geno = copy_gt!(out, reader) + # return a tuple not an array + + +@inline function Base.length(itr::VCFIterator) + return nrecords(itr.vcffile) +end + +@inline function vcfiterator(vcffile::AbstractString) + VCFIterator(vcffile) +end + +function ds_key(record::VCF.Record; key::String = "DS", impute::Bool = false, center::Bool = false, scale::Bool = false) + A = Vector{Union{Missing, Float64}}(undef, length(record.genotype)) + dskey = VariantCallFormat.findgenokey(record, key) + + for i in 1:length(record.genotype) + if dskey === nothing + break + end + geno = record.genotype[i] + # Missing genotype: dropped field or "." => 0x2e + if dskey > lastindex(geno) || record.data[geno[dskey]] == [0x2e] + A[i] = missing # (impute ? ct : missing) + else # not missing + A[i] = parse(Float64, String(record.data[geno[dskey]])) + end + + end + + if center || scale || impute + total_ds = zero(Float64) + cnt = 0 + + for i in eachindex(A) + if A[i] !== missing + total_ds += A[i] + cnt += 1 + end + ct = total_ds / cnt + wt = ct == 0 ? 1.0 : 1.0 / √(ct * (1 - ct/2)) + # center and scale if asked + center && !ismissing(A[i]) && (A[i] -= ct) + scale && !ismissing(A[i]) && (A[i] *= wt) + end + + if impute + for i in eachindex(A) + if A[i] === missing + A[i] = ct + end + end + end + end + + return A +end + +function gt_key(record::VCF.Record; model::Symbol = :additive, impute::Bool = false, center::Bool = false, scale::Bool = false) + A = Vector{Union{Missing, Float64}}(undef, length(record.genotype)) + gtkey = VariantCallFormat.findgenokey(record, "GT") + + _, _, _, _, _, alt_freq, _, _, _, _, _ = gtstats(record, nothing) + ct = 2alt_freq + wt = alt_freq == 0 ? 1.0 : 1.0 / √(2alt_freq * (1 - alt_freq)) + + for i in eachindex(record.genotype) + geno = record.genotype[i] + # Missing genotype: dropped field or when either haplotype contains "." + if gtkey > lastindex(geno) || geno_ismissing(record, geno[gtkey]) + if impute + a1, a2 = rand() ≤ alt_freq, rand() ≤ alt_freq + A[i] = convert_gt(T, (a1, a2), model) + else + A[i] = missing + end + else # not missing + # "0" (REF) => 0x30, "1" (ALT) => 0x31 + a1 = record.data[geno[gtkey][1]] == 0x31 + a2 = record.data[geno[gtkey][3]] == 0x31 + A[i] = convert_gt(Float64, (a1, a2), model) + end + # center and scale if asked + center && !ismissing(A[i]) && (A[i] -= ct) + scale && !ismissing(A[i]) && (A[i] *= wt) + end + + return A +end + +function GeneticVariantBase.chrom(data::VCFData, row::VCFRow)::String + return row.CHROM +end + +function GeneticVariantBase.pos(data::VCFData, row::VCFRow)::Int + return row.POS +end + +function GeneticVariantBase.rsid(data::VCFData, row::VCFRow)::Vector{String} + return row.ID +end + +function GeneticVariantBase.alleles(data::VCFData, row::VCFRow)::Tuple{String, Vector{String}} + return (row.REF, row.ALT) +end + +function GeneticVariantBase.alt_allele(data::VCFData, row::VCFRow)::Vector{String} + return row.ALT +end + +function GeneticVariantBase.ref_allele(data::VCFData, row::VCFRow)::String + return row.REF +end + +# use GeneticData as argument for genetic variant base functions +# GeneticData, VCFRow + +function GeneticVariantBase.maf(data::VCFData, row::VCFRow) + + records, samples, lines, missing_by_sample, missings_by_record, maf_by_record, minor_allele_by_record, hwe_by_record = gtstats(data.file_name) + maf = maf_by_record[row.INDEX] + return maf + +end + +#copyto! function +#copygt! copydt +#reads in genotypes 0 1 2 average divided by two allele frequency of alternate allele +#dosages for each snp 0-2 + +function GeneticVariantBase.hwepval(data::VCFData, row::VCFRow) + + records, samples, lines, missing_by_sample, missings_by_record, maf_by_record, minor_allele_by_record, hwe_by_record = gtstats(data.file_name) + p_value = hwe_by_record[row.INDEX] + return p_value + +end + +function GeneticVariantBase.n_samples(data::VCFData) + return nsamples(data.file_name) +end + +function GeneticVariantBase.n_variants(data::VCFData) + return nrecords(data.file_name) +end + + +#copy_gt has keyword argument impute in VCFTools.jl +# we need to run it with that option +# impute, scale, center keyword arguments for this function +# impute will impute the missing values +# scale will divide by standard dev +# center will subtract mean +# can do similar thing for other file formats + +function GeneticVariantBase.alt_dosages!(arr::AbstractArray{T}, row::VCFRow; use_genotype::Bool = false, mean_impute=nothing) where T <: Real + + + if use_genotype + genotypes = row.GENOTYPE + @assert length(arr) == length(genotypes) "Array size does not match genotype size" + for i in 1:length(genotypes) + if genotypes[i] === missing + arr[i] = convert_gt(T, (a1, a2), model) + else + arr[i] = genotypes[i] + end + end + return arr + else + dosages = row.DOSAGES + @assert length(arr) == length(dosages) "Array size does not match dosages size" + for i in 1:length(dosages) + if dosages[i] === missing + arr[i] = convert_gt(T, (a1, a2), model) + else + arr[i] = dosages[i] + end + end + return arr + end +end + + + +function GeneticVariantBase.alt_genotypes!(arr::AbstractArray{T}, row::VCFRow; mean_impute=nothing) where T <: Real + genotypes = row.GENOTYPE + @assert length(arr) == length(genotypes) "Array size does not match genotype size" + for i in 1:length(genotypes) + if genotypes[i] === missing + arr[i] = convert_gt(T, (a1, a2), model) + else + arr[i] = genotypes[i] + end + end + return arr +end \ No newline at end of file diff --git a/test/iterator_test.jl b/test/iterator_test.jl new file mode 100644 index 00000000..7a9d17dc --- /dev/null +++ b/test/iterator_test.jl @@ -0,0 +1,176 @@ +# Test the iteration behavior of the VCFIterator + +# vcf file +# read the data and print +# create the VCFIterator +# expected rows vs rows + +""" +function test_iteration() + + # Create a temporary VCF file for testing + isfile("test.08Jun17.d8b.vcf.gz") || Downloads.download("http://faculty.washington.edu/browning/beagle/test.08Jun17.d8b.vcf.gz", + joinpath(dirname(pathof(VCFTools)), "..", "test/test.08Jun17.d8b.vcf.gz")) + + vcf_file = joinpath(dirname(pathof(VCFTools)), "..", "test/test.08Jun17.d8b.vcf.gz") + + # Create the VCFIterator + iterator = vcfiterator(vcf_file) + + # Iterate over the variants and collect the rows + next_state = 1 + final_state = 2 + row = VCFRow("", 0, [""], "", [""], 0) + while next_state !== final_state + row, next_state = iterate(iterator, next_state) + end + + #@test row == VCFRow("22", 20000086, ["rs138720731"], "T", ["C"], 100.0) + @test string(row.CHROM) == string("22") + @test Int(row.POS) == Int(20000086) + @test string(row.ID) == string(["rs138720731"]) + @test string(row.REF) == string("T") + @test string(row.ALT) == string(["C"]) + @test float(row.QUAL) == float(100.0) + @test next_state == 2 + + next_state = 1 + final_state = 3 + row = VCFRow("", 0, [""], "", [""], 0) + while next_state !== final_state + if next_state == 2 + row = VCFRow("", 0, [""], "", [""], 0) + end + row, next_state = iterate(iterator, next_state) + end + + # return a tuple not an array + + #@test row == VCFRow("22", 20000146, ["rs73387790"], "G", ["A"], 100.0) + @test string(row.CHROM) == string("22") + @test Int(row.POS) == Int(20000146) + @test string(row.ID) == string(["rs73387790"]) + @test string(row.REF) == string("G") + @test string(row.ALT) == string(["A"]) + @test float(row.QUAL) == float(100.0) + @test next_state == 3 + + # Clean up the temporary VCF file + rm(vcf_file) +end + +@testset "iterator(vcf)" begin + test_iteration() +end + +# put genetic variant base tests here +""" + + # Create a temporary VCF file for testing + isfile("test.08Jun17.d8b.vcf.gz") || Downloads.download("http://faculty.washington.edu/browning/beagle/test.08Jun17.d8b.vcf.gz", + joinpath(dirname(pathof(VCFTools)), "..", "test/test.08Jun17.d8b.vcf.gz")) + + vcf_file = joinpath(dirname(pathof(VCFTools)), "..", "test/test.08Jun17.d8b.vcf.gz") + +# @testset "nrecords and nsamples" begin +# vcf_data = VCFData(vcf_file) +# println(GeneticVariantBase.n_samples(vcf_data)) +# println(GeneticVariantBase.n_variants(vcf_data)) +# end + +# vcf_iter = VCFIterator(vcf_file) +# vcf, state = iterate(vcf_iter,1299) +# print(vcf) + + # at record 292 id is missing + # at record 429 qual is missing + # at record 1299 id is missing + + @testset "VCF file tests" begin + vcf_iter = VCFIterator(vcf_file) + + state = nothing + + while true + result = iterate(vcf_iter, state) + if result === nothing + break + end + + vcf_row, state = result + + # Test chrom function + @test chrom(VCFData(vcf_file), vcf_row) == vcf_row.CHROM + @test pos(VCFData(vcf_file), vcf_row) == vcf_row.POS + @test rsid(VCFData(vcf_file), vcf_row) == vcf_row.ID + @test alleles(VCFData(vcf_file), vcf_row) == (vcf_row.REF, vcf_row.ALT) + @test alt_allele(VCFData(vcf_file), vcf_row) == vcf_row.ALT + @test ref_allele(VCFData(vcf_file), vcf_row) == vcf_row.REF + end +end + + +# @testset "MAF Tests" begin +# vcf_iter = VCFIterator(vcf_file) +# num = nrecords(vcf_file) +# vcf_data = VCFData(vcf_file) +# records, samples, lines, missing_by_sample, missings_by_record, maf_by_record, minor_allele_by_record, hwe_by_record = gtstats(vcf_file) + +# for i in 1:nrecords(vcf_file) +# # Obtain the VCFRow object at the current iteration +# vcf_row, _ = iterate(vcf_iter, i) +# @test maf(vcf_data,vcf_row) == maf_by_record[i] +# end +# end + +# @testset "HWE Tests" begin +# vcf_iter = VCFIterator(vcf_file) +# num = nrecords(vcf_file) +# vcf_data = VCFData(vcf_file) +# records, samples, lines, missing_by_sample, missings_by_record, maf_by_record, minor_allele_by_record, hwe_by_record = gtstats(vcf_file) + +# for i in 1:nrecords(vcf_file) +# # Obtain the VCFRow object at the current iteration +# vcf_row, _ = iterate(vcf_iter, i) +# @test hwepval(vcf_data,vcf_row) == hwe_by_record[i] +# end +# end + +# vcf_iter = VCFIterator(vcf_file) +# vcf, state = iterate(vcf_iter,1355) +# print(vcf) + +# @testset "Alternate Dosages" begin +# vcf_iter = VCFIterator(vcf_file) +# vcf_data = VCFData(vcf_file) + +# reader = VCF.Reader(openvcf(vcf_file, "r")) +# nrecords, nsamples, _, _, _, _, _, _ = gtstats(vcf_file) +# gholder = Matrix{Union{Missing, Float64}}(missing, nsamples, nrecords) +# copy_gt!(gholder, reader, impute=true) + +# i=1 +# reader = VCF.Reader(openvcf(vcf_file, "r")) +# for record in reader +# if i > nsamples +# break +# end +# gt = gt_key(record) +# cp = gholder[:, i] +# @test gt == cp +# # println("GT KEY $gt") +# # println("COPY_GT $cp") +# i=i+1 + +# end + +# for i in 1:nrecords +# vcf_row, _ = iterate(vcf_iter, i) +# ds = vcf_row.DOSAGES +# gt = vcf_row.GENOTYPE +# A = fill(0.0, length(gt)) +# alt_dosages!(A, vcf_row) +# println("alt_dosages array $A") +# end +# end + diff --git a/test/runtests.jl b/test/runtests.jl index 3d605baa..81c3f517 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,8 +1,11 @@ using VCFTools +using TranscodingStreams using Test using VariantCallFormat +import VariantCallFormat.findgenokey using CodecZlib using DelimitedFiles +using GeneticVariantBase # packages needed only for testing using Random @@ -12,9 +15,12 @@ using StatsBase using LinearAlgebra using Downloads -include("gtstats_test.jl") -include("conformgt_test.jl") -include("convert_test.jl") -include("filter_test.jl") -include("aim_test.jl") -include("grm_test.jl") + +include(joinpath(@__DIR__, "..", "src", "iterator.jl")) +# include("gtstats_test.jl") +# include("conformgt_test.jl") +# include("convert_test.jl") +# include("filter_test.jl") +# include("aim_test.jl") +# include("grm_test.jl") +include("iterator_test.jl")