Description Usage Arguments Value Examples
View source: R/profileFixedFeatures.R
This function calculates metadata profiles across fixed-width features using a procedure similar to that used in (https://www.sciencedirect.com/science/article/pii/S1097276519303533?via
1 2 3 4 |
fixedRegions |
A named |
sampleObject |
A |
TxDb |
A |
bins |
An ordered integer vector (must be greater equal that the length of |
weightCol |
A single character string. This must be the name of an integer column in the |
ignoreStrand |
When set to 'TRUE', the strand information in |
dropEmpty |
When set to 'TRUE', the transcripts with no signal in any of their sub-regions will be discarded. When set to 'FALSE', all values of these regions will be set to 0. |
normType |
A character string indicating which region normalising method to use. One of 'density' (default), 'max', 'none': can be abbreviated. Depending on the chosen method the values of each region are normalised using the sum ('density'), the maximum ('max') of the values across the region, or not normalised at all ('none'). |
collapse |
When set to 'TRUE', the profiles are collapsed into a single profile. |
verbose |
When set to 'TRUE', the function prints diagnostic messages. |
A data.table
of the normalised binned coverage across the fixed features. Column names are determined by collapse
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library("TxDb.Dmelanogaster.UCSC.dm3.ensGene")
TxDb = TxDb.Dmelanogaster.UCSC.dm3.ensGene
query = genes(TxDb, filter=list(tx_chrom = "chr4"))
query = GRangesList(Promoter = promoters(query, upstream=500, downstream=1000))
library("pasillaBamSubset")
library("GenomicAlignments")
fl1 <- untreated1_chr4()
subject = readGAlignments(fl1)
profile = profileFixedFeatures(fixedRegions=query, sampleObject=subject, TxDb=TxDb)
library("ggplot2")
ggplot(profile, aes(x=bin, y=Mean)) +
geom_line() +
geom_vline(xintercept=50, linetype="dashed", colour="grey30") +
scale_x_continuous("Relative position",
breaks=c(1, 50.5, 150), label=c("-500", "TSS", "1000")) +
scale_y_continuous("Average normalised signal") +
coord_cartesian(xlim=c(0, 150)) +
theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.