Entering edit mode
Steven McKinney
▴
310
@steven-mckinney-1754
Last seen 10.2 years ago
Hi Ian,
On 25 Jun 2007, at 11:58, Ian Roberts wrote:
>
>
> I've got snapCGH set up and running well - and drawing all the
> plots I need. However I am struggling to export a list of clones
> from the summarize.clones function. That is, a list of clones
> present in the segmented regions of the genome across all samples
> contained in the SegInfo object. I am sure a function was
> available in earlier snapCGH versions 'export clones' but doesn't
> seem to be there now?
>
> Thanks for your help.
>
>
>
> Ian
>
>
>
> __________________
> Ian Roberts PhD
> MRC Cancer Cell Unit
> Hutchison/MRC Research Centre
> Box 197
> Hills Road
> Cambridge. CB2 0XZ
> United Kingdom
>
> Tel +44 1223 763 279
>
> ir210 at hutchison-mrc.cam.ac.uk
> www.hutchison-mrc.cam.ac.uk
>
>
>
Using the latest version of snapCGH() installed with
biocLite(), I see that the current version of the
function summarize.clones() returns a data frame
of results.
(Note also that summarize.clones() is in the
package "aCGH" that snapCGH loads.)
The return clause of the function
is wrapped with "invisible()" so you won't
see the returned data frame if you invoke the
command in an interactive R session.
The help page for summarize.clones() shows
a basic example
data(colorectal)
summarize.clones(colorectal)
You can capture the resultant
data frame into a user variable, e.g.
foo <- summarize.clones(colorectal)
Object "foo" will be a data frame that
you can view, or export to an external
file using write.table() or write.csv().
Or you can just output the results of
summarize.clones() directly, e.g.
write.csv(summarize.clones(colorectal), file =
"colo.clone.summary.csv")
Hope this answers your question.
Steven McKinney
More details:
> sessionInfo()
R version 2.5.0 (2007-04-23)
powerpc-apple-darwin8.9.1
locale:
en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] "splines" "grid" "tools" "stats" "graphics"
"grDevices" "utils" "datasets" "methods" "base"
other attached packages:
snapCGH aCGH sma multtest cluster
GLAD aws DNAcopy tilingArray pixmap
"1.4.0" "1.10.0" "0.5.15" "1.14.0" "1.11.6"
"1.10.0" "1.3-2" "1.10.0" "1.14.0" "0.4-7"
geneplotter annotate genefilter survival vsn
strucchange sandwich zoo RColorBrewer affy
"1.14.0" "1.14.1" "1.14.1" "2.31" "2.2.0"
"1.3-2" "2.0-2" "1.3-1" "0.2-3" "1.14.0"
affyio Biobase limma glmmADMB lattice
DBI RODBC
"1.4.0" "1.14.0" "2.10.4" "0.3" "0.15-5"
"0.2-3" "1.2-1"
> summarize.clones(colorectal)
> foo <- summarize.clones(colorectal)
> class(foo)
[1] "data.frame"
> dim(foo)
[1] 2031 10
> foo[1:10, ]
Clone Target Chrom kb NumPresent.All NumGain.All
NumLost.All PropPresent.All PropGain.All PropLost.All
2 RP11-82D16 HumArray2H11_C9 1 2009 39 4
7 0.98 0.10 0.18
3 RP11-62M23 HumArray2H10_N30 1 3368 35 1
7 0.88 0.03 0.20
4 RP11-111O5 HumArray2H10_B18 1 4262 38 1
9 0.95 0.03 0.24
5 RP11-51B4 HumArray2H10_Q30 1 6069 35 0
10 0.88 0.00 0.29
6 RP11-60J11 HumArray2H10_T30 1 6817 36 1
7 0.90 0.03 0.19
7 RP11-813J5 HumArray2H10_B19 1 9498 30 0
8 0.75 0.00 0.27
8 RP11-199O1 HumArray2H10_W30 1 10284 39 1
5 0.98 0.03 0.13
9 RP11-188F7 HumArray2H9_C14 1 12042 36 1
4 0.90 0.03 0.11
10 RP11-178M15 HumArray2H9_F14 1 13349 35 1
4 0.88 0.03 0.11
11 RP11-219F4 HumArray2H9_I14 1 14391 39 1
7 0.98 0.03 0.18
> attributes(foo)
$names
[1] "Clone" "Target" "Chrom" "kb"
"NumPresent.All" "NumGain.All" "NumLost.All"
[8] "PropPresent.All" "PropGain.All" "PropLost.All"
$row.names
[1] "2" "3" "4" "5" "6" "7" "8"
"9" "10" "11" "12" "13" "14"
.....
> write.csv(summarize.clones(colorectal), file =
"colo.clone.summary.csv")
> summarize.clones
function (aCGH.obj, resT = NULL, pheno = rep(1, ncol(aCGH.obj)),
rsp.uniq = unique(pheno), thres = 0.25, factor = 2.5, all =
length(rsp.uniq) ==
1 && is.null(resT), titles = if (all) "all" else rsp.uniq)
{
if (!is.null(sd.samples(aCGH.obj)) && (factor > 0)) {
thres <- factor * (sd.samples(aCGH.obj)$madGenome)
}
data <- log2.ratios(aCGH.obj)
datainfo <- clones.info(aCGH.obj)
rsp.uniq <- sort(rsp.uniq)
colmatr <- if (length(rsp.uniq) > 1)
t(sapply(rsp.uniq, function(rsp.uniq.level) ifelse(pheno ==
rsp.uniq.level, 1, 0)))
else matrix(rep(1, length(pheno)), ncol = length(pheno),
nrow = 1)
data.thres <- threshold.func(data, posThres = thres)
bac.summary <- table.bac.func(dat = data.thres, colMatr = colmatr)
if (!is.null(resT)) {
res <- resT[order(resT$index), ]
bac.summary <- cbind(bac.summary, res$teststat, res$rawp,
res$adjp)
}
bac.summary <- as.data.frame(bac.summary)
nms <- c("NumPresent", "NumGain", "NumLost", "PropPresent",
"PropGain", "PropLost")
cnames <- colnames(bac.summary)
cnames[1:6] <- paste(nms, "All", sep = ".")
if (nrow(colmatr) > 1)
for (m in 1:length(rsp.uniq)) cnames[(6 * m + 1):(6 *
(m + 1))] <- paste(nms, titles[m], sep = ".")
if (!is.null(resT))
cnames[(ncol(bac.summary) - 2):ncol(bac.summary)] <- c("stat",
"rawp", "adjp")
colnames(bac.summary) <- cnames
bac.summary <- cbind(datainfo, bac.summary)
invisible(bac.summary)
}
Steven McKinney
Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre
email: smckinney at bccrc.ca
tel: 604-675-8000 x7561
BCCRC
Molecular Oncology
675 West 10th Ave, Floor 4
Vancouver B.C.
V5Z 1L3
Canada
-----Original Message-----
From: Natalie Thorne [mailto:npt22@cam.ac.uk]
Sent: Mon 6/25/2007 5:15 AM
To: ir210 at hutchison-mrc.cam.ac.uk
Cc: Mike Smith; J-C. Marioni; Steven McKinney
Subject: Re: snapCGH
Hi Ian,
I've no idea about this specific question as I'm not the maintainer
of snapCGH. Mike Smith would know about this since he wrote most of
the code - I don't know if he has finished his exams yet or not.
Steve McKinney might also be able to help. I've cc'd Mike and Steve
to see if they can answer your question. They will probably forward
the question and response to the Bioconductor mail list, since this
is the forum that is usually used for asking and answering any
questions about bioc packages (i.e. others may have similar questions
or find the answers and discussions useful). You'll probably find
emailing the bioc list the fastest way to get a (useful) response in
the future.
Natalie
On 25 Jun 2007, at 11:58, Ian Roberts wrote:
> Dear Nathalie,
>
>
>
> Hope you are well, and don't mind an email question about snapCGH -
> I asked John, but haven't heard back so assume he is off writing
> thesis.
>
>
>
> I've got snapCGH set up and running well - and drawing all the
> plots I need. However I am struggling to export a list of clones
> from the summarize.clones function. That is, a list of clones
> present in the segmented regions of the genome across all samples
> contained in the SegInfo object. I am sure a function was
> available in earlier snapCGH versions 'export clones' but doesn't
> seem to be there now?
>
> Thanks for your help.
>
>
>
> Ian
>
>
>
> __________________
> Ian Roberts PhD
> MRC Cancer Cell Unit
> Hutchison/MRC Research Centre
> Box 197
> Hills Road
> Cambridge. CB2 0XZ
> United Kingdom
>
> Tel +44 1223 763 279
>
> ir210 at hutchison-mrc.cam.ac.uk
> www.hutchison-mrc.cam.ac.uk
>
>
>