Skip to content

Commit

Permalink
Add data sets
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhang503 committed Jun 11, 2019
1 parent 55a283e commit 214d35d
Show file tree
Hide file tree
Showing 22 changed files with 150 additions and 28 deletions.
8 changes: 7 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Generated by roxygen2: do not edit by hand

export(copy_csv)
export(copy_expt)
export(copy_frac)
export(copy_globalCPTAC)
export(cptac_csv_1)
export(cptac_csv_2)
export(cptac_expt_1)
export(cptac_expt_2)
export(cptac_frac_1)
export(cptac_frac_2)
74 changes: 62 additions & 12 deletions R/globalCPTAC.R
Original file line number Diff line number Diff line change
@@ -1,48 +1,98 @@
#' Copy Mascot \code{.csv} files
#'
#' \code{copy_globalCPTAC} copies the \code{.csv} files from Mascot searches to
#' a target directory.
#' \code{copy_dat} copies the Mascot outputs of \code{.csv} files to a target
#' directory.
#' @export
copy_globalCPTAC <- function(dat_dir) {
copy_csv <- function(dat_dir, filelist) {
dir.create(file.path(dat_dir), recursive = TRUE, showWarnings = FALSE)

filelist <- c("F003481", "F003485", "F003486", "F003487", "F003488", "F003510")
data(list = filelist, package = "proteoQDA", envir = environment())

for (i in seq_along(filelist)) {
fileConn <- file(file.path(dat_dir, paste0(filelist[i], ".csv")))
df <- get(filelist[i])

writeLines(df, fileConn)
close(fileConn)
}
}


#' Copy Mascot \code{.csv} files
#'
#' @export
cptac_csv_1 <- function(dat_dir) {
copy_csv(dat_dir, filelist = c("F003481", "F003485", "F003486", "F003487", "F003488", "F003510"))
}


#' Copy Mascot \code{.csv} files
#'
#' @export
cptac_csv_2 <- function(dat_dir) {
copy_csv(dat_dir, filelist = c("F003529", "F003530", "F003531", "F003532", "F003533", "F003534"))
}



#' Copy \code{expt_smry.xlsx}
#'
#' \code{copy_expt} copies the \code{expt_smry.xlsx} to a target directory.
#' @export
copy_expt <- function(dat_dir) {
copy_expt <- function(dat_dir, filename = "expt_smry.xlsx") {
dir.create(file.path(dat_dir), recursive = TRUE, showWarnings = FALSE)

filepath <- system.file("extdata", "expt_smry.xlsx", package = "proteoQ")
if (nchar(filepath) == 0) stop("Load `library(proteoQ)` first.")
filepath <- system.file("extdata", filename, package = "proteoQDA")
# if (nchar(filepath) == 0) stop("Load `library(proteoQ)` first.")
filepath <- gsub("/", "\\\\", filepath)
file.copy(from = filepath, to = file.path(dat_dir, "expt_smry.xlsx"))
}


#' Copy \code{expt_smry.xlsx}
#'
#' @export
cptac_expt_1 <- function(dat_dir) {
copy_expt(dat_dir, "expt_smry_cptac_gl.xlsx")
}


#' Copy \code{expt_smry.xlsx}
#'
#' @export
cptac_expt_2 <- function(dat_dir) {
copy_expt(dat_dir, "expt_smry_cptac_cmbn.xlsx")
}



#' Copy \code{frac_smry.xlsx}
#'
#' \code{copy_frac} copies the \code{expt_smry.xlsx} to a target directory.
#' \code{copy_frac} copies the \code{frac_smry.xlsx} to a target directory.
#' @export
copy_frac <- function(dat_dir) {
copy_frac <- function(dat_dir, filename = "frac_smry.xlsx") {
dir.create(file.path(dat_dir), recursive = TRUE, showWarnings = FALSE)

filepath <- system.file("extdata", "frac_smry.xlsx", package = "proteoQ")
if (nchar(filepath) == 0) stop("Load `library(proteoQ)` first.")
filepath <- system.file("extdata", filename, package = "proteoQDA")
# if (nchar(filepath) == 0) stop("Load `library(proteoQ)` first.")
filepath <- gsub("/", "\\\\", filepath)
file.copy(from = filepath, to = file.path(dat_dir, "frac_smry.xlsx"))
}


#' Copy \code{frac_smry.xlsx}
#'
#' @export
cptac_frac_1 <- function(dat_dir) {
copy_frac(dat_dir, "frac_smry_cptac_gl.xlsx")
}


#' Copy \code{frac_smry.xlsx}
#'
#' @export
cptac_frac_2 <- function(dat_dir) {
copy_frac(dat_dir, "frac_smry_cptac_cmbn.xlsx")
}



Binary file added data/F003529.rda
Binary file not shown.
Binary file added data/F003530.rda
Binary file not shown.
Binary file added data/F003531.rda
Binary file not shown.
Binary file added data/F003532.rda
Binary file not shown.
Binary file added data/F003533.rda
Binary file not shown.
Binary file added data/F003534.rda
Binary file not shown.
Binary file added inst/extdata/expt_smry_cptac_cmbn.xlsx
Binary file not shown.
Binary file added inst/extdata/expt_smry_cptac_gl.xlsx
Binary file not shown.
Binary file added inst/extdata/frac_smry_cptac_cmbn.xlsx
Binary file not shown.
Binary file added inst/extdata/frac_smry_cptac_gl.xlsx
Binary file not shown.
12 changes: 12 additions & 0 deletions man/copy_csv.Rd

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

2 changes: 1 addition & 1 deletion man/copy_expt.Rd

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

4 changes: 2 additions & 2 deletions man/copy_frac.Rd

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

12 changes: 0 additions & 12 deletions man/copy_globalCPTAC.Rd

This file was deleted.

11 changes: 11 additions & 0 deletions man/cptac_csv_1.Rd

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

11 changes: 11 additions & 0 deletions man/cptac_csv_2.Rd

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

11 changes: 11 additions & 0 deletions man/cptac_expt_1.Rd

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

11 changes: 11 additions & 0 deletions man/cptac_expt_2.Rd

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

11 changes: 11 additions & 0 deletions man/cptac_frac_1.Rd

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

11 changes: 11 additions & 0 deletions man/cptac_frac_2.Rd

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

0 comments on commit 214d35d

Please sign in to comment.