Description Usage Arguments Value Examples
View source: R/profileStrandedRegions.R
This function calculates coverage profiles across genomic regions.
1 | profileStrandedRegions(query, subject, nbin = 100)
|
query |
A single stranded |
subject |
A |
nbin |
A single integer. It determines the number of bins in which each region will be divided. |
A data.table
of the normalised binned coverage across the genomic regions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library("TxDb.Dmelanogaster.UCSC.dm3.ensGene")
TxDb = TxDb.Dmelanogaster.UCSC.dm3.ensGene
query = keepSeqlevels(exonsBy(TxDb, by="tx", use.names=TRUE), "chr4", pruning.mode="coarse")
query = query[strand(query)=="+"]
query = query[sum(width(query))>0]
library("pasillaBamSubset")
library("GenomicAlignments")
fl1 <- untreated1_chr4()
subject = coverage(keepSeqlevels(readGAlignments(fl1), "chr4"))
profile = profileStrandedRegions(query, subject)
profile = profile[, list(value = mean(value)), by="bin"]
library("ggplot2")
ggplot(profile, aes(x=bin, y=value)) +
geom_line() +
scale_x_continuous("Position") +
scale_y_continuous("Average normalised coverage") +
theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.