Entering edit mode
Heidi Dvinge
★
2.0k
@heidi-dvinge-2195
Last seen 10.2 years ago
Hello Deepak,
On 1 Jun 2010, at 16:21, deepak roshan wrote:
> Dear Sir,
>
>
> Thank you for helps.Again iam facing some problems in raedCtData
> step. i changed exFiles$File[c(1:30) it reads 30 sample but when i
> change to exFiles$File[c(1:99) then it is showing error. could you
> tell me how to read 99 sample or what is the maximum number of
sample
> we can analysis.
As I've mentioned before, there's no inherent limit to how many files
can be read in. In your example below you get an error somewhere
between file number 30 and 99, indicating that there's some input
that readCtData() doesn't expect. It could either be a bug in
readCtData, or some issue with one of your files.
To narrow down a bit where the problem is, why don't you try:
for (i in 1:99) {
print(i)
test <- readCtData(files=exFiles$File[i], path=exPath,
n.features =
48, flag = 4, feature = 6, type = 7, position = 3, Ct = 8, header =
FALSE, SDS = FALSE, n.data = 1, na.value = 40)
}
Also, in general using traceback() after an error can help you (/us)
narrow down where the error occurred, in case it's in a sub-function.
> Second question is how to give feature class like in example it is
> given featureClass(raw) <- factor(c("Marker", "TF", "Kinase") in my
> case it is cyclins and cyclin inhibitors where to change that.
>
You can change the featureClass information anywhere along the way,
such as right after you read in the data. If you have 48 features for
each plate, and for example the first 10 are cyclins and the last 38
cyclin inhibitors, you can say:
featureClass(raw) <- factor(rep(c("Cyclin", "Cyclin_Inhibitor"),
times=c(10,38)))
HTH
\Heidi
> Details of the session is given below
>
> Deepak
>
>
> > data(qPCRraw)
> > data(qPCRpros)
> > class(qPCRraw)
>
> [1] "qPCRset"
> attr(,"package")
> [1] ".GlobalEnv"
>
> > path <- "F:/HTqPCR/TLDA_modi"
> > exPath <- "F:/HTqPCR/TLDA_modi"
> > exFiles <- read.delim(file.path(exPath, "files.txt"))
> > raw <- readCtData(files=exFiles$File[c(1:30)], path=exPath,
> n.features = 48, flag = 4, feature = 6, type = 7, position = 3, Ct
> = 8, header = FALSE, SDS = FALSE, n.data = 1, na.value = 40)
> > raw
>
> An object of class "qPCRset"
> Size: 48 features, 30 samples
> Feature types: Endogenous Control, Target
> Feature names: CCNF-Hs00171049_m1 RBL2-Hs00180562_m1 CCND1-
> Hs00277039_m1 ...
> Feature classes:
> Feature categories: OK, Undetermined
> Sample names: Sample4 Sample67 Sample80 ...
> > raw <- readCtData(files=exFiles$File[c(1:99)], path=exPath,
> n.features = 48, flag = 4, feature = 6, type = 7, position = 3, Ct
> = 8, header = FALSE, SDS = FALSE, n.data = 1, na.value = 40)
>
> Error in out@exprs[, cols] <- apply(data, 2, function(x) as.numeric
> (as.character(x))) :
> number of items to replace is not a multiple of replacement length
> > sessionInfo()
> R version 2.11.0 (2010-04-22)
> x86_64-pc-mingw32
>
> locale:
> [1] LC_COLLATE=English_India.1252 LC_CTYPE=English_India.1252
> LC_MONETARY=English_India.1252 LC_NUMERIC=C
> LC_TIME=English_India.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] HTqPCR_1.2.0 limma_3.4.1 RColorBrewer_1.0-2
> Biobase_2.8.0
>
> loaded via a namespace (and not attached):
> [1] affy_1.26.1 affyio_1.16.0
> gdata_2.8.0 gplots_2.7.4 gtools_2.6.2
> preprocessCore_1.10.0 tools_2.11.0
> >
>
>
> On Mon, May 31, 2010 at 6:46 PM, Heidi Dvinge <heidi@ebi.ac.uk>
wrote:
>>
>> Dear sir,
>>
>> thank you for your all help. iam facing some problems in
>> raedCtData step. i have 99 sample but it is deading only 6
>> samples.how the sample numbers can be incereased to 99. details of
>> the session is given below
>>
>> deepak
>>
>> > n.samples <- 99
>> > readCtData(files = files$File, path = path, n.features = 48,
>> flag = 4, feature = 6, type = 7, position = 3, Ct = 8, header =
>> FALSE, SDS = FALSE, n.data = 1, samples, na.value = 40)
>> An object of class "qPCRset"
>> Size: 48 features, 6 samples
>> Feature types: Endogenous Control, Target
>> Feature names: CCNF-Hs00171049_m1 RBL2-Hs00180562_m1
>> CCND1-Hs00277039_m1 ...
>> Feature classes:
>> Feature categories: OK
>> Sample names: Sample1 Sample2 Sample3 ...
>> Warning message:
>> In readCtData(files = files$File, path = path, n.features = 48, :
>> Not enough sample names provided; using Sample1, Sample2, ...
>> instead
>>
>
> Hello Deepak,
>
> there is nothing in readCtData specifying that only 6 samples can
> be read. Defining a variable n.samples isn't going to change that,
> since you don't actually use this variable anywhere. What matters
> here is if your length(files$File) is 99. What does just:
>
> > files$File
>
> say?
>
> In the example data there are only 6 files, but if I read some of
> them multiple times, I can say:
>
> > exPath <- system.file("exData", package="HTqPCR")
> > exFiles <- read.delim(file.path(exPath, "files.txt"))
> > raw <- readCtData(files=exFiles$File[c(1:6,2:5,1:6)], path=exPath)
> > raw
> An object of class "qPCRset"
> Size: 384 features, 16 samples
> Feature types: Endogenous Control, Target
> Feature names: Gene1 Gene2 Gene3 ...
> Feature classes:
> Feature categories: OK, Undetermined
> Sample names: sample1 sample2 sample3 ...
>
> However, note that you do get a warning message about sample
> names. In your readCtData command, you include "samples". This is
> meant to be a character vector of sample names, if you don't want
> to use file names as sample names. Have you actually defined a
> variable called "samples" anywhere?? If you have your sample names
> in e.g. a vector called my.samplenames, then you need to run
> readCtData with:
>
> readCtData(files = files$File, path = path, n.features = 48, flag =
> 4, feature = 6, type = 7, position = 3, Ct = 8, header = FALSE, SDS
> = FALSE, n.data = 1, samples=my.samplenames, na.value = 40)
>
> If not, then skip the "samples" parameter altogether and say:
>
> readCtData(files = files$File, path = path, n.features = 48, flag =
> 4, feature = 6, type = 7, position = 3, Ct = 8, header = FALSE, SDS
> = FALSE, n.data = 1, na.value = 40)
>
> Does that change anything?
> \Heidi
>
>
>
>> > head(read.delim(file.path(path, "files.txt")))
>> File Treatment
>> 1 Sample4.txt Tumor
>> 2 Sample67.txt Tumor
>> 3 Sample80.txt Tumor
>> 4 Sample44.txt Tumor
>> 5 Sample76.txt Tumor
>> 6 Sample94.txt Normal
>> > tail(read.delim(file.path(path, "files.txt")))
>> File Treatment
>> 94 Sample37.txt Tumor
>> 95 Sample32.txt Tumor
>> 96 Sample33.txt Tumor
>> 97 Sample34.txt Tumor
>> 98 Sample25.txt Tumor
>> 99 Sample26.txt Normal
>>
>> > sessionInfo()
>> R version 2.11.0 (2010-04-22)
>> i386-pc-mingw32
>> locale:
>> [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
>> States.1252 LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C LC_TIME=English_United
>> States.1252
>> attached base packages:
>> [1] stats graphics grDevices utils datasets methods
base
>> other attached packages:
>> [1] HTqPCR_1.2.0 limma_3.4.0 RColorBrewer_1.0-2
>> Biobase_2.8.0
>> loaded via a namespace (and not attached):
>> [1] affy_1.26.1 affyio_1.16.0
>> gdata_2.8.0 gplots_2.7.4 gtools_2.6.2
>> preprocessCore_1.10.0
>> [7] tools_2.11.0
>>
>>
>
>
>
>
> --
> Deepak Roshan V G
> Laboratory Of Cell Cycle Regulation & Molecular Oncology
> Division of Cancer Research
> Regional Cancer Centre
> Thiruvananthapuram
> Kerala, India 695 011
[[alternative HTML version deleted]]