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/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a50f202 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +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 + include: + - os: windows-latest + version: '1' + 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 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/Project.toml b/Project.toml index ffdb1bf..95bec91 100644 --- a/Project.toml +++ b/Project.toml @@ -18,13 +18,16 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] +Conda = "1" +DelimitedFiles = "1" 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" +Statistics = "1" +StatsBase = "0.33" +julia = "~1.9" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/README.md b/README.md index 47f21b2..e04664a 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ ## *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) 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 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)