read_sample_files: Read and combine common output files

View source: R/read_sample_files.R

read_sample_filesR Documentation

Read and combine common output files

Description

Read output files and parse the file name to add sample IDs in the first column

Usage

read_sample_files(path = ".", pattern = "\\.counts$", delim = "\t", ...)

Arguments

path

the path to output files, the default corresponds to the working directory.

pattern

regular expression for file name matching

delim

separator in output files, default table

...

additional options such as col_names passed to read_delim.

Value

A list with coverage and stats data.frames

Note

Sample names are parsed from file names without extensions. If the file name is not unique, the parent directory is used. Requires tibble > version 1.2 to avoid error in add_column

Author(s)

Chris Stubben

Examples

## Not run: 
   #FeatureCounts summary (second column name with *.bam is always unique, so skip and assign)
   fc <- read_sample_files(".summary$", skip=1, col_names=c("status", "count"))
 filter(fc, count!=0) %>%
   hchart("bar", x=sample, y=count, group=status) %>%
    hc_plotOptions(bar = list(stacking = "normal"))

## End(Not run)

HuntsmanCancerInstitute/hciR documentation built on Aug. 20, 2024, 12:22 a.m.