| Type: | Package |
| Title: | Implementation of Marker-Assisted Mini-Pooling with Algorithm |
| Version: | 1.2.0 |
| Author: | "Tao Liu, PhD <tliu@stat.brown.edu> [aut, cre]" "Yizhen Xu, ScM <yizhen_xu@brown.edu> [aut]" |
| Maintainer: | "Tao Liu, PhD" <tliu@stat.brown.edu> |
| Description: | To determine the number of quantitative assays needed for a sample of data using pooled testing methods, which include mini-pooling (MP), MP with algorithm (MPA), and marker-assisted MPA (mMPA). To estimate the number of assays needed, the package also provides a tool to conduct Monte Carlo (MC) to simulate different orders in which the sample would be collected to form pools. Using MC avoids the dependence of the estimated number of assays on any specific ordering of the samples to form pools. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 6.1.0.9000 |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2018-10-12 00:34:20 UTC; tliu |
| Repository: | CRAN |
| Date/Publication: | 2018-10-12 10:50:02 UTC |
Number of Assays Needed using Mini-Pooling
Description
Functionminipool(...) calculates the number of assays required, whenusing mini-pooling, forpools that are formed following the order that individual samples appear in the data.
Usage
minipool(v, K = 5, vf_cut = 1000, lod = 0, msg = T)Arguments
v | A vector of non-negative numerical assay results. |
K | Pool size; default is |
vf_cut | Cutoff value for defining positive cases;default is |
lod | A vector of lower limits of detection or a scalar if the limits are thesame; default is |
msg | Message generated during calculation; default is |
Details
Suppose that N samples are collected for pooled testing. The firstK samples are combined toform a pool, the nextK samples are combined to form the secondpool, and so on. If the number of samples for the last pool is less thanK, these remaining samples are not used to form a pool (i.e.not included in the calculation). Therefore, a total ofN%/%K pools are formed. The function calculates the number ofassays needed for each of these pools. For mini-pooling, if a pool isnegative, no further tests are needed and all samples in the poolare concluded as being negative; so the total number ofassays required is one. Otherwise if the pool is tested positive, allindividual samples in the pool are tested and the total number of assaysrequired is(K + 1).
Value
A vectorof lengthN%/%K for the numbers of assays needed for all poolsthat are formed.
References
Dorfman R. The detection of defective members of large populations. TheAnnals of Mathematical Statistics. 1943;14(4):436-440.
Liu T, Hogan JW, Daniels, MJ, Coetzer M, Xu Y, Bove G, et al. Improved HIV-1 Viral LoadMonitoring Capacity Using Pooled Testing with Marker-Assisted Deconvolution. Journal ofAIDS. 2017;75(5): 580-587.
See Also
Examples
K=5; n = 50;n.pool = n/K; n.pool# [1] 10set.seed(100)pvl = rgamma(n, shape = 2.8, scale = 150)minipool(pvl)# A total of 10 pools are formed.# The numbers of assays required by these pools are:# [1] 6 6 6 6 6 6 6 6 6 6Number of Assays Required using Marker-Assisted Mini-Pooling with Algorithm(mMPA)
Description
Functionmmpa(...) calculates the number of assays required, whenusing mMPA, forpools that are formed following the order of individual samples in the data.
Usage
mmpa(v, s, K = 5, vf_cut = 1000, lod = 0, msg = T)Arguments
v | A vector of non-negative numerical assay results. |
s | A vector of risk scores; |
K | Pool size; default is |
vf_cut | Cutoff value for defining positive cases;default is |
lod | A vector of lower limits of detection or a scalar if the limits are thesame; default is |
msg | Message generated during calculation; default is |
Details
For a given sample (v_i, s_i), i = 1, ..., N, the firstK samples are combined toform a pool, the nextK samples are combined to form the secondpool, and so on. If the number of samples for the last pool is less thanK, these remaining samples are not used to form a pool (i.e.not includedin the calculation) . Therefore, a total ofN%/%K pools are formed. The function calculates the number ofassays needed for each of these pools.
Value
A vectorof lengthN%/%K for the numbers of assays needed for all poolsthat are formed.
References
Liu T, Hogan JW, Daniels, MJ, Coetzer M, Xu Y, Bove G, et al. Improved HIV-1 Viral LoadMonitoring Capacity Using Pooled Testing with Marker-Assisted Deconvolution. Journal ofAIDS. 2017;75(5): 580-587.
Bilder CR, Tebbs JM, Chen P. Informative retesting. Journal of the AmericanStatistical Association. 2010;105(491):942-955.
May S, Gamst A, Haubrich R, Benson C, Smith DM. Pooled nucleic acid testingto identify antiretroviral treatment failure during HIV infection. Journalof Acquired Immune Deficiency Syndromes. 2010;53(2):194-201.
See Also
Examples
K=5; n = 50;n.pool = n/K; n.pool# [1] 10set.seed(100)pvl = rgamma(n, shape = 2.8, scale = 150)riskscore = (rank(pvl)/n) * 0.5 + runif(n) * 0.5mmpa(v = pvl, s = riskscore)# A total of 10 pools are formed.# The numbers of assays required by these pools are:# [1] 3 3 4 4 2 3 3 4 3 3Number of Assays Needed using Mini-Pooling with Algorithm (MPA)
Description
Functionmpa(...) calculates the number of assays required, when using MPA, forpools that are formed following the order of individual samples in the data.
Usage
mpa(v, K = 5, vf_cut = 1000, lod = 0, msg = T)Arguments
v | A vector of non-negative numerical assay results. |
K | Pool size; default is |
vf_cut | Cutoff value for defining positive cases;default is |
lod | A vector of lower limits of detection or a scalar if the limits are thesame; default is |
msg | Message generated during calculation; default is |
Details
For a given sample v_i, i = 1, ..., N, the firstK samples v_1,..., v_5 are combined to form a pool, the nextK samples v_6, ...,v_10 are combined to form the secondpool, and so on. If the number of samples for the last pool is less thanK, these remaining samples are not used to form a pool (i.e.not included in the calculation) . Therefore, a total ofN%/%K pools are formed. The function calculates the number ofassays needed for each of these pools. See May et al (2010).
Value
A vectorof lengthN%/%K for the numbers of assays needed for all poolsthat are formed.
References
May, S., Gamst, A., Haubrich, R., Benson, C., & Smith,D. M. (2010). Pooled nucleic acid testing to identify antiretroviraltreatment failure during HIV infection. Journal of acquired immunedeficiency syndromes (1999), 53(2), 194.
Liu T, Hogan JW, Daniels, MJ, Coetzer M, Xu Y, Bove G, et al. Improved HIV-1 Viral LoadMonitoring Capacity Using Pooled Testing with Marker-Assisted Deconvolution. Journal ofAIDS. 2017;75(5): 580-587.
See Also
Examples
K=5; n = 50;n.pool = n/K; n.pool# [1] 10set.seed(100)pvl = rgamma(n, shape = 2.8, scale = 150)mpa(v = pvl)# A total of 10 pools are formed.# The numbers of assays required by these pools are:# [1] 3 3 4 4 2 5 4 4 4 4Monte Carlo Simulation for Estimating the Number of Assays Requiredwhen Using Pooled Testing
Description
This function uses Monte Carlo (MC) to simulate different orders inwhich the samples would be collected to form pools. Unlike thefunctionminipool,mpa, andmmpa that calculatethe number of assaysneeded for pools that are formed following the exact orderof the samples that are listed in the data, this functionpooling_mc permutes the data many (perm_num) timesso as to estimate the average number ofassays required (ATR) per individual. Using MC avoids the dependenceon anyspecific ordering of forming pools.
Usage
pooling_mc(v, s = NULL, K = 5, vf_cut = 1000, lod = 0, method = "mmpa", perm_num = 100, msg = F)Arguments
v | A vector of non-negative numerical assay results. |
s | A vector of risk scores; |
K | Pool size; default is |
vf_cut | Cutoff value for defining positive cases;default is |
lod | A vector of lower limits of detection or a scalar if the limits are thesame; default is |
method | Method that is used for pooled testing; must be one of |
perm_num | The number of permutation to be used for the calculation;default is |
msg | Message generated during calculation; default is |
Value
The outcome is a matrix of dimensionnum_pool byperm_num.The row number is the number of pools (num_pool) from each permutationof the data, which isdetermined by the sample sizeN and pool sizeK;num_pool= N%/%K. The column number is the number ofpermutations (num_pool).
References
Liu T, Hogan JW, Daniels, MJ, Coetzer M, Xu Y, Bove G, et al. Improved HIV-1 Viral LoadMonitoring Capacity Using Pooled Testing with Marker-Assisted Deconvolution. Journal ofAIDS. 2017;75(5): 580-587.
Bilder CR, Tebbs JM, Chen P. Informative retesting. Journal of the AmericanStatistical Association. 2010;105(491):942-955.
May S, Gamst A, Haubrich R, Benson C, Smith DM. Pooled nucleic acid testing toidentify antiretroviral treatment failure during HIV infection. Journal of AcquiredImmune Deficiency Syndromes. 2010;53(2):194-201.
Dorfman R. The detection of defective members of large populations. TheAnnals of Mathematical Statistics. 1943;14(4):436-440.
See Also
Examples
### sample size = 300n = 300;set.seed(100)pvl = rgamma(n, shape = 2.8, scale = 150)summary(pvl)# Min. 1st Qu. Median Mean 3rd Qu. Max.# 53 225 392 424 564 1373riskscore = (rank(pvl)/n) * 0.5 + runif(n) * 0.5cor(pvl, riskscore, method = "spearman")# [1] 0.69### Pool size K is set to 5K=5;### so, the number of pools = 60n.pool = n/K; n.pool# [1] 60foo = pooling_mc(pvl, riskscore, perm_num = 100)### Average number of assays needed per pool for each of the 100### permutations of the dataapply(foo, 2, mean)# [1] 3.43 3.33 3.35 3.47 3.37 3.33 3.37 3.27 3.43 3.28 3.32 3.35 3.35 3.37# [15] 3.38 3.37 3.30 3.43 3.28 3.38 3.42 3.35 3.35 3.48 3.30 3.47 3.40 3.35# [29] 3.25 3.30 3.38 3.43 3.25 3.45 3.35 3.33 3.42 3.38 3.40 3.33 3.32 3.38# [43] 3.33 3.37 3.37 3.33 3.35 3.38 3.38 3.30 3.30 3.33 3.37 3.32 3.30 3.40# [57] 3.37 3.42 3.30 3.37 3.38 3.32 3.45 3.38 3.37 3.50 3.33 3.40 3.28 3.37# [71] 3.23 3.33 3.23 3.42 3.32 3.32 3.45 3.35 3.32 3.32 3.33 3.33 3.30 3.38# [85] 3.37 3.33 3.33 3.20 3.37 3.33 3.30 3.40 3.40 3.32 3.33 3.37 3.40 3.38# [99] 3.30 3.33### Estimated average number of assays needed per poolmean(foo)# 3.35### Estimated average number of assays needed per individualmean(foo)/K# [1] 0.67