From 5f19505534067d0674679a834792db93ecad8d28 Mon Sep 17 00:00:00 2001 From: hkim89 Date: Sat, 9 Dec 2023 19:26:00 -0600 Subject: [PATCH 1/8] update packages and fix a bug in Y_huber function (LossFunctions.jl removed 'value' function.) --- Project.toml | 12 ++++++------ src/Miscellanea.jl | 4 ++-- src/QTLplot.jl | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index ffdb1bf..8c3a1b7 100644 --- a/Project.toml +++ b/Project.toml @@ -19,12 +19,12 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] Distributions = "^0.23, 0.24, 0.25" -LossFunctions = "~0.7" -PyPlot = "~2.10" -Revise = "3.3" -StaticArrays = "1.4" -StatsBase = "~0.33" -julia = "~1.6, ~1.7" +LossFunctions = "~0.11" +PyPlot = "~2.11" +Revise = "3.5" +StaticArrays = "1.7" +StatsBase = "0.33" +julia = "~1.9" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/Miscellanea.jl b/src/Miscellanea.jl index ff63166..4e8bf6b 100644 --- a/src/Miscellanea.jl +++ b/src/Miscellanea.jl @@ -10,7 +10,7 @@ module Util using Random using Distributed -import LossFunctions: HuberLoss, value +import LossFunctions: HuberLoss import Distributions: Chisq,ccdf import StatsBase: mad, sample import Statistics: mean, var, median @@ -341,7 +341,7 @@ function huberize(y::Vector{Float64}) m = median(y) s = mad(y,normalize=true) z = (y.-m)./s -l = value.(HuberLoss(1),z) +l = HuberLoss().(z) x = sign.(z).* sqrt.(2*l) return m .+ s.*x end diff --git a/src/QTLplot.jl b/src/QTLplot.jl index 5870a4f..12fcd25 100644 --- a/src/QTLplot.jl +++ b/src/QTLplot.jl @@ -8,7 +8,7 @@ A module for generating PyPlot-based 1D-, 2D-plots for LOD scores (or effects). """ module QTLplot -using PyPlot +using PyPlot, LinearAlgebra import Statistics:median @@ -237,7 +237,7 @@ Chr=unique(S.chr); subplot(position) imshow(Chrom,cmap="jet",interpolation="bicubic",extent=[minimum(x),maximum(x),maximum(y),minimum(y)],vmin=0.0,vmax=maximum(S.lod)); # eval(Meta.parse(string("""title(string("Chromsome ", """,Chr[i+inner_num*(j-1)],""")) """))) - title(string("Chromosome ",Chromosome[i+inner_num*(j-1)]),fontsize=title_font) + title(string("Chromosome ",Chr[i+inner_num*(j-1)]),fontsize=title_font) xticks(fontsize=fontsize);yticks(fontsize=fontsize) cbar=colorbar() cbar.ax.tick_params(labelsize=fontsize) From c1e6348bcafe2a44ddab134bb326cffb4fcd0bf6 Mon Sep 17 00:00:00 2001 From: hkim89 Date: Mon, 29 Jan 2024 16:53:05 -0600 Subject: [PATCH 2/8] replacing travis/appveyor with ci.yml --- .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8a4c7fe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. + - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - 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 + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - run: | + julia --project=docs -e ' + using Documenter: doctest + using FlxQTL + doctest(FlxQTL)' + - run: julia --project=docs docs/make.jl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file From 6960b570bedb290516b2a9bc3d5f9d500124bde8 Mon Sep 17 00:00:00 2001 From: hkim89 Date: Mon, 29 Jan 2024 17:24:11 -0600 Subject: [PATCH 3/8] remove travis/appveyor --- .appveyor.yml | 39 --------------------------------- .travis.yml | 60 --------------------------------------------------- README.md | 5 +++-- 3 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index c07129a..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Documentation: https://github.com/JuliaCI/Appveyor.jl -environment: - matrix: - - julia_version: 1.6 - - julia_version: nightly -platform: - - x64 -cache: - - '%USERPROFILE%\.julia\artifacts' - -# # Uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -# matrix: -# allow_failures: -# - julia_version: nightly - -branches: - only: - - master - - /release-.*/ -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5e0c02d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia -language: julia -notifications: - email: false -julia: - - 1.6 - - nightly -os: - - linux -# - osx -arch: - - x64 -cache: - directories: - - ~/.julia/artifacts -before_install: - - sudo apt-get update -# - pip3 -m install -U matplotlib - - sudo apt-get install python3-matplotlib -jobs: - fast_finish: true - allow_failures: - - julia: nightly - include: -# - stage: test -# julia: -# - 1.5 -# - nightly -# os: linux -# dist: focal -# before_install: -# - sudo apt-get update -# # - pip3 -m install -U matplotlib -# - sudo apt-get install python3-matplotlib - - stage: Documentation - julia: 1.6 -# script: -# - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' -# - julia --project=docs/ docs/make.jl -# name: "HTML" - script: | - julia --project=docs -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate() - using Documenter: doctest - using FlxQTL - doctest(FlxQTL) - include("docs/make.jl")' - after_success: skip -after_success: - - | - julia -e ' - using Pkg - Pkg.add("Coverage") - using Coverage - Codecov.submit(process_folder())' - -# before_install: -# - julia -e 'ENV["PYTHON"]=""; Pkg.add("Conda"); using Conda; Conda.add("python==3.9.0"); Conda.add("matplotlib==3.3.2"); Conda.add("basemap"); Pkg.add("PyCall"); Pkg.build("PyCall"); Pkg.add("PyPlot");' diff --git a/README.md b/README.md index 47f21b2..d328733 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ ## *Fl*e*x*ible Multivariate Linear Mixed Model based *QTL* Analysis for Structured Multiple Traits [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://senresearch.github.io/FlxQTL.jl/stable) -[![Build Status](https://travis-ci.com/senresearch/FlxQTL.jl.svg?branch=master)](https://travis-ci.com/github/senresearch/FlxQTL.jl) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/senresearch/FlxQTL.jl?svg=true)](https://ci.appveyor.com/project/sens/flxqtl-jl) +[![CI](https://github.com/senresearch/FlxQTL.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/senresearch/FlxQTL.jl/actions/workflows/ci.yml) + [![codecov](https://codecov.io/gh/senresearch/FlxQTL.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/senresearch/FlxQTL.jl) From 72d3b90711808291c023083d1d08365359a2f0d0 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Tue, 30 Jan 2024 01:16:13 +0000 Subject: [PATCH 4/8] CompatHelper: add new compat entry for Conda at version 1, (keep existing compat) --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 8c3a1b7..5e9f8fe 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] +Conda = "1" Distributions = "^0.23, 0.24, 0.25" LossFunctions = "~0.11" PyPlot = "~2.11" From 7ac23a900a2275bfe9894db099f88c303151c16c Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Tue, 30 Jan 2024 01:16:15 +0000 Subject: [PATCH 5/8] CompatHelper: add new compat entry for Statistics at version 1, (keep existing compat) --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 8c3a1b7..b643fc7 100644 --- a/Project.toml +++ b/Project.toml @@ -23,6 +23,7 @@ LossFunctions = "~0.11" PyPlot = "~2.11" Revise = "3.5" StaticArrays = "1.7" +Statistics = "1" StatsBase = "0.33" julia = "~1.9" From 13966d02f27f58ac0f6ddc370690fefa44861599 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Tue, 30 Jan 2024 01:16:16 +0000 Subject: [PATCH 6/8] CompatHelper: add new compat entry for DelimitedFiles at version 1, (keep existing compat) --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 8c3a1b7..9ca4e7f 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] +DelimitedFiles = "1" Distributions = "^0.23, 0.24, 0.25" LossFunctions = "~0.11" PyPlot = "~2.11" From 3c886ab2a9448a994b5e0040b7f746ba335d8f98 Mon Sep 17 00:00:00 2001 From: hkim89 Date: Thu, 1 Feb 2024 19:48:12 -0600 Subject: [PATCH 7/8] correcting ci & readme files --- .github/workflows/ci.yml | 4 ++++ README.md | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a4c7fe..a50f202 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,10 @@ jobs: - ubuntu-latest arch: - x64 + include: + - os: windows-latest + version: '1' + arch: x64 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 diff --git a/README.md b/README.md index d328733..e04664a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://senresearch.github.io/FlxQTL.jl/stable) [![CI](https://github.com/senresearch/FlxQTL.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/senresearch/FlxQTL.jl/actions/workflows/ci.yml) - [![codecov](https://codecov.io/gh/senresearch/FlxQTL.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/senresearch/FlxQTL.jl) From 1b9c0fc797c05cbed5ce8e8eb6ed074574cc3b73 Mon Sep 17 00:00:00 2001 From: hkim89 Date: Mon, 12 Feb 2024 14:38:28 -0600 Subject: [PATCH 8/8] commenting out QTLplot module for testing --- src/FlxQTL.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FlxQTL.jl b/src/FlxQTL.jl index 19a5a7c..2ffa87d 100644 --- a/src/FlxQTL.jl +++ b/src/FlxQTL.jl @@ -12,7 +12,7 @@ module FlxQTL include("MLM.jl") -include("QTLplot.jl") +# include("QTLplot.jl") include("Miscellanea.jl") include("GRM.jl") include("EcmNestrv.jl") @@ -25,8 +25,8 @@ using .GRM:kinshipMan,kinship4way,kinshipGs,kinshipLin,kinshipCtr,kinshipStd,shr export kinshipMan,kinship4way,kinshipGs,kinshipLin,kinshipCtr,kinshipStd export shrinkg,shrinkgLoco,kinshipLoco -using .QTLplot:layers, plot1d, plot2d, subplot2d -export layers, plot1d, plot2d, subplot2d +# using .QTLplot:layers, plot1d, plot2d, subplot2d +# export layers, plot1d, plot2d, subplot2d using .flxMLMM: geneScan,gene2Scan,envScan,permTest,K2eig, K2Eig, obtainKc,gene1Scan,updateKc #selectQTL