Browse code

deal with warnings from documentation

hcorrada authored on 24/03/2020 19:05:29
Showing 8 changed files

... ...
@@ -14,12 +14,10 @@
14 14
 #' @param taxa Taxa list.
15 15
 #' @param uniqueNames Number the various taxa.
16 16
 #' @param adjustMethod Method to adjust p-values by. Default is "FDR". Options
17
-#' include "IHW", "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
18
-#' "none". See \code{\link{p.adjust}} for more details.
19
-#' @param IHWcov Character value specifying which covariate to use when adjusting pvalues
20
-#' using IHW. Options include: "nnz" (number of non-zero elements per feature), 
21
-#' "median" (median abundance value per feature), "Amean" (adjusted mean, used for a 
22
-#' fitZigResults obj)
17
+#' include "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
18
+#' "none". See \code{\link{p.adjust}} for more details. Additionally, options using
19
+#' independent hypothesis weighting (IHW) are available. See \code{\link{MRihw}} for more
20
+#' details.
23 21
 #' @param alpha Value for p-value significance threshold when running IHW. 
24 22
 #' The default is set to 0.1 
25 23
 #' @param group One of five choices, 0,1,2,3,4. 0: the sort is ordered by a
... ...
@@ -53,12 +51,6 @@ MRcoefs<-function(obj,by=2,coef=NULL,number=10,taxa=obj@taxa,
53 51
     uniqueNames=FALSE,adjustMethod="fdr",alpha=0.1,
54 52
     group=0,eff=0,numberEff=FALSE,counts=0,file=NULL){
55 53
 
56
-    if (adjustMethod == "ihw-ubiquity" || adjustMethod == "ihw-abundance") {
57
-	if (!require(IHW)) {
58
-	  stop("Adjustment using IHW for adjustment requires the 'IHW' package. Please install.")
59
-	}
60
-    } 
61
-
62 54
     if(length(grep("fitFeatureModel",obj@call))){
63 55
         groups = factor(obj@design[,by])
64 56
         by = "logFC"; coef = 1:2;
... ...
@@ -89,14 +81,6 @@ MRcoefs<-function(obj,by=2,coef=NULL,number=10,taxa=obj@taxa,
89 81
         }
90 82
     }
91 83
     
92
-    # # adding IHW as pvalue adjustment method
93
-    # if(adjustMethod == "ihw") {
94
-    #   # run MRihw
95
-    #   padj = MRihw(obj, p, IHWcov, alpha)
96
-    # } else {
97
-    #   padj = p.adjust(p, method = adjustMethod) # use classic pvalue adjusment methods
98
-    # }
99
-    
100 84
     # adding 'ihw' as pvalue adjustment method
101 85
     if (adjustMethod == "ihw-ubiquity" | adjustMethod == "ihw-abundance") {
102 86
       # use IHW to adjust pvalues
... ...
@@ -16,8 +16,8 @@ setGeneric("MRihw", function(obj, ...){standardGeneric("MRihw")})
16 16
 #' @param obj Either a fitFeatureModelResults or fitZigResults object
17 17
 #' @param p a vector of pvalues extracted from obj
18 18
 #' @param adjustMethod Value specifying which adjustment method and which covariate to use for IHW pvalue adjustment. 
19
-#' For obj of class \code{\link{fitFeatureModelResults}}, options are "ihw-abundance" (median feature count per row) 
20
-#' and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults}}, 
19
+#' For obj of class \code{\link{fitFeatureModelResults-class}}, options are "ihw-abundance" (median feature count per row) 
20
+#' and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults-class}}, 
21 21
 #' options are "ihw-abundance" (weighted mean per feature) and "ihw-ubiquity" (number of non-zero features per row). 
22 22
 #' @param alpha pvalue significance level specified for IHW call. Default is 0.1
23 23
 #' 
... ...
@@ -46,8 +46,8 @@ setMethod("MRihw", signature = "fitFeatureModelResults", function(obj, p, adjust
46 46
 #' @param obj Either a fitFeatureModelResults or fitZigResults object
47 47
 #' @param p a vector of pvalues extracted from obj
48 48
 #' @param adjustMethod Value specifying which adjustment method and which covariate to use for IHW pvalue adjustment. 
49
-#' For obj of class \code{\link{fitFeatureModelResults}}, options are "ihw-abundance" (median feature count per row) 
50
-#' and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults}}, 
49
+#' For obj of class \code{\link{fitFeatureModelResults-class}}, options are "ihw-abundance" (median feature count per row) 
50
+#' and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults-class}}, 
51 51
 #' options are "ihw-abundance" (weighted mean per feature) and "ihw-ubiquity" (number of non-zero features per row). 
52 52
 #' @param alpha pvalue significance level specified for IHW call. Default is 0.1
53 53
 #' 
... ...
@@ -55,7 +55,7 @@ setMethod("MRihw", signature = "fitZigResults", function(obj, p, adjustMethod, a
55 55
   if (adjustMethod == "ihw-ubiquity"){
56 56
     #use number of non-zero features per row as the covariate in ihw() call
57 57
     covariate <- rowSums(obj@counts != 0)
58
-    ihwRes <- ihw(p, covariate, alpha)
58
+    ihwRes <- IHW::ihw(p, covariate, alpha)
59 59
     padj <- ihwRes@df$adj_pvalue
60 60
   }
61 61
   if (adjustMethod == "ihw-abundance"){
... ...
@@ -146,7 +146,7 @@ setReplaceMethod("libSize", signature=c(object="MRexperiment", value="numeric"),
146 146
 #' @slot stillActive convergence
147 147
 #' @slot stillActiveNLL nll at convergence
148 148
 #' @slot dupcor correlation of duplicates
149
-#' @exportClass
149
+#' 
150 150
 #' 
151 151
 setClass("fitZigResults", 
152 152
          slots = c(fit = "list", countResiduals = "matrix", z = "matrix", zUsed = "ANY", 
... ...
@@ -165,7 +165,7 @@ setClass("fitZigResults",
165 165
 #' @slot counts  count matrix
166 166
 #' @slot pvalues  calculated p-values
167 167
 #' @slot permuttedFits  permutted z-score estimates under the null
168
-#' @exportClass
168
+#' 
169 169
 #' 
170 170
 setClass("fitFeatureModelResults",
171 171
          slots = c(call = "call", fitZeroLogNormal = "list", design = "matrix", taxa = "character",
... ...
@@ -36,8 +36,10 @@ or contrast of the linear model to display.}
36 36
 \item{uniqueNames}{Number the various taxa.}
37 37
 
38 38
 \item{adjustMethod}{Method to adjust p-values by. Default is "FDR". Options
39
-include "IHW", "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
40
-"none". See \code{\link{p.adjust}} for more details.}
39
+include "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
40
+"none". See \code{\link{p.adjust}} for more details. Additionally, options using
41
+independent hypothesis weighting (IHW) are available. See \code{\link{MRihw}} for more
42
+details.}
41 43
 
42 44
 \item{alpha}{Value for p-value significance threshold when running IHW. 
43 45
 The default is set to 0.1}
... ...
@@ -55,11 +57,6 @@ of the coefficient fit in increasing order. 4: no sorting.}
55 57
 \item{counts}{Filter features to have at least 'counts' counts.}
56 58
 
57 59
 \item{file}{Name of output file, including location, to save the table.}
58
-
59
-\item{IHWcov}{Character value specifying which covariate to use when adjusting pvalues
60
-using IHW. Options include: "nnz" (number of non-zero elements per feature), 
61
-"median" (median abundance value per feature), "Amean" (adjusted mean, used for a 
62
-fitZigResults obj)}
63 60
 }
64 61
 \value{
65 62
 Table of the top-ranked features determined by the linear fit's
... ...
@@ -12,8 +12,8 @@
12 12
 \item{p}{a vector of pvalues extracted from obj}
13 13
 
14 14
 \item{adjustMethod}{Value specifying which adjustment method and which covariate to use for IHW pvalue adjustment. 
15
-For obj of class \code{\link{fitFeatureModelResults}}, options are "ihw-abundance" (median feature count per row) 
16
-and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults}}, 
15
+For obj of class \code{\link{fitFeatureModelResults-class}}, options are "ihw-abundance" (median feature count per row) 
16
+and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults-class}}, 
17 17
 options are "ihw-abundance" (weighted mean per feature) and "ihw-ubiquity" (number of non-zero features per row).}
18 18
 
19 19
 \item{alpha}{pvalue significance level specified for IHW call. Default is 0.1}
... ...
@@ -12,8 +12,8 @@
12 12
 \item{p}{a vector of pvalues extracted from obj}
13 13
 
14 14
 \item{adjustMethod}{Value specifying which adjustment method and which covariate to use for IHW pvalue adjustment. 
15
-For obj of class \code{\link{fitFeatureModelResults}}, options are "ihw-abundance" (median feature count per row) 
16
-and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults}}, 
15
+For obj of class \code{\link{fitFeatureModelResults-class}}, options are "ihw-abundance" (median feature count per row) 
16
+and "ihw-ubiquity" (number of non-zero features per row). For obj of class \code{\link{fitZigResults-class}}, 
17 17
 options are "ihw-abundance" (weighted mean per feature) and "ihw-ubiquity" (number of non-zero features per row).}
18 18
 
19 19
 \item{alpha}{pvalue significance level specified for IHW call. Default is 0.1}
... ...
@@ -7,6 +7,6 @@
7 7
 \value{
8 8
 MRexperiment-class object of 16S lung samples.
9 9
 }
10
-\usage{lungData}
10
+%\usage{lungData}
11 11
 \format{A list of OTU matrix, taxa, otus, and phenotypes}
12 12
 \references{http://www.ncbi.nlm.nih.gov/pubmed/21680950}
13 13
\ No newline at end of file
... ...
@@ -7,6 +7,6 @@
7 7
 \value{
8 8
 MRexperiment-class object of 16S mouse samples.
9 9
 }
10
-\usage{mouseData}
10
+%\usage{mouseData}
11 11
 \format{A list of OTU matrix, taxa, otus, and phenotypes}
12 12
 \references{http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2894525/}
13 13
\ No newline at end of file