Skip to content

Commit

Permalink
Merge pull request #58 from uclahs-cds/nzeltser-cran-prep
Browse files Browse the repository at this point in the history
Internal Release
  • Loading branch information
alkaZeltser authored Jul 26, 2024
2 parents 608dfd3 + 6d8930a commit 00c2446
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
^.*\.Rproj$
^\.Rproj\.user$
.github
.vscode
metadata.yaml
LICENSE.md
LICENSE.md
RCMD-CHECK.R
^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
*.Rproj*
.Rproj.user
inst/doc
/doc/
/Meta/
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ApplyPolygenicScore
Type: Package
Title: Utilities for the Application of a Polygenic Score to a VCF
Version: 0.1.0
Version: 1.0.0
Authors@R: c(
person('Paul', 'Boutros', role = 'cre', email = '[email protected]'),
person('Nicole', 'Zeltser', role = 'aut', comment = c(ORCID = '000-0001-7246-2771')),
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ApplyPolygenicScore (0.1.0)
# ApplyPolygenicScore 1.0.0 (2024-07-25)

* First release

# ApplyPolygenicScore 0.1.0 (2024-07-25)

* INITIAL FEATURES
7 changes: 3 additions & 4 deletions R/apply-pgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ validate.phenotype.data.input <- function(phenotype.data, phenotype.analysis.col
#' @param n.percentiles An integer indicating the number of percentiles to calculate for the PGS. Default is \code{NULL}.
#' @param analysis.source.pgs A character string indicating the source PGS for percentile calculation and regression analyses. Options are "mean.dosage", "normalize", or "none".
#' When not specified, defaults to \code{missing.genotype.method} choice and if more than one PGS missing genotype method is chosen, calculation defaults to the first selection.
#' @param validate.inputs.only A logical indicating whether to only perform input data validation checks without running PGS application. If no errors are triggered, a message is printed and TRUE is returned. Default is \code{FALSE}.
#' @param validate.inputs.only A logical indicating whether to only perform input data validation checks without running PGS application.
#' If no errors are triggered, a message is printed and TRUE is returned. Default is \code{FALSE}.
#' @return A list containing per-sample PGS output and per-phenotype regression output if phenotype analysis columns are provided.
#'
#' \strong{Output Structure}
#'
#' The outputed list contains the following elements:
Expand Down Expand Up @@ -154,7 +154,7 @@ validate.phenotype.data.input <- function(phenotype.data, phenotype.analysis.col
#' Where \emph{P} is the ploidy and has the value \code{2} and \eqn{M_{non-missing}} is the number of non-missing genotypes.
#'
#' \code{mean.dosage}: Missing genotype dosages are replaced by the mean population dosage of the variant which is calculated as the product of the effect allele frequency \emph{EAF} and the ploidy of a diploid genome:
#' \deqn{\overline{dosage_{k}} = EAF_k * P}}
#' \deqn{\overline{dosage_{k}} = EAF_k * P}
#' where \emph{k} is a PGS component variant that is missing in between 1 and n-1 individuals in the cohort and \emph{P} = ploidy = 2
#' This dosage calculation holds under assumptions of Hardy-Weinberg equilibrium.
#' By default, the effect allele frequency is calculated from the provided VCF data.
Expand Down Expand Up @@ -224,7 +224,6 @@ validate.phenotype.data.input <- function(phenotype.data, phenotype.analysis.col
#' pgs.weight.data = pgs.import$pgs.weight.data,
#' validate.inputs.only = TRUE
#' );
#'
#' @export
apply.polygenic.score <- function(
vcf.data,
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ To install the latest development version from GitHub:
# install.packages("devtools")
devtools::install_github("uclahs-cds/package-ApplyPolygenicScore")
# To access vignettes, make sure to add the `build_vignettes` argument:
devtools::install_github("uclahs-cds/package-ApplyPolygenicScore", build_vignettes = TRUE)
```

## Getting Started
Expand Down Expand Up @@ -72,6 +77,19 @@ If you wish to apply a PGS to a cohort, we recommend that genotypes for the whol
For more step-by-step instructions, check out our vignettes.

## Resources
This package is in the process of being submitted to CRAN, where the manual and vignettes will be readily available. In the meantime, if you have installed the package from GitHub with `build_vignettes = TRUE`, you may view the vignette by running the following:

```
vignette('UserGuide', package = 'ApplyPolygenicScore')
```
Or by simply opening the rendered file that will be automatically written to the `doc` folder in your local package directory.

View function-specific documentation using `?`:

```
?apply.polygenic.score
```


## Getting Help
Looking for guidance or support with ApplyPolygenicScore? Check out our [Discussions](https://github.com/uclahs-cds/package-ApplyPolygenicScore/discussions) page.
Expand Down
69 changes: 67 additions & 2 deletions man/apply.polygenic.score.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Category: '' # shoule be one of docker/pipeline/project/template/tool/training/users
Description: '' # Description of why the repository exists
Maintainers: ['[email protected]', 'someoneelse@mednet.ucla.edu'] # email address of maintainers
Contributors: 'Xavier Hernandez' # Full names of contributors
Languages: ['R', 'perl', 'nextflow'] # programming languages used
Dependencies: 'BPG' # packages, tools that repo needs to run
Category: 'tool' # should be one of docker/pipeline/project/template/tool/training/users
Description: 'Utilities for matching a polygenic score coordinate file to a VCF input and the subsequent calculation of the provided polygenic score in each individual.' # Description of why the repository exists
Maintainers: ['nzeltser@mednet.ucla.edu'] # email address of maintainers
Contributors: ['Nicole Zeltser', 'Rachel Dang'] # Full names of contributors
Languages: ['R'] # programming languages used
Dependencies: ['BPG', 'vcfR', 'pROC', 'data.table', 'reshape2'] # packages, tools that repo needs to run
References: '' # is the tool/dependencies published, is there a confluence page

0 comments on commit 00c2446

Please sign in to comment.