Description Usage Arguments Details Value Examples
View source: R/bam_to_bigwig.R
Given an input BAM file, convert this to the BigWig format which can then be
used in get_coverage()
.
1 2 3 4 5 6 7 |
bam_file |
A |
prefix |
A |
min_unique_qual |
A |
double_count |
A |
overwrite |
A |
Note that this functionality is currently not supported on Windows by Megadepth.
A character()
with the path to the output files(s).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Install the latest version if necessary
install_megadepth(force = TRUE)
## Find the example BAM file
example_bam <- system.file("tests", "test.bam",
package = "megadepth", mustWork = TRUE
)
## Create the BigWig file
## Currently Megadepth does not support this on Windows
if (!xfun::is_windows()) {
example_bw <- bam_to_bigwig(example_bam, overwrite = TRUE)
## Path to the output file(s) generated by bam_to_bigwig()
example_bw
## Use the all.bw file in get_coverage(), first find an annotation file
annotation_file <- system.file("tests", "testbw2.bed",
package = "megadepth", mustWork = TRUE
)
## Compute the coverage
bw_cov <- get_coverage(
example_bw["all.bw"],
op = "mean",
annotation = annotation_file
)
bw_cov
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.