Package mmpa. March 22, 2017

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package sigqc. June 13, 2018

Package SEMrushR. November 3, 2018

Package fastdummies. January 8, 2018

Package ECctmc. May 1, 2018

Package spark. July 21, 2017

Package datasets.load

Package bisect. April 16, 2018

Package splithalf. March 17, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package quadprogxt. February 4, 2018

Package validara. October 19, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package milr. June 8, 2017

Package auctestr. November 13, 2017

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package calpassapi. August 25, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package spelling. December 18, 2017

Package shinyfeedback

Package canvasxpress

Package messaging. May 27, 2018

Package epitab. July 4, 2018

Package weco. May 4, 2018

Package kdtools. April 26, 2018

Package EvolutionaryGames

Package nngeo. September 29, 2018

Package widyr. August 14, 2017

Package IATScore. January 10, 2018

Package fitur. March 11, 2018

Package fitbitscraper

Package slickr. March 6, 2018

Package crossrun. October 8, 2018

Package tiler. June 9, 2018

Package coga. May 8, 2018

Package knitrprogressbar

Package semver. January 6, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package zoomgrid. January 3, 2019

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package WordR. September 7, 2017

Package repec. August 31, 2018

Package editdata. October 7, 2017

Package gtrendsr. October 19, 2017

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package fusionclust. September 19, 2017

Package Numero. November 24, 2018

Package pdfsearch. July 10, 2018

Package rzeit2. January 7, 2019

Package sfc. August 29, 2016

Package nmslibr. April 14, 2018

Package gtrendsr. August 4, 2018

Package climber. R topics documented:

Package goodpractice

Package TrafficBDE. March 1, 2018

Package postgistools

Package mgc. April 13, 2018

Package rsppfp. November 20, 2018

Package effectr. January 17, 2018

Package pksea. December 22, 2017

Package wdman. January 23, 2017

Package understandbpmn

Package strat. November 23, 2016

Package comparedf. February 11, 2019

Package fcr. March 13, 2018

Package patentsview. July 12, 2017

Package internetarchive

Package available. November 17, 2017

Package githubinstall

Package samplesizecmh

Package linkspotter. July 22, Type Package

Package fastrtext. December 10, 2017

Package edfreader. R topics documented: May 21, 2017

Package modules. July 22, 2017

Package TANDEM. R topics documented: June 15, Type Package

Package docxtools. July 6, 2018

Package vip. June 15, 2018

Package geoops. March 19, 2018

Package facerec. May 14, 2018

Package virustotal. May 1, 2017

Package wrswor. R topics documented: February 2, Type Package

Package stapler. November 27, 2017

Package dkanr. July 12, 2018

Package robotstxt. November 12, 2017

Package apastyle. March 29, 2017

Package jpmesh. December 4, 2017

Package modmarg. R topics documented:

Package queuecomputer

Package censusapi. August 19, 2018

Package qicharts2. March 3, 2018

Package projector. February 27, 2018

Package mapsapi. March 12, 2018

Package RNAseqNet. May 16, 2017

Package labelvector. July 28, 2018

Package liftr. R topics documented: May 14, Type Package

Package GFD. January 4, 2018

Package barcoder. October 26, 2018

Package datapasta. January 24, 2018

Package vinereg. August 10, 2018

Package crossword.r. January 19, 2018

Transcription:

Type Package Package mmpa March 22, 2017 Title Implementation of Marker-Assisted Mini-Pooling with Algorithm Version 0.1.0 Author ``Tao Liu <tliu@stat.brown.edu> [aut, cre]'' ``Yizhen Xu <yizhen_xu@brown.edu> [aut]'' Maintainer Tao Liu <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.0.1 Suggests knitr, rmarkdown VignetteBuilder knitr NeedsCompilation no Repository CRAN Date/Publication 2017-03-22 19:20:49 UTC R topics documented: minipool........................................... 2 mmpa............................................ 3 mpa............................................. 4 pooling_mc......................................... 5 Index 8 1

