diff --git a/README.md b/README.md index 0885dfd1..b8cf43da 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,3 @@ This is a package to perform Ghost Knockoff analysis for summary statistics data. :warning: **Package is in early phase of development**. - -:warning: **This package currently only works on Julia v1.8.x or 1.9.x** with Linux aarch64 or x86_64. If you need it to work on a different Julia version, please file an issue. diff --git a/docs/src/man/FAQ.ipynb b/docs/src/man/FAQ.ipynb new file mode 100644 index 00000000..a1aefed5 --- /dev/null +++ b/docs/src/man/FAQ.ipynb @@ -0,0 +1,32 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Common questions and Answers\n", + "\n", + "Here is a collection of common questions & answers. If you have a question not listed here, do not hesitate to open a new issue on Github. \n", + "\n", + "## How to handle missing data?\n", + "\n", + "## Memory requirement?" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.9.1", + "language": "julia", + "name": "julia-1.9" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.9.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/src/man/FAQ.md b/docs/src/man/FAQ.md new file mode 100644 index 00000000..0e4789db --- /dev/null +++ b/docs/src/man/FAQ.md @@ -0,0 +1,8 @@ + +# Common questions and Answers + +Here is a collection of common questions & answers. If you have a question not listed here, do not hesitate to open a new issue on Github. + +## How to handle missing data? + +## Memory requirement? diff --git a/docs/src/man/developer.ipynb b/docs/src/man/developer.ipynb index e94845f4..889c9685 100644 --- a/docs/src/man/developer.ipynb +++ b/docs/src/man/developer.ipynb @@ -36,6 +36,10 @@ "Pkg.add(url=\"https://github.com/biona001/GhostKnockoffGWAS\")\n", "```\n", "\n", + "!!! warning\n", + "\n", + " This package currently only works on Julia 1.8.x and 1.9.x. If you need it to work on a different Julia version, let us know by filing an issue on Github. \n", + "\n", "### Julia API\n", "\n", "```@autodocs\n", diff --git a/docs/src/man/developer.md b/docs/src/man/developer.md index ee08ffcf..da96da6b 100644 --- a/docs/src/man/developer.md +++ b/docs/src/man/developer.md @@ -23,6 +23,10 @@ Pkg.add(url="https://github.com/biona001/Ghostbasil.jl") Pkg.add(url="https://github.com/biona001/GhostKnockoffGWAS") ``` +!!! warning + + This package currently only works on Julia 1.8.x and 1.9.x. If you need it to work on a different Julia version, let us know by filing an issue on Github. + ### Julia API ```@autodocs diff --git a/docs/src/man/examples.ipynb b/docs/src/man/examples.ipynb new file mode 100644 index 00000000..32530ff7 --- /dev/null +++ b/docs/src/man/examples.ipynb @@ -0,0 +1,28 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Examples\n", + "\n", + "This page collect examples of running the ghost knockoff pipeline. We will cover topics such as installation, examining input data, running the software, and visualizing the output. " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.9.1", + "language": "julia", + "name": "julia-1.9" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.9.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/src/man/examples.md b/docs/src/man/examples.md new file mode 100644 index 00000000..a4bae37c --- /dev/null +++ b/docs/src/man/examples.md @@ -0,0 +1,4 @@ + +# Examples + +This page collect examples of running the ghost knockoff pipeline. We will cover topics such as installation, examining input data, running the software, and visualizing the output. diff --git a/docs/src/man/getting_started.ipynb b/docs/src/man/getting_started.ipynb index 75f75652..c19d611c 100644 --- a/docs/src/man/getting_started.ipynb +++ b/docs/src/man/getting_started.ipynb @@ -29,7 +29,39 @@ "\n", "To see required inputs (and optional inputs), invoke\n", "```shell\n", - "./GhostKnockoffGWAS --help\n", + "$ ./GhostKnockoffGWAS --help\n", + "\n", + "usage: [--genome-build GENOME-BUILD] [--m M] [--seed SEED]\n", + " [-h] zfile knockoff_dir Neffect out\n", + "\n", + "positional arguments:\n", + " zfile Tab or comma separated summary Z-score file.\n", + " The first row must be a header line that\n", + " contains CHR/POS/REF/ALT fields, as well as\n", + " something that indicates Z-score information.\n", + " CHR must be integer valued (e.g. chr21 is not\n", + " correct). If a column with `Z` is available,\n", + " it will be used as Z scores. Otherwise, we\n", + " need both `pvalue` and `beta` to be available,\n", + " or both `OR` (odds ratio) and `SE` (standard\n", + " error) to be available. In these cases, we\n", + " will convert them to Z scores.\n", + " knockoff_dir Path to the directory storing pre-processed\n", + " knockoff files\n", + " Neffect Effective sample size for original data (type:\n", + " Int64)\n", + " out Output file prefix (without extensions)\n", + "\n", + "optional arguments:\n", + " --genome-build GENOME-BUILD\n", + " Specifies the human genome build for the\n", + " summary file. Must be 19 (hg19) or 38 (hg38).\n", + " (type: Int64, default: 38)\n", + " --m M Number of knockoffs to generate (type: Int64,\n", + " default: 5)\n", + " --seed SEED Sets the random seed (type: Int64, default:\n", + " 2023)\n", + " -h, --help show this help message and exit\n", "```\n", "\n", "Example run:\n", diff --git a/docs/src/man/getting_started.md b/docs/src/man/getting_started.md index b247a3b7..0edc72ef 100644 --- a/docs/src/man/getting_started.md +++ b/docs/src/man/getting_started.md @@ -24,7 +24,39 @@ Most users are expected to follow this workflow. For advanced users, see [Develo To see required inputs (and optional inputs), invoke ```shell -./GhostKnockoffGWAS --help +$ ./GhostKnockoffGWAS --help + +usage: [--genome-build GENOME-BUILD] [--m M] [--seed SEED] + [-h] zfile knockoff_dir Neffect out + +positional arguments: + zfile Tab or comma separated summary Z-score file. + The first row must be a header line that + contains CHR/POS/REF/ALT fields, as well as + something that indicates Z-score information. + CHR must be integer valued (e.g. chr21 is not + correct). If a column with `Z` is available, + it will be used as Z scores. Otherwise, we + need both `pvalue` and `beta` to be available, + or both `OR` (odds ratio) and `SE` (standard + error) to be available. In these cases, we + will convert them to Z scores. + knockoff_dir Path to the directory storing pre-processed + knockoff files + Neffect Effective sample size for original data (type: + Int64) + out Output file prefix (without extensions) + +optional arguments: + --genome-build GENOME-BUILD + Specifies the human genome build for the + summary file. Must be 19 (hg19) or 38 (hg38). + (type: Int64, default: 38) + --m M Number of knockoffs to generate (type: Int64, + default: 5) + --seed SEED Sets the random seed (type: Int64, default: + 2023) + -h, --help show this help message and exit ``` Example run: diff --git a/src/app.jl b/src/app.jl index cbab7424..715a9d9a 100644 --- a/src/app.jl +++ b/src/app.jl @@ -6,11 +6,11 @@ function julia_main()::Cint parse_commandline() println("Running GhostKnockoffGWAS analysis with the following options:") - println("zfile = $zfile") - println("knockoff_dir = $knockoff_dir") + println("zfile = $(abspath(zfile))") + println("knockoff_dir = $(abspath(knockoff_dir))") println("N (effective sample size) = $Neffect") println("hg_build = $hg_build") - println("outfile = $outfile") + println("outfile = $(abspath(outfile))") println("m (number of knockoffs for stability) = $m") println("seed = $seed") diff --git a/src/utilities.jl b/src/utilities.jl index 101ce549..9b5b14b7 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -150,7 +150,7 @@ function read_zscores(filepath::String) pos = info[!, "POS"] |> Vector{Int} effect_allele = info[!, "ALT"] |> Vector{String} non_effect_allele = info[!, "REF"] |> Vector{String} - return chr, pos, effect_allele, non_effect_allele + chr, pos, effect_allele, non_effect_allele catch error("Z score file does not contain CHR/POS/REF/ALT.") end