Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
biona001 committed Dec 11, 2023
1 parent 32d433f commit 4c7f276
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
32 changes: 32 additions & 0 deletions docs/src/man/FAQ.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
8 changes: 8 additions & 0 deletions docs/src/man/FAQ.md
Original file line number Diff line number Diff line change
@@ -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?
4 changes: 4 additions & 0 deletions docs/src/man/developer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions docs/src/man/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions docs/src/man/examples.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 4 additions & 0 deletions docs/src/man/examples.md
Original file line number Diff line number Diff line change
@@ -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.
34 changes: 33 additions & 1 deletion docs/src/man/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,39 @@
"\n",
"To see required inputs (and optional inputs), invoke\n",
"```shell\n",
"./GhostKnockoffGWAS --help\n",
"$ ./GhostKnockoffGWAS --help\n",
"\n",
"usage: <PROGRAM> [--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",
Expand Down
34 changes: 33 additions & 1 deletion docs/src/man/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <PROGRAM> [--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:
Expand Down
6 changes: 3 additions & 3 deletions src/app.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c7f276

Please sign in to comment.