2 minipool minipool Number of Assays Needed using Mini-Pooling Description Function minipool(...) calculates the number of assays required, when using mini-pooling, for pools 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 K = 5. vf_cut Cutoff value for defining positive cases; default is vf_cut = 1000. lod msg A vector of lower limits of detection or a scalar if the limits are the same; default is lod = 0. Message generated during calculation; default is TRUE. Details Suppose that N samples are collected for pooled testing. The first K samples are combined to form a pool, the next K samples are combined to form the second pool, and so on. If the number of samples for the last pool is less than K, these remaining samples are not used to form a pool (i.e. not included in the calculation). Therefore, a total of N%/%K pools are formed. The function calculates the number of assays needed for each of these pools. For mini-pooling, if a pool is negative, no further tests are needed and all samples in the pool are concluded as being negative; so the total number of assays required is one. Otherwise if the pool is tested positive, all individual samples in the pool are tested and the total number of assays required is (K + 1). Value A vectorof length N%/%K for the numbers of assays needed for all pools that are formed. References Dorfman R. The detection of defective members of large populations. The Annals of Mathematical Statistics. 1943;14(4):436-440. See Also mpa, mmpa, pooling_mc

mmpa 3 Examples K=5; n = 50; n.pool = n/k; n.pool # [1] 10 set.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 6 mmpa Number of Assays Required using Marker-Assisted Mini-Pooling with Algorithm (mmpa) Description Usage Function mmpa(...) calculates the number of assays required, when using mmpa, for pools that are formed following the order of individual samples in the data. mmpa(v, s, K = 5, vf_cut = 1000, lod = 0, msg = T) Arguments v s A vector of non-negative numerical assay results. A vector of risk scores; s must have the same length as v. The risk score s needs to be positively associated with v; othewise an error message will be generated. K Pool size; default is K = 5. vf_cut Cutoff value for defining positive cases; default is vf_cut = 1000. lod msg Details Value A vector of lower limits of detection or a scalar if the limits are the same; default is lod = 0. Message generated during calculation; default is TRUE. For a given sample (v_i, s_i), i = 1,..., N, the first K samples are combined to form a pool, the next K samples are combined to form the second pool, and so on. If the number of samples for the last pool is less than K, these remaining samples are not used to form a pool (i.e. not included in the calculation). Therefore, a total of N%/%K pools are formed. The function calculates the number of assays needed for each of these pools. A vectorof length N%/%K for the numbers of assays needed for all pools that are formed.

4 mpa References Bilder CR, Tebbs JM, Chen P. Informative retesting. Journal of the American Statistical Association. 2010;105(491):942-955. May S, Gamst A, Haubrich R, Benson C, Smith DM. Pooled nucleic acid testing to identify antiretroviral treatment failure during HIV infection. Journal of Acquired Immune Deficiency Syndromes. 2010;53(2):194-201. See Also Our manuscript (under review); to be added. minipool, mpa, pooling_mc Examples K=5; n = 50; n.pool = n/k; n.pool # [1] 10 set.seed(100) pvl = rgamma(n, shape = 2.8, scale = 150) riskscore = (rank(pvl)/n) * 0.5 + runif(n) * 0.5 mmpa(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 3 mpa Number of Assays Needed using Mini-Pooling with Algorithm (MPA) Description Usage Function mpa(...) calculates the number of assays required, when using MPA, for pools that are formed following the order of individual samples in the data. 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 K = 5. vf_cut Cutoff value for defining positive cases; default is vf_cut = 1000. lod msg A vector of lower limits of detection or a scalar if the limits are the same; default is lod = 0. Message generated during calculation; default is TRUE.

pooling_mc 5 Details For a given sample v_i, i = 1,..., N, the first K samples v_1,..., v_5 are combined to form a pool, the next K samples v_6,..., v_10 are combined to form the second pool, and so on. If the number of samples for the last pool is less than K, these remaining samples are not used to form a pool (i.e. not included in the calculation). Therefore, a total of N%/%K pools are formed. The function calculates the number of assays needed for each of these pools. See May et al (2010). Value A vectorof length N%/%K for the numbers of assays needed for all pools that are formed. References May, S., Gamst, A., Haubrich, R., Benson, C., & Smith, D. M. (2010). Pooled nucleic acid testing to identify antiretroviral treatment failure during HIV infection. Journal of acquired immune deficiency syndromes (1999), 53(2), 194. See Also minipool, mmpa, pooling_mc Examples K=5; n = 50; n.pool = n/k; n.pool # [1] 10 set.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 4 pooling_mc Monte Carlo Simulation for Estimating the Number of Assays Required when Using Pooled Testing Description This function uses Monte Carlo (MC) to simulate different orders in which the samples would be collected to form pools. Unlike the function minipool, mpa, and mmpa that calculate the number of assays needed for pools that are formed following the exact order of the samples that are listed in the data, this function pooling_mc permutes the data many (perm_num) times so as to estimate the average number of assays required (ATR) per individual. Using MC avoids the dependence on any specific ordering of forming pools.

6 pooling_mc Usage pooling_mc(v, s = NULL, K = 5, vf_cut = 1000, lod = 0, method = "mmpa", perm_num = 100, msg = F) Arguments v s Value A vector of non-negative numerical assay results. A vector of risk scores; s must be provided if method = "mmpa" and have the same length as v. The risk score s needs to be positively associated with v; othewise an error message will be generated. K Pool size; default is K = 5. vf_cut Cutoff value for defining positive cases; default is vf_cut = 1000. lod method A vector of lower limits of detection or a scalar if the limits are the same; default is lod = 0. Method that is used for pooled testing; must be one of minipool, mpa, and mmpa. By default, method = "mmpa". perm_num The number of permutation to be used for the calculation; default is 100. msg Message generated during calculation; default is FALSE. The outcome is a matrix of dimension num_pool by perm_num. The row number is the number of pools (num_pool) from each permutation of the data, which is determined by the sample size N and pool size K; num_pool = N%/%K. The column number is the number of permutations (num_pool). References Bilder CR, Tebbs JM, Chen P. Informative retesting. Journal of the American Statistical Association. 2010;105(491):942-955. May S, Gamst A, Haubrich R, Benson C, Smith DM. Pooled nucleic acid testing to identify antiretroviral treatment failure during HIV infection. Journal of Acquired Immune Deficiency Syndromes. 2010;53(2):194-201. Dorfman R. The detection of defective members of large populations. The Annals of Mathematical Statistics. 1943;14(4):436-440. See Also Our manuscript; to be added. minipool, mpa, mmpa Examples ### sample size = 300 n = 300; set.seed(100) pvl = rgamma(n, shape = 2.8, scale = 150)

pooling_mc 7 summary(pvl) # Min. 1st Qu. Median Mean 3rd Qu. Max. # 53 225 392 424 564 1373 riskscore = (rank(pvl)/n) * 0.5 + runif(n) * 0.5 cor(pvl, riskscore, method = "spearman") # [1] 0.69 ### Pool size K is set to 5 K=5; ### so, the number of pools = 60 n.pool = n/k; n.pool # [1] 60 foo = pooling_mc(pvl, riskscore, perm_num = 100) ### Average number of assays needed per pool for each of the 100 ### permutations of the data apply(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 pool mean(foo) # 3.35 ### Estimated average number of assays needed per individual mean(foo)/k # [1] 0.67

Index Topic Pooling. pooling_mc, 5 Topic mmpa. mmpa, 3 mpa, 4 Topic mini-pooling. minipool, 2 minipool, 2, 4 6 mmpa, 2, 3, 5, 6 mpa, 2, 4, 4, 6 pooling_mc, 2, 4, 5, 5 8