By default, when you use a report-based DBA, all the samples are included even if they are not "in" the contrast as it doesn't really know which contrast it came from.
To select which samples to include, and in which order, use the list
option to specify samples to the initial call to dba.plotProfile()
.
For example, consider an example from the plotProfileDemo
workbook:
data(tamoxifen_analysis)
tamoxifen$config$RunParallel <- TRUE
# Add contrast #2 with a subset of samples
tamoxifen <- dba.contrast(tamoxifen,contrast=c("Tissue","ZR75","BT474"))
tamoxifen <- dba.analyze(tamoxifen)
# plot only the samples in contrast #2, merged into two groups
profiles <- dba.plotProfile(tamoxifen, sites=2)
dba.plotProfile(profiles)
# get report DB for contrast #2 and plot with all samples
repObj <- dba.report(tamoxifen, contrast=2, bDB=TRUE)
profiles <- dba.plotProfile(tamoxifen, sites=repObj)
dba.plotProfile(profiles)
# plot with only contrast samples and reverse order
profiles <- dba.plotProfile(tamoxifen, sites=repObj,
samples=list(BT474=1:2,ZR75=10:11))
dba.plotProfile(profiles)
# plot only samples not in contrast
repObj <- dba.report(tamoxifen, contrast=2,
bGain=TRUE, bLoss=TRUE, bAll=FALSE)
profiles <- dba.plotProfile(tamoxifen, sites=repObj,
samples=list(MCF7_RESPOND=3:5,
MCF7_RESIST=8:9,
T47D=6:7))
dba.plotProfile(profiles)
Thanks so much! It worked like a charm.