Description Usage Arguments Value Examples
View source: R/getAvgProfileWithCI.R
Compute the average profile and its confidence interval for a selection of features
1 2 3 4 5 6 7 | getAvgProfileWithCI(
FeatureProfiles,
selFeatures = NULL,
pos = NULL,
conf = 0.95,
type = c("mean", "freq", "avgnorm", "sum", "n")
)
|
FeatureProfiles |
Matrix (features in row, position in columns) or RleList with coverage profiles for a set of features |
selFeatures |
Character or integer vector defining a selection of features from |
pos |
(Optional) Integer vector with values defining the genomic positions represented in |
conf |
Numeric in ]0,1] representing the confidence level used to compute the confidence interval |
type |
Character string indicating the method used to aggregate values from all the
|
a data frame with 4 columns:
Position
: pos values
Profile
: values obtained by aggregating as defined by type
on all selFeatures
Upper
: Upper bound of the confidence interval of Profile
Lower
: Lower bound of the confidence interval of Profile
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 | ## Extract the profiles around (+/-50bp) the first 200 genes. We bin the genes in 3 bins only.
top200Prof <- annotationCoverageAroundFeatures(Genegr,
features=1:200,
sidedist = 50,
usePercent = TRUE,
nbins=3)
## Assemble the metagene profiles
Prof <- assembleProfiles(top200Prof)
## Select a set of 50 random genes within the top200
set.seed(123)
randGenes <- sample(names(Genegr)[1:200], 50)
##Get the average profile for these genes
avgProf_sense <- getAvgProfileWithCI(Prof$Profiles_Sense,
selFeatures = randGenes,
pos = c(-50:0, 1:3, 0:50))
head(avgProf_sense)
## A quick look at the profile:
plot(1:105, avgProf_sense$Profile,
type="l", axes = FALSE,
xlab="Position", ylab="Percent")
lines(1:105, avgProf_sense$Upper, lty=2, col="grey")
lines(1:105, avgProf_sense$Lower, lty=2, col="grey")
axis(side=2)
axis(side=1, at=c(1,51,55,105),
labels=c("-50bp", "TSS", "TES", "+50bp"),
las=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.