diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index e79bbca..5ac6c97 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -33,6 +33,6 @@ jobs: - run: | julia --project=docs -e ' using Documenter: DocMeta, doctest - using CDGRN - DocMeta.setdocmeta!(CDGRN, :DocTestSetup, :(using CDGRN); recursive=true) - doctest(CDGRN)' \ No newline at end of file + using CDGRNs + DocMeta.setdocmeta!(CDGRNs, :DocTestSetup, :(using CDGRNs); recursive=true) + doctest(CDGRNs)' \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7c6ba8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Yueh-Hua Tu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Project.toml b/Project.toml index a2665dd..1a101d4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "CDGRN" +name = "CDGRNs" uuid = "b97acbd9-7fbb-4cbc-bc29-58677f11bc5c" authors = ["Yueh-Hua Tu "] version = "0.0.1" diff --git a/README.md b/README.md index ce83227..143c050 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# CDGRN.jl +# CDGRNs.jl -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://yuehhua.github.io/CDGRN.jl/stable/) -[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://yuehhua.github.io/CDGRN.jl/dev/) -[![Build Status](https://github.com/yuehhua/CDGRN.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/yuehhua/CDGRN.jl/actions/workflows/CI.yml?query=branch%3Amain) -[![Coverage](https://codecov.io/gh/yuehhua/CDGRN.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/yuehhua/CDGRN.jl) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://yuehhua.github.io/CDGRNs.jl/stable/) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://yuehhua.github.io/CDGRNs.jl/dev/) +[![Build Status](https://github.com/yuehhua/CDGRNs.jl/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/yuehhua/CDGRNs.jl/actions/workflows/test.yml?query=branch%3Amain) +[![Coverage](https://codecov.io/gh/yuehhua/CDGRNs.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/yuehhua/CDGRNs.jl) diff --git a/docs/Project.toml b/docs/Project.toml index 17fd2fc..bf7c85a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,3 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -CDGRN = "b97acbd9-7fbb-4cbc-bc29-58677f11bc5c" +CDGRNs = "b97acbd9-7fbb-4cbc-bc29-58677f11bc5c" diff --git a/docs/make.jl b/docs/make.jl index 3c8da01..7c8d365 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,16 +1,16 @@ -using CDGRN +using CDGRNs using Documenter -DocMeta.setdocmeta!(CDGRN, :DocTestSetup, :(using CDGRN); recursive=true) +DocMeta.setdocmeta!(CDGRNs, :DocTestSetup, :(using CDGRNs); recursive=true) makedocs(; - modules=[CDGRN], + modules=[CDGRNs], authors="Yueh-Hua Tu", - repo="https://github.com/yuehhua/CDGRN.jl/blob/{commit}{path}#{line}", - sitename="CDGRN.jl", + repo="https://github.com/yuehhua/CDGRNs.jl/blob/{commit}{path}#{line}", + sitename="CDGRNs.jl", format=Documenter.HTML(; prettyurls=get(ENV, "CI", "false") == "true", - canonical="https://yuehhua.github.io/CDGRN.jl", + canonical="https://yuehhua.github.io/CDGRNs.jl", edit_link="main", assets=String[], ), @@ -20,6 +20,6 @@ makedocs(; ) deploydocs(; - repo="github.com/yuehhua/CDGRN.jl", + repo="github.com/yuehhua/CDGRNs.jl", devbranch="main", ) diff --git a/docs/src/index.md b/docs/src/index.md index 84f0b14..643aaa5 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,14 +1,14 @@ ```@meta -CurrentModule = CDGRN +CurrentModule = CDGRNs ``` -# CDGRN +# CDGRNs -Documentation for [CDGRN](https://github.com/yuehhua/CDGRN.jl). +Documentation for [CDGRNs](https://github.com/yuehhua/CDGRNs.jl). ```@index ``` ```@autodocs -Modules = [CDGRN] +Modules = [CDGRNs] ``` diff --git a/src/CDGRN.jl b/src/CDGRNs.jl similarity index 99% rename from src/CDGRN.jl rename to src/CDGRNs.jl index 732f931..a02d534 100644 --- a/src/CDGRN.jl +++ b/src/CDGRNs.jl @@ -1,4 +1,4 @@ -module CDGRN +module CDGRNs using GaussianMixtures: GaussianMixture, size using LinearAlgebra diff --git a/src/cdgrn.jl b/src/cdgrn.jl index 12eda94..6e33936 100644 --- a/src/cdgrn.jl +++ b/src/cdgrn.jl @@ -2,7 +2,7 @@ function corr_table(pairs) # unit: component cor_pairs = map(x -> (tf=x[:tf_name], target=x[:gene_name], best_k=x[:best_k], corr=correlation(x[:model])), pairs) df = DataFrames.flatten(DataFrame(cor_pairs), :corr) - df.adjusted_corr = CDGRN.fisher_transform(df.corr) + df.adjusted_corr = CDGRNs.fisher_transform(df.corr) return df end diff --git a/src/interface.jl b/src/interface.jl index 7cfd827..98ae6da 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -99,7 +99,7 @@ function test_cdf(ρ1, ρ2, condition1, condition2; step=0.1, plot_dir=nothing, end function save_cdgrn(filename, cdgrn, tfs, prof, cntx) - context_cor = CDGRN.cor(cdgrn, tfs, prof, cntx) + context_cor = CDGRNs.cor(cdgrn, tfs, prof, cntx) context_cor = context_cor[.!isnan.(context_cor.ρ), :] context_cor.reg_type = context_cor.ρ .> 0 context_cor.reg_stng = abs.(context_cor.ρ) diff --git a/test/mixture.jl b/test/mixture.jl index b3da553..0b72cdb 100644 --- a/test/mixture.jl +++ b/test/mixture.jl @@ -29,7 +29,7 @@ using GLM @test check_confint(model.models[2].β, stderror(model.models[2]), GLM.coef(model1_true)) | check_confint(model.models[2].β, stderror(model.models[2]), GLM.coef(model2_true)) - model = fit(MixtureRegression{2}, data.X, data.Y; max_iter=iter, init=()->CDGRN.random_init(k, 2n)) + model = fit(MixtureRegression{2}, data.X, data.Y; max_iter=iter, init=()->CDGRNs.random_init(k, 2n)) @test check_confint(model.models[1].β, stderror(model.models[1]), GLM.coef(model1_true)) | check_confint(model.models[1].β, stderror(model.models[1]), GLM.coef(model2_true)) @test check_confint(model.models[2].β, stderror(model.models[2]), GLM.coef(model1_true)) | diff --git a/test/runtests.jl b/test/runtests.jl index 5bbf2b1..e930b42 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using CDGRN +using CDGRNs using DataFrames using CSV using SnowyOwl