spike_counts | R Documentation |
It dawned on me one day that we don't even have to bother reading the file if we have an index for a spiked BAM/CRAM result, since any fragments that map properly to the spike contigs are generated from synthetic templates. This function takes an index and a spike database (usually a DataFrame) as inputs and provides a rough coverage estimate over "rehabilitated" contig names (i.e., canonicalized contigs mapping to the database) as its output.
spike_counts( bam, spike, sep = "_", ref = "spike", verbose = FALSE, dump_idx = FALSE )
bam |
the BAM or CRAM file (MUST HAVE AN INDEX) |
spike |
a data.frame, DataFrame, or similar with spikes |
sep |
separator character in contig names ("_") |
ref |
reference name for spike genome ("spike") |
verbose |
be verbose? (FALSE) |
dump_idx |
dump the renamed idxstats to aggregate? (FALSE) |
The argument spike
has no default since we are attempting to refactor the
spike-in databases into their own data packages and allow more general use.
a GRanges of spike-in contig read counts
data(spike, package="spiky") sb <- system.file("extdata", "example.spike.bam", package="spiky", mustWork=TRUE) spike_counts(sb, spike=spike)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.