diff --git a/DESCRIPTION b/DESCRIPTION index 92302b8..01b03a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,7 +7,8 @@ Description: This package provides convenience functions for reading real-world Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 -Depends: +Imports: + dplyr SummarizedExperiment, readxl, MultiAssayExperiment, @@ -15,7 +16,6 @@ Depends: pbapply, tidyr, purrr, - dplyr, BumpyMatrix, rvest, stringr, diff --git a/R/personalis.R b/R/personalis.R index 6d9b5ed..079a218 100644 --- a/R/personalis.R +++ b/R/personalis.R @@ -351,7 +351,12 @@ read_personalis_variant_calling_summary_statistics <- function(sample_folder, mo } #' Read in (unfiltered) small variant data from VCF files from personalis folders -#' @param sample_list A vector of paths to personalis folders +#' @param sample_paths A vector of paths to personalis folders +#' @param sample_type Can be one or multiple of of 'tumor', 'normal', or 'somatic'. +#' 'tumor' refers to tumor sample vs. genome reference (i.e. somatic+germline mutations), +#' 'normal' refers to normal sample vs. genome reference (i.e. germline mutations) and +#' 'somatic' refers to tumor vs. normal (i.e. somatic mutations only). +#' @param modality modality from which the variants were called. Can be either 'DNA' or 'RNA' #' @return SummarizedExperiment #' @export read_personalis_vcf_files <- function(sample_paths, modality, sample_type) { diff --git a/R/util.R b/R/util.R index 1528b9e..e75b128 100644 --- a/R/util.R +++ b/R/util.R @@ -98,6 +98,7 @@ read_samples <- function(sample_paths, io_func, description, ...) { #' @param col_data {data.frame} data frame that is used as colData (must have rownames that are sample identifiers!) #' @param sample_col {character} column in `df` that contains the sample identifier #' @return {tibble} new data frame with dummy entries added +#' @importFrom tibble as_tibble #' @keywords internal add_dummy_entry <- function(df, col_data, sample_col = "sample") { missing_samples <- setdiff(rownames(col_data), unique(df[[sample_col]])) @@ -122,6 +123,7 @@ add_dummy_entry <- function(df, col_data, sample_col = "sample") { #' @importFrom dplyr mutate left_join #' @importFrom vcfR read.vcfR vcfR2tidy #' @importFrom stringr str_split_i +#' @importFrom tibble as_tibble parse_vcf_to_df <- function(path) { # parse VCF file vcf_content <- read.vcfR(path)