diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a1b34c3..3ea2751 100755 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,16 +1,13 @@ + + name: CI + on: push: branches: - master - tags: ['*'] + tags: '*' pull_request: - workflow_dispatch: -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -19,19 +16,48 @@ jobs: fail-fast: false matrix: version: - - '1.0' - - '1.7' - - 'nightly' + - '1' # will expand to the latest stable 1.x release of Julia. os: - ubuntu-latest + - macos-latest + - windows-latest arch: - x64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: '1.7' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - uses: julia-actions/julia-runtest@v1 + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token + run: julia --project=docs/ --code-coverage=user docs/make.jl + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 \ No newline at end of file diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100755 index cba9134..0000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: CompatHelper -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - CompatHelper: - runs-on: ubuntu-latest - steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} - run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml deleted file mode 100755 index 2bacdb8..0000000 --- a/.github/workflows/TagBot.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: TagBot -on: - issue_comment: - types: - - created - workflow_dispatch: - inputs: - lookback: - default: 3 -permissions: - actions: read - checks: read - contents: write - deployments: read - issues: read - discussions: read - packages: read - pages: read - pull-requests: read - repository-projects: read - security-events: read - statuses: read -jobs: - TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100755 index 0000000..cb04ffa --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,21 @@ +name: Documentation +on: + push: + branches: + - master + tags: '*' + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: '1.8' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token + run: julia --project=docs/ docs/make.jl diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f72cf84..3802014 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,15 +11,19 @@ For reporting a bug or a failed function or requesting a new feature, you can si To make contributions to `PhyloClustering.jl`, you need to set up your [GitHub](https://github.com) account if you do not have and sign in, and request your change(s) or contribution(s) via a pull request against the ``develop`` -branch of the [PhyloClustering.jl repository](https://github.com/solislemuslab/ml-phylo-trees). +branch of the [PhyloClustering.jl repository](https://github.com/solislemuslab/PhyloClustering.jl +). Please use the following steps: -1. Open a new issue for new feature or failed function in the [issue tracker](https://github.com/solislemuslab/ml-phylo-trees/issues) -2. Fork the [PhyloClustering.jl repository](https://github.com/solislemuslab/ml-phylo-trees) to your GitHub account +1. Open a new issue for new feature or failed function in the [issue tracker](https://github.com/solislemuslab/PhyloClustering.jl +/issues) +2. Fork the [PhyloClustering.jl repository](https://github.com/solislemuslab/PhyloClustering.jl +) to your GitHub account 3. Clone your fork locally: ``` -$ git clone https://github.com/your-username/ml-phylo-trees.git +$ git clone https://github.com/your-username/PhyloClustering.jl +.git ``` 4. Make your change(s) in the `master` (or `development`) branch of your cloned fork 5. Make sure that all tests (`test/runtests.jl`) are passed without any errors @@ -32,7 +36,9 @@ Make sure to include the following information in your pull request: * **Code** which you are contributing to this package -* **Documentation** of this code if it provides new functionality. This should be a description of new functionality added to the [docs](https://solislemuslab.github.io/ml-phylo-trees/dev/). Check out the [docs folder](https://github.com/solislemuslab/ml-phylo-trees.jl/tree/main/docs) for instructions on how to update the documentation. +* **Documentation** of this code if it provides new functionality. This should be a description of new functionality added to the [docs](https://solislemuslab.github.io/PhyloClustering.jl +/dev/). Check out the [docs folder](https://github.com/solislemuslab/PhyloClustering.jl +.jl/tree/main/docs) for instructions on how to update the documentation. - **Tests** of this code to make sure that the previously failed function or the new functionality now works properly diff --git a/Manifest.toml b/Manifest.toml index d1a0cbe..455eead 100755 --- a/Manifest.toml +++ b/Manifest.toml @@ -3,6 +3,11 @@ julia_version = "1.7.3" manifest_format = "2.0" +[[deps.ANSIColoredPrinters]] +git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" +uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" +version = "0.0.1" + [[deps.AbstractFFTs]] deps = ["ChainRulesCore", "LinearAlgebra", "Test"] git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" @@ -335,6 +340,12 @@ git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.9.3" +[[deps.Documenter]] +deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "Dates", "DocStringExtensions", "Downloads", "Git", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "Test", "Unicode"] +git-tree-sha1 = "43aa88b72dffff46b1b19f66483ea3e2f907c4fa" +uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +version = "1.2.0" + [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" @@ -540,6 +551,18 @@ git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046" uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" version = "0.21.0+0" +[[deps.Git]] +deps = ["Git_jll"] +git-tree-sha1 = "51764e6c2e84c37055e846c516e9015b4a291c7d" +uuid = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2" +version = "1.3.0" + +[[deps.Git_jll]] +deps = ["Artifacts", "Expat_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Libiconv_jll", "OpenSSL_jll", "PCRE2_jll", "Zlib_jll"] +git-tree-sha1 = "bb8f7cc77ec1152414b2af6db533d9471cfbb2d1" +uuid = "f8c6e375-362e-5223-8a59-34ff63f689eb" +version = "2.42.0+0" + [[deps.Glib_jll]] deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"] git-tree-sha1 = "e94c92c7bf4819685eb80186d51c43e71d4afa17" @@ -581,6 +604,12 @@ git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" version = "0.3.23" +[[deps.IOCapture]] +deps = ["Logging", "Random"] +git-tree-sha1 = "d75853a0bdbfb1ac815478bacd89cd27b550ace6" +uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" +version = "0.2.3" + [[deps.ImageAxes]] deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"] git-tree-sha1 = "2e4520d67b0cef90865b3ef727594d2a58e0e1f8" @@ -757,6 +786,11 @@ git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" version = "1.3.1" +[[deps.LazilyInitializedFields]] +git-tree-sha1 = "8f7f3cabab0fd1800699663533b6d5cb3fc0e612" +uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf" +version = "1.2.2" + [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" @@ -891,6 +925,12 @@ version = "0.4.2" deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +[[deps.MarkdownAST]] +deps = ["AbstractTrees", "Markdown"] +git-tree-sha1 = "465a70f0fc7d443a00dcdc3267a497397b8a3899" +uuid = "d0879d2d-cac2-40c8-9cee-1863dc0c7391" +version = "0.1.2" + [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] git-tree-sha1 = "70ea2892b8bfffecc0387ba1a6a21192814f120c" @@ -1259,6 +1299,12 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" version = "1.2.2" +[[deps.RegistryInstances]] +deps = ["LazilyInitializedFields", "Pkg", "TOML", "Tar"] +git-tree-sha1 = "ffd19052caf598b8653b99404058fce14828be51" +uuid = "2792f1a3-b283-48e8-9a74-f99dce5104f3" +version = "0.1.0" + [[deps.RelocatableFolders]] deps = ["SHA", "Scratch"] git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864" @@ -1422,12 +1468,6 @@ git-tree-sha1 = "30edbce1c797dc7d4c74bc07b2b6a57b891bead3" uuid = "c5dd0088-6c3f-4803-b00e-f31a60c170fa" version = "1.1.0" -[[deps.StableRNGs]] -deps = ["Random", "Test"] -git-tree-sha1 = "3be7d49667040add7ee151fefaf1f8c04c8c8276" -uuid = "860ef19b-820b-49d6-a774-d7a799459cd3" -version = "1.0.0" - [[deps.StackViews]] deps = ["OffsetArrays"] git-tree-sha1 = "46e589465204cd0c08b4bd97385e4fa79a0c770c" diff --git a/Project.toml b/Project.toml index bee1d87..b94a19e 100755 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0" GaussianMixtures = "cc18c42c-b769-54ff-9e2a-b28141a64aae" MultivariateStats = "6f286f6a-111f-5878-ab1e-185364afe411" diff --git a/README.md b/README.md index 07c2c48..4b18681 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # PhyloClustering.jl -[![Build Status](https://github.com/YiboK/ml-phylo-trees/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/YiboK/ml-phylo-trees/actions/workflows/CI.yml?query=branch%3Amaster) - +[![Build Status](https://github.com/YiboK/PhyloClustering.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/YiboK/PhyloClustering.jl/actions/workflows/CI.yml?query=branch%3Amaster) +[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://solislemuslab.github.io/PhyloClustering.jl/dev) ## License `PhyloClustering.jl` is licensed under a -[MIT License](https://github.com/solislemuslab/ml-phylo-trees/blob/master/LICENSE). +[MIT License](https://github.com/solislemuslab/PhyloClustering.jl/blob/master/LICENSE). diff --git a/docs/Manifest.toml b/docs/Manifest.toml new file mode 100755 index 0000000..d61ad81 --- /dev/null +++ b/docs/Manifest.toml @@ -0,0 +1,232 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.7.3" +manifest_format = "2.0" + +[[deps.ANSIColoredPrinters]] +git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" +uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" +version = "0.0.1" + +[[deps.AbstractTrees]] +git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.4.4" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Documenter]] +deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "Dates", "DocStringExtensions", "Downloads", "Git", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "Test", "Unicode"] +git-tree-sha1 = "43aa88b72dffff46b1b19f66483ea3e2f907c4fa" +uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +version = "1.2.0" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" + +[[deps.Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.5.0+0" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.Git]] +deps = ["Git_jll"] +git-tree-sha1 = "51764e6c2e84c37055e846c516e9015b4a291c7d" +uuid = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2" +version = "1.3.0" + +[[deps.Git_jll]] +deps = ["Artifacts", "Expat_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Libiconv_jll", "OpenSSL_jll", "PCRE2_jll", "Zlib_jll"] +git-tree-sha1 = "bb8f7cc77ec1152414b2af6db533d9471cfbb2d1" +uuid = "f8c6e375-362e-5223-8a59-34ff63f689eb" +version = "2.42.0+0" + +[[deps.IOCapture]] +deps = ["Logging", "Random"] +git-tree-sha1 = "d75853a0bdbfb1ac815478bacd89cd27b550ace6" +uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" +version = "0.2.3" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.LazilyInitializedFields]] +git-tree-sha1 = "8f7f3cabab0fd1800699663533b6d5cb3fc0e612" +uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf" +version = "1.2.2" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.17.0+0" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MarkdownAST]] +deps = ["AbstractTrees", "Markdown"] +git-tree-sha1 = "465a70f0fc7d443a00dcdc3267a497397b8a3899" +uuid = "d0879d2d-cac2-40c8-9cee-1863dc0c7391" +version = "0.1.2" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "cc6e1927ac521b659af340e0ca45828a3ffc748f" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "3.0.12+0" + +[[deps.PCRE2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "a935806434c9d4c506ba941871b327b96d41f2bf" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.0" + +[[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" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.0" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.1" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA", "Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RegistryInstances]] +deps = ["LazilyInitializedFields", "Pkg", "TOML", "Tar"] +git-tree-sha1 = "ffd19052caf598b8653b99404058fce14828be51" +uuid = "2792f1a3-b283-48e8-9a74-f99dce5104f3" +version = "0.1.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100755 index 0000000..81d49e1 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "1.2.0" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index e6beecf..5c27389 100755 --- a/docs/make.jl +++ b/docs/make.jl @@ -5,18 +5,23 @@ makedocs( authors="Yibo Kong, Claudia Solís-Lemus, and contributors", modules=[PhyloClustering], format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"), + checkdocs=:exports, pages = [ "Home" => "index.md", - "Manual" => [ - "Installation" => "man/installation.md", - "Implementation" => "man/implementation.md", + "Installation" => "man/installation.md", + "Models" => [ + "model/basic.md", + "model/kmeans.md", + "model/hclust.md", + "model/dbscan.md", + "model/gmm.md", ], "Library" => [ - "Public Methods" => "lib/public_methods.md", + "Helper Methods" => "lib/helper_methods.md", ] ] ) deploydocs( - # repo = "github.com/solislemuslab/PhyloDiamond.jl.git", + repo = "github.com/solislemuslab/ml-phylo-trees", ) \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index 39f01a1..e830b3a 100755 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,14 +1,8 @@ -```@meta -CurrentModule = {{{PKG}}} -``` -# {{{PKG}}} +# PhyloClustering.jl -Documentation for [{{{PKG}}}](https://{{{REPO}}}). +[PhyloClustering.jl](https://github.com/solislemuslab/ml-phylo-trees) is a [Julia](http://julialang.org/) package for performing unsupervised learning on phylogenetic trees. The algorithms currently included are K-means, Hierarchical Clustering, Gaussian Mixture Model, and DBSCAN. -```@index -``` +## Citation -```@autodocs -Modules = [{{{PKG}}}] -``` +If you use `PhyloClustering.jl` in your work, we kindly ask that you cite the following paper: diff --git a/docs/src/lib/helper_methods.md b/docs/src/lib/helper_methods.md new file mode 100755 index 0000000..5674b99 --- /dev/null +++ b/docs/src/lib/helper_methods.md @@ -0,0 +1,40 @@ +```@meta +CurrentModule = PhyloClustering +``` + +# Convert trees in Newick format to bipartition format +```@docs +num_bipartitions(n::Int64) +``` + +```@docs +show_bipartitions(n::Int64; start::Int64 = 0, stop::Int64=-1) +``` + +```@docs +show_bipartition(n::Int64, idx::Int64) +``` + +```@docs +plot_clusters(tree::AbstractMatrix{<:Real}, label::Vector{Int64}) +``` + +```@docs +get_bipartition(tree::HybridNetwork, n::Int64) +``` + +```@docs +print_bipartition(trees::Vector{HybridNetwork}, n::Int64) +``` + +```@docs +standardize_tree(tree::AbstractMatrix{<:Real}) +``` + +```@docs +num_to_name(tree::Vector{HybridNetwork}) +``` + +```@docs +distance(tree::AbstractMatrix{<:Real}) +``` \ No newline at end of file diff --git a/docs/src/man/installation.md b/docs/src/man/installation.md new file mode 100755 index 0000000..07f40ee --- /dev/null +++ b/docs/src/man/installation.md @@ -0,0 +1,49 @@ +# Installation + +## Installation of Julia + +Julia is a high-level and interactive programming language (like R or Matlab), +but it is also high-performance (like C). +To install Julia, follow instructions [here](http://julialang.org/downloads/). +For a quick & basic tutorial on Julia, see +[learn x in y minutes](http://learnxinyminutes.com/docs/julia/). + +Editors: + +- [Visual Studio Code](https://code.visualstudio.com) provides an editor + and an integrated development environment (IDE) for Julia: highly recommended! +- You can also run Julia within a [Jupyter](http://jupyter.org) notebook + (formerly IPython notebook). + +IMPORTANT: Julia code is just-in-time compiled. This means that the +first time you run a function, it will be compiled at that moment. So, +please be patient! Future calls to the function will be much much +faster. Trying out toy examples for the first calls is a good idea. + +## Installation of the `PhyloClustering.jl` package + +To install the package, type inside Julia: +```julia +] +add PhyloClustering +``` + +The first step can take a few minutes, be patient. + +The `PhyloClustering.jl` package has dependencies like +[Distributions](https://juliastats.org/Distributions.jl/stable/starting/) and +[StatsBase](https://juliastats.org/StatsBase.jl/stable/) +(see the `Project.toml` file for the full list), but everything is installed automatically. + +## Loading the Package + +To check that your installation worked, type this in Julia to load the package. +This is something to type every time you start a Julia session: +```@example install +using PhyloClustering +``` +This step can also take a while, if Julia needs to pre-compile the code (after a package +update for instance). + +Press `?` inside Julia to switch to help mode, +followed by the name of a function (or type) to get more details about it. diff --git a/docs/src/model/basic.md b/docs/src/model/basic.md new file mode 100755 index 0000000..94cfd7d --- /dev/null +++ b/docs/src/model/basic.md @@ -0,0 +1 @@ +# Testing \ No newline at end of file diff --git a/docs/src/model/dbscan.md b/docs/src/model/dbscan.md new file mode 100755 index 0000000..38ca358 --- /dev/null +++ b/docs/src/model/dbscan.md @@ -0,0 +1,19 @@ +# DBSCAN + +[Density-based Spatial Clustering of Applications with Noise +(DBSCAN)](http://en.wikipedia.org/wiki/DBSCAN) is a data clustering +algorithm that finds clusters through density-based expansion of seed +points. The algorithm was proposed in: + +> Martin Ester, Hans-peter Kriegel, Jörg S, and Xiaowei Xu *A +> density-based algorithm for discovering clusters in large spatial +> databases with noise.* 1996. + +## Interface + +The implementation of *DBSCAN* algorithm provided by [Clustering](https://juliastats.org/Clustering.jl/stable/dbscan.html) +supports the two ways of specifying clustering data: + +```@docs +dbscan_label(tree::AbstractMatrix{<:Real}, radius::Real; min_neighbors::Int64 = 1, min_cluster_size::Int64 = 1) +``` diff --git a/docs/src/model/gmm.md b/docs/src/model/gmm.md new file mode 100755 index 0000000..ee4ffd7 --- /dev/null +++ b/docs/src/model/gmm.md @@ -0,0 +1,3 @@ +```@docs +gmm_label(tree::AbstractMatrix{<:Real}, n::Int64; method::Symbol=:kmeans, kind::Symbol=:diag) +``` \ No newline at end of file diff --git a/docs/src/model/hclust.md b/docs/src/model/hclust.md new file mode 100755 index 0000000..80771c5 --- /dev/null +++ b/docs/src/model/hclust.md @@ -0,0 +1,16 @@ +# Hierarchical Clustering + +[Hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) +algorithms build a dendrogram of nested clusters by repeatedly merging +or splitting clusters. + +The `hclust` function implements several classical algorithms for hierarchical +clustering (the algorithm to use is defined by the `linkage` parameter): + +```@docs +hc_label(matrix::AbstractMatrix{<:Real}, n::Int64; linkage::Symbol=:ward) +``` + +Single-linkage clustering using distance matrix: +```@example +``` diff --git a/docs/src/model/kmeans.md b/docs/src/model/kmeans.md new file mode 100755 index 0000000..8e44fa0 --- /dev/null +++ b/docs/src/model/kmeans.md @@ -0,0 +1,23 @@ +# K-means + +[K-means](http://en.wikipedia.org/wiki/K_means) is a classical method for +clustering or vector quantization. It produces a fixed number of clusters, +each associated with a *center* (also known as a *prototype*), and each data +point is assigned to a cluster with the nearest center. + +From a mathematical standpoint, K-means is a coordinate descent +algorithm that solves the following optimization problem: +```math +\text{minimize} \ \sum_{i=1}^n \| \mathbf{x}_i - \boldsymbol{\mu}_{z_i} \|^2 \ \text{w.r.t.} \ (\boldsymbol{\mu}, z) +``` +Here, ``\boldsymbol{\mu}_k`` is the center of the ``k``-th cluster, and +``z_i`` is an index of the cluster for ``i``-th point ``\mathbf{x}_i``. + +```@docs +kmeans_label(tree::AbstractMatrix{<:Real}, n::Int64; init::String="k-means++", rng::AbstractRNG=Random.GLOBAL_RNG) +``` + +## Examples + +```@example +``` \ No newline at end of file diff --git a/manuscript/README.md b/manuscript/README.md index f2e1e54..a6e6f8a 100644 --- a/manuscript/README.md +++ b/manuscript/README.md @@ -1,4 +1,4 @@ -# ml-phylo-trees +# PhyloClustering ## Data diff --git a/src/bipartition.jl b/src/bipartition.jl index 115ab77..b2db23d 100755 --- a/src/bipartition.jl +++ b/src/bipartition.jl @@ -222,7 +222,7 @@ end 3 => "P1" 1 => "HYB" """ -function num_to_name(tree) +function num_to_name(tree::Vector{HybridNetwork}) taxa = sort(tipLabels(tree)) dict = Dict{Int64, Any}() for i in 1:length(taxa) diff --git a/src/models.jl b/src/models.jl index 1e43a44..208d3e4 100755 --- a/src/models.jl +++ b/src/models.jl @@ -26,7 +26,7 @@ end a vector tuple where the first vector contains predicted labels for each tree based on the posterior probability and the second vector contain predicted labels for each tree based on the Log Likelihood """ -function gmm_label(tree::AbstractMatrix{<:Real}, n::Int64; method::Symbol=:kmeans, kind::Symbol=:diag) +function gmm_label(tree::AbstractMatrix{<:Real}, n::Int64; method::Symbol=:kmeans, kind::Symbol=:diag) data= Matrix(tree'); gmm= GMM(n,data,method=method, kind=kind); prob_pos=gmmposterior(gmm,data)[1]