findSimilarLibraries: findSimilarLibraries - function to identify libraries that...

Description Usage Arguments Value Examples

Description

findSimilarLibraries – function to identify libraries that hare similar WC patterns on chromosomes

Usage

1
2
3
4
  ## S4 method for signature 'StrandStateMatrix,StrandReadMatrix,ChrTable'
findSimilarLibraries(strandStateMatrix,
  strandReadMatrix, chrGrange, chrNum, cluster = 1, clusterParam = NULL,
  verbose = TRUE)

Arguments

strandStateMatrix

A strandStateMatrix object for all libraries across split fragments, derived from preprocessStrandTable

strandReadMatrix

The number of reads present for each strandStateMatrix element. An object of type strandReadMatrix from strandSeqFreqTable

chrGrange

File of type ChrTable (a GRanges object with a meta column titled 'name' determining contig name) to split chromosomes based on locations. name meta should match the rownames of strandStateMatrix and strandReadMatrix

chrNum

The chromosome number to analyse

cluster

Number of times to recluster and take the consensus of. If NULL, clustering is run only once

clusterParam

optional BiocParallelParam specifying cluster to use for parallel execution. When NULL, execution will be serial.

verbose

prints messages to the terminal (default is TRUE)

Value

a list of type LinkageGroupList with two elements; libraries that are mostly Watson, and those that are mostly Crick

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#Get a list of BAM files containing libraries for cells from the same organism, aligned to the same genome
#In this case these are the example BAM files provided with the package (hence the call to system.file);
data("exampleDividedChr")
data("exampleWCMatrix")
data("exampleReadCounts")

library(BiocParallel)

example.dir <- file.path(system.file(package='contiBAIT'), 'extdata')

chrGrange <- exampleDividedChr[which(exampleDividedChr$name %in% rownames(exampleWCMatrix))]

exampleLibList <- lapply(seq_len(length(unique(seqnames(chrGrange)))), function(x) findSimilarLibraries(exampleWCMatrix, exampleReadCounts, chrGrange, x, cluster=1, clusterParam=MulticoreParam()))
exampleLibList <- exampleLibList[!sapply(exampleLibList, is.null)]
exampleLibList <- LibraryGroupList(exampleLibList)

show(exampleLibList)

contiBAIT documentation built on Nov. 8, 2020, 5:49 p.m.