load_telescope_reports: Load counts from multiple Telescope reports

View source: R/load_telescope_reports.R

load_telescope_reportsR Documentation

Load counts from multiple Telescope reports

Description

This returns a dataframe where the rows are genes/loci and columns are samples. If files is a named vector, the names are used as sample names; otherwise sample names can be provided by colnames. If not provided, unique strings will be extracted from the report filenames.

Usage

load_telescope_reports(
  files,
  colnames = names(files),
  all_locs = NULL,
  count_column = "final_count"
)

Arguments

files

A character vector with paths to the reports.

colnames

Output column names. If files is a named vector, the names will be used as column names. Otherwise finds a unique string from the report filenames.

all_locs

A character vector with all genes/loci to be included in the output; typically this is a list of all loci in the annotation. If not provided, the loci will be the union of loci in all reports, in an arbitrary order.

count_column

The column in the Telescope report to use. Defaults is 'final_count'

Value

A dataframe where the rows are genes/loci and the columns are samples (when each report corresponds to one sample).

Examples

ddir <- system.file("extdata", package="scopetools")
t_files <- file.path(ddir, paste0(samples.encode$GEO_sample, '-telescope_report.tsv'))
names(t_files) <- samples.encode$Name

# Provide all_locs to include all annotated loci (preferred)
herv_counts <- load_telescope_reports(t_files, all_locs=HERVrmsk.hg38.v2$locus)

# Contstruct table with loci that appear in reports
## Not run: 
herv_counts <- load_telescope_reports(t_files)

## End(Not run)


nixonlab/scopetools documentation built on Sept. 30, 2022, 11:15 a.m.