Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roxygen doesn't recognize a parameter #530

Closed
llrs opened this issue Oct 23, 2016 · 1 comment
Closed

Roxygen doesn't recognize a parameter #530

llrs opened this issue Oct 23, 2016 · 1 comment

Comments

@llrs
Copy link

llrs commented Oct 23, 2016

I wanted to use roxygen do document a package but it keeps failing the documentation tests done with

library(devtools)
check_man()
Warning: @param [blockwiseModulesC.R#1840]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#1849]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#1853]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2450]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2483]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2544]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2551]: mismatched braces or quotes
Warning: @param [consensusTOM.R#237]: mismatched braces or quotes
Warning: @param [consensusTOM.R#284]: mismatched braces or quotes
Warning: WGCNA-package.R:176: Missing name
Warning: WGCNA-package.R:566: Missing name
Checking documentation...
Undocumented arguments in documentation object 'blockwiseConsensusModules'individualTOMFileNames’ ‘consensusTOMFileNamesUndocumented arguments in documentation object 'blockwiseIndividualTOMs'checkPower’ ‘individualTOMFileNames

However in blockwiseIndividualTOMS documentation (lines 1808-1930 of the blockwiseModulesC.R file) it both arguments checkPower and individualTOMFileNames are documented:


#' Calculation of block-wise topological overlaps
#'
#' Calculates topological overlaps in the given (expression) data. If the
#' number of variables (columns) in the input data is too large, the data is
#' first split using pre-clustering, then topological overlaps are calculated
#' in each block.
#'
#' The function starts by optionally filtering out samples that have too many
#' missing entries and genes that have either too many missing entries or zero
#' variance in at least one set. Genes that are filtered out are excluded from
#' the TOM calculations.
#'
#' If \code{blocks} is not given and the number of genes exceeds
#' \code{maxBlockSize}, genes are pre-clustered into blocks using the function
#' \code{\link{consensusProjectiveKMeans}}; otherwise all genes are treated in
#' a single block.
#'
#' For each block of genes, the network is constructed and (if requested)
#' topological overlap is calculated in each set. The topological overlaps can
#' be saved to disk as RData files, or returned directly within the return
#' value (see below). Note that the matrices can be big and returning them
#' within the return value can quickly exhaust the system's memory. In
#' particular, if the block-wise calculation is necessary, it is nearly certain
#' that returning all matrices via the return value will be impossible.
#'
#' @inheritParams adjacency
#' @inheritParams blockwiseModules
#' @param multiExpr expression data in the multi-set format (see
#' \code{\link{checkSets}}). A vector of lists, one per set. Each set must
#' contain a component \code{data} that contains the expression data, with rows
#' corresponding to samples and columns to genes or probes.
#' @param checkPower logical: should basic sanity check be performed on the
#' supplied \code{power}? If you would like to experiment with unusual powers,
#' set the argument to \code{FALSE} and proceed with caution.
#' individual TOMs into. The following tags should be used to make the file
#' names unique for each set and block: \code{%s} will be replaced by the set
#' number; \code{%N} will be replaced by the set name (taken from
#' \code{names(multiExpr)}) if it exists, otherwise by set number; \code{%b}
#' will be replaced by the block number. If the file names turn out to be
#' non-unique, an error will be generated.
#' @param individualTOMFileNames character string giving the file names to save
#' individual TOMs into. The following tags should be used to make the file
#' names unique for each set and block: \code{%s} will be replaced by the set
#' number; \code{%N} will be replaced by the set name (taken from
#' \code{names(multiExpr)}) if it exists, otherwise by set number; \code{%b}
#' will be replaced by the block number. If the file names turn out to be
#' non-unique, an error will be generated.
#' @return A list with the following components:
#'
#' \item{actualTOMFileNames}{Only returned if input \code{saveTOMs} is
#' \code{TRUE}. A matrix of character strings giving the file names in which
#' each block TOM is saved. Rows correspond to data sets and columns to
#' blocks.}
#'
#' \item{TOMSimilarities}{Only returned if input \code{saveTOMs} is
#' \code{FALSE}. A list in which each component corresponds to one block. Each
#' component is a matrix of dimensions (N times (number of sets)), where N is
#' the length of a distance structure corresponding to the block. That is, if
#' the block contains n genes, N=n*(n-1)/2. Each column of the matrix contains
#' the topological overlap of variables in the corresponding set ( and the
#' corresponding block), arranged as a distance structure. Do note however that
#' the topological overlap is a similarity (not a distance). }
#'
#' \item{blocks}{if input \code{blocks} was given, its copy; otherwise a vector
#' of length equal number of genes giving the block label for each gene. Note
#' that block labels are not necessarilly sorted in the order in which the
#' blocks were processed (since we do not require this for the input
#' \code{blocks}). See \code{blockOrder} below. }
#'
#' \item{blockGenes}{a list with one component for each block of genes. Each
#' component is a vector giving the indices (relative to the input
#' \code{multiExpr}) of genes in the corresponding block. }
#'
#' \item{goodSamplesAndGenes}{if input \code{checkMissingData} is \code{TRUE},
#' the output of the function \code{\link{goodSamplesGenesMS}}.  A list with
#' components \code{goodGenes} (logical vector indicating which genes passed
#' the missing data filters), \code{goodSamples} (a list of logical vectors
#' indicating which samples passed the missing data filters in each set), and
#' \code{allOK} (a logical indicating whether all genes and all samples passed
#' the filters). See \code{\link{goodSamplesGenesMS}} for more details. If
#' \code{checkMissingData} is \code{FALSE}, \code{goodSamplesAndGenes} contains
#' a list of the same type but indicating that all genes and all samples passed
#' the missing data filters.}
#'
#' The following components are present mostly to streamline the interaction of
#' this function with \code{\link{blockwiseConsensusModules}}.
#'
#' \item{nGGenes}{ Number of genes that passed missing data filters (if input
#' \code{checkMissingData} is \code{TRUE}), or the number of all genes (if
#' \code{checkMissingData} is \code{FALSE}).}
#'
#' \item{gBlocks}{ the vector \code{blocks} (above), restricted to good genes
#' only. }
#'
#' \item{nThreads}{ number of threads used to calculate correlation and TOM
#' matrices. }
#'
#' \item{saveTOMs}{ logical: were calculated matrices saved in files
#' (\code{TRUE}) or returned in the return value (\code{FALSE})?}
#'
#' \item{intNetworkType, intCorType}{integer codes for network and correlation
#' type. }
#'
#' \item{nSets}{number of sets in input data.}
#'
#' \item{setNames}{the \code{names} attribute of input \code{multiExpr}.}
#' @author Peter Langfelder
#' @seealso
#'
#' \code{\link{blockwiseConsensusModules}}
#' @references For a general discussion of the weighted network formalism, see
#'
#' Bin Zhang and Steve Horvath (2005) "A General Framework for Weighted Gene
#' Co-Expression Network Analysis", Statistical Applications in Genetics and
#' Molecular Biology: Vol. 4: No. 1, Article 17
#'
#' The blockwise approach is briefly described in the article describing this
#' package,
#'
#' Langfelder P, Horvath S (2008) "WGCNA: an R package for weighted correlation
#' network analysis".  BMC Bioinformatics 2008, 9:559
#' @keywords misc

With the blockwiseConsensusModules arguments happens the same, they are both documented but roxygen2 don't recognize them.
I might be doing something completely wrong as it is my first time using roxygen2 but AFAIK it should create the correct .Rd files. If you need further information you can ask me or consult the repository.

Many thanks

My session

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=es_ES.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=es_ES.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=es_ES.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] WGCNA_1.51            roxygen2_5.0.1.9000   fastcluster_1.1.20    dynamicTreeCut_1.63-1 devtools_1.12.0      

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6           RColorBrewer_1.1-2    plyr_1.8.4            iterators_1.0.8       tools_3.3.1          
 [6] rpart_4.1-10          digest_0.6.10         RSQLite_1.0.0         preprocessCore_1.34.0 memoise_1.0.0        
[11] gtable_0.2.0          lattice_0.20-33       Matrix_1.2-6          foreach_1.4.3         DBI_0.4-1            
[16] commonmark_0.9        parallel_3.3.1        gridExtra_2.2.1       withr_1.0.1           stringr_1.1.0        
[21] xml2_1.0.0            cluster_2.0.4         desc_1.0.0            IRanges_2.6.0         S4Vectors_0.10.1     
[26] stats4_3.3.1          grid_3.3.1            nnet_7.3-12           Biobase_2.32.0        data.table_1.9.6     
[31] impute_1.46.0         R6_2.1.3              AnnotationDbi_1.34.3  survival_2.39-4       foreign_0.8-66       
[36] latticeExtra_0.6-28   Formula_1.2-1         GO.db_3.3.0           ggplot2_2.1.0         magrittr_1.5         
[41] BiocGenerics_0.18.0   Hmisc_3.17-4          scales_0.4.0          codetools_0.2-14      matrixStats_0.50.2   
[46] splines_3.3.1         colorspace_1.2-6      stringi_1.1.1         acepack_1.3-3.3       munsell_0.4.3        
[51] doParallel_1.0.10     crayon_1.3.2          chron_2.3-47  
@hadley
Copy link
Member

hadley commented Oct 23, 2016

Start by fixing the reported problems:

Warning: @param [blockwiseModulesC.R#1840]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#1849]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#1853]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2450]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2483]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2544]: mismatched braces or quotes
Warning: @param [blockwiseModulesC.R#2551]: mismatched braces or quotes

(Hint: \code{%s} needs some escaping because % is the Rd comment character)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants