[BioC] readCtData() in HTqPCR with matrix of multiple samples

Andrew Yee yee at post.harvard.edu
Tue Mar 22 02:24:01 CET 2011


Thanks, that works!

On Sun, Mar 20, 2011 at 3:21 PM, Heidi Dvinge <heidi at ebi.ac.uk> wrote:
> Hi Andrew,
>
>> Hi I was wondering if you can read a tab delimited file of micro array
>> data using readCtData() in HTqPCR as follows:
>>
>> Detector   SampleA   SampleB etc.
>> Gene1      20             23
>> Gene 2     32             25
>> etc.
>>
> if multiple samples are present within a file, then readCtData expects
> them to be arranged sequentially rather than side by side, since this is
> the default output from the SDS analysis software.
>
> However, if you simply have your data in a tabular format, you can create
> your qPCRset object manually like this:
>
> # Reading in all values
> temp    <- read.delim('PCM_cardA-all-raw.txt')
>
> # Making pesudo-data, just to illustrate the example
> temp    <- matrix(sample(12:40, size=27*381, replace=TRUE), ncol=27)
> rownames(temp)  <- paste("gene", 1:381)
> colnames(temp)  <- paste("sample", 1:27)
>
> # Make qPCRset object
> q.raw   <- new("qPCRset",
>        exprs=temp,
>        featureNames=rownames(temp),
>        sampleNames=colnames(temp),
>        flag=as.data.frame(array("Passed", dim=dim(temp))),
>        featureCategory=as.data.frame(array("OK", dim=dim(temp))))
>
> If this doesn't work with your data for some reason, then please let me know.
>
> HTH
> \Heidi
>
>> I've tried
>>
>> foo <- readCtData('file.txt', header=T,  n.features=381,
>> samples=samples, n.data=27)
>> # in this case there are 381 rows of Detectors and 27 samples
>>
>> But get the following error message:
>>
>>> foo <- readCtData('PCM_cardA-all-raw.txt', header=T,  n.features=381,
>>> samples=samples, n.data=27)
>> Error in `[<-.data.frame`(`*tmp*`, undeter, value = "Undetermined") :
>>   only logical matrix subscripts are allowed in replacement
>> In addition: Warning messages:
>> 1: In readCtData("PCM_cardA-all-raw.txt", header = T, n.features = 381,  :
>>   381 gene names (rows) expected, got 381
>> 2: In matrix(sample[, Ct], ncol = n.data[i]) :
>>   data length [381] is not a sub-multiple or multiple of the number of
>> rows [15]
>>
>> Thanks,
>> Andrew
>>
>>
>>> sessionInfo()
>> R version 2.12.2 (2011-02-25)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>>  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] HTqPCR_1.5.4       limma_3.6.9        RColorBrewer_1.0-2
>> Biobase_2.10.0
>>
>> loaded via a namespace (and not attached):
>> [1] affy_1.28.0           affyio_1.18.0         gdata_2.8.1
>> [4] gplots_2.8.0          gtools_2.6.2          preprocessCore_1.12.0
>> [7] tools_2.12.2
>>
>
>
>



More information about the Bioconductor mailing list