get_coverage
returns the mean coverage of the BigWig files passed in.
Internally, this operates through derfinder::loadCoverage
.
get_coverage(
bw_paths,
auc_raw,
auc_target,
chrs = "",
genome = "hg38",
bw_chr = "chr"
)
bw_paths | path(s) to bigwig file(s) with the RNA-seq data that you want the #' coverage of. |
---|---|
auc_raw | vector containing AUCs(Area Under Coverage) matching the order of bigwig path(s). |
auc_target | total AUC to normalise all samples to e.g. 40e6 * 100 would be the estimated total auc for sample sequenced to 40 million reads of 100bp in length. |
chrs | chromosomes to obtain mean coverage for, default is "" giving every chromosome. Can take UCSC format(chrs = "chr1") or just the chromosome i.e. chrs = c(1,X) |
genome | the UCSC genome you want to use, the default is hg38. |
bw_chr | specifies whether the bigwig files has the chromosomes labelled with a "chr" preceding the chromosome i.e. "chr1" vs "1". Can be either "chr" or "nochr" with "chr" being the default. |
a list of Rles detailing the mean coverage per chromosome passed in.
rec_url <- recount::download_study(
project = "SRP012682",
type = "samples",
download = FALSE
)
bw_path <- file_cache(rec_url[1])
# As of rtracklayer 1.25.16, BigWig is not supported on Windows.
if (!xfun::is_windows()) {
eg_coverage <- get_coverage(
bw_paths = bw_path,
auc_raw = 11872688252,
auc_target = 40e6 * 100,
chrs = c("chr21", "chr22")
)
eg_coverage
}
#> 2021-10-08 16:10:20 - Obtaining mean coverage across 1 samples
#> 2021-10-08 16:10:20 - chr21
#> 2021-10-08 16:10:21 - chr22
#> $chr21
#> $chr21$meanCoverage
#> numeric-Rle of length 46709983 with 351770 runs
#> Lengths: 5010597 76 112 74 ... 2074 36 10111
#> Values : 0.000000 0.336908 0.000000 0.336908 ... 0.000000 0.336908 0.000000
#>
#>
#> $chr22
#> $chr22$meanCoverage
#> numeric-Rle of length 50818468 with 619684 runs
#> Lengths: 10519675 2 1 2 ... 160 76 13858
#> Values : 0.000000 0.336908 0.673815 6.401246 ... 0.000000 0.336908 0.000000
#>
#>