-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Hoffman
committed
May 23, 2019
0 parents
commit 919f7a1
Showing
12 changed files
with
233 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,2 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
This file contains 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,4 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata |
This file contains 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,15 @@ | ||
Package: SeuratData | ||
Type: Package | ||
Title: What the Package Does (Title Case) | ||
Version: 0.1.0 | ||
Author: Who wrote it | ||
Maintainer: The package maintainer <[email protected]> | ||
Description: More about what it does (maybe more than one line) | ||
Use four spaces when indenting paragraphs within the Description. | ||
License: What license is it under? | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.1.1 | ||
Collate: | ||
'zzz.R' | ||
'seurat_data.R' |
This file contains 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,8 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(AvailableData) | ||
export(InstallData) | ||
export(InstalledData) | ||
importFrom(utils,available.packages) | ||
importFrom(utils,install.packages) | ||
importFrom(utils,remove.packages) |
This file contains 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,87 @@ | ||
#' @include zzz.R | ||
#' | ||
NULL | ||
|
||
#' Get list of available datasets | ||
#' | ||
#' @return A vector of dataset names | ||
#' | ||
#' @export | ||
#' | ||
AvailableData <- function() { | ||
UpdateManifest() | ||
return(manifest) | ||
} | ||
|
||
#' Install a dataset | ||
#' | ||
#' @param pkgs List of datasets to install | ||
#' @param ... Extra parameters passed to \code{\link[utils]{install.packages}} | ||
#' | ||
#' @importFrom utils install.packages | ||
#' | ||
#' @export | ||
#' | ||
InstallData <- function(pkgs, ...) { | ||
UpdateManifest() | ||
pkgs <- pkgs[pkgs %in% manifest] | ||
if (length(x = pkgs) < 1) { | ||
stop("No datasets provided", call. = FALSE) | ||
} | ||
install.packages( | ||
pkgs = pkgs, | ||
repos = 'http://satijalab04.nygenome.org', | ||
type = 'source', | ||
... | ||
) | ||
for (pkg in pkgs) { | ||
attachNamespace(ns = pkg) | ||
attached <<- c(attached, pkg) | ||
} | ||
} | ||
|
||
#' Get a list of installed datasets | ||
#' | ||
#' @return A vector of installed datasets | ||
#' | ||
#' @export | ||
#' | ||
InstalledData <- function() { | ||
installed <- vector(mode = 'character') | ||
for (pkg in manifest) { | ||
if (requireNamespace(pkg, quietly = TRUE)) { | ||
installed <- c(installed, pkg) | ||
} | ||
} | ||
return(installed) | ||
} | ||
|
||
#' Remove a dataset | ||
#' | ||
#' @inheritDotParams utils::remove.packages | ||
#' @param pkgs List of dataset to remove | ||
#' | ||
#' @importFrom utils remove.packages | ||
#' | ||
RemoveData <- function(pkgs, lib) { | ||
UpdateManifest() | ||
pkgs <- pkgs[pkgs %in% manifest] | ||
if (length(x = pkgs) < 1) { | ||
stop("No datasets provided", call. = FALSE) | ||
} | ||
remove.packages(pkgs = pkgs, lib = lib) | ||
} | ||
|
||
#' Update the available package manifest | ||
#' | ||
#' @importFrom utils available.packages | ||
#' | ||
UpdateManifest <- function() { | ||
repo.use <- 'http://satijalab04.nygenome.org' | ||
avail.pkgs <- available.packages( | ||
contriburl = paste(repo.use, 'src/contrib', sep = '/'), | ||
type = 'source' | ||
) | ||
manifest <<- rownames(x = avail.pkgs) | ||
invisible(x = NULL) | ||
} |
This file contains 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,21 @@ | ||
manifest <- vector(mode = 'character') | ||
|
||
attached <- vector(mode = 'character') | ||
|
||
.onLoad <- function(libname, pkgname) { | ||
UpdateManifest() | ||
for (pkg in manifest) { | ||
if (requireNamespace(pkg, quietly = TRUE)) { | ||
message("Attaching ", pkg) | ||
try(expr = attachNamespace(ns = pkg), silent = TRUE) | ||
attached <<- c(attached, pkg) | ||
} | ||
} | ||
} | ||
|
||
.onUnload <- function(libpath) { | ||
for (pkg in attached) { | ||
message("Detaching ", pkg) | ||
unloadNamespace(ns = pkg) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,19 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
StripTrailingWhitespace: Yes | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source |