Possible bug in setCategory function from HTqPCR package
1
0
Entering edit mode
@matthew-mccall-4459
Last seen 5.5 years ago
United States

These 2 lines from the setCategory function are suppose to set flagged values to "Unreliable":

> flags <- flag(q)

> featureCategory(out)[flags %in% flag.out] <- "Unreliable"

but the first line returns a data.frame object, so the logic statement does not work as desired:

> flags %in% flag.out

[1] FALSE FALSE FALSE FALSE FALSE FALSE

If you replace %in% with ==, I believe the function works as planned, but this would only allow one value of flag.out.

I've copied the full R script and sessionInfo below.

Thank you,

Matthew McCall

 

> library(HTqPCR)

>  data(qPCRraw)
> head(featureCategory(qPCRraw))
      sample1 sample2      sample3 sample4 sample5      sample6
Gene1      OK      OK           OK      OK      OK           OK
Gene2      OK      OK           OK      OK      OK           OK
Gene3      OK      OK           OK      OK      OK           OK
Gene4      OK      OK           OK      OK      OK           OK
Gene5      OK      OK           OK      OK      OK           OK
Gene6      OK      OK Undetermined      OK      OK Undetermined
> head(flag(qPCRraw))
      sample1 sample2 sample3 sample4 sample5 sample6
Gene1  Passed  Passed  Passed Flagged  Passed  Passed
Gene2  Passed  Passed  Passed Flagged  Passed  Passed
Gene3  Passed  Passed  Passed  Passed  Passed  Passed
Gene4  Passed  Passed  Passed  Passed  Passed  Passed
Gene5  Passed  Passed  Passed  Passed  Passed  Passed
Gene6 Flagged Flagged Flagged Flagged Flagged Flagged
> tst <- setCategory(qPCRraw, flag=TRUE, flag.out = "Flagged", groups=NULL)
Categories after Ct.max and Ct.min filtering:
             sample1 sample2 sample3 sample4 sample5 sample6
OK               313     264     327     295     296     286
Undetermined      68     119      56      86      86      96
Unreliable         3       1       1       3       2       2
> head(featureCategory(tst))
      sample1      sample2      sample3      sample4      sample5      sample6
Gene1      OK           OK           OK           OK           OK           OK
Gene2      OK           OK           OK           OK           OK           OK
Gene3      OK           OK           OK           OK           OK           OK
Gene4      OK           OK           OK           OK           OK           OK
Gene5      OK           OK           OK           OK           OK           OK
Gene6      OK Undetermined Undetermined Undetermined Undetermined Undetermined

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: i686-pc-linux-gnu (32-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=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.20.0       limma_3.22.1        RColorBrewer_1.0-5 
[4] Biobase_2.26.0      BiocGenerics_0.12.1

loaded via a namespace (and not attached):
 [1] affy_1.44.0           affyio_1.34.0         BiocInstaller_1.16.1 
 [4] bitops_1.0-6          caTools_1.17.1        compiler_3.1.2       
 [7] gdata_2.13.3          gplots_2.15.0         gtools_3.4.1         
[10] KernSmooth_2.23-13    preprocessCore_1.28.0 stats4_3.1.2         
[13] tools_3.1.2           zlibbioc_1.12.0      
htqpcr HTqPCR • 1.5k views
ADD COMMENT
0
Entering edit mode
h.roest • 0
@hroest-11230
Last seen 7.0 years ago

Dear Matt,

No answer, just the observation that the setCategory feature is not functioning properly. Tried to get in contact wit the package maintenance but no response yet. I (believe I) followed your R script to the letter which is supposed to be the solution to this problem. However, the Unreliable category doesn't show up in the setCtCategory. I created an qPCRset object reading in Ct values from manually edited .txt files. Ct values are numeric between 15 and 35 (flag=Passed), Undetermined (flag=Flagged) or NA (flag=Failed). Reading results for Undetermined and NA is set to 40. If I want to set the category of the features that are NA to "unreliable" I used the following command line:

>raw
An object of class "qPCRset"
Size:  384 features, 8 samples
Feature types:		  
Feature names:		 MammU6 MammU6 MammU6 ...
Feature classes:		  
Feature categories:	 OK, Undetermined 
Sample names:			 NTx1 NTx2 NTx3 ...
>cat.set <- setCategory(raw, Ct.max = 35, Ct.min=10, groups=NULL, replicates = FALSE, flag = TRUE, flag.out = "Failed", verbose = TRUE)
Categories after Ct.max and Ct.min filtering:
             NTx1 NTx2 NTx3 NTx4 NTx5 NTx6 NTx7 NTx8
OK            217  221  173  175  232  207  202  209
Undetermined  167  163  211  209  152  177  182  175
> cat.set
An object of class "qPCRset"
Size:  384 features, 8 samples
Feature types:		  
Feature names:		 MammU6 MammU6 MammU6 ...
Feature classes:		  
Feature categories:	 OK, Undetermined 
Sample names:			 NTx1 NTx2 NTx3 ...

Still no Unreliable category. Any idea where I go wrong? Hopelfully you can help me.

Henk

 

 

ADD COMMENT

Login before adding your answer.

Traffic: 545 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