scan_spike_counts: run spike_counts on BAM/CRAM files and shape the results for...

View source: R/scan_spike_counts.R

scan_spike_countsR Documentation

run spike_counts on BAM/CRAM files and shape the results for model_glm_pmol

Description

Typically one will want to fit a correction model to multiple samples. This function eases this task by merging the output of spike_counts into a data.frame that model_glm_pmol can directly fit.

Usage

scan_spike_counts(files, spike, methylated = 1, sep = "_")

Arguments

files

a vector of BAM/CRAM file names

spike

a spike-in database

methylated

a logical (0/1) to include only methylated fragments

sep

the separator for spike-in contig names ("_")

Value

   a data.frame with columns "frag_grp", "id", and "read_count"

Examples

data(spike)
library(GenomicRanges)
sb <- system.file("extdata", "example.spike.bam", package="spiky",
                  mustWork=TRUE)
scan_spike_counts(sb, spike=spike)
fit <- model_glm_pmol(scan_spike_counts(sb, spike=spike),spike=spike)


trichelab/spiky documentation built on Sept. 17, 2022, 8:44 a.m.