-
Notifications
You must be signed in to change notification settings - Fork 2
Merge refactored branch into main #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
553366c
refactoring core gdb methods/functions + >90% coverage
4bdb033
varSet refactoring
a50297d
refactored varSet unit tests (>90% coverage)
a1fda07
genoMatrix refactoring
9d74812
genoMatrix unit test refactoring (>90%)
90ed689
refactoring summariseGeno
526e65c
add asserts
94b9d59
replace aggregateFile and associated methods with aggDb
ce5482c
refactored gdb-aggregate method (using aggDb)
d025cdd
assocTest refactoring
67cf889
refactor assocTest_gdb
eb0f2d4
replace assoctest_aggregateFile with assoctest_aggdb + refactor
2a1b1e3
refactor rvatResult
24ee3a1
update nullmodelGSA to aggdb
6d6bb79
update internal data
3700348
update cli
51aed93
minor fixes in geneSetAssoc tests
4343ffa
replace aggregateFile tests with aggdb tests
5eaa201
minor updates cli tests
0435360
add test helper functions
79d3d00
minor updates unit tests
761d2aa
updates DESCRIPTION/NAMESPACE and documentation
b17f17e
small fix unit tests
cdf19f6
add test data
39dea48
small fix in unit tests
d88c383
minor fixes
3508f50
refactor genoMatrix unit tests (>90% coverage)
pjhop 6994358
refactor summariseGeno unit tests (>90% coverage)
pjhop 977e3c0
minor updates aggdb + updated unit tests aggdb and related methods (>…
pjhop 7f7730f
minor updates assocTest + refactoring assocTest unit tests
pjhop 0b19300
refactoring of rvatResult unit tests
pjhop abe7d83
reformat mapToCDS.R
pjhop 2a122dd
refactor mapToCDS
pjhop 925c015
reformat vcfUtils.R
pjhop a974c0e
linting mapToCDS
pjhop 9c8bb40
vcfUtils: reformatting
pjhop 764ef17
spatialClust.R: reformat
pjhop 678320f
spatialClust linting
pjhop 603fab7
refactoring of spatialClust
pjhop c5183bf
reformat geneSetAssoc.R
pjhop 8a9748a
move geneSet functions and methods to separate file
pjhop 456d86b
geneSet.R linting
pjhop 2737ad6
geneSet.R refactoring
pjhop af21f12
reformat geneSet unit tests
pjhop 8814c27
update geneSet unit tests
pjhop 13c84aa
format geneSetAssoc unit tests
pjhop d6ebb33
reorganize geneSetAssoc unit tests
pjhop 15a8502
geneSetAssoc: linting
pjhop cfa229c
refactor geneSetAssoc unit tests + bump to >80% coverage
pjhop befde00
geneSetAssoc: refactoring
pjhop b06799f
geneSetAssoc: refactor core GSA parts
pjhop 9169557
geneSetAssoc: refactor conditional GSA and cell-type enrichments
pjhop aa5b528
geneSetAssoc: minor updates refactoring + cleanup
pjhop 33c9b3a
remove rvatViewer code (will me moved to separate package)
pjhop 7d34802
fix aggdb documentation/examples
pjhop b0442ad
update documentation + move examples to separate files
pjhop 61b7238
remove skat_fwe tests; add aggregate documentation; add writeVcf to c…
pjhop 3959bba
reformat allClasses/allGenerics
pjhop 8c635d1
fix writing to output in assocTest
pjhop d8a9889
consistent file naming
pjhop 338eb3b
minor fix gdb and related methods
pjhop d21b34d
minor fixes + file renamings
pjhop 81efb14
minor fixes documentation
pjhop 39ee4f6
fix data paths in unit tests
pjhop 98ceee4
version bump + format DESCRIPTION
pjhop 27a0829
minor fixes unit tests
pjhop a8d8dee
minor fixes
pjhop 27b595b
update air formatting
pjhop 653e516
update man
pjhop 672a75b
remaining formatting
pjhop 26f034f
minor fixes
pjhop fd013ee
add snapshots + R CMD check workflow
pjhop 3b6fa0d
avoid opening all aggdb connections simultaneously in aggdbList
pjhop a62427d
minor update
pjhop d9ca5db
add rvatData to remotes in DESCRIPTION
pjhop a8df225
minor unit test fix
pjhop 5c8eb74
add v.0.4.0 to changelog
pjhop eee1e68
couple of minor fixes
pjhop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: R-CMD-check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, dev] | ||
| pull_request: | ||
| branches: [main, dev] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| R-CMD-check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| R_KEEP_PKG_SOURCE: yes | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| use-public-rspm: true | ||
|
|
||
| - uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| extra-packages: any::rcmdcheck | ||
| needs: check | ||
|
|
||
| - uses: r-lib/actions/check-r-package@v2 | ||
| with: | ||
| error-on: '"error"' | ||
| args: 'c("--no-manual", "--as-cran")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,101 @@ | ||
| Package: rvat | ||
| Title: Rare variant analysis toolkit | ||
| Version: 0.3.4 | ||
| Version: 0.4.0 | ||
| Authors@R: c(person(given='Kevin',family='Kenna',email='K.P.Kenna@umcutrecht.nl',role = c("aut")),person(given='Paul',family='Hop',email='P.J.Hop-2@umcutrecht.nl',role = c("aut", "cre"))) | ||
| Description: RVAT is an R package that allows for the conversion of large genetic datasets from variant call format (.vcf) to a compressed SQLite representation (.gdb). Gdb files allow for rapid loading of compressed sample genotype strings into R BioConductor-compatible classes. They also allow for the upload and integration of variant and sample annotation data and complex data querying. RVAT includes a range of methods for SQL and non-SQL based querying, as well as methods for single variant association testing, aggregate association testing, gene set analyses, (interactive) visualization and the generation of various population genetic summary statistics. RVAT methods can be called directly in R sessions or used outside of the R environment through a provided command line tool. | ||
| License: GPL-3 | ||
| Encoding: UTF-8 | ||
| biocViews: | ||
| Imports: magrittr, dplyr, ggplot2 (>= 3.3.0), logistf (>= 1.24), RSQLite, SKAT, MASS, Matrix, zoo, shiny,WGCNA,GenomicRanges,IRanges,DBI,methods,SPAtest,DT,ggrepel,stringr,stringi,tibble,tidyr,rtracklayer,plotly,BiocGenerics,GENESIS,GenomeInfoDb,GWASTools,matrixcalc,R.utils,optparse,readr,ggh4x | ||
| Depends: R (>= 3.4.1), SummarizedExperiment,S4Vectors | ||
| Imports: | ||
| magrittr, | ||
| dplyr, | ||
| ggplot2 (>= 3.3.0), | ||
| logistf (>= 1.24), | ||
| RSQLite, | ||
| SKAT, | ||
| MASS, | ||
| Matrix, | ||
| zoo, | ||
| WGCNA, | ||
| GenomicRanges, | ||
| IRanges, | ||
| DBI, | ||
| methods, | ||
| SPAtest, | ||
| ggrepel, | ||
| stringr, | ||
| stringi, | ||
| tibble, | ||
| tidyr, | ||
| rtracklayer, | ||
| plotly, | ||
| BiocGenerics, | ||
| GENESIS, | ||
| GenomeInfoDb, | ||
| GWASTools, | ||
| matrixcalc, | ||
| R.utils, | ||
| optparse, | ||
| readr, | ||
| ggh4x, | ||
| data.table, | ||
| rlang (>= 1.1.0) | ||
| Depends: | ||
| R (>= 3.4.1), | ||
| SummarizedExperiment, | ||
| S4Vectors | ||
| Roxygen: list(markdown = TRUE) | ||
| RoxygenNote: 7.3.2 | ||
| RoxygenNote: 7.3.3 | ||
| Collate: | ||
| 'allInternalData.R' | ||
| 'allGenerics.R' | ||
| 'allClasses.R' | ||
| 'aggregateFile.R' | ||
| 'aggDb-collapse.R' | ||
| 'aggDb-list.R' | ||
| 'aggDb-merge.R' | ||
| 'asserts-types-check.R' | ||
| 'asserts-obj-type.R' | ||
| 'aggDb.R' | ||
| 'assocTest-aggdb.R' | ||
| 'assocTest-gdb.R' | ||
| 'assocTest-helper.R' | ||
| 'assocTest-stattests.R' | ||
| 'assocTest.R' | ||
| 'assocTest_aggregateFile.R' | ||
| 'assocTest_gdb.R' | ||
| 'assocTest_helper.R' | ||
| 'dump.R' | ||
| 'gdb-aggregate.R' | ||
| 'gdb-anno-cohort.R' | ||
| 'gdb-buildGdb.R' | ||
| 'gdb-getGT.R' | ||
| 'gdb-mapVariants.R' | ||
| 'gdb-shared-helpers.R' | ||
| 'gdb-summariseGeno.R' | ||
| 'gdb-utils.R' | ||
| 'gdb.R' | ||
| 'gdbUtils.R' | ||
| 'geneSet.R' | ||
| 'rvatResult.R' | ||
| 'gsaResult.R' | ||
| 'geneSetAssoc.R' | ||
| 'genoMatrix.R' | ||
| 'manhattanly.R' | ||
| 'genoMatrix-aggregate.R' | ||
| 'genoMatrix-constructor.R' | ||
| 'genoMatrix-core.R' | ||
| 'genoMatrix-getCarriers.R' | ||
| 'genoMatrix-getters.R' | ||
| 'genoMatrix-summariseGeno.R' | ||
| 'genoMatrix-updaters.R' | ||
| 'mapToCDS.R' | ||
| 'mapVariants.R' | ||
| 'mutationPlot.R' | ||
| 'nullmodelGSA.R' | ||
| 'pipe.R' | ||
| 'resampling.R' | ||
| 'rvatViewer.R' | ||
| 'rvatViewerClass.R' | ||
| 'rvat_cli.R' | ||
| 'rvat_cli_help.R' | ||
| 'rvat_cli_options.R' | ||
| 'rvat_cli_helpers.R' | ||
| 'shiny_functions.R' | ||
| 'rvat-cli-help.R' | ||
| 'rvat-cli-options.R' | ||
| 'rvat-cli-helpers.R' | ||
| 'rvat-cli.R' | ||
| 'spatialClust.R' | ||
| 'utils.R' | ||
| 'varSet.R' | ||
| 'vcfUtils.R' | ||
| Suggests: | ||
| testthat (>= 3.0.0), rvatData, withr | ||
| Remotes: | ||
| KennaLab/rvatData | ||
| Config/testthat/edition: 3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| #' @include allClasses.R | ||
| #' @include allGenerics.R | ||
| #' @include allInternalData.R | ||
|
|
||
| #' @rdname collapseAggDbs | ||
| #' @usage NULL | ||
| #' @export | ||
| setMethod( | ||
| "collapseAggDbs", | ||
| signature = signature(object = "aggdbList"), | ||
| definition = function( | ||
| object, | ||
| output = NULL, | ||
| overWrite = FALSE, | ||
| verbose = TRUE | ||
| ) { | ||
| # input validation | ||
| check_character(output, allow_null = TRUE) | ||
| check_length(output, equal = 1L, allow_null = TRUE) | ||
| if (!is.null(output)) { | ||
| .check_output(output, overWrite = overWrite, verbose = verbose) | ||
| } | ||
| check_bool(verbose) | ||
|
|
||
| # initialize | ||
| samples <- listSamples(object) | ||
| agg_merged <- vector(mode = "numeric", length = length(samples)) | ||
|
|
||
| # loop through databases | ||
| for (i in seq_along(object@paths)) { | ||
| path <- object@paths[i] | ||
| if (verbose) { | ||
| message(sprintf( | ||
| "Processing aggdb %d/%d: '%s'", | ||
| i, | ||
| length(object@paths), | ||
| basename(path) | ||
| )) | ||
| } | ||
|
|
||
| con <- NULL | ||
| tryCatch( | ||
| { | ||
| # connect | ||
| con <- aggdb(path) | ||
|
|
||
| # retrieve aggregates | ||
| agg_current <- getUnit(con, unit = listUnits(con)) | ||
|
|
||
| # sum aggregates | ||
| agg_current_merged <- colSums(agg_current, na.rm = TRUE) | ||
|
|
||
| # add to total | ||
| agg_merged <- agg_merged + agg_current_merged | ||
| }, | ||
| error = function(e) { | ||
| stop( | ||
| sprintf( | ||
| "Could not process '%s': Error: %s", | ||
| basename(path), | ||
| e$message | ||
| ), | ||
| call. = FALSE | ||
| ) | ||
| }, | ||
| finally = { | ||
| if (!is.null(con) && DBI::dbIsValid(con)) { | ||
| close(con) | ||
| } | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| # finalize | ||
| agg_merged <- data.frame( | ||
| IID = samples, | ||
| aggregate = agg_merged, | ||
| stringsAsFactors = FALSE, | ||
| row.names = NULL | ||
| ) | ||
|
|
||
| # return data.frame if output is not specified | ||
| if (is.null(output)) { | ||
| return(agg_merged) | ||
| } else { | ||
| if (verbose) { | ||
| message(sprintf("Writing merged aggregates to: %s", output)) | ||
| } | ||
|
|
||
| # write to output if specified | ||
| output_con <- gzfile(output, "wb") | ||
| on.exit(close(output_con), add = TRUE) | ||
| write.table( | ||
| agg_merged, | ||
| file = output_con, | ||
| quote = FALSE, | ||
| sep = "\t", | ||
| row.names = FALSE | ||
| ) | ||
|
|
||
| invisible(NULL) | ||
| } | ||
| } | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.