# loading library and example data
library(h5vc)
tallyFile <- system.file( "extdata", "example.tally.hfs5", package = "h5vcData" )
sampleData <- getSampleData( tallyFile, "/ExampleStudy/16" )
position <- 29979628
windowsize <- 30
samples <- sampleData$Sample[sampleData$Patient == "Patient8"]
data <- h5readBlock(
filename = tallyFile,
group = "/ExampleStudy/16",
names = c("Coverages", "Counts", "Deletions", "Reference"),
range = c(position - windowsize, position + windowsize)
)
#Plotting with position and windowsize
p <- mismatchPlot(
data = data,
sampledata = sampleData,
samples = samples,
windowsize = windowsize,
position = position
)
print(p)
#plotting with range and modified tickSpacing and refHeight
p <- mismatchPlot(
data = data,
sampledata = sampleData,
samples = samples,
range = c(position - windowsize, position + windowsize),
tickSpacing = c(20, 5),
refHeight = 5
)
print(p)
#plotting without specfiying range or position
p <- mismatchPlot(
data = data,
sampledata = sampleData,
samples = samples
)
print(p)
#Plotting multiple regions (with small overlaps)
library(IRanges)
dataList <- h5dapply(
filename = tallyFile,
group = "/ExampleStudy/16",
names = c("Coverages", "Counts", "Deletions", "Reference"),
range = IRanges(start = seq( position - windowsize, position + windowsize, 20), width = 30 )
)
p <- mismatchPlot(
data = dataList,
sampledata = sampleData,
samples = samples
)
print(p)
Run the code above in your browser using DataLab