readCtData() in HTqPCR with matrix of multiple samples
1
0
Entering edit mode
Andrew Yee ▴ 350
@andrew-yee-2667
Last seen 7.3 years ago
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. 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
HTqPCR HTqPCR • 1.5k views
ADD COMMENT
0
Entering edit mode
Heidi Dvinge ★ 2.0k
@heidi-dvinge-2195
Last seen 7.3 years ago
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 >
ADD COMMENT
0
Entering edit mode
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 >> > > >
ADD REPLY
0
Entering edit mode

I'm having the same issue, and the example with pseudo data does (same for my own data) not work for me:

# 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))))

> 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))))
Error in (function (storage.mode = c("lockedEnvironment", "environment",  :
  'AssayData' elements with invalid dimensions: 'featureNames' 'sampleNames''AssayData' elements with different rowNames

 

ADD REPLY
0
Entering edit mode

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)

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=en_US.UTF-8    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] parallel  stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
[1] HTqPCR_1.26.0        limma_3.28.21        RColorBrewer_1.1-2
[4] Biobase_2.32.0       BiocGenerics_0.18.0  BiocInstaller_1.22.3

loaded via a namespace (and not attached):
 [1] gtools_3.5.0          bitops_1.0-6          affy_1.50.0
 [4] stats4_3.3.0          KernSmooth_2.23-15    gplots_3.0.1
 [7] zlibbioc_1.18.0       gdata_2.17.0          affyio_1.42.0
[10] preprocessCore_1.34.0 tools_3.3.0           caTools_1.17.1

 

ADD REPLY
0
Entering edit mode

> head(temp)
       sample 1 sample 2 sample 3 sample 4 sample 5 sample 6 sample 7 sample 8
gene 1       30       33       37       35       33       25       23       33
gene 2       25       30       20       17       38       24       26       34
gene 3       17       34       12       35       31       19       20       20
       sample 9 sample 10 sample 11 sample 12 sample 13 sample 14 sample 15
gene 1       13        20        32        24        25        28        37
gene 2       21        37        34        26        23        17        32
gene 3       34        34        12        30        16        31        32
       sample 16 sample 17 sample 18 sample 19 sample 20 sample 21 sample 22
gene 1        22        12        18        34        26        25        39
gene 2        16        13        17        20        37        33        26
gene 3        23        27        36        27        40        16        18
       sample 23 sample 24 sample 25 sample 26 sample 27
gene 1        22        14        17        40        27
gene 2        32        29        29        26        26
gene 3        25        26        21        28        24

ADD REPLY
0
Entering edit mode

I also run into the exactly same problem!
Did you find a solution to that?

ADD REPLY
0
Entering edit mode

I'm also getting this issue. Not finding any answers resolving anywhere.

ADD REPLY

Login before adding your answer.

Traffic: 402 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6