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