loadTSSobj-methods: *loadTSSobj*

Description Usage Arguments Value Note Examples

Description

loadTSSobj processes alignment files in .bam or .bed formats from the local directory supplied.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
loadTSSobj(experimentTitle, inputDir, ...)

## S4 method for signature 'character,character'
loadTSSobj(
  experimentTitle,
  inputDir,
  n.cores = 1,
  isPairedBAM = TRUE,
  isPairedBED = TRUE,
  sampleSheet = NA,
  sampleNames = NA,
  replicateIDs = NA
)

Arguments

experimentTitle

a descriptive title for the experiment (character).

inputDir

path to the directory containing the alignment files (in either .bam or .bed formats) (character). Note that all the paths to all files in inputDir with the extension .bam or .bed will be imported with this function.

n.cores

the number of cores to be used for this job. (numeric)

isPairedBAM

if the input is in BAM format, specifies whether the TSS profiling experiment is paired-end (if TRUE) or single-end (if FALSE). Set to TRUE by default. (logical)

isPairedBED

if the input is in BED format, specifies whether the TSS profiling experiment is paired-end (if TRUE) or single-end (if FALSE). Set to TRUE by default. (logical) Note: if TRUE, the input data must be in bedpe format, as described here: http://bedtools.readthedocs.io/en/latest/content/general-usage.html

sampleSheet

file providing TSS sample information; if provided, sampleNames and replicateIDs are ignored; input format is tab-delimited 3-column rows with sample name, replicate ID, and sample data file name; the file has to include column headers "SAMPLE ReplicateID FILE" and can be either tab-delimited or an Excel spreadsheet (file extension ".xls" or "xlsx" (character)

sampleNames

unique labels of class character for each TSS sample within the experiment (character).

replicateIDs

identifiers indicating which samples are biological replicates. Note that loadTSSobj imports alignment data in ascending alphanumeric order, so the arguments to replicateIDs must be arranged in this order also so that they directly correspond to the intended file. Thus replicateIDs must be ordinal values in consecutive order without gaps (e.g. 1, 2, 3, ...) (numeric).

Value

loadTSSobj fills the slot bamDataFirstRead and/or bedData on the returned tssObject with GAlignments objects (for .bam files), or GRanges objects (for .bed files).

Note

An example similar to the one provided can be found in the vignette (/inst/doc/TSRchitect.Rmd).

All files found in inputDir will be retrieved and written in ascending alphanumeric order to the @fileNamesBAM and/or @fileNamesBED slot(s) on the tssObject that is created.

Examples

1
2
3
4
extdata.dir <- system.file("extdata/bamFiles", package="TSRchitect")
test.Obj <- loadTSSobj(experimentTitle="Code example", inputDir=extdata.dir,
n.cores=2, isPairedBAM=TRUE, sampleNames=c("sample1-rep1", "sample1-rep2",
"sample2-rep1","sample2-rep2"), replicateIDs=c(1,1,2,2))

BrendelGroup/TSRchitect documentation built on March 3, 2021, 1:45 a.m.