├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ └── R-CMD-check.yaml ├── .gitignore ├── DESCRIPTION ├── NAMESPACE ├── NEWS ├── R ├── AllClasses.R ├── checkObjects.R ├── compcodeR-package.R ├── generateCodeHTMLs.R ├── generateRmdCodeDiffExp.R ├── generateRmdCodeDiffExpPhylo.R ├── generateSyntheticData.R ├── phylolmMethods.R ├── runComparison.R ├── runComparisonShiny.R ├── runDiffExp.R ├── show-methods.R └── simulatePhyloPoissonLogNormal.R ├── README.md ├── inst ├── CITATION └── extdata │ ├── Pickrell.Cheung.Mu.Phi.Estimates.rds │ ├── Stern2018.Length.Mu.Phi.Estimates.rds │ └── Stern2018.tree ├── man ├── DESeq2.createRmd.Rd ├── DESeq2.length.createRmd.Rd ├── DSS.createRmd.Rd ├── EBSeq.createRmd.Rd ├── NBPSeq.createRmd.Rd ├── NB_to_PLN.Rd ├── NOISeq.prenorm.createRmd.Rd ├── TCC.createRmd.Rd ├── add_replicates.Rd ├── checkDataObject.Rd ├── checkParamMatrix.Rd ├── checkParamVector.Rd ├── checkSpecies.Rd ├── checkTableConsistency.Rd ├── check_compData.Rd ├── check_compData_results.Rd ├── check_phyloCompData.Rd ├── compData-class.Rd ├── compData.Rd ├── compcodeR-package.Rd ├── computeFactorLengths.Rd ├── convertListTocompData.Rd ├── convertListTophyloCompData.Rd ├── convertcompDataToList.Rd ├── convertphyloCompDataToList.Rd ├── edgeR.GLM.createRmd.Rd ├── edgeR.exact.createRmd.Rd ├── extract_results_phylolm.Rd ├── generateCodeHTMLs.Rd ├── generateLengths.Rd ├── generateLengthsPhylo.Rd ├── generateSyntheticData.Rd ├── getNegativeBinomialDispersion.Rd ├── getNegativeBinomialMean.Rd ├── getNegativeBinomialParameters.Rd ├── getTree.Rd ├── get_model_factor.Rd ├── get_poisson_log_normal_parameters.Rd ├── lengthNorm.limma.createRmd.Rd ├── lengthNorm.sva.limma.createRmd.Rd ├── listcreateRmd.Rd ├── logcpm.limma.createRmd.Rd ├── nEffNaive.Rd ├── nEffRatio.Rd ├── phyloCompData-class.Rd ├── phyloCompData.Rd ├── phyloCompDataFromCompData.Rd ├── phylolm.createRmd.Rd ├── phylolm_analysis.Rd ├── runComparison.Rd ├── runComparisonGUI.Rd ├── runComparisonShiny.Rd ├── runDiffExp.Rd ├── scale_variance_process.Rd ├── show-compData-method.Rd ├── show-phyloCompData-method.Rd ├── show_compData.Rd ├── simulateData.Rd ├── simulateDataPhylo.Rd ├── simulatePhyloPoissonLogNormal.Rd ├── sqrtcpm.limma.createRmd.Rd ├── summarizeSyntheticDataSet.Rd ├── ttest.createRmd.Rd ├── voom.limma.createRmd.Rd ├── voom.ttest.createRmd.Rd └── writeNormalization.Rd ├── tests ├── testthat.R └── testthat │ ├── test-moments_NB_PLN.R │ ├── test-runComparison.R │ ├── testEffectiveSampleSize.R │ ├── testNBtoPLN.R │ └── test_length_factors.R └── vignettes ├── compcodeR-concordance.tex ├── compcodeR.Rmd ├── compcodeR.bib ├── compcodeR_check_figure ├── logfoldchanges.png ├── maplot-nbroutliers.png └── maplot-trueDEstatus.png ├── compcodeR_code ├── B_625_625_5spc_repl1_edgeR.exact_code.html ├── B_625_625_5spc_repl1_ttest_code.html └── B_625_625_5spc_repl1_voom.limma_code.html ├── compcodeR_figure ├── auc.png ├── correlation-11.png ├── correlation-12.png ├── fdcall-1.png ├── fdcone-1.png ├── fdr.png ├── fdrvsexpr-1.png ├── fracsign.png ├── maplot-1.png ├── rocall-1.png ├── rocone-1.png ├── scorevsexpr-1.png ├── scorevsoutlier-1.png ├── scorevssignal-1.png ├── sorensen-1.png ├── tpr.png └── typeIerror.png ├── compcodeR_parameters_2014-04-02-11-00-28.rds ├── compcodeR_report_2014-04-02-11-00-28.html ├── phylocompcodeR.Rmd ├── phylocompcodeR_check_figure ├── lengths-1.png ├── logfoldchanges-1.png ├── logfoldchanges-logTPM-1.png ├── maplot-corHeatmap-1.png ├── maplot-nbroutliers-1.png ├── maplot-phyloHeatmap-1.png ├── maplot-trueDEstatus-1.png └── maplot-trueDEstatus-logTPM-1.png ├── screenshot-gui-1.png └── screenshot-gui-2.png /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | .travis.yml 4 | ^\.github$ 5 | ^doc$ 6 | ^Meta$ 7 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | pull_request: 4 | branches: 5 | - devel 6 | schedule: 7 | - cron: '0 9 * * 5' 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | container: ${{ matrix.config.image }} 15 | 16 | name: ${{ matrix.config.os }} (${{ matrix.config.bioc }} - ${{ matrix.config.image }}) 17 | 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | config: 22 | - { os: windows-latest, bioc: 'devel'} 23 | - { os: macOS-latest, bioc: 'devel', curlConfigPath: '/usr/bin/'} 24 | - { os: ubuntu-latest, bioc: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} 25 | - { os: ubuntu-latest, image: 'bioconductor/bioconductor_docker:devel'} 26 | 27 | env: 28 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 29 | _R_CHECK_FORCE_SUGGESTS_: false 30 | CRAN: ${{ matrix.config.cran }} 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 33 | CURL_CONFIG: ${{ matrix.config.curlConfigPath }}curl-config 34 | 35 | steps: 36 | - name: Check out repo 37 | uses: actions/checkout@v2 38 | 39 | - name: Set up R and install BiocManager 40 | uses: grimbough/bioc-actions/setup-bioc@v1 41 | if: matrix.config.image == null 42 | with: 43 | bioc-version: ${{ matrix.config.bioc }} 44 | 45 | - name: Set up pandoc 46 | uses: r-lib/actions/setup-pandoc@v2 47 | if: matrix.config.image == null 48 | 49 | - name: Set bitmapType 50 | if: runner.os == 'macOS' 51 | run: echo 'options(bitmapType = "cairo")' >> $HOME/.Rprofile 52 | 53 | - name: Set up display (Linux) 54 | if: runner.os == 'Linux' 55 | run: | 56 | sudo apt-get update && sudo apt-get -y install tcl8.6-dev tk8.6-dev 57 | sudo apt-get -y install bwidget 58 | export DISPLAY=:99.0 59 | 60 | - name: Set up display (MacOS) 61 | if: runner.os == 'macOS' 62 | run: | 63 | brew install --cask xquartz 64 | 65 | - name: Install remotes 66 | run: | 67 | install.packages('remotes') 68 | shell: Rscript {0} 69 | 70 | - name: Query dependencies 71 | run: | 72 | saveRDS(remotes::dev_package_deps(dependencies = TRUE, repos = c(getOption('repos'), BiocManager::repositories())), 'depends.Rds', version = 2) 73 | shell: Rscript {0} 74 | 75 | - name: Cache R packages 76 | if: runner.os != 'Windows' && matrix.config.image == null 77 | uses: actions/cache@v4 78 | with: 79 | path: ${{ env.R_LIBS_USER }} 80 | key: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-${{ hashFiles('depends.Rds') }} 81 | restore-keys: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}- 82 | 83 | - name: Install system dependencies (Linux) 84 | if: runner.os == 'Linux' 85 | env: 86 | RHUB_PLATFORM: linux-x86_64-ubuntu-gcc 87 | uses: r-lib/actions/setup-r-dependencies@v2 88 | with: 89 | extra-packages: any::rcmdcheck 90 | pak-version: devel 91 | 92 | - name: Install system dependencies (macOS) 93 | if: runner.os == 'macOS' 94 | run: | 95 | brew install harfbuzz 96 | brew install fribidi 97 | 98 | - name: Set up gfortran symlinks (macOS) 99 | if: runner.os == 'macOS' 100 | run: | 101 | set -x 102 | sudo mkdir -p /usr/local/gfortran 103 | sudo ln -s /usr/local/Cellar/gcc@12/12.3.0/lib/gcc/12 /usr/local/gfortran/lib 104 | gfortran --version 105 | 106 | - name: Install dependencies 107 | run: | 108 | local_deps <- remotes::local_package_deps(dependencies = TRUE) 109 | deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories()) 110 | BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]], Ncpu = 2L) 111 | remotes::install_cran('rcmdcheck', Ncpu = 2L) 112 | BiocManager::install(c('rpanel', 'DSS'), Ncpu = 2L) 113 | shell: Rscript {0} 114 | 115 | - name: Session info 116 | run: | 117 | options(width = 100) 118 | pkgs <- installed.packages()[, "Package"] 119 | sessioninfo::session_info(pkgs, include_base = TRUE) 120 | shell: Rscript {0} 121 | 122 | - name: Build, Install, Check (2) 123 | id: build-install-check 124 | uses: grimbough/bioc-actions/build-install-check@v1 125 | 126 | - name: Upload install log if the build/install/check step fails 127 | if: always() && (steps.build-install-check.outcome == 'failure') 128 | uses: actions/upload-artifact@v4 129 | with: 130 | name: install-log 131 | path: | 132 | ${{ steps.build-install-check.outputs.install-log }} 133 | 134 | - name: Show testthat output (windows) 135 | if: always() && runner.os == 'Windows' 136 | run: | 137 | type ${{ steps.build-install-check.outputs.check-dir }}\tests\testthat.Rout 138 | shell: cmd 139 | 140 | - name: Show testthat output (non-windows) 141 | if: always() && runner.os != 'Windows' 142 | run: | 143 | cat ${{ steps.build-install-check.outputs.check-dir }}/tests/testthat.Rout 144 | shell: bash 145 | 146 | - name: Upload check results 147 | if: failure() 148 | uses: actions/upload-artifact@v4 149 | with: 150 | name: ${{ runner.os }}-bioc${{ matrix.config.bioc }}-results 151 | path: ${{ steps.build-install-check.outputs.check-dir }} 152 | 153 | - name: Run BiocCheck 154 | uses: grimbough/bioc-actions/run-BiocCheck@v1 155 | with: 156 | arguments: '--no-check-bioc-views --no-check-bioc-help' 157 | error-on: 'error' 158 | 159 | - name: Test coverage 160 | if: matrix.config.os == 'macOS-latest' 161 | run: | 162 | install.packages("covr") 163 | covr::codecov(token = "${{secrets.CODECOV_TOKEN}}") 164 | shell: Rscript {0} 165 | 166 | - name: Deploy 167 | if: github.event_name == 'push' && github.ref == 'refs/heads/devel' && matrix.config.os == 'macOS-latest' 168 | run: | 169 | R CMD INSTALL . 170 | Rscript -e "remotes::install_dev('pkgdown'); pkgdown::deploy_to_branch(new_process = FALSE)" 171 | 172 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.Rproj 2 | .Rproj.user 3 | .Rhistory 4 | .RData 5 | .Ruserdata 6 | .DS_Store 7 | /doc/ 8 | /Meta/ 9 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: compcodeR 2 | Type: Package 3 | Title: RNAseq data simulation, differential expression analysis and 4 | performance comparison of differential expression methods 5 | Version: 1.45.0 6 | Authors@R: c( 7 | person("Charlotte", "Soneson", role = c("aut", "cre"), 8 | email = "charlottesoneson@gmail.com", comment = c(ORCID = "0000-0003-3833-2169")), 9 | person("Paul", "Bastide", role = "aut", 10 | email = "paul.bastide@umontpellier.fr", comment = c(ORCID = "0000-0002-8084-9893")), 11 | person("Mélina", "Gallopin", role = "aut", 12 | email = "melina.gallopin@u-psud.fr", comment = c(ORCID = "0000-0002-2431-7825 ")) 13 | ) 14 | Description: This package provides extensive functionality for 15 | comparing results obtained by different methods for 16 | differential expression analysis of RNAseq data. It also 17 | contains functions for simulating count data. Finally, it provides 18 | convenient interfaces to several packages for performing the 19 | differential expression analysis. These can also be used as templates 20 | for setting up and running a user-defined differential analysis 21 | workflow within the framework of the package. 22 | Depends: 23 | R (>= 4.0), 24 | sm 25 | Imports: 26 | knitr (>= 1.2), 27 | markdown, 28 | ROCR, 29 | lattice (>= 0.16), 30 | gplots, 31 | gtools, 32 | caTools, 33 | grid, 34 | KernSmooth, 35 | MASS, 36 | ggplot2, 37 | stringr, 38 | modeest, 39 | edgeR, 40 | limma, 41 | vioplot, 42 | methods, 43 | stats, 44 | utils, 45 | ape, 46 | phylolm, 47 | matrixStats, 48 | grDevices, 49 | graphics, 50 | rmarkdown, 51 | shiny, 52 | shinydashboard 53 | Suggests: 54 | BiocStyle, 55 | EBSeq, 56 | DESeq2 (>= 1.1.31), 57 | genefilter, 58 | NOISeq, 59 | TCC, 60 | NBPSeq (>= 0.3.0), 61 | phytools, 62 | phangorn, 63 | testthat, 64 | ggtree, 65 | tidytree, 66 | statmod, 67 | covr, 68 | sva, 69 | tcltk 70 | Enhances: rpanel, DSS 71 | License: GPL (>= 2) 72 | VignetteBuilder: knitr 73 | biocViews: ImmunoOncology, RNASeq, DifferentialExpression 74 | RoxygenNote: 7.2.3 75 | URL: https://github.com/csoneson/compcodeR 76 | BugReports: https://github.com/csoneson/compcodeR/issues 77 | Encoding: UTF-8 78 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(DESeq2.createRmd) 4 | export(DESeq2.length.createRmd) 5 | export(DSS.createRmd) 6 | export(EBSeq.createRmd) 7 | export(NBPSeq.createRmd) 8 | export(NOISeq.prenorm.createRmd) 9 | export(TCC.createRmd) 10 | export(checkDataObject) 11 | export(checkTableConsistency) 12 | export(check_compData) 13 | export(check_compData_results) 14 | export(check_phyloCompData) 15 | export(compData) 16 | export(convertListTocompData) 17 | export(convertListTophyloCompData) 18 | export(convertcompDataToList) 19 | export(convertphyloCompDataToList) 20 | export(edgeR.GLM.createRmd) 21 | export(edgeR.exact.createRmd) 22 | export(generateCodeHTMLs) 23 | export(generateSyntheticData) 24 | export(lengthNorm.limma.createRmd) 25 | export(lengthNorm.sva.limma.createRmd) 26 | export(listcreateRmd) 27 | export(logcpm.limma.createRmd) 28 | export(phyloCompData) 29 | export(phylolm.createRmd) 30 | export(runComparison) 31 | export(runComparisonGUI) 32 | export(runComparisonShiny) 33 | export(runDiffExp) 34 | export(sqrtcpm.limma.createRmd) 35 | export(summarizeSyntheticDataSet) 36 | export(ttest.createRmd) 37 | export(voom.limma.createRmd) 38 | export(voom.ttest.createRmd) 39 | exportClasses(compData) 40 | exportClasses(phyloCompData) 41 | import(KernSmooth) 42 | import(MASS) 43 | import(ROCR) 44 | import(caTools) 45 | import(edgeR) 46 | import(ggplot2) 47 | import(gplots) 48 | import(grid) 49 | import(gtools) 50 | import(knitr) 51 | import(lattice) 52 | import(limma) 53 | import(markdown) 54 | import(methods) 55 | import(modeest) 56 | import(rmarkdown) 57 | import(sm) 58 | import(stringr) 59 | import(vioplot) 60 | importFrom(grDevices,heat.colors) 61 | importFrom(graphics,axis) 62 | importFrom(graphics,legend) 63 | importFrom(graphics,lines) 64 | importFrom(graphics,par) 65 | importFrom(graphics,title) 66 | importFrom(shiny,actionButton) 67 | importFrom(shiny,checkboxGroupInput) 68 | importFrom(shiny,fluidRow) 69 | importFrom(shiny,htmlOutput) 70 | importFrom(shiny,incProgress) 71 | importFrom(shiny,numericInput) 72 | importFrom(shiny,observeEvent) 73 | importFrom(shiny,reactive) 74 | importFrom(shiny,renderText) 75 | importFrom(shiny,renderUI) 76 | importFrom(shiny,selectInput) 77 | importFrom(shiny,shinyApp) 78 | importFrom(shiny,stopApp) 79 | importFrom(shiny,uiOutput) 80 | importFrom(shiny,withProgress) 81 | importFrom(shinydashboard,box) 82 | importFrom(shinydashboard,dashboardBody) 83 | importFrom(shinydashboard,dashboardHeader) 84 | importFrom(shinydashboard,dashboardPage) 85 | importFrom(shinydashboard,dashboardSidebar) 86 | importFrom(stats,as.dist) 87 | importFrom(stats,cor) 88 | importFrom(stats,hclust) 89 | importFrom(stats,lm) 90 | importFrom(stats,loess) 91 | importFrom(stats,median) 92 | importFrom(stats,na.omit) 93 | importFrom(stats,pf) 94 | importFrom(stats,predict) 95 | importFrom(stats,pt) 96 | importFrom(stats,qf) 97 | importFrom(stats,qt) 98 | importFrom(stats,rexp) 99 | importFrom(stats,rnbinom) 100 | importFrom(stats,rnorm) 101 | importFrom(stats,rpois) 102 | importFrom(stats,runif) 103 | importFrom(stats,sd) 104 | importFrom(utils,head) 105 | importFrom(utils,packageVersion) 106 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | CHANGES IN VERSION 1.37.3 2 | ------------------------- 3 | 4 | o Removed support for baySeq since it has been deprecated 5 | o Added runComparisonShiny function 6 | 7 | CHANGES IN VERSION 1.35.1 8 | ------------------------- 9 | 10 | o Add a function for SVA + limma differential expression analysis 11 | 12 | CHANGES IN VERSION 1.31.1 13 | ------------------------- 14 | 15 | o Implement simulations according to the phylogenetic poisson log normal model 16 | o Implement length-varying simulations 17 | o New PhyloCompData object for phylogenetic informed simulation data 18 | o Add possible length normalization to DESeq2 and limma analyses 19 | o Add phylolm analyses 20 | 21 | CHANGES IN VERSION 1.23.1 22 | ------------------------- 23 | 24 | o Moved vignette to Rmd 25 | 26 | CHANGES IN VERSION 1.17.1 27 | ------------------------- 28 | 29 | o Removed support for SAMseq since samr has been removed from CRAN 30 | 31 | CHANGES IN VERSION 1.5.3 32 | ------------------------ 33 | 34 | o Updated baySeq code to match package version 2.2.0 35 | 36 | CHANGES IN VERSION 1.5.2 37 | ------------------------ 38 | 39 | o Updated NBPseq code to match package version 0.3.0 40 | 41 | CHANGES IN VERSION 1.5.1 42 | ------------------------ 43 | 44 | o Added the number of significant genes, then number of true positives, true negatives, false positives and false negatives as evaluation criteria. 45 | o Bug fixes 46 | 47 | CHANGES IN VERSION 1.3.4 48 | ------------------------ 49 | 50 | o Fixed documentation 51 | 52 | CHANGES IN VERSION 1.3.3 53 | ------------------------ 54 | 55 | o Removed support for HTSDiff since it has been removed from CRAN 56 | 57 | CHANGES IN VERSION 1.3.2 58 | ------------------------ 59 | 60 | o Fixed a bug that prevented data sets with more than 17,343 genes to be simulated (thanks to Simon Greenaway) 61 | 62 | CHANGES IN VERSION 1.3.1 63 | ------------------------ 64 | 65 | o Updated vignette 66 | o Added citation file 67 | 68 | CHANGES IN VERSION 1.2.0 69 | ------------------------ 70 | 71 | o Release version with Bioconductor 3.0 72 | 73 | CHANGES IN VERSION 1.1.4 74 | ------------------------ 75 | 76 | o Added MCC (Matthew's correlation coefficient) as evaluation measure 77 | 78 | CHANGES IN VERSION 1.1.3 79 | ------------------------ 80 | 81 | o Fixed summarizeSyntheticDataSet to work also for non-simulated data 82 | 83 | CHANGES IN VERSION 1.1.2 84 | ------------------------ 85 | 86 | o Added reference information for TCC (thanks to Koji Kadota) 87 | 88 | CHANGES IN VERSION 1.1.1 89 | ------------------------ 90 | 91 | o Bug fix in EBSeq quantile normalization (thanks to Rory Kirchner) 92 | 93 | CHANGES IN VERSION 0.99.3 94 | ------------------------- 95 | 96 | o Bug fixes 97 | 98 | CHANGES IN VERSION 0.99.2 99 | ------------------------- 100 | 101 | o Extended the examples 102 | o Bug fixes 103 | 104 | CHANGES IN VERSION 0.99.1 105 | ------------------------- 106 | 107 | o inclusion of an additional comparison metric, relating the gene score to the signal strength for genes expressed in only one condition 108 | o improved documentation of the compData class 109 | 110 | CHANGES IN VERSION 0.99.0 111 | ------------------------- 112 | 113 | o identical to 0.2.0, renamed for Bioconductor submission 114 | 115 | CHANGES IN VERSION 0.2.0 116 | ------------------------ 117 | 118 | o introduction of a new S4 class (compData) and associated functions 119 | o more examples, checks and error messages 120 | o more options for providing user-specified values in the data simulation 121 | o changed the range of the color palette in the Spearman correlation plots to [-1,1] 122 | 123 | CHANGES IN VERSION 0.1.0 124 | ------------------------ 125 | 126 | o first version 127 | -------------------------------------------------------------------------------- /R/checkObjects.R: -------------------------------------------------------------------------------- 1 | #' Check a list or a \code{compData} object for compatibility with the differential expression functions interfaced by \code{compcodeR} 2 | #' 3 | #' Check if a list or a \code{compData} object contains the necessary slots for applying the differential expression functions interfaced by the \code{compcodeR} package. This function is provided for backward compatibility, see also \code{\link{check_compData}} and \code{\link{check_compData_results}}. 4 | #' 5 | #' @param data.obj A list containing data and condition information, or a \code{compData} object. 6 | #' @author Charlotte Soneson 7 | #' @export 8 | #' @examples 9 | #' mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 10 | #' samples.per.cond = 5, n.diffexp = 100) 11 | #' checkDataObject(mydata.obj) 12 | checkDataObject <- function(data.obj) { 13 | if (is.list(data.obj)) data.obj <- convertListTocompData(data.obj) 14 | if (check_compData(data.obj) == TRUE) { 15 | "Data object looks ok." 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /R/compcodeR-package.R: -------------------------------------------------------------------------------- 1 | #' RNAseq data simulation, differential expression analysis and 2 | #' performance comparison of differential expression methods 3 | #' 4 | #' This package provides extensive functionality for comparing 5 | #' results obtained by different methods for differential expression analysis 6 | #' of RNAseq data. It also contains functions for simulating count data and 7 | #' interfaces to several packages for performing the differential expression analysis. 8 | #' @name compcodeR-package 9 | #' @aliases compcodeR 10 | #' @docType package 11 | #' @import knitr markdown ROCR lattice gplots gtools caTools grid KernSmooth MASS ggplot2 stringr modeest limma edgeR vioplot methods rmarkdown sm 12 | #' @title RNAseq data simulation, differential expression analysis and 13 | #' performance comparison of differential expression methods 14 | #' @author Charlotte Soneson 15 | #' @keywords package 16 | NULL 17 | -------------------------------------------------------------------------------- /R/generateCodeHTMLs.R: -------------------------------------------------------------------------------- 1 | #' Generate HTML file(s) containing code used to run differential expression analysis. 2 | #' 3 | #' A function to extract the code used to generate differential expression results from saved \code{compData} result objects (typically obtained by \code{\link{runDiffExp}}), and to write the code to HTML files. This requires that the code was saved as a character string in R markdown format in the \code{code} slot of the result object, which is done automatically by \code{\link{runDiffExp}}. If the differential expression analysis was performed with functions outside \code{compcodeR}, the code has to be added manually to the result object. 4 | #' 5 | #' @param input.files A vector with paths to one or several \code{.rds} files containing \code{compData} objects with the results from differential expression analysis. One code HTML file is generated for each file in the vector. 6 | #' @param output.directory The path to the directory where the code HTML files will be saved. 7 | #' @export 8 | #' @author Charlotte Soneson 9 | #' @examples 10 | #' tmpdir <- normalizePath(tempdir(), winslash = "/") 11 | #' mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 12 | #' samples.per.cond = 5, n.diffexp = 100, 13 | #' output.file = file.path(tmpdir, "mydata.rds")) 14 | #' runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 15 | #' Rmdfunction = "voom.limma.createRmd", output.directory = tmpdir, 16 | #' norm.method = "TMM") 17 | #' generateCodeHTMLs(file.path(tmpdir, "mydata_voom.limma.rds"), tmpdir) 18 | generateCodeHTMLs <- function(input.files, output.directory) { 19 | input.files <- normalizePath(input.files, winslash = "/") 20 | output.directory <- normalizePath(output.directory, winslash = "/") 21 | 22 | for (i in seq_len(length(input.files))) { 23 | temp <- as.character(input.files[i]) 24 | if (!(substr(basename(temp), nchar(basename(temp)) - 3, nchar(basename(temp))) == ".rds")) { 25 | message(paste(temp, "is not an .rds file, no code file will be generated.")) 26 | } else { 27 | ## Extract only the filename (that will be used to name the code file) 28 | filename <- sub(".rds", "", basename(temp)) 29 | rdsobj <- readRDS(temp) 30 | ## If it is a list, convert to a compData object 31 | if (is.list(rdsobj)) { 32 | rdsobj <- convertListTocompData(rdsobj) 33 | } 34 | if (!is.logical(check_compData(rdsobj))) { 35 | message(paste(temp, "is not a valid compData object, no code file will be generated.")) 36 | } else { 37 | if (length(code(rdsobj)) == 0) { 38 | message(paste("Code not available in", input.files[i])) 39 | } else { 40 | ## Create the code file 41 | codefile <- file.path(output.directory, paste(filename, "_code.md", sep = "")) 42 | fileConn <- file(codefile) 43 | 44 | ## Write the code to the file 45 | writeLines(text = code(rdsobj), con = fileConn) 46 | close(fileConn) 47 | 48 | ## Generate HTML file 49 | rmarkdown::pandoc_convert(input = codefile, 50 | output = str_replace(codefile, pattern = ".md", replacement = ".html")) 51 | # markdownToHTML(file = codefile, 52 | # output = str_replace(codefile, pattern = ".md", replacement = ".html"), 53 | # title = 'Code') 54 | 55 | ## Remove the temporary markdown file 56 | file.remove(codefile) 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /R/runDiffExp.R: -------------------------------------------------------------------------------- 1 | checkClass <- function(object, objname, trueclass) { 2 | if (!(is(object, trueclass))) { 3 | stop(paste("The object", objname, "should be of class", trueclass)) 4 | } 5 | } 6 | 7 | #' The main function to run differential expression analysis 8 | #' 9 | #' The main function for running differential expression analysis (comparing two conditions), using one of the methods interfaced through \code{compcodeR} or a user-defined method. Note that the interface functions are provided for convenience and as templates for other, user-defined workflows, and there is no guarantee that the included differential expression code is kept up-to-date with the latest recommendations and best practices for running each of the interfaced methods, or that the chosen settings are suitable in all situations. The user should make sure that the analysis is performed in the way they intend, and check the code that was run, using e.g. the \code{generateCodeHTMLs()} function. 10 | #' 11 | #' @param data.file The path to a \code{.rds} file containing the data on which the differential expression analysis will be performed, for example a \code{compData} object returned from \code{\link{generateSyntheticData}}. 12 | #' @param result.extent The extension that will be added to the data file name in order to construct the result file name. This can be for example the differential expression method together with a version number. 13 | #' @param Rmdfunction A function that creates an Rmd file containing the code that should be run to perform the differential expression analysis. All functions available through \code{compcodeR} can be listed using the \code{\link{listcreateRmd}} function. 14 | #' @param output.directory The directory in which the result object will be saved. 15 | #' @param norm.path Logical, whether to include the full (absolute) path to the output object in the saved code. 16 | #' @param ... Additional arguments that will be passed to the \code{Rmdfunction}, such as parameter choices for the differential expression method. 17 | #' @export 18 | #' 19 | #' @author Charlotte Soneson 20 | #' @examples 21 | #' tmpdir <- normalizePath(tempdir(), winslash = "/") 22 | #' mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 23 | #' samples.per.cond = 5, n.diffexp = 100, 24 | #' output.file = file.path(tmpdir, "mydata.rds")) 25 | #' listcreateRmd() 26 | #' runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 27 | #' Rmdfunction = "voom.limma.createRmd", 28 | #' output.directory = tmpdir, norm.method = "TMM") 29 | #' 30 | #' if (interactive()) { 31 | #' ## The following list covers the currently available 32 | #' ## differential expression methods: 33 | #' runDiffExp(data.file = "mydata.rds", result.extent = "DESeq2", 34 | #' Rmdfunction = "DESeq2.createRmd", 35 | #' output.directory = ".", fit.type = "parametric", 36 | #' test = "Wald", beta.prior = TRUE, 37 | #' independent.filtering = TRUE, cooks.cutoff = TRUE, 38 | #' impute.outliers = TRUE) 39 | #' runDiffExp(data.file = "mydata.rds", result.extent = "DSS", 40 | #' Rmdfunction = "DSS.createRmd", 41 | #' output.directory = ".", norm.method = "quantile", 42 | #' disp.trend = TRUE) 43 | #' runDiffExp(data.file = "mydata.rds", result.extent = "EBSeq", 44 | #' Rmdfunction = "EBSeq.createRmd", 45 | #' output.directory = ".", norm.method = "median") 46 | #' runDiffExp(data.file = "mydata.rds", result.extent = "edgeR.exact", 47 | #' Rmdfunction = "edgeR.exact.createRmd", 48 | #' output.directory = ".", norm.method = "TMM", 49 | #' trend.method = "movingave", disp.type = "tagwise") 50 | #' runDiffExp(data.file = "mydata.rds", result.extent = "edgeR.GLM", 51 | #' Rmdfunction = "edgeR.GLM.createRmd", 52 | #' output.directory = ".", norm.method = "TMM", 53 | #' disp.type = "tagwise", disp.method = "CoxReid", 54 | #' trended = TRUE) 55 | #' runDiffExp(data.file = "mydata.rds", result.extent = "logcpm.limma", 56 | #' Rmdfunction = "logcpm.limma.createRmd", 57 | #' output.directory = ".", norm.method = "TMM") 58 | #' runDiffExp(data.file = "mydata.rds", result.extent = "NBPSeq", 59 | #' Rmdfunction = "NBPSeq.createRmd", 60 | #' output.directory = ".", norm.method = "TMM", 61 | #' disp.method = "NBP") 62 | #' runDiffExp(data.file = "mydata.rds", result.extent = "NOISeq", 63 | #' Rmdfunction = "NOISeq.prenorm.createRmd", 64 | #' output.directory = ".", norm.method = "TMM") 65 | #' runDiffExp(data.file = "mydata.rds", result.extent = "sqrtcpm.limma", 66 | #' Rmdfunction = "sqrtcpm.limma.createRmd", 67 | #' output.directory = ".", norm.method = "TMM") 68 | #' runDiffExp(data.file = "mydata.rds", result.extent = "TCC", 69 | #' Rmdfunction = "TCC.createRmd", 70 | #' output.directory = ".", norm.method = "tmm", 71 | #' test.method = "edger", iteration = 3, 72 | #' normFDR = 0.1, floorPDEG = 0.05) 73 | #' runDiffExp(data.file = "mydata.rds", result.extent = "ttest", 74 | #' Rmdfunction = "ttest.createRmd", 75 | #' output.directory = ".", norm.method = "TMM") 76 | #' runDiffExp(data.file = "mydata.rds", result.extent = "voom.limma", 77 | #' Rmdfunction = "voom.limma.createRmd", 78 | #' output.directory = ".", norm.method = "TMM") 79 | #' runDiffExp(data.file = "mydata.rds", result.extent = "voom.ttest", 80 | #' Rmdfunction = "voom.ttest.createRmd", 81 | #' output.directory = ".", norm.method = "TMM") 82 | #' } 83 | runDiffExp <- function(data.file, result.extent, Rmdfunction, 84 | output.directory = ".", norm.path = TRUE, ...) { 85 | code.file <- tempfile(pattern = "tempcode", tmpdir = output.directory, fileext = ".Rmd") 86 | checkClass(data.file, "data.file", "character") 87 | checkClass(result.extent, "result.extent", "character") 88 | checkClass(Rmdfunction, "Rmdfunction", "character") 89 | checkClass(output.directory, "output.directory", "character") 90 | 91 | if (norm.path) { 92 | output.directory <- normalizePath(output.directory, winslash = "/") 93 | } else { 94 | ## Just remove any trailing "/" 95 | if (substr(output.directory, nchar(output.directory), nchar(output.directory)) == "/") { 96 | output.directory <- substr(output.directory, 1, nchar(output.directory) - 1) 97 | } 98 | } 99 | 100 | ## Extract the file name of the data file (after the last /), and extend it with the 101 | ## result.extent (before the .rds) to create the result file name. 102 | data.file.name <- basename(data.file) 103 | result.file <- file.path(output.directory, 104 | gsub(".rds", paste("_", result.extent, ".rds", sep = ""), 105 | data.file.name)) 106 | 107 | ## Create the .Rmd file with the differential expression code 108 | eval(parse(text = Rmdfunction))(data.file, result.file, code.file, ...) 109 | input.Rmd <- code.file 110 | 111 | ## Run the differential expression analysis 112 | knit(input = input.Rmd, output = str_replace(code.file, ".Rmd", ".md")) 113 | 114 | ## Add the code to the result object 115 | temp.file <- readRDS(result.file) 116 | if (is.list(temp.file)) temp.file <- convertListTocompData(temp.file) 117 | code(temp.file) <- readLines(str_replace(code.file, ".Rmd", ".md")) 118 | saveRDS(temp.file, file = result.file) 119 | 120 | ## Remove the temporary code file 121 | file.remove(code.file) 122 | file.remove(str_replace(code.file, ".Rmd", ".md")) 123 | } 124 | -------------------------------------------------------------------------------- /R/show-methods.R: -------------------------------------------------------------------------------- 1 | #' Show function for \code{compData} object 2 | #' 3 | #' Show function for \code{compData} object. 4 | #' @param object A \code{compData} object 5 | #' 6 | #' @keywords internal 7 | #' 8 | show_compData <- function(object) { 9 | nbr.random.outliers <- 10 | sum(object@variable.annotations$n.random.outliers.up.S1 + 11 | object@variable.annotations$n.random.outliers.down.S1 + 12 | object@variable.annotations$n.random.outliers.up.S2 + 13 | object@variable.annotations$n.random.outliers.down.S2) 14 | nbr.single.outliers <- 15 | sum(object@variable.annotations$n.single.outliers.up.S1 + 16 | object@variable.annotations$n.single.outliers.down.S1 + 17 | object@variable.annotations$n.single.outliers.up.S2 + 18 | object@variable.annotations$n.single.outliers.down.S2) 19 | nbr.diffexp <- sum(object@variable.annotations$differential.expression) 20 | if (length(object@method.names) == 0) { 21 | diffexp.statement <- "No differential expression analysis has been performed." 22 | } else { 23 | diffexp.statement <- 24 | paste("Differential expression analysis was performed by the method", 25 | object@method.names$full.name, "on", 26 | object@analysis.date, ".") 27 | } 28 | cat(paste("An object of class", class(object), "\n")) 29 | cat(paste("Dataset name:", object@info.parameters$dataset, "\n")) 30 | cat(paste("Number of samples:", ncol(object@count.matrix), "\n")) 31 | cat(paste("Number of variables:", nrow(object@count.matrix), "\n")) 32 | cat(paste("Number of random outliers:", nbr.random.outliers, "\n")) 33 | cat(paste("Number of single outliers:", nbr.single.outliers, "\n")) 34 | cat(paste("Number of known truly differentially expressed genes:", nbr.diffexp, "\n")) 35 | cat(paste(diffexp.statement, "\n\n")) 36 | cat("count.matrix:\n") 37 | print(utils::head(object@count.matrix[, seq_len(min(ncol(object@count.matrix), 6))])) 38 | nbrleftoutrows <- max(c(0, nrow(object@count.matrix) - 6)) 39 | nbrleftoutcols <- max(c(0, ncol(object@count.matrix) - 6)) 40 | if (nbrleftoutrows > 0 & nbrleftoutcols > 0) { 41 | cat(paste("+", nbrleftoutrows, "rows and", nbrleftoutcols, "cols...\n\n")) 42 | } else if (nbrleftoutrows > 0) { 43 | cat(paste("+", nbrleftoutrows, "rows...\n\n")) 44 | } else if (nbrleftoutcols > 0) { 45 | cat(paste("+", nbrleftoutrows, "cols...\n\n")) 46 | } 47 | cat("sample.annotations:\n") 48 | print(utils::head(object@sample.annotations)) 49 | nbrleftoutrows <- max(c(0, nrow(object@sample.annotations) - 6)) 50 | if (nbrleftoutrows > 0) { 51 | cat(paste("+", nbrleftoutrows, "rows...\n\n")) 52 | } else { 53 | cat("\n") 54 | } 55 | cat("variable.annotations:\n") 56 | print(utils::head(object@variable.annotations)) 57 | nbrleftoutrows <- max(c(0, nrow(object@variable.annotations) - 6)) 58 | if (nbrleftoutrows > 0) { 59 | cat(paste("+", nbrleftoutrows, "rows...\n\n")) 60 | } else { 61 | cat("\n") 62 | } 63 | 64 | if (length(object@method.names) != 0) { 65 | cat("Differential expression results:\n\n") 66 | print(utils::head(object@result.table)) 67 | nbrleftoutrows <- max(c(0, nrow(object@result.table) - 6)) 68 | if (nbrleftoutrows > 0) { 69 | cat(paste("+", nbrleftoutrows, "rows...\n\n")) 70 | } else { 71 | cat("\n") 72 | } 73 | } 74 | } 75 | 76 | #' Show method for \code{compData} object 77 | #' 78 | #' Show method for \code{compData} object. 79 | #' @param object A \code{compData} object 80 | #' @author Charlotte Soneson 81 | #' @examples 82 | #' mydata <- generateSyntheticData(dataset = "mydata", n.vars = 12500, 83 | #' samples.per.cond = 5, n.diffexp = 1250) 84 | #' mydata 85 | #' @importFrom utils head 86 | setMethod( 87 | f = "show", # name of function 88 | signature = "compData", # class of each argument. other ex: signature = c(x = , y = ) 89 | definition = show_compData 90 | ) 91 | 92 | #' Show method for \code{phyloCompData} object 93 | #' 94 | #' Show method for \code{phyloCompData} object. 95 | #' @param object A \code{phyloCompData} object 96 | #' @author Charlotte Soneson, Paul Bastide 97 | #' @examples 98 | #' mydata <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 99 | #' samples.per.cond = 5, n.diffexp = 100, 100 | #' id.species = factor(1:10), 101 | #' tree = ape::rphylo(10, 1, 0), 102 | #' lengths.relmeans = "auto", lengths.dispersions = "auto") 103 | #' mydata 104 | #' @importFrom utils head 105 | setMethod( 106 | f = "show", # name of function 107 | signature = "phyloCompData", # class of each argument. other ex: signature = c(x = , y = ) 108 | definition = function(object) { 109 | show_compData(object) 110 | 111 | if (length(object@tree) != 0) { 112 | cat("Phylogenetic tree:\n") 113 | print(object@tree) 114 | cat("\n") 115 | } else { 116 | cat("Without phylogenetic tree. \n") 117 | } 118 | 119 | if (length(object@length.matrix) != 0) { 120 | cat("length.matrix:\n") 121 | print(head(object@length.matrix[, 1:min(ncol(object@length.matrix), 6)])) 122 | cat("\n") 123 | } else { 124 | cat("No length matrix. \n") 125 | } 126 | } 127 | ) 128 | 129 | #setGeneric("show") 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## compcodeR 2 | 3 | [![R build status](https://github.com/csoneson/compcodeR/workflows/R-CMD-check/badge.svg)](https://github.com/csoneson/compcodeR/actions) 4 | 5 | **compcodeR** is an R package that provides extensive functionality for comparing results obtained by different methods for differential expression analysis of (mainly) RNAseq data. It also contains functions for simulating count data and interfaces to several packages for performing the differential expression analysis. 6 | 7 | The release version of **compcodeR** can be installed via [Bioconductor](http://www.bioconductor.org/packages/release/bioc/html/compcodeR.html): 8 | 9 | ``` 10 | install.packages("BiocManager") 11 | BiocManager::install("compcodeR") 12 | ``` 13 | 14 | The most recent (development) version can also be installed from GitHub directly: 15 | 16 | ``` 17 | BiocManager::install("csoneson/compcodeR") 18 | ``` 19 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citEntry(entry = "article", 2 | title = "compcodeR - an R package for benchmarking differential expression methods for RNA-seq data", 3 | author = "Charlotte Soneson", 4 | year = 2014, 5 | journal = "Bioinformatics", 6 | volume = "30", 7 | number = "17", 8 | pages = "2517-2518", 9 | textVersion = "Charlotte Soneson (2014): compcodeR - an R package for benchmarking differential expression methods for RNA-seq data. Bioinformatics 30(17):2517-2518") -------------------------------------------------------------------------------- /inst/extdata/Pickrell.Cheung.Mu.Phi.Estimates.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/inst/extdata/Pickrell.Cheung.Mu.Phi.Estimates.rds -------------------------------------------------------------------------------- /inst/extdata/Stern2018.Length.Mu.Phi.Estimates.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/inst/extdata/Stern2018.Length.Mu.Phi.Estimates.rds -------------------------------------------------------------------------------- /inst/extdata/Stern2018.tree: -------------------------------------------------------------------------------- 1 | ((((t11_1:3.076923084e-14,t11_2:0)NA:3.076923084e-14,t11_3:0)NA:0.4846295242,((t13_1:3.076923084e-14,t13_2:0)NA:0.3399398316,((t12_1:3.076923084e-14,t12_2:0)NA:0.07225760017,t14_1:0.07225760017)1:0.2676822314)1:0.1446896926)2:0.5153704758,(((t7_1:3.076923084e-14,t7_2:0)NA:3.076923084e-14,t7_3:0)NA:0.8495918609,((((t2_1:3.076923084e-14,t2_2:0)NA:3.076923084e-14,t2_3:0)NA:0.5752774167,(t1_1:0.5078042012,((t4_1:3.076923084e-14,t4_2:0)NA:3.076923084e-14,t4_3:0)NA:0.5078042012)1:0.06747321554)2:0.03702385393,(((t5_1:3.076923084e-14,t5_2:0)NA:3.076923084e-14,t5_3:0)NA:0.5383997705,((((t9_1:3.076923084e-14,t9_2:0)NA:3.076923084e-14,t9_3:0)NA:0.2407900159,(t10_1:3.076923084e-14,t10_2:0)NA:0.2407900159)1:0.2038925082,(((t3_1:3.076923084e-14,t3_2:0)NA:3.076923084e-14,t3_3:0)NA:0.3895370932,((t6_1:3.076923084e-14,t6_2:0)NA:0.09432235406,((t8_1:3.076923084e-14,t8_2:0)NA:3.076923084e-14,t8_3:0)NA:0.09432235406)2:0.2952147391)2:0.0551454309)2:0.09371724637)2:0.07390150017)2:0.2372905902)2:0.1504081391)2; -------------------------------------------------------------------------------- /man/DESeq2.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{DESeq2.createRmd} 4 | \alias{DESeq2.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with DESeq2} 6 | \usage{ 7 | DESeq2.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | fit.type, 12 | test, 13 | beta.prior = TRUE, 14 | independent.filtering = TRUE, 15 | cooks.cutoff = TRUE, 16 | impute.outliers = TRUE, 17 | nas.as.ones = FALSE 18 | ) 19 | } 20 | \arguments{ 21 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 22 | 23 | \item{result.path}{The path to the file where the result object will be saved.} 24 | 25 | \item{codefile}{The path to the file where the code will be written.} 26 | 27 | \item{fit.type}{The fitting method used to get the dispersion-mean relationship. Possible values are \code{"parametric"}, \code{"local"} and \code{"mean"}.} 28 | 29 | \item{test}{The test to use. Possible values are \code{"Wald"} and \code{"LRT"}.} 30 | 31 | \item{beta.prior}{Whether or not to put a zero-mean normal prior on the non-intercept coefficients. Default is \code{TRUE}.} 32 | 33 | \item{independent.filtering}{Whether or not to perform independent filtering of the data. With independent filtering=TRUE, the adjusted p-values for genes not passing the filter threshold are set to NA.} 34 | 35 | \item{cooks.cutoff}{The cutoff value for the Cook's distance to consider a value to be an outlier. Set to Inf or FALSE to disable outlier detection. For genes with detected outliers, the p-value and adjusted p-value will be set to NA.} 36 | 37 | \item{impute.outliers}{Whether or not the outliers should be replaced by a trimmed mean and the analysis rerun.} 38 | 39 | \item{nas.as.ones}{Whether or not adjusted p values that are returned as \code{NA} by \code{DESeq2} should be set to \code{1}. This option is useful for comparisons with other methods. For more details, see section "I want to benchmark DESeq2 comparing to other DE tools" from the \code{DESeq2} vignette (available by running \code{vignette("DESeq2", package = "DESeq2")}). Default to \code{FALSE}.} 40 | } 41 | \value{ 42 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 43 | } 44 | \description{ 45 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the DESeq2 package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 46 | } 47 | \details{ 48 | For more information about the methods and the interpretation of the parameters, see the \code{DESeq2} package and the corresponding publications. 49 | } 50 | \examples{ 51 | try( 52 | if (require(DESeq2)) { 53 | tmpdir <- normalizePath(tempdir(), winslash = "/") 54 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 55 | samples.per.cond = 5, n.diffexp = 100, 56 | output.file = file.path(tmpdir, "mydata.rds")) 57 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "DESeq2", 58 | Rmdfunction = "DESeq2.createRmd", 59 | output.directory = tmpdir, fit.type = "parametric", 60 | test = "Wald") 61 | }) 62 | } 63 | \references{ 64 | Anders S and Huber W (2010): Differential expression analysis for sequence count data. Genome Biology 11:R106 65 | } 66 | \author{ 67 | Charlotte Soneson 68 | } 69 | -------------------------------------------------------------------------------- /man/DESeq2.length.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExpPhylo.R 3 | \name{DESeq2.length.createRmd} 4 | \alias{DESeq2.length.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with DESeq2 with custom model matrix} 6 | \usage{ 7 | DESeq2.length.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | fit.type, 12 | test, 13 | beta.prior = TRUE, 14 | independent.filtering = TRUE, 15 | cooks.cutoff = TRUE, 16 | impute.outliers = TRUE, 17 | extra.design.covariates = NULL, 18 | nas.as.ones = FALSE 19 | ) 20 | } 21 | \arguments{ 22 | \item{data.path}{The path to a .rds file containing the \code{phyloCompData} object that will be used for the differential expression analysis.} 23 | 24 | \item{result.path}{The path to the file where the result object will be saved.} 25 | 26 | \item{codefile}{The path to the file where the code will be written.} 27 | 28 | \item{fit.type}{The fitting method used to get the dispersion-mean relationship. Possible values are \code{"parametric"}, \code{"local"} and \code{"mean"}.} 29 | 30 | \item{test}{The test to use. Possible values are \code{"Wald"} and \code{"LRT"}.} 31 | 32 | \item{beta.prior}{Whether or not to put a zero-mean normal prior on the non-intercept coefficients. Default is \code{TRUE}.} 33 | 34 | \item{independent.filtering}{Whether or not to perform independent filtering of the data. With independent filtering=TRUE, the adjusted p-values for genes not passing the filter threshold are set to NA.} 35 | 36 | \item{cooks.cutoff}{The cutoff value for the Cook's distance to consider a value to be an outlier. Set to Inf or FALSE to disable outlier detection. For genes with detected outliers, the p-value and adjusted p-value will be set to NA.} 37 | 38 | \item{impute.outliers}{Whether or not the outliers should be replaced by a trimmed mean and the analysis rerun.} 39 | 40 | \item{extra.design.covariates}{A vector containing the names of extra control variables to be passed to the design matrix of \code{DESeq2}. All the covariates need to be a column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object, with a matching column name. The covariates can be a numeric vector, or a factor. Note that "condition" factor column is always included, and should not be added here. See Details.} 41 | 42 | \item{nas.as.ones}{Whether or not adjusted p values that are returned as \code{NA} by \code{DESeq2} should be set to \code{1}. This option is useful for comparisons with other methods. For more details, see section "I want to benchmark DESeq2 comparing to other DE tools" from the \code{DESeq2} vignette (available by running \code{vignette("DESeq2", package = "DESeq2")}). Default to \code{FALSE}.} 43 | } 44 | \value{ 45 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 46 | } 47 | \description{ 48 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the DESeq2 package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 49 | } 50 | \details{ 51 | For more information about the methods and the interpretation of the parameters, see the \code{DESeq2} package and the corresponding publications. 52 | 53 | 54 | The lengths matrix is used as a normalization factor and applied to the \code{DESeq2} 55 | model in the way explained in \code{\link[DESeq2]{normalizationFactors}} 56 | (see examples of this function). 57 | The provided matrix will be multiplied by the default normalization factor 58 | obtained through the \code{\link[DESeq2]{estimateSizeFactors}} function. 59 | 60 | The \code{design} model used in the \code{\link[DESeq2]{DESeqDataSetFromMatrix}} 61 | uses the "condition" column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object 62 | as well as all the covariates named in \code{extra.design.covariates}. 63 | For example, if \code{extra.design.covariates = c("var1", "var2")}, then 64 | \code{sample.annotations} must have two columns named "var1" and "var2", and the design formula 65 | in the \code{\link[DESeq2]{DESeqDataSetFromMatrix}} function will be: 66 | \code{~ condition + var1 + var2}. 67 | } 68 | \examples{ 69 | try( 70 | if (require(DESeq2)) { 71 | tmpdir <- normalizePath(tempdir(), winslash = "/") 72 | ## Simulate data 73 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 74 | samples.per.cond = 5, n.diffexp = 100, 75 | id.species = 1:10, 76 | lengths.relmeans = rpois(1000, 1000), 77 | lengths.dispersions = rgamma(1000, 1, 1), 78 | output.file = file.path(tmpdir, "mydata.rds")) 79 | ## Add covariates 80 | ## Model fitted is count.matrix ~ condition + test_factor + test_reg 81 | sample.annotations(mydata.obj)$test_factor <- factor(rep(1:2, each = 5)) 82 | sample.annotations(mydata.obj)$test_reg <- rnorm(10, 0, 1) 83 | saveRDS(mydata.obj, file.path(tmpdir, "mydata.rds")) 84 | ## Diff Exp 85 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "DESeq2", 86 | Rmdfunction = "DESeq2.length.createRmd", 87 | output.directory = tmpdir, fit.type = "parametric", 88 | test = "Wald", 89 | extra.design.covariates = c("test_factor", "test_reg")) 90 | }) 91 | } 92 | \references{ 93 | Anders S and Huber W (2010): Differential expression analysis for sequence count data. Genome Biology 11:R106 94 | 95 | Love, M.I., Huber, W., Anders, S. (2014) Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15:550. 10.1186/s13059-014-0550-8. 96 | } 97 | \author{ 98 | Charlotte Soneson, Paul Bastide, Mélina Gallopin 99 | } 100 | -------------------------------------------------------------------------------- /man/DSS.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{DSS.createRmd} 4 | \alias{DSS.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with DSS} 6 | \usage{ 7 | DSS.createRmd(data.path, result.path, codefile, norm.method, disp.trend) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. Possible values are \code{"quantile"}, \code{"total"} and \code{"median"}.} 17 | 18 | \item{disp.trend}{A logical parameter indicating whether or not to include a trend in the dispersion estimation.} 19 | } 20 | \description{ 21 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the DSS package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 22 | } 23 | \details{ 24 | For more information about the methods and the interpretation of the parameters, see the \code{DSS} package and the corresponding publications. 25 | } 26 | \examples{ 27 | try( 28 | if (require(DSS)) { 29 | tmpdir <- normalizePath(tempdir(), winslash = "/") 30 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 31 | samples.per.cond = 5, n.diffexp = 100, 32 | output.file = file.path(tmpdir, "mydata.rds")) 33 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "DSS", 34 | Rmdfunction = "DSS.createRmd", 35 | output.directory = tmpdir, norm.method = "quantile", 36 | disp.trend = TRUE) 37 | }) 38 | } 39 | \references{ 40 | Wu H, Wang C and Wu Z (2013): A new shrinkage estimator for dispersion improves differential expression detection in RNA-seq data. Biostatistics 14(2), 232-243 41 | } 42 | \author{ 43 | Charlotte Soneson 44 | } 45 | -------------------------------------------------------------------------------- /man/EBSeq.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{EBSeq.createRmd} 4 | \alias{EBSeq.createRmd} 5 | \title{Generate a .Rmd file containing code to perform differential expression analysis with EBSeq} 6 | \usage{ 7 | EBSeq.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. Possible values are \code{"median"} and \code{"quantile"}.} 17 | } 18 | \value{ 19 | The function generates a .Rmd file containing the differential expression code. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the \code{EBSeq} package. The code is written to a .Rmd file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the meaning of the parameters, see the \code{EBSeq} package and the corresponding publications. 26 | } 27 | \examples{ 28 | try( 29 | if (require(EBSeq)) { 30 | tmpdir <- normalizePath(tempdir(), winslash = "/") 31 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 32 | samples.per.cond = 5, n.diffexp = 100, 33 | output.file = file.path(tmpdir, "mydata.rds")) 34 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "EBSeq", 35 | Rmdfunction = "EBSeq.createRmd", 36 | output.directory = tmpdir, norm.method = "median") 37 | } 38 | ) 39 | } 40 | \references{ 41 | Leng N, Dawson JA, Thomson JA, Ruotti V, Rissman AI, Smits BMG, Haag JD, Gould MN, Stewart RM and Kendziorski C (2013): EBSeq: An empirical Bayes hierarchical model for inference in RNA-seq experiments. Bioinformatics 42 | } 43 | \author{ 44 | Charlotte Soneson 45 | } 46 | -------------------------------------------------------------------------------- /man/NBPSeq.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{NBPSeq.createRmd} 4 | \alias{NBPSeq.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with NBPSeq} 6 | \usage{ 7 | NBPSeq.createRmd(data.path, result.path, codefile, norm.method, disp.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 17 | 18 | \item{disp.method}{The method to use to estimate the dispersion values. Possible values are \code{"NBP"} and \code{"NB2"}.} 19 | } 20 | \value{ 21 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 22 | } 23 | \description{ 24 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using \code{NBPSeq}. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 25 | } 26 | \details{ 27 | For more information about the methods and the interpretation of the parameters, see the \code{NBPSeq} and \code{edgeR} packages and the corresponding publications. 28 | } 29 | \examples{ 30 | try( 31 | if (require(NBPSeq)) { 32 | tmpdir <- normalizePath(tempdir(), winslash = "/") 33 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 34 | samples.per.cond = 5, n.diffexp = 100, 35 | output.file = file.path(tmpdir, "mydata.rds")) 36 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "NBPSeq", 37 | Rmdfunction = "NBPSeq.createRmd", 38 | output.directory = tmpdir, norm.method = "TMM", disp.method = "NBP") 39 | }) 40 | } 41 | \references{ 42 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 43 | 44 | Robinson MD and Oshlack A (2010): A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11:R25 45 | 46 | Di Y, Schafer DW, Cumbie JS, and Chang JH (2011): The NBP Negative Binomial Model for Assessing Differential Gene Expression from RNA-Seq. Statistical Applications in Genetics and Molecular Biology 10(1), 1-28 47 | } 48 | \author{ 49 | Charlotte Soneson 50 | } 51 | -------------------------------------------------------------------------------- /man/NB_to_PLN.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{NB_to_PLN} 4 | \alias{NB_to_PLN} 5 | \title{Negative Binomial to Poisson Log-Normal} 6 | \usage{ 7 | NB_to_PLN(mean, dispersion) 8 | } 9 | \arguments{ 10 | \item{mean}{mean of the negative binomial.} 11 | 12 | \item{dispersion}{dispersion of the negative binomial.} 13 | } 14 | \value{ 15 | A list, with: 16 | \describe{ 17 | \item{log_means_pln}{Mean of the Poisson log normal in the log space.} 18 | \item{log_variances_pln}{Variance of the Poisson log normal in the log space.} 19 | } 20 | } 21 | \description{ 22 | From the parameters of a negative binomial (mean and dispersion), 23 | compute the parameters of a Poisson log-normal with the 24 | same expectation and variance. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/NOISeq.prenorm.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{NOISeq.prenorm.createRmd} 4 | \alias{NOISeq.prenorm.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with NOISeq} 6 | \usage{ 7 | NOISeq.prenorm.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using \code{NOISeq}. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{NOISeq} package and the corresponding publications. 26 | } 27 | \examples{ 28 | try( 29 | if (require(NOISeq)) { 30 | tmpdir <- normalizePath(tempdir(), winslash = "/") 31 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 32 | samples.per.cond = 5, n.diffexp = 100, 33 | output.file = file.path(tmpdir, "mydata.rds")) 34 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "NOISeq", 35 | Rmdfunction = "NOISeq.prenorm.createRmd", 36 | output.directory = tmpdir, norm.method = "TMM") 37 | }) 38 | } 39 | \references{ 40 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 41 | 42 | Robinson MD and Oshlack A (2010): A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11:R25 43 | 44 | Tarazona S, Furio-Tari P, Ferrer A and Conesa A (2012): NOISeq: Exploratory analysis and differential expression for RNA-seq data. R package 45 | 46 | Tarazona S, Garcia-Alcalde F, Dopazo J, Ferrer A and Conesa A (2011): Differential expression in RNA-seq: a matter of depth. Genome Res 21(12), 2213-2223 47 | } 48 | \author{ 49 | Charlotte Soneson 50 | } 51 | -------------------------------------------------------------------------------- /man/TCC.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{TCC.createRmd} 4 | \alias{TCC.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with TCC} 6 | \usage{ 7 | TCC.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | test.method, 13 | iteration = 3, 14 | normFDR = 0.1, 15 | floorPDEG = 0.05 16 | ) 17 | } 18 | \arguments{ 19 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 20 | 21 | \item{result.path}{The path to the file where the result object will be saved.} 22 | 23 | \item{codefile}{The path to the file where the code will be written.} 24 | 25 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. Possible values are \code{"tmm"}, and \code{"deseq"}.} 26 | 27 | \item{test.method}{The method used in TCC to find differentially expressed genes. Possible values are \code{"edger"}, \code{"deseq"} and \code{"bayseq"}.} 28 | 29 | \item{iteration}{The number of iterations used to find the normalization factors. Default value is 3.} 30 | 31 | \item{normFDR}{The FDR cutoff for calling differentially expressed genes in the computation of the normalization factors. Default value is 0.1.} 32 | 33 | \item{floorPDEG}{The minimum value to be eliminated as potential differentially expressed genes before performing step 3 in the TCC algorithm. Default value is 0.05.} 34 | } 35 | \description{ 36 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the TCC package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 37 | } 38 | \details{ 39 | For more information about the methods and the interpretation of the parameters, see the \code{TCC} package and the corresponding publications. 40 | } 41 | \examples{ 42 | try( 43 | if (require(TCC)) { 44 | tmpdir <- normalizePath(tempdir(), winslash = "/") 45 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 46 | samples.per.cond = 5, n.diffexp = 100, 47 | output.file = file.path(tmpdir, "mydata.rds")) 48 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "TCC", 49 | Rmdfunction = "TCC.createRmd", 50 | output.directory = tmpdir, norm.method = "tmm", 51 | test.method = "edger") 52 | }) 53 | } 54 | \references{ 55 | Kadota K, Nishiyama T, and Shimizu K. A normalization strategy for comparing tag count data. Algorithms Mol Biol. 7:5, 2012. 56 | 57 | Sun J, Nishiyama T, Shimizu K, and Kadota K. TCC: an R package for comparing tag count data with robust normalization strategies. BMC Bioinformatics 14:219, 2013. 58 | } 59 | \author{ 60 | Charlotte Soneson 61 | } 62 | -------------------------------------------------------------------------------- /man/add_replicates.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{add_replicates} 4 | \alias{add_replicates} 5 | \title{Add replicates to a tree} 6 | \usage{ 7 | add_replicates(tree, r) 8 | } 9 | \arguments{ 10 | \item{tree}{A phylogenetic tree with n tips.} 11 | 12 | \item{r}{the number of replicates too add at each species.} 13 | } 14 | \value{ 15 | A phylogenetic tree with n * r tips, and clusters of tips with zero branch lengths. 16 | } 17 | \description{ 18 | Utility function to add replicates to a tree, as tips with zero length branches. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/checkDataObject.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/checkObjects.R 3 | \name{checkDataObject} 4 | \alias{checkDataObject} 5 | \title{Check a list or a \code{compData} object for compatibility with the differential expression functions interfaced by \code{compcodeR}} 6 | \usage{ 7 | checkDataObject(data.obj) 8 | } 9 | \arguments{ 10 | \item{data.obj}{A list containing data and condition information, or a \code{compData} object.} 11 | } 12 | \description{ 13 | Check if a list or a \code{compData} object contains the necessary slots for applying the differential expression functions interfaced by the \code{compcodeR} package. This function is provided for backward compatibility, see also \code{\link{check_compData}} and \code{\link{check_compData_results}}. 14 | } 15 | \examples{ 16 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 17 | samples.per.cond = 5, n.diffexp = 100) 18 | checkDataObject(mydata.obj) 19 | } 20 | \author{ 21 | Charlotte Soneson 22 | } 23 | -------------------------------------------------------------------------------- /man/checkParamMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{checkParamMatrix} 4 | \alias{checkParamMatrix} 5 | \title{Check Matrix Parameter} 6 | \usage{ 7 | checkParamMatrix(x, name, tree) 8 | } 9 | \arguments{ 10 | \item{x}{matrix of parameters being tested.} 11 | 12 | \item{name}{name of the parameter.} 13 | 14 | \item{tree}{A phylogenetic tree with n tips.} 15 | } 16 | \description{ 17 | Check that the parameters are compatible with the tree. Throws an error if not. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/checkParamVector.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{checkParamVector} 4 | \alias{checkParamVector} 5 | \title{Check Vector Parameter} 6 | \usage{ 7 | checkParamVector(x, name, tree) 8 | } 9 | \arguments{ 10 | \item{x}{vector of parameters being tested.} 11 | 12 | \item{name}{name of the parameter.} 13 | 14 | \item{tree}{A phylogenetic tree with n tips.} 15 | } 16 | \description{ 17 | Check that the parameters are compatible with the tree. Throws an error if not. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/checkSpecies.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{checkSpecies} 4 | \alias{checkSpecies} 5 | \title{Check Species} 6 | \usage{ 7 | checkSpecies(x, name, tree, tol, check.id.species) 8 | } 9 | \arguments{ 10 | \item{x}{vector of parameters being tested.} 11 | 12 | \item{name}{name of the parameter.} 13 | 14 | \item{tree}{A phylogenetic tree with n tips.} 15 | } 16 | \description{ 17 | Check that the parameters are compatible with the tree. Throws an error if not. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/checkTableConsistency.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/runComparison.R 3 | \name{checkTableConsistency} 4 | \alias{checkTableConsistency} 5 | \title{Check consistency of input table to \code{\link{runComparison}}} 6 | \usage{ 7 | checkTableConsistency(file.table) 8 | } 9 | \arguments{ 10 | \item{file.table}{A data frame with columns named \code{input.files} and (optionally) \code{datasets}, \code{nbr.samples}, \code{repl}, \code{de.methods}.} 11 | } 12 | \value{ 13 | Returns a consistent file table defining the result files that will be used as the basis for a method comparison. 14 | } 15 | \description{ 16 | Check that the \code{dataset}, \code{nbr.samples}, \code{repl} and \code{de.methods} columns of a data frame are consistent with the information provided in the input files (given in the \code{input.files} column of the data frame). If there are inconsistencies or missing information in any of the columns, replace the given information with the information in the input files. 17 | } 18 | \examples{ 19 | tmpdir <- normalizePath(tempdir(), winslash = "/") 20 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 21 | samples.per.cond = 5, n.diffexp = 100, 22 | output.file = file.path(tmpdir, "mydata.rds")) 23 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 24 | Rmdfunction = "voom.limma.createRmd", output.directory = tmpdir, 25 | norm.method = "TMM") 26 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "edgeR.exact", 27 | Rmdfunction = "edgeR.exact.createRmd", output.directory = tmpdir, 28 | norm.method = "TMM", 29 | trend.method = "movingave", disp.type = "tagwise") 30 | 31 | ## A correct table 32 | file.table <- data.frame(input.files = file.path(tmpdir, 33 | c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")), 34 | datasets = c("mydata", "mydata"), 35 | nbr.samples = c(5, 5), 36 | repl = c(1, 1), 37 | stringsAsFactors = FALSE) 38 | new.table <- checkTableConsistency(file.table) 39 | new.table 40 | 41 | ## An incorrect table 42 | file.table <- data.frame(input.files = file.path(tmpdir, 43 | c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")), 44 | datasets = c("mydata", "mydata"), 45 | nbr.samples = c(5, 3), 46 | repl = c(2, 1), 47 | stringsAsFactors = FALSE) 48 | new.table <- checkTableConsistency(file.table) 49 | new.table 50 | 51 | ## A table with missing information 52 | file.table <- data.frame(input.files = file.path(tmpdir, 53 | c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")), 54 | stringsAsFactors = FALSE) 55 | new.table <- checkTableConsistency(file.table) 56 | new.table 57 | } 58 | \author{ 59 | Charlotte Soneson 60 | } 61 | -------------------------------------------------------------------------------- /man/check_compData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{check_compData} 4 | \alias{check_compData} 5 | \title{Check the validity of a \code{compData} object} 6 | \usage{ 7 | check_compData(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{compData} object} 11 | } 12 | \description{ 13 | Check the validity of a \code{compData} object. An object that passes the check can be used as the input for the differential expression analysis methods interfaced by \code{compcodeR}. 14 | } 15 | \examples{ 16 | mydata <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 17 | samples.per.cond = 5, n.diffexp = 100) 18 | check_compData(mydata) 19 | } 20 | \author{ 21 | Charlotte Soneson 22 | } 23 | -------------------------------------------------------------------------------- /man/check_compData_results.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{check_compData_results} 4 | \alias{check_compData_results} 5 | \title{Check the validity of a \code{compData} result object} 6 | \usage{ 7 | check_compData_results(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{compData} object} 11 | } 12 | \description{ 13 | Check the validity of a \code{compData} object containing differential expression results. An object that passes the check can be used as the input for the method comparison functions in \code{compcodeR}. 14 | } 15 | \examples{ 16 | tmpdir <- normalizePath(tempdir(), winslash = "/") 17 | mydata <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 18 | samples.per.cond = 5, n.diffexp = 100, 19 | output.file = file.path(tmpdir, "mydata.rds")) 20 | ## Check an object without differential expression results 21 | check_compData_results(mydata) 22 | 23 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), 24 | result.extent = "voom.limma", 25 | Rmdfunction = "voom.limma.createRmd", 26 | output.directory = tmpdir, norm.method = "TMM") 27 | resdata <- readRDS(file.path(tmpdir, "mydata_voom.limma.rds")) 28 | ## Check an object containing differential expression results 29 | check_compData_results(resdata) 30 | } 31 | \author{ 32 | Charlotte Soneson 33 | } 34 | -------------------------------------------------------------------------------- /man/check_phyloCompData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{check_phyloCompData} 4 | \alias{check_phyloCompData} 5 | \title{Check the validity of a \code{phyloCompData} object} 6 | \usage{ 7 | check_phyloCompData(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{phyloCompData} object} 11 | } 12 | \description{ 13 | Check the validity of a \code{phyloCompData} object. 14 | An object that passes the check can be used as the input for the differential expression analysis methods interfaced by \code{compcodeR}. 15 | } 16 | \examples{ 17 | mydata <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 18 | samples.per.cond = 5, n.diffexp = 100, 19 | id.species = factor(1:10), 20 | tree = ape::rphylo(10, 1, 0), 21 | lengths.relmeans = "auto", lengths.dispersions = "auto") 22 | check_phyloCompData(mydata) 23 | 24 | } 25 | \author{ 26 | Charlotte Soneson, Paul Bastide 27 | } 28 | -------------------------------------------------------------------------------- /man/compData-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \docType{class} 4 | \name{compData-class} 5 | \alias{compData-class} 6 | \title{Class compData} 7 | \description{ 8 | The \code{compData} class is used to store information about the experiment, such as the count matrix, sample and variable annotations, information regarding the generation of the data and results from applying a differential expression analysis to the data. 9 | } 10 | \section{Slots}{ 11 | 12 | \describe{ 13 | \item{\code{count.matrix}:}{The read count matrix, with genes as rows and samples as columns. Class \code{matrix}} 14 | \item{\code{sample.annotations}:}{A data frame containing sample annotation information for all samples in the data set. Must contain at least a column named \code{condition}, encoding the division of the samples into two classes. The row names should be the same as the column names of \code{count.matrix}. Class \code{data.frame}} 15 | \item{\code{info.parameters}:}{A list of parameters detailing the simulation process used to generate the data. Must contain at least two entries, named \code{dataset} (an informative name for the data set/simulation setting) and \code{uID} (a unique ID for the specific data set instance). Class \code{list}} 16 | \item{\code{filtering}:}{A character string detailing the filtering process that has been applied to the data. Class \code{character}} 17 | \item{\code{variable.annotations}:}{Contains information regarding the variables, such as the differential expression status, the true mean, dispersion and effect sizes. If present, the row names should be the same as those of \code{count.matrix}. Class \code{data.frame}} 18 | \item{\code{analysis.date}:}{(If a differential expression analysis has been performed and the results are included in the \code{compData} object). Gives the date when the differential expression analysis was performed. Class \code{character}} 19 | \item{\code{package.version}:}{(If a differential expression analysis has been performed and the results are included in the \code{compData} object). Gives the version numbers of the package(s) used for the differential expression analysis. Class \code{character}} 20 | \item{\code{method.names}:}{(If a differential expression analysis has been performed and the results are included in the \code{compData} object). A list, containing the name of the method used for the differential expression analysis. The list should have two entries: \code{full.name} and \code{short.name}, where the \code{full.name} is the full (potentially long) name identifying the method, and \code{short.name} may be an abbreviation. Class \code{list}} 21 | \item{\code{code}:}{(If a differential expression analysis has been performed and the results are included in the \code{compData} object). A character string containing the code that was used to run the differential expression analysis. The code should be in R markdown format. Class \code{character}} 22 | \item{\code{result.table}:}{(If a differential expression analysis has been performed and the results are included in the \code{compData} object). Contains the results of the differential expression analysis, in the form of a data frame with one row per gene. Must contain at least one column named \code{score}, where a higher value corresponds to 'more strongly differentially expressed genes'. Class \code{data.frame}} 23 | } 24 | } 25 | 26 | \section{Methods}{ 27 | 28 | \describe{ 29 | \item{count.matrix}{\code{signature(x="compData")}} 30 | \item{count.matrix<-}{\code{signature(x="compData",value="matrix")}: 31 | Get or set the count matrix in a \code{compData} object. \code{value} should be a numeric matrix.} 32 | \item{sample.annotations}{\code{signature(x="compData")}} 33 | \item{sample.annotations<-}{\code{signature(x="compData",value="data.frame")}: 34 | Get or set the sample annotations data frame in a \code{compData} object. \code{value} should be a data frame with at least a column named 'condition'.} 35 | \item{info.parameters}{\code{signature(x="compData")}} 36 | \item{info.parameters<-}{\code{signature(x="compData",value="list")}: 37 | Get or set the list with info parameters in a \code{compData} object. \code{value} should be a list with at least elements named 'dataset' and 'uID'.} 38 | \item{filtering}{\code{signature(x="compData")}} 39 | \item{filtering<-}{\code{signature(x="compData",value="character")}: 40 | Get or set the information about the filtering in a \code{compData} object. \code{value} should be a character string describing the filtering that has been performed.} 41 | \item{variable.annotations}{\code{signature(x="compData")}} 42 | \item{variable.annotations<-}{\code{signature(x="compData",value="data.frame")}: 43 | Get or set the variable annotations data frame in a \code{compData} object. \code{value} should be a data frame.} 44 | \item{analysis.date}{\code{signature(x="compData")}} 45 | \item{analysis.date<-}{\code{signature(x="compData",value="character")}: 46 | Get or set the analysis date in a \code{compData} object. \code{value} should be a character string describing when the differential expression analysis of the data was performed.} 47 | \item{package.version}{\code{signature(x="compData")}} 48 | \item{package.version<-}{\code{signature(x="compData",value="character")}: 49 | Get or set the information about the package version in a \code{compData} object. \code{value} should be a character string detailing which packages and versions were used to perform the differential expression analysis of the data.} 50 | \item{method.names}{\code{signature(x="compData")}} 51 | \item{method.names<-}{\code{signature(x="compData",value="list")}: 52 | Get or set the method names in a \code{compData} object. \code{value} should be a list with slots \code{full.name} and \code{short.name}, giving the full name and an abbreviation for the method that was used to perform the analysis of the data.} 53 | \item{code}{\code{signature(x="compData")}} 54 | \item{code<-}{\code{signature(x="compData",value="character")}: 55 | Get or set the code slot in a \code{compData} object. \code{value} should be a character string in R markdown format, giving the code that was run to obtain the results from the differential expression analysis.} 56 | \item{result.table}{\code{signature(x="compData")}} 57 | \item{result.table<-}{\code{signature(x="compData",value="data.frame")}: 58 | Get or set the result table in a \code{compData} object. \code{value} should be a data frame with one row per gene, and at least a column named 'score'.} 59 | } 60 | } 61 | 62 | \section{Construction}{ 63 | 64 | An object of the class \code{compData} can be constructed using the \code{\link{compData}} function. 65 | } 66 | 67 | \author{ 68 | Charlotte Soneson 69 | } 70 | -------------------------------------------------------------------------------- /man/compData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{compData} 4 | \alias{compData} 5 | \title{Create a \code{compData} object} 6 | \usage{ 7 | compData( 8 | count.matrix, 9 | sample.annotations, 10 | info.parameters, 11 | variable.annotations = data.frame(), 12 | filtering = "no info", 13 | analysis.date = "", 14 | package.version = "", 15 | method.names = list(), 16 | code = "", 17 | result.table = data.frame() 18 | ) 19 | } 20 | \arguments{ 21 | \item{count.matrix}{A count matrix, with genes as rows and observations as columns.} 22 | 23 | \item{sample.annotations}{A data frame, containing at least one column named 'condition', encoding the grouping of the observations into two groups. The row names should be the same as the column names of the \code{count.matrix}.} 24 | 25 | \item{info.parameters}{A list containing information regarding simulation parameters etc. The only mandatory entries are \code{dataset} and \code{uID}, but it may contain entries such as the ones listed below (see \code{generateSyntheticData} for more detailed information about each of these entries). 26 | \itemize{ 27 | \item \code{dataset}: an informative name or identifier of the data set (e.g., summarizing the simulation settings). 28 | \item \code{samples.per.cond} 29 | \item \code{n.diffexp} 30 | \item \code{repl.id} 31 | \item \code{seqdepth} 32 | \item \code{minfact} 33 | \item \code{maxfact} 34 | \item \code{fraction.upregulated} 35 | \item \code{between.group.diffdisp} 36 | \item \code{filter.threshold.total} 37 | \item \code{filter.threshold.mediancpm} 38 | \item \code{fraction.non.overdispersed} 39 | \item \code{random.outlier.high.prob} 40 | \item \code{random.outlier.low.prob} 41 | \item \code{single.outlier.high.prob} 42 | \item \code{single.outlier.low.prob} 43 | \item \code{effect.size} 44 | \item \code{uID}: a unique ID for the data set. In contrast to \code{dataset}, the \code{uID} is unique e.g. for each instance of replicated data sets generated with the same simulation settings. 45 | }} 46 | 47 | \item{variable.annotations}{A data frame with variable annotations (with number of rows equal to the number of rows in \code{count.matrix}, that is, the number of variables in the data set). Not mandatory, but may contain columns such as the ones listed below. If present, the row names should be the same as the row names of the \code{count.matrix}. 48 | \itemize{ 49 | \item \code{truedispersions.S1}: the true dispersion for each gene in condition S1. 50 | \item \code{truedispersions.S2}: the true dispersion for each gene in condition S2. 51 | \item \code{truemeans.S1}: the true mean value for each gene in condition S1. 52 | \item \code{truemeans.S2}: the true mean value for each gene in condition S2. 53 | \item \code{n.random.outliers.up.S1}: the number of 'random' outliers with extremely high counts for each gene in condition S1. 54 | \item \code{n.random.outliers.up.S2}: the number of 'random' outliers with extremely high counts for each gene in condition S2. 55 | \item \code{n.random.outliers.down.S1}: the number of 'random' outliers with extremely low counts for each gene in condition S1. 56 | \item \code{n.random.outliers.down.S2}: the number of 'random' outliers with extremely low counts for each gene in condition S2. 57 | \item \code{n.single.outliers.up.S1}: the number of 'single' outliers with extremely high counts for each gene in condition S1. 58 | \item \code{n.single.outliers.up.S2}: the number of 'single' outliers with extremely high counts for each gene in condition S2. 59 | \item \code{n.single.outliers.down.S1}: the number of 'single' outliers with extremely low counts for each gene in condition S1. 60 | \item \code{n.single.outliers.down.S2}: the number of 'single' outliers with extremely low counts for each gene in condition S2. 61 | \item \code{M.value}: the M-value (observed log2 fold change between condition S1 and condition S2) for each gene. 62 | \item \code{A.value}: the A-value (observed average expression level across condition S1 and condition S2) for each gene. 63 | \item \code{truelog2foldchanges}: the true (simulated) log2 fold changes between condition S1 and condition S2. 64 | \item \code{upregulation}: a binary vector indicating which genes are simulated to be upregulated in condition S2 compared to condition S1. 65 | \item \code{downregulation}: a binary vector indicating which genes are simulated to be downregulated in condition S2 compared to condition S1. 66 | \item \code{differential.expression}: a binary vector indicating which genes are simulated to be differentially expressed in condition S2 compared to condition S1. 67 | }} 68 | 69 | \item{filtering}{A character string containing information about the filtering that has been applied to the data set.} 70 | 71 | \item{analysis.date}{If a differential expression analysis has been performed, a character string detailing when it was performed.} 72 | 73 | \item{package.version}{If a differential expression analysis has been performed, a character string giving the version of the differential expression packages that were applied.} 74 | 75 | \item{method.names}{If a differential expression analysis has been performed, a list with entries \code{full.name} and \code{short.name}, giving the full name of the differential expression method (may including version number and parameter settings) and a short name or abbreviation.} 76 | 77 | \item{code}{If a differential expression analysis has been performed, a character string containing the code that was run to perform the analysis. The code should be in R markdown format, and can be written to an HTML file using the \code{\link{generateCodeHTMLs}} function.} 78 | 79 | \item{result.table}{If a differential expression analysis has been performed, a data frame containing the results of the analysis. The number of rows should be equal to the number of rows in \code{count.matrix} and if present, the row names should be identical. The only mandatory column is \code{score}, which gives a score for each gene, where a higher score suggests a "more highly differentially expressed" gene. Different comparison functions use different columns of this table, if available. The list below gives the columns that are used by the interfaced methods. 80 | \itemize{ 81 | \item \code{pvalue} nominal p-values 82 | \item \code{adjpvalue} p-values adjusted for multiple comparisons 83 | \item \code{logFC} estimated log-fold changes between the two conditions 84 | \item \code{score} the score that will be used to rank the genes in order of significance. Note that high scores always signify differential expression, that is, a strong association with the predictor. For example, for methods returning a nominal p-value the score can be defined as 1 - pvalue. 85 | \item \code{FDR} false discovery rate estimates 86 | \item \code{posterior.DE} posterior probabilities of differential expression 87 | \item \code{prob.DE} conditional probabilities of differential expression 88 | \item \code{lfdr} local false discovery rates 89 | \item \code{statistic} test statistics from the differential expression analysis 90 | \item \code{dispersion.S1} dispersion estimates in condition S1 91 | \item \code{dispersion.S2} dispersion estimates in condition S2 92 | }} 93 | } 94 | \value{ 95 | A \code{compData} object. 96 | } 97 | \description{ 98 | The \code{compData} class is used to store information about the experiment, such as the count matrix, sample and variable annotations, information regarding the generation of the data and results from applying a differential expression analysis to the data. This constructor function creates a \code{compData} object. 99 | } 100 | \examples{ 101 | count.matrix <- round(matrix(1000*runif(4000), 1000)) 102 | sample.annotations <- data.frame(condition = c(1, 1, 2, 2)) 103 | info.parameters <- list(dataset = "mydata", uID = "123456") 104 | cpd <- compData(count.matrix, sample.annotations, info.parameters) 105 | } 106 | \author{ 107 | Charlotte Soneson 108 | } 109 | -------------------------------------------------------------------------------- /man/compcodeR-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compcodeR-package.R 3 | \docType{package} 4 | \name{compcodeR-package} 5 | \alias{compcodeR-package} 6 | \alias{compcodeR} 7 | \title{RNAseq data simulation, differential expression analysis and 8 | performance comparison of differential expression methods} 9 | \description{ 10 | RNAseq data simulation, differential expression analysis and 11 | performance comparison of differential expression methods 12 | } 13 | \details{ 14 | This package provides extensive functionality for comparing 15 | results obtained by different methods for differential expression analysis 16 | of RNAseq data. It also contains functions for simulating count data and 17 | interfaces to several packages for performing the differential expression analysis. 18 | } 19 | \author{ 20 | Charlotte Soneson 21 | } 22 | \keyword{package} 23 | -------------------------------------------------------------------------------- /man/computeFactorLengths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{computeFactorLengths} 4 | \alias{computeFactorLengths} 5 | \title{Compute Length Normalization Factors} 6 | \usage{ 7 | computeFactorLengths(length_matrix, prob.S1, sum.S1) 8 | } 9 | \arguments{ 10 | \item{length_matrix}{An n.vars times n.sample matrix of lengths of each gene in each sample.} 11 | 12 | \item{prob.S1}{Vector of means for condition 1.} 13 | 14 | \item{sum.S1}{Sum of means for condition 1.} 15 | } 16 | \value{ 17 | A matrix of the same size as 'length_matrix', with normalization factors 18 | to be applied for each sample and each gene. 19 | } 20 | \description{ 21 | Compute the factor to be applied for length normalization. 22 | Each column of the matrix (samples) is normalized by the weighted average of 23 | the column, with weights corresponding to the true probabilities of each gene. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/convertListTocompData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{convertListTocompData} 4 | \alias{convertListTocompData} 5 | \title{Convert a list with data and results to a \code{compData} object} 6 | \usage{ 7 | convertListTocompData(inp.list) 8 | } 9 | \arguments{ 10 | \item{inp.list}{A list with data and results, e.g. generated by \code{compcodeR} version 0.1.0.} 11 | } 12 | \description{ 13 | Given a list with data and results (resulting e.g. from \code{compcodeR} version 0.1.0), convert it to a \code{compData} object. 14 | } 15 | \examples{ 16 | convertListTocompData(list(count.matrix = matrix(round(1000*runif(4000)), 1000), 17 | sample.annotations = data.frame(condition = c(1,1,2,2)), 18 | info.parameters = list(dataset = "mydata", 19 | uID = "123456"))) 20 | } 21 | \author{ 22 | Charlotte Soneson 23 | } 24 | -------------------------------------------------------------------------------- /man/convertListTophyloCompData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{convertListTophyloCompData} 4 | \alias{convertListTophyloCompData} 5 | \title{Convert a list with data and results to a \code{phyloCompData} object} 6 | \usage{ 7 | convertListTophyloCompData(inp.list) 8 | } 9 | \arguments{ 10 | \item{inp.list}{A list with data and results, e.g. generated by \code{compcodeR} version 0.1.0.} 11 | } 12 | \description{ 13 | Given a list with data and results (resulting e.g. from \code{compcodeR} version 0.1.0), convert it to a \code{phyloCompData} object. 14 | } 15 | \examples{ 16 | tree <- ape::read.tree( 17 | text = "(((A1:0,A2:0,A3:0):1,B1:1):1,((C1:0,C2:0):1.5,(D1:0,D2:0):1.5):0.5);" 18 | ) 19 | count.matrix <- round(matrix(1000*runif(8000), 1000)) 20 | sample.annotations <- data.frame(condition = c(1, 1, 1, 1, 2, 2, 2, 2), 21 | id.species = c("A", "A", "A", "B", "C", "C", "D", "D")) 22 | info.parameters <- list(dataset = "mydata", uID = "123456") 23 | length.matrix <- round(matrix(1000*runif(8000), 1000)) 24 | colnames(count.matrix) <- colnames(length.matrix) <- rownames(sample.annotations) <- tree$tip.label 25 | convertListTophyloCompData(list(count.matrix = count.matrix, 26 | sample.annotations = sample.annotations, 27 | info.parameters = list(dataset = "mydata", 28 | uID = "123456"), 29 | tree = tree, 30 | length.matrix = length.matrix)) 31 | 32 | } 33 | \author{ 34 | Charlotte Soneson, Paul Bastide 35 | } 36 | -------------------------------------------------------------------------------- /man/convertcompDataToList.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{convertcompDataToList} 4 | \alias{convertcompDataToList} 5 | \title{Convert a \code{compData} object to a list} 6 | \usage{ 7 | convertcompDataToList(cpd) 8 | } 9 | \arguments{ 10 | \item{cpd}{A \code{compData} object} 11 | } 12 | \description{ 13 | Given a \code{compData} object, convert it to a list. 14 | } 15 | \examples{ 16 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 12500, 17 | samples.per.cond = 5, n.diffexp = 1250) 18 | mydata.list <- convertcompDataToList(mydata.obj) 19 | } 20 | \author{ 21 | Charlotte Soneson 22 | } 23 | -------------------------------------------------------------------------------- /man/convertphyloCompDataToList.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{convertphyloCompDataToList} 4 | \alias{convertphyloCompDataToList} 5 | \title{Convert a \code{phyloCompData} object to a list} 6 | \usage{ 7 | convertphyloCompDataToList(cpd) 8 | } 9 | \arguments{ 10 | \item{cpd}{A \code{phyloCompData} object} 11 | } 12 | \description{ 13 | Given a \code{phyloCompData} object, convert it to a list. 14 | } 15 | \examples{ 16 | tree <- ape::read.tree( 17 | text = "(((A1:0,A2:0,A3:0):1,B1:1):1,((C1:0,C2:0):1.5,(D1:0,D2:0):1.5):0.5);" 18 | ) 19 | id.species <- factor(c("A", "A", "A", "B", "C", "C", "D", "D")) 20 | names(id.species) <- tree$tip.label 21 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 22 | samples.per.cond = 4, n.diffexp = 100, 23 | tree = tree, 24 | id.species = id.species) 25 | mydata.list <- convertcompDataToList(mydata.obj) 26 | 27 | } 28 | \author{ 29 | Charlotte Soneson, Paul Bastide 30 | } 31 | -------------------------------------------------------------------------------- /man/edgeR.GLM.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{edgeR.GLM.createRmd} 4 | \alias{edgeR.GLM.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with the edgeR GLM approach} 6 | \usage{ 7 | edgeR.GLM.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | disp.type, 13 | disp.method, 14 | trended 15 | ) 16 | } 17 | \arguments{ 18 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 19 | 20 | \item{result.path}{The path to the file where the result object will be saved.} 21 | 22 | \item{codefile}{The path to the file where the code will be written.} 23 | 24 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 25 | 26 | \item{disp.type}{The type of dispersion estimate used. Possible values are \code{"common"}, \code{"trended"} and \code{"tagwise"}.} 27 | 28 | \item{disp.method}{The method used to estimate the dispersion. Possible values are \code{"CoxReid"}, \code{"Pearson"} and \code{"deviance"}.} 29 | 30 | \item{trended}{Logical parameter indicating whether or not a trended dispersion estimate should be used.} 31 | } 32 | \value{ 33 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 34 | } 35 | \description{ 36 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the GLM functionality from the edgeR package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 37 | } 38 | \details{ 39 | For more information about the methods and the interpretation of the parameters, see the \code{edgeR} package and the corresponding publications. 40 | } 41 | \examples{ 42 | tmpdir <- normalizePath(tempdir(), winslash = "/") 43 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 44 | samples.per.cond = 5, n.diffexp = 100, 45 | output.file = file.path(tmpdir, "mydata.rds")) 46 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "edgeR.GLM", 47 | Rmdfunction = "edgeR.GLM.createRmd", 48 | output.directory = tmpdir, norm.method = "TMM", 49 | disp.type = "tagwise", disp.method = "CoxReid", 50 | trended = TRUE) 51 | } 52 | \references{ 53 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 54 | } 55 | \author{ 56 | Charlotte Soneson 57 | } 58 | -------------------------------------------------------------------------------- /man/edgeR.exact.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{edgeR.exact.createRmd} 4 | \alias{edgeR.exact.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with the edgeR exact test} 6 | \usage{ 7 | edgeR.exact.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | trend.method, 13 | disp.type 14 | ) 15 | } 16 | \arguments{ 17 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 18 | 19 | \item{result.path}{The path to the file where the result object will be saved.} 20 | 21 | \item{codefile}{The path to the file where the code will be written.} 22 | 23 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 24 | 25 | \item{trend.method}{The method used to estimate the trend in the mean-dispersion relationship. Possible values are \code{"none"}, \code{"movingave"} and \code{"loess"}} 26 | 27 | \item{disp.type}{The type of dispersion estimate used. Possible values are \code{"common"}, \code{"trended"} and \code{"tagwise"}.} 28 | } 29 | \value{ 30 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 31 | } 32 | \description{ 33 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the exact test functionality from the edgeR package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 34 | } 35 | \details{ 36 | For more information about the methods and the interpretation of the parameters, see the \code{edgeR} package and the corresponding publications. 37 | } 38 | \examples{ 39 | tmpdir <- normalizePath(tempdir(), winslash = "/") 40 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 41 | samples.per.cond = 5, n.diffexp = 100, 42 | output.file = file.path(tmpdir, "mydata.rds")) 43 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "edgeR.exact", 44 | Rmdfunction = "edgeR.exact.createRmd", 45 | output.directory = tmpdir, norm.method = "TMM", 46 | trend.method = "movingave", disp.type = "tagwise") 47 | } 48 | \references{ 49 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 50 | } 51 | \author{ 52 | Charlotte Soneson 53 | } 54 | -------------------------------------------------------------------------------- /man/extract_results_phylolm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/phylolmMethods.R 3 | \name{extract_results_phylolm} 4 | \alias{extract_results_phylolm} 5 | \title{Extract phylolm results} 6 | \usage{ 7 | extract_results_phylolm(phylo_lm_obj) 8 | } 9 | \arguments{ 10 | \item{phylo_lm_obj}{a phylolm object.} 11 | } 12 | \value{ 13 | A list, with: 14 | \describe{ 15 | \item{pvalue}{the p value of the differential expression.} 16 | \item{logFC}{the log fold change of the differential expression.} 17 | \item{score}{1 - pvalue.} 18 | } 19 | } 20 | \description{ 21 | Extract results from a phylolm object. 22 | The coefficient of interest must be named "condition". 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/generateCodeHTMLs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateCodeHTMLs.R 3 | \name{generateCodeHTMLs} 4 | \alias{generateCodeHTMLs} 5 | \title{Generate HTML file(s) containing code used to run differential expression analysis.} 6 | \usage{ 7 | generateCodeHTMLs(input.files, output.directory) 8 | } 9 | \arguments{ 10 | \item{input.files}{A vector with paths to one or several \code{.rds} files containing \code{compData} objects with the results from differential expression analysis. One code HTML file is generated for each file in the vector.} 11 | 12 | \item{output.directory}{The path to the directory where the code HTML files will be saved.} 13 | } 14 | \description{ 15 | A function to extract the code used to generate differential expression results from saved \code{compData} result objects (typically obtained by \code{\link{runDiffExp}}), and to write the code to HTML files. This requires that the code was saved as a character string in R markdown format in the \code{code} slot of the result object, which is done automatically by \code{\link{runDiffExp}}. If the differential expression analysis was performed with functions outside \code{compcodeR}, the code has to be added manually to the result object. 16 | } 17 | \examples{ 18 | tmpdir <- normalizePath(tempdir(), winslash = "/") 19 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 20 | samples.per.cond = 5, n.diffexp = 100, 21 | output.file = file.path(tmpdir, "mydata.rds")) 22 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 23 | Rmdfunction = "voom.limma.createRmd", output.directory = tmpdir, 24 | norm.method = "TMM") 25 | generateCodeHTMLs(file.path(tmpdir, "mydata_voom.limma.rds"), tmpdir) 26 | } 27 | \author{ 28 | Charlotte Soneson 29 | } 30 | -------------------------------------------------------------------------------- /man/generateLengths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{generateLengths} 4 | \alias{generateLengths} 5 | \title{Simulate a length matrix} 6 | \usage{ 7 | generateLengths(id.species, lengths.relmeans, lengths.dispersions) 8 | } 9 | \arguments{ 10 | \item{id.species}{An n.sample vector, indicating the species of each sample.} 11 | 12 | \item{lengths.relmeans}{A vector of mean values to use in the simulation of 13 | lengths from the Negative Binomial distribution.} 14 | 15 | \item{lengths.dispersions}{A vector or matrix of dispersions to use in the 16 | simulation of data from the Negative Binomial distribution.} 17 | } 18 | \value{ 19 | A matrix of lengths, with as many columns as the number of species (length of id.species) 20 | and as many rows as the number of parameters in lengths.relmeans. 21 | } 22 | \description{ 23 | Simulate a length matrix of size n.vars times n.sample, with the length of 24 | each gene in each sample. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/generateLengthsPhylo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{generateLengthsPhylo} 4 | \alias{generateLengthsPhylo} 5 | \title{Simulate a length matrix with a phylo model} 6 | \usage{ 7 | generateLengthsPhylo(tree, id.species, lengths.relmeans, lengths.dispersions) 8 | } 9 | \arguments{ 10 | \item{tree}{The phylogeneti tree.} 11 | 12 | \item{id.species}{An n.sample vector, indicating the species of each sample.} 13 | 14 | \item{lengths.relmeans}{A vector of mean values to use in the simulation of 15 | lengths from the Negative Binomial distribution.} 16 | 17 | \item{lengths.dispersions}{A vector or matrix of dispersions to use in the 18 | simulation of data from the Negative Binomial distribution.} 19 | 20 | \item{lengths.lambda}{A vector of heritability parameters to use in the 21 | simulation of data from the lambda model.} 22 | } 23 | \value{ 24 | A matrix of the same size as 'length_matrix', with normalization 25 | factors to be applied for each sample and each gene. 26 | } 27 | \description{ 28 | Simulate a length matrix of size n.vars times n.sample, with the length of 29 | each gene in each sample. 30 | } 31 | \keyword{internal} 32 | -------------------------------------------------------------------------------- /man/getNegativeBinomialDispersion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{getNegativeBinomialDispersion} 4 | \alias{getNegativeBinomialDispersion} 5 | \title{Get NB dispersion} 6 | \usage{ 7 | getNegativeBinomialDispersion( 8 | i, 9 | j, 10 | S1, 11 | truedispersions.S1, 12 | S2, 13 | truedispersions.S2 14 | ) 15 | } 16 | \arguments{ 17 | \item{i}{gene index.} 18 | 19 | \item{j}{sample index.} 20 | 21 | \item{S1}{Indices in condition 1.} 22 | 23 | \item{truedispersions.S1}{Vector of dispersions for condition 1.} 24 | 25 | \item{S2}{Indices in condition 2.} 26 | 27 | \item{truedispersions.S2}{Vector of dispersions for condition 2.} 28 | } 29 | \value{ 30 | The dispersion for gene i in sample j. 31 | } 32 | \description{ 33 | Get the NB dispersion for one gene in one sample 34 | } 35 | \keyword{internal} 36 | -------------------------------------------------------------------------------- /man/getNegativeBinomialMean.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{getNegativeBinomialMean} 4 | \alias{getNegativeBinomialMean} 5 | \title{Get NB mean} 6 | \usage{ 7 | getNegativeBinomialMean( 8 | i, 9 | j, 10 | S1, 11 | prob.S1, 12 | sum.S1, 13 | nfact_length.S1, 14 | S2, 15 | prob.S2, 16 | sum.S2, 17 | nfact_length.S2, 18 | seq.depths 19 | ) 20 | } 21 | \arguments{ 22 | \item{i}{gene index.} 23 | 24 | \item{j}{sample index.} 25 | 26 | \item{S1}{Indices in condition 1.} 27 | 28 | \item{prob.S1}{Vector of means for condition 1.} 29 | 30 | \item{sum.S1}{Sum of means for condition 1.} 31 | 32 | \item{nfact_length.S1}{Matrix of length factors for condition 1.} 33 | 34 | \item{S2}{Indices in condition 2.} 35 | 36 | \item{prob.S2}{Vector of means for condition 2.} 37 | 38 | \item{sum.S2}{Sum of means for condition 2.} 39 | 40 | \item{nfact_length.S2}{Matrix of length factors for condition 2.} 41 | } 42 | \value{ 43 | The mean for gene i in sample j. 44 | } 45 | \description{ 46 | Get the NB mean for one gene in one sample 47 | } 48 | \keyword{internal} 49 | -------------------------------------------------------------------------------- /man/getNegativeBinomialParameters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{getNegativeBinomialParameters} 4 | \alias{getNegativeBinomialParameters} 5 | \title{Get all parameters of the NB at once} 6 | \usage{ 7 | getNegativeBinomialParameters( 8 | n.vars, 9 | S1, 10 | prob.S1, 11 | sum.S1, 12 | truedispersions.S1, 13 | nfact_length.S1, 14 | S2, 15 | prob.S2, 16 | sum.S2, 17 | truedispersions.S2, 18 | nfact_length.S2, 19 | seq.depths 20 | ) 21 | } 22 | \arguments{ 23 | \item{n.vars}{The initial number of genes in the simulated data set. Based on the filtering conditions (\code{filter.threshold.total} and \code{filter.threshold.mediancpm}), the number of genes in the final data set may be lower than this number.} 24 | 25 | \item{S1}{Indices in condition 1.} 26 | 27 | \item{prob.S1}{Vector of means for condition 1.} 28 | 29 | \item{sum.S1}{Sum of means for condition 1.} 30 | 31 | \item{truedispersions.S1}{Vector of dispersions for condition 1.} 32 | 33 | \item{nfact_length.S1}{Matrix of length factors for condition 1.} 34 | 35 | \item{S2}{Indices in condition 2.} 36 | 37 | \item{prob.S2}{Vector of means for condition 2.} 38 | 39 | \item{sum.S2}{Sum of means for condition 2.} 40 | 41 | \item{truedispersions.S2}{Vector of dispersions for condition 2.} 42 | 43 | \item{nfact_length.S2}{Matrix of length factors for condition 2.} 44 | } 45 | \value{ 46 | A list of parameters for each entry of the count matrix: 47 | \describe{ 48 | \item{count_means}{a matrix of mean for each gene and sample.} 49 | \item{count_dispersions}{a matrix of dispersions for each gene and sample.} 50 | } 51 | } 52 | \description{ 53 | Get both the mean and the dispersions of the NB as matrices for all indices. 54 | } 55 | \keyword{internal} 56 | -------------------------------------------------------------------------------- /man/getTree.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/phylolmMethods.R 3 | \name{getTree} 4 | \alias{getTree} 5 | \title{Get the tree from a phyloCompData object} 6 | \usage{ 7 | getTree(cdata) 8 | } 9 | \arguments{ 10 | \item{cdata}{a phyloCompData object.} 11 | } 12 | \value{ 13 | A tree of class \code{phylo} 14 | } 15 | \description{ 16 | Return the tree of a \code{phyloCompData} object. 17 | If no tree, return a star tree with unit height, and throw a warning. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/get_model_factor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{get_model_factor} 4 | \alias{get_model_factor} 5 | \title{Get the scaling factor} 6 | \usage{ 7 | get_model_factor(model.process, selection.strength, tree) 8 | } 9 | \arguments{ 10 | \item{model.process}{the process to be used for phylogenetic simulations. One of "BM" or "OU", default to "BM".} 11 | 12 | \item{selection.strength}{if the process is "OU", the selection strength parameter.} 13 | 14 | \item{tree}{a dated phylogenetic tree of class \code{\link[ape]{phylo}} with `samples.per.cond * 2` species.} 15 | } 16 | \value{ 17 | A vector N of factors. 18 | } 19 | \description{ 20 | Get the scaling factors. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_poisson_log_normal_parameters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{get_poisson_log_normal_parameters} 4 | \alias{get_poisson_log_normal_parameters} 5 | \title{Compute log means and variances} 6 | \usage{ 7 | get_poisson_log_normal_parameters( 8 | count_means, 9 | count_dispersions, 10 | prop.var.tree 11 | ) 12 | } 13 | \arguments{ 14 | \item{count_means}{a matrix with the number of genes p rows and the number of 15 | species n columns. Column names should match the tree taxa names.} 16 | 17 | \item{count_dispersions}{a matrix of size p x n, for each gene and species. 18 | Column names should match the tree taxa names.} 19 | } 20 | \value{ 21 | A list, with: 22 | \describe{ 23 | \item{log_means}{the p x n matrix of log-means for Poisson-lognormal simulations.} 24 | \item{log_variance_phylo}{the p vector of phylogenetic log-variances for Poisson-lognormal simulations.} 25 | \item{log_variance_sample}{the p x n matrix of environmental log-variances for Poisson-lognormal simulations.} 26 | } 27 | } 28 | \description{ 29 | From the parameters of a negative binomial (count_means and count_dispersions), 30 | compute the parameters of a phylogenetic Poisson log-normal with the 31 | same expectations and variances. 32 | } 33 | \keyword{internal} 34 | -------------------------------------------------------------------------------- /man/lengthNorm.limma.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExpPhylo.R 3 | \name{lengthNorm.limma.createRmd} 4 | \alias{lengthNorm.limma.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with length normalized counts + limma} 6 | \usage{ 7 | lengthNorm.limma.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | extra.design.covariates = NULL, 13 | length.normalization = "RPKM", 14 | data.transformation = "log2", 15 | trend = FALSE, 16 | block.factor = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{data.path}{The path to a .rds file containing the \code{phyloCompData} object that will be used for the differential expression analysis.} 21 | 22 | \item{result.path}{The path to the file where the result object will be saved.} 23 | 24 | \item{codefile}{The path to the file where the code will be written.} 25 | 26 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} of the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 27 | 28 | \item{extra.design.covariates}{A vector containing the names of extra control variables to be passed to the design matrix of \code{limma}. All the covariates need to be a column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object, with a matching column name. The covariates can be a numeric vector, or a factor. Note that "condition" factor column is always included, and should not be added here. See Details.} 29 | 30 | \item{length.normalization}{one of "none" (no length correction), "TPM", or "RPKM" (default). See details.} 31 | 32 | \item{data.transformation}{one of "log2", "asin(sqrt)" or "sqrt". Data transformation to apply to the normalized data.} 33 | 34 | \item{trend}{should an intensity-trend be allowed for the prior variance? Default to \code{FALSE}.} 35 | 36 | \item{block.factor}{Name of the factor specifying a blocking variable, to be passed to \code{\link[limma]{duplicateCorrelation}} function of the \code{limma} package. All the factors need to be a \code{sample.annotations} from the \code{\link{phyloCompData}} object. Default to null (no block structure).} 37 | } 38 | \value{ 39 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 40 | } 41 | \description{ 42 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) by applying a length normalizing transformation followed by differential expression analysis with limma. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 43 | } 44 | \details{ 45 | For more information about the methods and the interpretation of the parameters, see the \code{limma} package and the corresponding publications. 46 | 47 | The \code{length.matrix} field of the \code{phyloCompData} object 48 | is used to normalize the counts, using one of the following formulas: 49 | \itemize{ 50 | \item \code{length.normalization="none"} : \eqn{CPM_{gi} = \frac{N_{gi} + 0.5}{NF_i \times \sum_{g} N_{gi} + 1} \times 10^6} 51 | \item \code{length.normalization="TPM"} : \eqn{TPM_{gi} = \frac{(N_{gi} + 0.5) / L_{gi}}{NF_i \times \sum_{g} N_{gi}/L_{gi} + 1} \times 10^6} 52 | \item \code{length.normalization="RPKM"} : \eqn{RPKM_{gi} = \frac{(N_{gi} + 0.5) / L_{gi}}{NF_i \times \sum_{g} N_{gi} + 1} \times 10^9} 53 | } 54 | 55 | where \eqn{N_{gi}} is the count for gene g and sample i, 56 | where \eqn{L_{gi}} is the length of gene g in sample i, 57 | and \eqn{NF_i} is the normalization for sample i, 58 | normalized using \code{calcNormFactors} of the \code{edgeR} package. 59 | 60 | The function specified by the \code{data.transformation} is then applied 61 | to the normalized count matrix. 62 | 63 | The "\eqn{+0.5}" and "\eqn{+1}" are taken from Law et al 2014, 64 | and dropped from the normalization 65 | when the transformation is something else than \code{log2}. 66 | 67 | The "\eqn{\times 10^6}" and "\eqn{\times 10^9}" factors are omitted when 68 | the \code{asin(sqrt)} transformation is taken, as \eqn{asin} can only 69 | be applied to real numbers smaller than 1. 70 | 71 | The \code{design} model used in the \code{\link[limma]{lmFit}} 72 | uses the "condition" column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object 73 | as well as all the covariates named in \code{extra.design.covariates}. 74 | For example, if \code{extra.design.covariates = c("var1", "var2")}, then 75 | \code{sample.annotations} must have two columns named "var1" and "var2", and the design formula 76 | in the \code{\link[limma]{lmFit}} function will be: 77 | \code{~ condition + var1 + var2}. 78 | } 79 | \examples{ 80 | try( 81 | if (require(limma)) { 82 | tmpdir <- normalizePath(tempdir(), winslash = "/") 83 | ## Simulate data 84 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 85 | samples.per.cond = 5, n.diffexp = 100, 86 | id.species = factor(1:10), 87 | lengths.relmeans = rpois(1000, 1000), 88 | lengths.dispersions = rgamma(1000, 1, 1), 89 | output.file = file.path(tmpdir, "mydata.rds")) 90 | ## Add covariates 91 | ## Model fitted is count.matrix ~ condition + test_factor + test_reg 92 | sample.annotations(mydata.obj)$test_factor <- factor(rep(1:2, each = 5)) 93 | sample.annotations(mydata.obj)$test_reg <- rnorm(10, 0, 1) 94 | saveRDS(mydata.obj, file.path(tmpdir, "mydata.rds")) 95 | ## Diff Exp 96 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "length.limma", 97 | Rmdfunction = "lengthNorm.limma.createRmd", 98 | output.directory = tmpdir, norm.method = "TMM", 99 | extra.design.covariates = c("test_factor", "test_reg")) 100 | }) 101 | 102 | } 103 | \references{ 104 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 105 | 106 | Smyth, G. K., Michaud, J., and Scott, H. (2005). The use of within-array replicate spots for assessing differential expression in microarray experiments. Bioinformatics 21(9), 2067-2075. 107 | 108 | Law, C.W., Chen, Y., Shi, W. et al. (2014) voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biol 15, R29. 109 | 110 | Musser, JM, Wagner, GP. (2015): Character trees from transcriptome data: Origin and individuation of morphological characters and the so‐called “species signal”. J. Exp. Zool. (Mol. Dev. Evol.) 324B: 588– 604. 111 | } 112 | \author{ 113 | Charlotte Soneson, Paul Bastide, Mélina Gallopin 114 | } 115 | -------------------------------------------------------------------------------- /man/lengthNorm.sva.limma.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExpPhylo.R 3 | \name{lengthNorm.sva.limma.createRmd} 4 | \alias{lengthNorm.sva.limma.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with length normalized counts + SVA + limma} 6 | \usage{ 7 | lengthNorm.sva.limma.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | extra.design.covariates = NULL, 13 | length.normalization = "RPKM", 14 | data.transformation = "log2", 15 | trend = FALSE, 16 | n.sv = "auto" 17 | ) 18 | } 19 | \arguments{ 20 | \item{data.path}{The path to a .rds file containing the \code{phyloCompData} object that will be used for the differential expression analysis.} 21 | 22 | \item{result.path}{The path to the file where the result object will be saved.} 23 | 24 | \item{codefile}{The path to the file where the code will be written.} 25 | 26 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} of the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 27 | 28 | \item{extra.design.covariates}{A vector containing the names of extra control variables to be passed to the design matrix of \code{limma}. All the covariates need to be a column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object, with a matching column name. The covariates can be a numeric vector, or a factor. Note that "condition" factor column is always included, and should not be added here. See Details.} 29 | 30 | \item{length.normalization}{one of "none" (no length correction), "TPM", or "RPKM" (default). See details.} 31 | 32 | \item{data.transformation}{one of "log2", "asin(sqrt)" or "sqrt". Data transformation to apply to the normalized data.} 33 | 34 | \item{trend}{should an intensity-trend be allowed for the prior variance? Default to \code{FALSE}.} 35 | 36 | \item{n.sv}{The number of surrogate variables to estimate (see \code{\link[sva]{sva}}). Default to \code{"auto"}: will be estimated with \code{\link[sva]{num.sv}}.} 37 | } 38 | \value{ 39 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 40 | } 41 | \description{ 42 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) by applying a length normalizing transformation, followed by a surrogate variable analysis (SVA), and then a differential expression analysis with limma. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 43 | } 44 | \details{ 45 | For more information about the methods and the interpretation of the parameters, see the \code{sva} and \code{limma} packages and the corresponding publications. 46 | 47 | See the \code{details} section of \code{\link{lengthNorm.limma.createRmd}} for details 48 | on the normalization and the extra design covariates. 49 | } 50 | \examples{ 51 | try( 52 | if (require(limma) && require(sva)) { 53 | tmpdir <- normalizePath(tempdir(), winslash = "/") 54 | ## Simulate data 55 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 56 | samples.per.cond = 5, n.diffexp = 100, 57 | id.species = factor(1:10), 58 | lengths.relmeans = rpois(1000, 1000), 59 | lengths.dispersions = rgamma(1000, 1, 1), 60 | output.file = file.path(tmpdir, "mydata.rds")) 61 | ## Add covariates 62 | ## Model fitted is count.matrix ~ condition + test_factor + test_reg 63 | sample.annotations(mydata.obj)$test_factor <- factor(rep(1:2, each = 5)) 64 | sample.annotations(mydata.obj)$test_reg <- rnorm(10, 0, 1) 65 | saveRDS(mydata.obj, file.path(tmpdir, "mydata.rds")) 66 | ## Diff Exp 67 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "lengthNorm.sva.limma", 68 | Rmdfunction = "lengthNorm.sva.limma.createRmd", 69 | output.directory = tmpdir, norm.method = "TMM", 70 | extra.design.covariates = c("test_factor", "test_reg")) 71 | }) 72 | 73 | } 74 | \references{ 75 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 76 | 77 | Smyth, G. K., Michaud, J., and Scott, H. (2005). The use of within-array replicate spots for assessing differential expression in microarray experiments. Bioinformatics 21(9), 2067-2075. 78 | 79 | Law, C.W., Chen, Y., Shi, W. et al. (2014) voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biol 15, R29. 80 | 81 | Musser, JM, Wagner, GP. (2015): Character trees from transcriptome data: Origin and individuation of morphological characters and the so‐called “species signal”. J. Exp. Zool. (Mol. Dev. Evol.) 324B: 588– 604. 82 | 83 | Leek JT, Johnson WE, Parker HS, Jaffe AE, and Storey JD. (2012) The sva package for removing batch effects and other unwanted variation in high-throughput experiments. Bioinformatics DOI:10.1093/bioinformatics/bts034 84 | } 85 | \author{ 86 | Charlotte Soneson, Paul Bastide, Mélina Gallopin 87 | } 88 | -------------------------------------------------------------------------------- /man/listcreateRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{listcreateRmd} 4 | \alias{listcreateRmd} 5 | \title{List available *.createRmd functions} 6 | \usage{ 7 | listcreateRmd() 8 | } 9 | \description{ 10 | Print a list of all \code{*.createRmd} functions that are available in the search path. These functions can be used together with the \code{\link{runDiffExp}} function to perform differential expression analysis. Consult the help pages for the respective functions for more information. 11 | } 12 | \examples{ 13 | listcreateRmd() 14 | 15 | } 16 | \author{ 17 | Charlotte Soneson 18 | } 19 | -------------------------------------------------------------------------------- /man/logcpm.limma.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{logcpm.limma.createRmd} 4 | \alias{logcpm.limma.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with limma after log-transforming the counts per million (cpm)} 6 | \usage{ 7 | logcpm.limma.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using limma, after preprocessing the counts by computing the counts per million (cpm) and applying a logarithmic transformation. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{edgeR} and \code{limma} packages and the corresponding publications. 26 | } 27 | \examples{ 28 | tmpdir <- normalizePath(tempdir(), winslash = "/") 29 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 30 | samples.per.cond = 5, n.diffexp = 100, 31 | output.file = file.path(tmpdir, "mydata.rds")) 32 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "logcpm.limma", 33 | Rmdfunction = "logcpm.limma.createRmd", 34 | output.directory = tmpdir, norm.method = "TMM") 35 | } 36 | \references{ 37 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 38 | 39 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 40 | 41 | Robinson MD and Oshlack A (2010): A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11:R25 42 | } 43 | \author{ 44 | Charlotte Soneson 45 | } 46 | -------------------------------------------------------------------------------- /man/nEffNaive.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{nEffNaive} 4 | \alias{nEffNaive} 5 | \title{Effective Sample Size} 6 | \usage{ 7 | nEffNaive(tree, id.condition, model, selection.strength) 8 | } 9 | \arguments{ 10 | \item{tree}{A phylogenetic tree. If \code{NULL}, samples are assumed to be iid.} 11 | 12 | \item{id.condition}{A named vector giving the state of each tip (sample).} 13 | 14 | \item{model}{The trait evolution model. One of "BM" or "OU".} 15 | 16 | \item{selection.strength}{If \code{model="OU"}, the selection strength parameter.} 17 | } 18 | \value{ 19 | The effective sample size. 20 | } 21 | \description{ 22 | Sample size so that the variance of the estimator is sigma^2 / nEff. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/nEffRatio.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{nEffRatio} 4 | \alias{nEffRatio} 5 | \title{Effective Sample Size Ratio} 6 | \usage{ 7 | nEffRatio(tree, id.condition, model, selection.strength) 8 | } 9 | \arguments{ 10 | \item{tree}{A phylogenetic tree. If \code{NULL}, samples are assumed to be iid.} 11 | 12 | \item{id.condition}{A named vector giving the state of each tip (sample).} 13 | 14 | \item{model}{The trait evolution model. One of "BM" or "OU".} 15 | 16 | \item{selection.strength}{If \code{model="OU"}, the selection strength parameter.} 17 | } 18 | \value{ 19 | The ratio of sample sizes. 20 | } 21 | \description{ 22 | Ratio between the tree sample size and the sample size of the equivalent problem 23 | with independent measures. A result larger than one indicates a problem that is 24 | made "easier" by the tree structure. Note that it strongly depends on the 25 | tip conditions (see examples). 26 | } 27 | \examples{ 28 | set.seed(1289) 29 | ## Ballanced tree 30 | ntips <- 2^5 31 | tree <- ape::compute.brlen(ape::stree(ntips, "balanced")) 32 | ## Alt cond : nEff greater than 1 33 | id_cond <- rep(rep(0:1, each = 2), ntips / 4) 34 | names(id_cond) <- tree$tip.label 35 | plot(tree); ape::tiplabels(pch = 21, col = id_cond, bg = id_cond) 36 | compcodeR:::nEffRatio(tree, id_cond, "BM", 0) 37 | ## Bloc cond : nEff smaller than 1 38 | id_cond <- rep(0:1, each = ntips / 2) 39 | names(id_cond) <- tree$tip.label 40 | plot(tree); ape::tiplabels(pch = 21, col = id_cond, bg = id_cond) 41 | compcodeR:::nEffRatio(tree, id_cond, "BM", 0) 42 | 43 | } 44 | \keyword{internal} 45 | -------------------------------------------------------------------------------- /man/phyloCompData-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \docType{class} 4 | \name{phyloCompData-class} 5 | \alias{phyloCompData-class} 6 | \title{Class phyloCompData} 7 | \description{ 8 | The \code{phyloCompData} class extends the \code{\linkS4class{compData}} class 9 | with sequence length and phylogeny related information. 10 | } 11 | \section{Slots}{ 12 | 13 | \describe{ 14 | \item{\code{tree}:}{The phylogenetic tree describing the relationships between samples. The taxa names of the \code{tree} should be the same as the column names of the \code{count.matrix}. Class \code{phylo}.} 15 | \item{\code{length.matrix}:}{The length matrix, with genes as rows and samples as columns. The column names of the \code{length.matrix} should be the same as the column names of the \code{count.matrix}. Class \code{matrix}.} 16 | \item{\code{sample.annotations}:}{In addition to the columns described in the \code{\linkS4class{compData}} class, if the tree is specified, it should contain an extra column named \code{id.species} of factors giving the species for each sample. The row names should be the same as the column names of count.matrix. Class \code{data.frame}.} 17 | } 18 | } 19 | 20 | \section{Methods}{ 21 | 22 | \describe{ 23 | \item{phylo.tree}{\code{signature(x="phyloCompData")}} 24 | \item{phylo.tree<-}{\code{signature(x="phyloCompData",value="phylo")}: 25 | Get or set the tree in a \code{phyloCompData} object. \code{value} should be a phylo object.} 26 | \item{length.matrix}{\code{signature(x="phyloCompData")}} 27 | \item{length.matrix<-}{\code{signature(x="phyloCompData",value="matrix")}: 28 | Get or set the length matrix in a \code{phyloCompData} object. \code{value} should be a numeric matrix.} 29 | } 30 | } 31 | 32 | \section{Construction}{ 33 | 34 | An object of the class \code{phyloCompData} can be constructed using the \code{\link{phyloCompData}} function. 35 | } 36 | 37 | \author{ 38 | Charlotte Soneson, Paul Bastide 39 | } 40 | -------------------------------------------------------------------------------- /man/phyloCompData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{phyloCompData} 4 | \alias{phyloCompData} 5 | \title{Create a \code{phyloCompData} object} 6 | \usage{ 7 | phyloCompData( 8 | count.matrix, 9 | sample.annotations, 10 | info.parameters, 11 | variable.annotations = data.frame(), 12 | filtering = "no info", 13 | analysis.date = "", 14 | package.version = "", 15 | method.names = list(), 16 | code = "", 17 | result.table = data.frame(), 18 | tree = list(), 19 | length.matrix = matrix(NA_integer_, 0, 0) 20 | ) 21 | } 22 | \arguments{ 23 | \item{count.matrix}{A count matrix, with genes as rows and observations as columns.} 24 | 25 | \item{sample.annotations}{A data frame, containing at least one column named 'condition', encoding the grouping of the observations into two groups, and one column named \code{id.species} of factors giving the species for each sample if the tree is specified. The row names should be the same as the column names of count.matrix. \code{Class data.frame}.} 26 | 27 | \item{info.parameters}{A list containing information regarding simulation parameters etc. The only mandatory entries are \code{dataset} and \code{uID}, but it may contain entries such as the ones listed below (see \code{generateSyntheticData} for more detailed information about each of these entries). 28 | \itemize{ 29 | \item \code{dataset}: an informative name or identifier of the data set (e.g., summarizing the simulation settings). 30 | \item \code{samples.per.cond} 31 | \item \code{n.diffexp} 32 | \item \code{repl.id} 33 | \item \code{seqdepth} 34 | \item \code{minfact} 35 | \item \code{maxfact} 36 | \item \code{fraction.upregulated} 37 | \item \code{between.group.diffdisp} 38 | \item \code{filter.threshold.total} 39 | \item \code{filter.threshold.mediancpm} 40 | \item \code{fraction.non.overdispersed} 41 | \item \code{random.outlier.high.prob} 42 | \item \code{random.outlier.low.prob} 43 | \item \code{single.outlier.high.prob} 44 | \item \code{single.outlier.low.prob} 45 | \item \code{effect.size} 46 | \item \code{uID}: a unique ID for the data set. In contrast to \code{dataset}, the \code{uID} is unique e.g. for each instance of replicated data sets generated with the same simulation settings. 47 | }} 48 | 49 | \item{variable.annotations}{A data frame with variable annotations (with number of rows equal to the number of rows in \code{count.matrix}, that is, the number of variables in the data set). Not mandatory, but may contain columns such as the ones listed below. If present, the row names should be the same as the row names of the \code{count.matrix}. 50 | \itemize{ 51 | \item \code{truedispersions.S1}: the true dispersion for each gene in condition S1. 52 | \item \code{truedispersions.S2}: the true dispersion for each gene in condition S2. 53 | \item \code{truemeans.S1}: the true mean value for each gene in condition S1. 54 | \item \code{truemeans.S2}: the true mean value for each gene in condition S2. 55 | \item \code{n.random.outliers.up.S1}: the number of 'random' outliers with extremely high counts for each gene in condition S1. 56 | \item \code{n.random.outliers.up.S2}: the number of 'random' outliers with extremely high counts for each gene in condition S2. 57 | \item \code{n.random.outliers.down.S1}: the number of 'random' outliers with extremely low counts for each gene in condition S1. 58 | \item \code{n.random.outliers.down.S2}: the number of 'random' outliers with extremely low counts for each gene in condition S2. 59 | \item \code{n.single.outliers.up.S1}: the number of 'single' outliers with extremely high counts for each gene in condition S1. 60 | \item \code{n.single.outliers.up.S2}: the number of 'single' outliers with extremely high counts for each gene in condition S2. 61 | \item \code{n.single.outliers.down.S1}: the number of 'single' outliers with extremely low counts for each gene in condition S1. 62 | \item \code{n.single.outliers.down.S2}: the number of 'single' outliers with extremely low counts for each gene in condition S2. 63 | \item \code{M.value}: the M-value (observed log2 fold change between condition S1 and condition S2) for each gene. 64 | \item \code{A.value}: the A-value (observed average expression level across condition S1 and condition S2) for each gene. 65 | \item \code{truelog2foldchanges}: the true (simulated) log2 fold changes between condition S1 and condition S2. 66 | \item \code{upregulation}: a binary vector indicating which genes are simulated to be upregulated in condition S2 compared to condition S1. 67 | \item \code{downregulation}: a binary vector indicating which genes are simulated to be downregulated in condition S2 compared to condition S1. 68 | \item \code{differential.expression}: a binary vector indicating which genes are simulated to be differentially expressed in condition S2 compared to condition S1. 69 | }} 70 | 71 | \item{filtering}{A character string containing information about the filtering that has been applied to the data set.} 72 | 73 | \item{analysis.date}{If a differential expression analysis has been performed, a character string detailing when it was performed.} 74 | 75 | \item{package.version}{If a differential expression analysis has been performed, a character string giving the version of the differential expression packages that were applied.} 76 | 77 | \item{method.names}{If a differential expression analysis has been performed, a list with entries \code{full.name} and \code{short.name}, giving the full name of the differential expression method (may including version number and parameter settings) and a short name or abbreviation.} 78 | 79 | \item{code}{If a differential expression analysis has been performed, a character string containing the code that was run to perform the analysis. The code should be in R markdown format, and can be written to an HTML file using the \code{\link{generateCodeHTMLs}} function.} 80 | 81 | \item{result.table}{If a differential expression analysis has been performed, a data frame containing the results of the analysis. The number of rows should be equal to the number of rows in \code{count.matrix} and if present, the row names should be identical. The only mandatory column is \code{score}, which gives a score for each gene, where a higher score suggests a "more highly differentially expressed" gene. Different comparison functions use different columns of this table, if available. The list below gives the columns that are used by the interfaced methods. 82 | \itemize{ 83 | \item \code{pvalue} nominal p-values 84 | \item \code{adjpvalue} p-values adjusted for multiple comparisons 85 | \item \code{logFC} estimated log-fold changes between the two conditions 86 | \item \code{score} the score that will be used to rank the genes in order of significance. Note that high scores always signify differential expression, that is, a strong association with the predictor. For example, for methods returning a nominal p-value the score can be defined as 1 - pvalue. 87 | \item \code{FDR} false discovery rate estimates 88 | \item \code{posterior.DE} posterior probabilities of differential expression 89 | \item \code{prob.DE} conditional probabilities of differential expression 90 | \item \code{lfdr} local false discovery rates 91 | \item \code{statistic} test statistics from the differential expression analysis 92 | \item \code{dispersion.S1} dispersion estimates in condition S1 93 | \item \code{dispersion.S2} dispersion estimates in condition S2 94 | }} 95 | 96 | \item{tree}{The phylogenetic tree describing the relationships between samples. The taxa names of the \code{tree} should be the same as the column names of the \code{count.matrix}.} 97 | 98 | \item{length.matrix}{The length matrix, with genes as rows and samples as columns. The column names of the \code{length.matrix} should be the same as the column names of the \code{count.matrix}.} 99 | } 100 | \value{ 101 | A \code{phyloCompData} object. 102 | } 103 | \description{ 104 | The \code{\linkS4class{phyloCompData}} class extends the \code{\link{compData}} class 105 | with sequence length and phylogeny related information. 106 | } 107 | \examples{ 108 | tree <- ape::read.tree( 109 | text = "(((A1:0,A2:0,A3:0):1,B1:1):1,((C1:0,C2:0):1.5,(D1:0,D2:0):1.5):0.5);" 110 | ) 111 | count.matrix <- round(matrix(1000*runif(8000), 1000)) 112 | sample.annotations <- data.frame(condition = c(1, 1, 1, 1, 2, 2, 2, 2), 113 | id.species = c("A", "A", "A", "B", "C", "C", "D", "D")) 114 | info.parameters <- list(dataset = "mydata", uID = "123456") 115 | length.matrix <- round(matrix(1000*runif(8000), 1000)) 116 | colnames(count.matrix) <- colnames(length.matrix) <- rownames(sample.annotations) <- tree$tip.label 117 | cpd <- phyloCompData(count.matrix, sample.annotations, info.parameters, 118 | tree = tree, length.matrix = length.matrix) 119 | 120 | } 121 | \author{ 122 | Charlotte Soneson, Paul Bastide 123 | } 124 | -------------------------------------------------------------------------------- /man/phyloCompDataFromCompData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AllClasses.R 3 | \name{phyloCompDataFromCompData} 4 | \alias{phyloCompDataFromCompData} 5 | \title{Create a \code{phyloCompData} object} 6 | \usage{ 7 | phyloCompDataFromCompData( 8 | compDataObject, 9 | tree = list(), 10 | length.matrix = matrix(NA_integer_, 0, 0) 11 | ) 12 | } 13 | \arguments{ 14 | \item{compDataObject}{An object of class \code{\link{compData}}.} 15 | 16 | \item{tree}{A phylogenetic tree describing the relationships between samples.} 17 | 18 | \item{length.matrix}{A length matrix, with genes as rows and observations as columns.} 19 | } 20 | \value{ 21 | A \code{phyloCompData} object. 22 | } 23 | \description{ 24 | The \code{phyloCompData} class extends the \code{\link{compData}} class 25 | with sequence length and phylogeny related information. 26 | } 27 | \author{ 28 | Charlotte Soneson, Paul Bastide 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /man/phylolm.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/phylolmMethods.R 3 | \name{phylolm.createRmd} 4 | \alias{phylolm.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with \code{\link[phylolm]{phylolm}}.} 6 | \usage{ 7 | phylolm.createRmd( 8 | data.path, 9 | result.path, 10 | codefile, 11 | norm.method, 12 | model = "BM", 13 | measurement_error = TRUE, 14 | extra.design.covariates = NULL, 15 | length.normalization = "RPKM", 16 | data.transformation = "log2", 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{data.path}{The path to a .rds file containing the \code{phyloCompData} object that will be used for the differential expression analysis.} 22 | 23 | \item{result.path}{The path to the file where the result object will be saved.} 24 | 25 | \item{codefile}{The path to the file where the code will be written.} 26 | 27 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} of the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 28 | 29 | \item{model}{The model for trait evolution on the tree. Default to "BM".} 30 | 31 | \item{measurement_error}{A logical value indicating whether there is measurement error. Default to TRUE.} 32 | 33 | \item{extra.design.covariates}{A vector containing the names of extra control variables to be passed to the design matrix of \code{phyolm}. All the covariates need to be a column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object, with a matching column name. The covariates can be a numeric vector, or a factor. Note that "condition" factor column is always included, and should not be added here. See Details.} 34 | 35 | \item{length.normalization}{one of "none" (no correction), "TPM" or "RPKM" (default). See details.} 36 | 37 | \item{data.transformation}{one of "log2", "asin(sqrt)" or "sqrt". Data transformation to apply to the normalized data.} 38 | 39 | \item{...}{Further arguments to be passed to function \code{\link[phylolm]{phylolm}}.} 40 | } 41 | \value{ 42 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 43 | } 44 | \description{ 45 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using the phylolm package. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 46 | } 47 | \details{ 48 | For more information about the methods and the interpretation of the parameters, see the \code{\link[phylolm]{phylolm}} package and the corresponding publications. 49 | 50 | 51 | The \code{length.matrix} field of the \code{phyloCompData} object 52 | is used to normalize the counts, using one of the following formulas: 53 | * \code{length.normalization="none"} : \eqn{CPM_{gi} = \frac{N_{gi} + 0.5}{NF_i \times \sum_{g} N_{gi} + 1} \times 10^6} 54 | * \code{length.normalization="TPM"} : \eqn{TPM_{gi} = \frac{(N_{gi} + 0.5) / L_{gi}}{NF_i \times \sum_{g} N_{gi}/L_{gi} + 1} \times 10^6} 55 | * \code{length.normalization="RPKM"} : \eqn{RPKM_{gi} = \frac{(N_{gi} + 0.5) / L_{gi}}{NF_i \times \sum_{g} N_{gi} + 1} \times 10^9} 56 | 57 | where \eqn{N_{gi}} is the count for gene g and sample i, 58 | where \eqn{L_{gi}} is the length of gene g in sample i, 59 | and \eqn{NF_i} is the normalization for sample i, 60 | normalized using \code{calcNormFactors} of the \code{edgeR} package. 61 | 62 | The function specified by the \code{data.transformation} is then applied 63 | to the normalized count matrix. 64 | 65 | The "\eqn{+0.5}" and "\eqn{+1}" are taken from Law et al 2014, 66 | and dropped from the normalization 67 | when the transformation is something else than \code{log2}. 68 | 69 | The "\eqn{\times 10^6}" and "\eqn{\times 10^9}" factors are omitted when 70 | the \code{asin(sqrt)} transformation is taken, as \eqn{asin} can only 71 | be applied to real numbers smaller than 1. 72 | 73 | The \code{design} model used in the \code{\link[phylolm]{phylolm}} 74 | uses the "condition" column of the \code{sample.annotations} data frame from the \code{\link{phyloCompData}} object 75 | as well as all the covariates named in \code{extra.design.covariates}. 76 | For example, if \code{extra.design.covariates = c("var1", "var2")}, then 77 | \code{sample.annotations} must have two columns named "var1" and "var2", and the design formula 78 | in the \code{\link[phylolm]{phylolm}} function will be: 79 | \code{~ condition + var1 + var2}. 80 | } 81 | \examples{ 82 | try( 83 | if (require(ape) && require(phylolm)) { 84 | tmpdir <- normalizePath(tempdir(), winslash = "/") 85 | set.seed(20200317) 86 | tree <- rphylo(10, 0.1, 0) 87 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 88 | samples.per.cond = 5, n.diffexp = 100, 89 | tree = tree, 90 | id.species = 1:10, 91 | lengths.relmeans = rpois(1000, 1000), 92 | lengths.dispersions = rgamma(1000, 1, 1), 93 | output.file = file.path(tmpdir, "mydata.rds")) 94 | ## Add covariates 95 | ## Model fitted is count.matrix ~ condition + test_factor + test_reg 96 | sample.annotations(mydata.obj)$test_factor <- factor(rep(1:2, each = 5)) 97 | sample.annotations(mydata.obj)$test_reg <- rnorm(10, 0, 1) 98 | saveRDS(mydata.obj, file.path(tmpdir, "mydata.rds")) 99 | ## Diff Exp 100 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "DESeq2", 101 | Rmdfunction = "phylolm.createRmd", 102 | output.directory = tmpdir, 103 | norm.method = "TMM", 104 | extra.design.covariates = c("test_factor", "test_reg"), 105 | length.normalization = "RPKM") 106 | }) 107 | } 108 | \references{ 109 | Ho, L. S. T. and Ane, C. 2014. "A linear-time algorithm for Gaussian and non-Gaussian trait evolution models". Systematic Biology 63(3):397-408. 110 | 111 | Law, C.W., Chen, Y., Shi, W. et al. (2014) voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biol 15, R29. 112 | 113 | Musser, JM, Wagner, GP. (2015): Character trees from transcriptome data: Origin and individuation of morphological characters and the so‐called “species signal”. J. Exp. Zool. (Mol. Dev. Evol.) 324B: 588– 604. 114 | } 115 | \author{ 116 | Charlotte Soneson, Paul Bastide, Mélina Gallopin 117 | } 118 | -------------------------------------------------------------------------------- /man/phylolm_analysis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/phylolmMethods.R 3 | \name{phylolm_analysis} 4 | \alias{phylolm_analysis} 5 | \title{Perform the phylolm analysis} 6 | \usage{ 7 | phylolm_analysis( 8 | dat, 9 | design_data, 10 | design_formula, 11 | tree, 12 | model, 13 | measurement_error, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{dat}{the data associated with a gene} 19 | 20 | \item{design_data}{design matrix} 21 | 22 | \item{design_formula}{design formula} 23 | 24 | \item{tree}{phylogenetic tree} 25 | 26 | \item{model}{the model to be used in phylolm} 27 | 28 | \item{measurement_error}{boolean} 29 | } 30 | \value{ 31 | A list, with: 32 | \describe{ 33 | \item{pvalue}{the p value of the differential expression.} 34 | \item{logFC}{the log fold change of the differential expression.} 35 | \item{score}{1 - pvalue.} 36 | } 37 | } 38 | \description{ 39 | Perform the phylolm analysis for a given gene. 40 | } 41 | \keyword{internal} 42 | -------------------------------------------------------------------------------- /man/runComparison.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/runComparison.R 3 | \name{runComparison} 4 | \alias{runComparison} 5 | \title{Run the performance comparison between differential expression methods.} 6 | \usage{ 7 | runComparison( 8 | file.table, 9 | parameters, 10 | output.directory, 11 | check.table = TRUE, 12 | out.width = NULL, 13 | save.result.table = FALSE, 14 | knit.results = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{file.table}{A data frame with at least a column \code{input.files}, potentially also columns named \code{datasets}, \code{nbr.samples}, \code{repl} and \code{de.methods}.} 19 | 20 | \item{parameters}{A list containing parameters for the comparison study. The following entries are supported, and used by different comparison methods: 21 | \itemize{ 22 | \item \code{incl.nbr.samples} An array with sample sizes (number of samples per condition) to consider in the comparison. If set to \code{NULL}, all sample sizes will be included. 23 | \item \code{incl.dataset} A dataset name (corresponding to the \code{dataset} slot of the results or data objects), indicating the dataset that will be used for the comparison. Only one dataset can be chosen. 24 | \item \code{incl.replicates} An array with replicate numbers to consider in the comparison. If set to \code{NULL}, all replicates will be included. 25 | \item \code{incl.de.methods} An array with differential expression methods to be compared. If set to \code{NULL}, all differential expression methods will be included. 26 | \item \code{fdr.threshold} The adjusted p-value threshold for FDR calculations. Default 0.05. 27 | \item \code{tpr.threshold} The adjusted p-value threshold for TPR calculations. Default 0.05. 28 | \item \code{mcc.threshold} The adjusted p-value threshold for MCC calculations. Default 0.05. 29 | \item \code{typeI.threshold} The nominal p-value threshold for type I error calculations. Default 0.05. 30 | \item \code{fdc.maxvar} The maximal number of variables to include in false discovery curve plots. Default 1500. 31 | \item \code{overlap.threshold} The adjusted p-value for overlap analysis. Default 0.05. 32 | \item \code{fracsign.threshold} The adjusted p-value for calculation of the fraction/number of genes called significant. Default 0.05. 33 | \item \code{nbrtpfp.threshold} The adjusted p-value for calculation of the number of TP, FP, TN, FN genes. Default 0.05. 34 | \item \code{ma.threshold} The adjusted p-value threshold for coloring genes in MA plots. Default 0.05. 35 | \item \code{signal.measure} Either \code{'mean'} or \code{'snr'}, determining how to define the signal strength for a gene which is expressed in only one condition. 36 | \item \code{upper.limits,lower.limits} Lists that can be used to manually set the upper and lower plot limits for boxplots of fdr, tpr, auc, mcc, fracsign, nbrtpfp and typeIerror. 37 | \item \code{comparisons} Array containing the comparison methods to be applied. The entries must be chosen among the following abbreviations: 38 | \itemize{ 39 | \item \code{"auc"} - Compute the area under the ROC curve 40 | \item \code{"mcc"} - Compute Matthew's correlation coefficient 41 | \item \code{"tpr"} - Compute the true positive rate at a given adjusted p-value threshold (\code{tpr.threshold}) 42 | \item \code{"fdr"} - Compute the false discovery rate at a given adjusted p-value threshold (\code{fdr.threshold}) 43 | \item \code{"fdrvsexpr"} - Compute the false discovery rate as a function of the expression level. 44 | \item \code{"typeIerror"} - Compute the type I error rate at a given nominal p-value threshold (\code{typeI.threshold}) 45 | \item \code{"fracsign"} - Compute the fraction of genes called significant at a given adjusted p-value threshold (\code{fracsign.threshold}). 46 | \item \code{"nbrsign"} - Compute the number of genes called significant at a given adjusted p-value threshold (\code{fracsign.threshold}). 47 | \item \code{"nbrtpfp"} - Compute the number of true positives, false positives, true negatives and false negatives at a given adjusted p-value threshold (\code{nbrtpfp.threshold}). 48 | \item \code{"maplot"} - Construct MA plots, depicting the average expression level and the log fold change for the genes and indicating the genes called differential expressed at a given adjusted p-value threshold (\code{ma.threshold}). 49 | \item \code{"fdcurvesall"} - Construct false discovery curves for each of the included replicates. 50 | \item \code{"fdcurvesone"} - Construct false discovery curves for a single replicate only 51 | \item \code{"rocall"} - Construct ROC curves for each of the included replicates 52 | \item \code{"rocone"} - Construct ROC curves for a single replicate only 53 | \item \code{"overlap"} - Compute the overlap between collections of genes called differentially expressed by the different methods at a given adjusted p-value threshold (\code{overlap.threshold}) 54 | \item \code{"sorensen"} - Compute the Sorensen index, quantifying the overlap between collections of genes called differentially expressed by the different methods, at a given adjusted p-value threshold (\code{overlap.threshold}) 55 | \item \code{"correlation"} - Compute the Spearman correlation between gene scores assigned by different methods 56 | \item \code{"scorevsoutlier"} - Visualize the distribution of the gene scores as a function of the number of outlier counts introduced for the genes 57 | \item \code{"scorevsexpr"} - Visualize the gene scores as a function of the average expression level of the genes 58 | \item \code{"scorevssignal"} - Visualize the gene score as a function of the 'signal strength' (see the \code{signal.measure} parameter above) for genes that are expressed in only one condition 59 | } 60 | }} 61 | 62 | \item{output.directory}{The directory where the results should be written. The subdirectory structure will be created automatically. If the directory already exists, it will be overwritten.} 63 | 64 | \item{check.table}{Logical, should the input table be checked for consistency. Default \code{TRUE}.} 65 | 66 | \item{out.width}{The width of the figures in the final report. Will be passed on to \code{knitr} when the HTML is generated.} 67 | 68 | \item{save.result.table}{Logical, should the intermediate result table be saved for future use ? Default to \code{FALSE}.} 69 | 70 | \item{knit.results}{Logical, should the Rmd be generated and knitted ? Default to \code{TRUE}. If \code{FALSE}, no comparison report is generated, and only the intermediate result table is saved (if \code{save.result.table=TRUE}).} 71 | } 72 | \value{ 73 | If \code{knit.results=TRUE}, the function will create a comparison report, named \strong{compcodeR_report.html}, in the \code{output.directory}. It will also create subfolders named \code{compcodeR_code} and \code{compcodeR_figure}, where the code used to perform the differential expression analysis and the figures contained in the report, respectively, will be stored. Note that if these directories already exists, they will be overwritten. 74 | If \code{save.result.table=TRUE}, the function will also create a comparison report, named \strong{compcodeR_result_table_.rds} in the \code{output.directory}, containing the result table. 75 | } 76 | \description{ 77 | The main function for performing comparisons among differential expression methods and generating a report in HTML format. It is assumed that all differential expression results have been generated in advance (using e.g. the function \code{\link{runDiffExp}}) and that the result \code{compData} object for each data set and each differential expression method is saved separately in files with the extension \code{.rds}. Note that the function can also be called via the \code{\link{runComparisonGUI}} function, which lets the user set parameters and select input files using a graphical user interface. 78 | } 79 | \details{ 80 | The input to \code{\link{runComparison}} is a data frame with at least a column named \code{input.files}, containing paths to \code{.rds} files containing result objects (of the class \code{compData}), such as those generated by \code{\link{runDiffExp}}. Other columns that can be included in the data frame are \code{datasets}, \code{nbr.samples}, \code{repl} and \code{de.methods}. They have to match the information contained in the corresponding result objects. If these columns are not present, they will be added to the data frame automatically. 81 | } 82 | \examples{ 83 | tmpdir <- normalizePath(tempdir(), winslash = "/") 84 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 85 | samples.per.cond = 5, n.diffexp = 100, 86 | output.file = file.path(tmpdir, "mydata.rds")) 87 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 88 | Rmdfunction = "voom.limma.createRmd", output.directory = tmpdir, 89 | norm.method = "TMM") 90 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "edgeR.exact", 91 | Rmdfunction = "edgeR.exact.createRmd", output.directory = tmpdir, 92 | norm.method = "TMM", 93 | trend.method = "movingave", disp.type = "tagwise") 94 | file.table <- data.frame(input.files = file.path(tmpdir, 95 | c("mydata_voom.limma.rds", "mydata_edgeR.exact.rds")), 96 | stringsAsFactors = FALSE) 97 | parameters <- list(incl.nbr.samples = 5, incl.replicates = 1, incl.dataset = "mydata", 98 | incl.de.methods = NULL, 99 | fdr.threshold = 0.05, tpr.threshold = 0.05, typeI.threshold = 0.05, 100 | ma.threshold = 0.05, fdc.maxvar = 1500, overlap.threshold = 0.05, 101 | fracsign.threshold = 0.05, mcc.threshold = 0.05, 102 | nbrtpfp.threshold = 0.05, 103 | comparisons = c("auc", "fdr", "tpr", "ma", "correlation")) 104 | if (interactive()) { 105 | runComparison(file.table = file.table, parameters = parameters, output.directory = tmpdir) 106 | } 107 | } 108 | \author{ 109 | Charlotte Soneson 110 | } 111 | -------------------------------------------------------------------------------- /man/runComparisonGUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/runComparison.R 3 | \name{runComparisonGUI} 4 | \alias{runComparisonGUI} 5 | \title{A GUI to the main function for running the performance comparison between differential expression methods.} 6 | \usage{ 7 | runComparisonGUI( 8 | input.directories, 9 | output.directory, 10 | recursive, 11 | out.width = NULL, 12 | upper.limits = NULL, 13 | lower.limits = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{input.directories}{A list of directories containing the result files (\code{*.rds}). All results in the provided directories will be available for inclusion in the comparison, and the selection is performed through a graphical user interface. All result objects saved in the files should be of the \code{compData} class, although list objects created by earlier versions of \code{compcodeR} are supported.} 18 | 19 | \item{output.directory}{The directory where the results should be written. The subdirectory structure will be created automatically. If the directory already exists, it will be overwritten.} 20 | 21 | \item{recursive}{A logical parameter indicating whether or not the search should be extended recursively to subfolders of the \code{input.directories}.} 22 | 23 | \item{out.width}{The width of the figures in the final report. Will be passed on to \code{knitr} when the HTML is generated. Can be for example "800px" (see \code{knitr} documentation for more information)} 24 | 25 | \item{upper.limits, lower.limits}{Lists that can be used to manually set upper and lower limits for boxplots of fdr, tpr, auc, mcc, fracsign, nbrtpfp, nbrsign and typeIerror.} 26 | } 27 | \value{ 28 | The function will create a comparison report, named \strong{compcodeR_report.html}, in the \code{output.directory}. It will also create subfolders named \code{compcodeR_code} and \code{compcodeR_figure}, where the code used to perform the differential expression analysis and the figures contained in the report, respectively, will be saved. Note that if these directories already exist they will be overwritten. 29 | } 30 | \description{ 31 | This function provides a GUI to the main function for performing comparisons among differential expression methods and generating a report in HTML format (\code{\link{runComparison}}). It is assumed that all differential expression results have been generated in advance (using e.g. the function \code{\link{runDiffExp}}) and that the result \code{compData} object for each data set and each differential expression method is saved separately in files with the extension \code{.rds}. The function opens a graphical user interface where the user can set parameter values and choose the files to be used as the basis of the comparison. It is, however, possible to circumvent the GUI and call the comparison function \code{\link{runComparison}} directly. 32 | } 33 | \details{ 34 | This function requires that the \code{rpanel} package is installed. If this package can not be installed, please use the \code{\link{runComparison}} function directly. 35 | } 36 | \examples{ 37 | if (interactive()) { 38 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 12500, 39 | samples.per.cond = 5, n.diffexp = 1250, 40 | output.file = "mydata.rds") 41 | runDiffExp(data.file = "mydata.rds", result.extent = "voom.limma", 42 | Rmdfunction = "voom.limma.createRmd", output.directory = ".", 43 | norm.method = "TMM") 44 | runDiffExp(data.file = "mydata.rds", result.extent = "ttest", 45 | Rmdfunction = "ttest.createRmd", output.directory = ".", 46 | norm.method = "TMM") 47 | runComparisonGUI(input.directories = ".", output.directory = ".", recursive = FALSE) 48 | } 49 | } 50 | \author{ 51 | Charlotte Soneson 52 | } 53 | -------------------------------------------------------------------------------- /man/runComparisonShiny.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/runComparisonShiny.R 3 | \name{runComparisonShiny} 4 | \alias{runComparisonShiny} 5 | \title{A shiny-based GUI to the main function for running the performance 6 | comparison between differential expression methods.} 7 | \usage{ 8 | runComparisonShiny( 9 | input.directories, 10 | output.directory, 11 | recursive, 12 | out.width = NULL, 13 | upper.limits = NULL, 14 | lower.limits = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{input.directories}{A list of directories containing the result files 19 | (\code{*.rds}). All results in the provided directories will be available 20 | for inclusion in the comparison, and the selection is performed through 21 | a graphical user interface. All result objects saved in the files should 22 | be of the \code{compData} class, although list objects created by 23 | earlier versions of \code{compcodeR} are supported.} 24 | 25 | \item{output.directory}{The directory where the results should be written. 26 | The subdirectory structure will be created automatically. If the 27 | directory already exists, it will be overwritten.} 28 | 29 | \item{recursive}{A logical parameter indicating whether or not the search 30 | should be extended recursively to subfolders of the 31 | \code{input.directories}.} 32 | 33 | \item{out.width}{The width of the figures in the final report. Will be 34 | passed on to \code{knitr} when the HTML is generated. Can be for 35 | example "800px" (see \code{knitr} documentation for more information).} 36 | 37 | \item{upper.limits, lower.limits}{Lists that can be used to manually set 38 | upper and lower limits for boxplots of fdr, tpr, auc, mcc, fracsign, 39 | nbrtpfp, nbrsign and typeIerror.} 40 | } 41 | \value{ 42 | The function will create a comparison report, named 43 | \strong{compcodeR_report.html}, in the \code{output.directory}. 44 | It will also create subfolders named \code{compcodeR_code} and 45 | \code{compcodeR_figure}, where the code used to perform the differential 46 | expression analysis and the figures contained in the report, respectively, 47 | will be saved. Note that if these directories already exist they will be 48 | overwritten. 49 | } 50 | \description{ 51 | This function provides a GUI to the main function for performing comparisons 52 | among differential expression methods and generating a report in HTML format 53 | (\code{\link{runComparison}}). It is assumed that all differential 54 | expression results have been generated in advance (using e.g. the function 55 | \code{\link{runDiffExp}}) and that the result \code{compData} object for 56 | each data set and each differential expression method is saved separately in 57 | files with the extension \code{.rds}. The function opens a graphical user 58 | interface where the user can set parameter values and choose the files to be 59 | used as the basis of the comparison. It is, however, possible to circumvent 60 | the GUI and call the comparison function \code{\link{runComparison}} directly. 61 | } 62 | \examples{ 63 | if (interactive()) { 64 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 12500, 65 | samples.per.cond = 5, n.diffexp = 1250, 66 | output.file = "mydata.rds") 67 | runDiffExp(data.file = "mydata.rds", result.extent = "voom.limma", 68 | Rmdfunction = "voom.limma.createRmd", output.directory = ".", 69 | norm.method = "TMM") 70 | runDiffExp(data.file = "mydata.rds", result.extent = "ttest", 71 | Rmdfunction = "ttest.createRmd", output.directory = ".", 72 | norm.method = "TMM") 73 | runComparisonShiny(input.directories = ".", output.directory = ".", recursive = FALSE) 74 | } 75 | 76 | } 77 | \author{ 78 | Charlotte Soneson 79 | } 80 | -------------------------------------------------------------------------------- /man/runDiffExp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/runDiffExp.R 3 | \name{runDiffExp} 4 | \alias{runDiffExp} 5 | \title{The main function to run differential expression analysis} 6 | \usage{ 7 | runDiffExp( 8 | data.file, 9 | result.extent, 10 | Rmdfunction, 11 | output.directory = ".", 12 | norm.path = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{data.file}{The path to a \code{.rds} file containing the data on which the differential expression analysis will be performed, for example a \code{compData} object returned from \code{\link{generateSyntheticData}}.} 18 | 19 | \item{result.extent}{The extension that will be added to the data file name in order to construct the result file name. This can be for example the differential expression method together with a version number.} 20 | 21 | \item{Rmdfunction}{A function that creates an Rmd file containing the code that should be run to perform the differential expression analysis. All functions available through \code{compcodeR} can be listed using the \code{\link{listcreateRmd}} function.} 22 | 23 | \item{output.directory}{The directory in which the result object will be saved.} 24 | 25 | \item{norm.path}{Logical, whether to include the full (absolute) path to the output object in the saved code.} 26 | 27 | \item{...}{Additional arguments that will be passed to the \code{Rmdfunction}, such as parameter choices for the differential expression method.} 28 | } 29 | \description{ 30 | The main function for running differential expression analysis (comparing two conditions), using one of the methods interfaced through \code{compcodeR} or a user-defined method. Note that the interface functions are provided for convenience and as templates for other, user-defined workflows, and there is no guarantee that the included differential expression code is kept up-to-date with the latest recommendations and best practices for running each of the interfaced methods, or that the chosen settings are suitable in all situations. The user should make sure that the analysis is performed in the way they intend, and check the code that was run, using e.g. the \code{generateCodeHTMLs()} function. 31 | } 32 | \examples{ 33 | tmpdir <- normalizePath(tempdir(), winslash = "/") 34 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 35 | samples.per.cond = 5, n.diffexp = 100, 36 | output.file = file.path(tmpdir, "mydata.rds")) 37 | listcreateRmd() 38 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 39 | Rmdfunction = "voom.limma.createRmd", 40 | output.directory = tmpdir, norm.method = "TMM") 41 | 42 | if (interactive()) { 43 | ## The following list covers the currently available 44 | ## differential expression methods: 45 | runDiffExp(data.file = "mydata.rds", result.extent = "DESeq2", 46 | Rmdfunction = "DESeq2.createRmd", 47 | output.directory = ".", fit.type = "parametric", 48 | test = "Wald", beta.prior = TRUE, 49 | independent.filtering = TRUE, cooks.cutoff = TRUE, 50 | impute.outliers = TRUE) 51 | runDiffExp(data.file = "mydata.rds", result.extent = "DSS", 52 | Rmdfunction = "DSS.createRmd", 53 | output.directory = ".", norm.method = "quantile", 54 | disp.trend = TRUE) 55 | runDiffExp(data.file = "mydata.rds", result.extent = "EBSeq", 56 | Rmdfunction = "EBSeq.createRmd", 57 | output.directory = ".", norm.method = "median") 58 | runDiffExp(data.file = "mydata.rds", result.extent = "edgeR.exact", 59 | Rmdfunction = "edgeR.exact.createRmd", 60 | output.directory = ".", norm.method = "TMM", 61 | trend.method = "movingave", disp.type = "tagwise") 62 | runDiffExp(data.file = "mydata.rds", result.extent = "edgeR.GLM", 63 | Rmdfunction = "edgeR.GLM.createRmd", 64 | output.directory = ".", norm.method = "TMM", 65 | disp.type = "tagwise", disp.method = "CoxReid", 66 | trended = TRUE) 67 | runDiffExp(data.file = "mydata.rds", result.extent = "logcpm.limma", 68 | Rmdfunction = "logcpm.limma.createRmd", 69 | output.directory = ".", norm.method = "TMM") 70 | runDiffExp(data.file = "mydata.rds", result.extent = "NBPSeq", 71 | Rmdfunction = "NBPSeq.createRmd", 72 | output.directory = ".", norm.method = "TMM", 73 | disp.method = "NBP") 74 | runDiffExp(data.file = "mydata.rds", result.extent = "NOISeq", 75 | Rmdfunction = "NOISeq.prenorm.createRmd", 76 | output.directory = ".", norm.method = "TMM") 77 | runDiffExp(data.file = "mydata.rds", result.extent = "sqrtcpm.limma", 78 | Rmdfunction = "sqrtcpm.limma.createRmd", 79 | output.directory = ".", norm.method = "TMM") 80 | runDiffExp(data.file = "mydata.rds", result.extent = "TCC", 81 | Rmdfunction = "TCC.createRmd", 82 | output.directory = ".", norm.method = "tmm", 83 | test.method = "edger", iteration = 3, 84 | normFDR = 0.1, floorPDEG = 0.05) 85 | runDiffExp(data.file = "mydata.rds", result.extent = "ttest", 86 | Rmdfunction = "ttest.createRmd", 87 | output.directory = ".", norm.method = "TMM") 88 | runDiffExp(data.file = "mydata.rds", result.extent = "voom.limma", 89 | Rmdfunction = "voom.limma.createRmd", 90 | output.directory = ".", norm.method = "TMM") 91 | runDiffExp(data.file = "mydata.rds", result.extent = "voom.ttest", 92 | Rmdfunction = "voom.ttest.createRmd", 93 | output.directory = ".", norm.method = "TMM") 94 | } 95 | } 96 | \author{ 97 | Charlotte Soneson 98 | } 99 | -------------------------------------------------------------------------------- /man/scale_variance_process.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{scale_variance_process} 4 | \alias{scale_variance_process} 5 | \title{Scale the variances} 6 | \usage{ 7 | scale_variance_process( 8 | log_variance_phylo, 9 | tree, 10 | model.process, 11 | selection.strength 12 | ) 13 | } 14 | \arguments{ 15 | \item{tree}{a dated phylogenetic tree of class \code{\link[ape]{phylo}} with `samples.per.cond * 2` species.} 16 | 17 | \item{model.process}{the process to be used for phylogenetic simulations. One of "BM" or "OU", default to "BM".} 18 | 19 | \item{selection.strength}{if the process is "OU", the selection strength parameter.} 20 | } 21 | \value{ 22 | A matrix N * P of factors to multiply the simulated phylogenetic residuals. 23 | } 24 | \description{ 25 | Scale the variances of the process simulation so that they are equal to log_variance_phylo. 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/show-compData-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/show-methods.R 3 | \name{show,compData-method} 4 | \alias{show,compData-method} 5 | \title{Show method for \code{compData} object} 6 | \usage{ 7 | \S4method{show}{compData}(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{compData} object} 11 | } 12 | \description{ 13 | Show method for \code{compData} object. 14 | } 15 | \examples{ 16 | mydata <- generateSyntheticData(dataset = "mydata", n.vars = 12500, 17 | samples.per.cond = 5, n.diffexp = 1250) 18 | mydata 19 | } 20 | \author{ 21 | Charlotte Soneson 22 | } 23 | -------------------------------------------------------------------------------- /man/show-phyloCompData-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/show-methods.R 3 | \name{show,phyloCompData-method} 4 | \alias{show,phyloCompData-method} 5 | \title{Show method for \code{phyloCompData} object} 6 | \usage{ 7 | \S4method{show}{phyloCompData}(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{phyloCompData} object} 11 | } 12 | \description{ 13 | Show method for \code{phyloCompData} object. 14 | } 15 | \examples{ 16 | mydata <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 17 | samples.per.cond = 5, n.diffexp = 100, 18 | id.species = factor(1:10), 19 | tree = ape::rphylo(10, 1, 0), 20 | lengths.relmeans = "auto", lengths.dispersions = "auto") 21 | mydata 22 | } 23 | \author{ 24 | Charlotte Soneson, Paul Bastide 25 | } 26 | -------------------------------------------------------------------------------- /man/show_compData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/show-methods.R 3 | \name{show_compData} 4 | \alias{show_compData} 5 | \title{Show function for \code{compData} object} 6 | \usage{ 7 | show_compData(object) 8 | } 9 | \arguments{ 10 | \item{object}{A \code{compData} object} 11 | } 12 | \description{ 13 | Show function for \code{compData} object. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/simulateData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{simulateData} 4 | \alias{simulateData} 5 | \title{Simulate the Data} 6 | \usage{ 7 | simulateData( 8 | n.vars, 9 | S1, 10 | prob.S1, 11 | sum.S1, 12 | truedispersions.S1, 13 | nfact_length.S1, 14 | S2, 15 | prob.S2, 16 | sum.S2, 17 | truedispersions.S2, 18 | nfact_length.S2, 19 | seq.depths, 20 | overdispersed 21 | ) 22 | } 23 | \arguments{ 24 | \item{n.vars}{The initial number of genes in the simulated data set. Based on the filtering conditions (\code{filter.threshold.total} and \code{filter.threshold.mediancpm}), the number of genes in the final data set may be lower than this number.} 25 | 26 | \item{S1}{Indices in condition 1.} 27 | 28 | \item{prob.S1}{Vector of means for condition 1.} 29 | 30 | \item{sum.S1}{Sum of means for condition 1.} 31 | 32 | \item{truedispersions.S1}{Vector of dispersions for condition 1.} 33 | 34 | \item{nfact_length.S1}{Matrix of length factors for condition 1.} 35 | 36 | \item{S2}{Indices in condition 2.} 37 | 38 | \item{prob.S2}{Vector of means for condition 2.} 39 | 40 | \item{sum.S2}{Sum of means for condition 2.} 41 | 42 | \item{truedispersions.S2}{Vector of dispersions for condition 2.} 43 | 44 | \item{nfact_length.S2}{Matrix of length factors for condition 2.} 45 | 46 | \item{overdispersed}{Indices that are overdispersed.} 47 | } 48 | \value{ 49 | Z a n.var times 2*samples.per.cond matrix with the simulated data. 50 | } 51 | \description{ 52 | Use the Poisson or Negative Binomial model to simulate the data. 53 | } 54 | \keyword{internal} 55 | -------------------------------------------------------------------------------- /man/simulateDataPhylo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{simulateDataPhylo} 4 | \alias{simulateDataPhylo} 5 | \title{Simulate the Data using the tree} 6 | \usage{ 7 | simulateDataPhylo( 8 | count_means, 9 | count_dispersions, 10 | tree, 11 | prop.var.tree, 12 | model.process = "BM", 13 | selection.strength = 0 14 | ) 15 | } 16 | \arguments{ 17 | \item{tree}{a dated phylogenetic tree of class \code{\link[ape]{phylo}} with `samples.per.cond * 2` species.} 18 | 19 | \item{prop.var.tree}{the proportion of the common variance explained by the tree for each gene. It can be a scalar, in which case the same parameter is used for all genes. Otherwise it needs to be a vector with length \code{n.vars}. Default to 1.} 20 | 21 | \item{model.process}{the process to be used for phylogenetic simulations. One of "BM" or "OU", default to "BM".} 22 | 23 | \item{selection.strength}{if the process is "OU", the selection strength parameter.} 24 | } 25 | \value{ 26 | Z a matrix with the data 27 | } 28 | \description{ 29 | Use the Phylogenetic Poisson Log Normal model to simulate the data. 30 | } 31 | \keyword{internal} 32 | -------------------------------------------------------------------------------- /man/simulatePhyloPoissonLogNormal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simulatePhyloPoissonLogNormal.R 3 | \name{simulatePhyloPoissonLogNormal} 4 | \alias{simulatePhyloPoissonLogNormal} 5 | \title{Simulate Tree Structured Counts} 6 | \usage{ 7 | simulatePhyloPoissonLogNormal( 8 | tree, 9 | log_means, 10 | log_variance_phylo, 11 | log_variance_sample, 12 | model.process = "BM", 13 | selection.strength = 0 14 | ) 15 | } 16 | \arguments{ 17 | \item{tree}{A phylogenetic tree with n tips.} 18 | 19 | \item{log_means}{a matrix with the number of genes p rows and the number of 20 | species n columns. Column names should match the tree taxa names.} 21 | 22 | \item{log_variance_phylo}{a vector of length p of phylogenetic variances for 23 | the BM in the log space for each gene.} 24 | 25 | \item{log_variance_sample}{a matrix of size p x n of environmental variances 26 | for individual variations in the log space, for each gene and species. 27 | Column names should match the tree taxa names.} 28 | } 29 | \value{ 30 | A list, with: 31 | \describe{ 32 | \item{log_lambda}{the p x n matrix of log-lambda simulated by the BM on the tree.} 33 | \item{counts}{the p x n matrix of counts with corresponding Poisson draws.} 34 | } 35 | } 36 | \description{ 37 | Simulate a tree structured matrix of counts according to a Poisson-lognormal 38 | model, with the log parameter of the poisson following a Brownian Motion (BM) 39 | on the tree with noise. 40 | } 41 | \details{ 42 | For each gene, the log-lambda parameter evolves like a BM on the tree, 43 | with an extra independent variance noise that can depend on the species. 44 | Each gene has its own tree variance for the BM. 45 | Each gene and each species has its own mean. 46 | The counts for each gene and each species are then obtained as a Poisson draw 47 | with a different lambda parameter, as generated by the BM. 48 | } 49 | \keyword{internal} 50 | -------------------------------------------------------------------------------- /man/sqrtcpm.limma.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{sqrtcpm.limma.createRmd} 4 | \alias{sqrtcpm.limma.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with limma after square root-transforming the counts per million (cpm)} 6 | \usage{ 7 | sqrtcpm.limma.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using limma, after preprocessing the counts by computing the counts per million (cpm) and applying a square-root transformation. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{edgeR} and \code{limma} packages and the corresponding publications. 26 | } 27 | \examples{ 28 | tmpdir <- normalizePath(tempdir(), winslash = "/") 29 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 30 | samples.per.cond = 5, n.diffexp = 100, 31 | output.file = file.path(tmpdir, "mydata.rds")) 32 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "sqrtcpm.limma", 33 | Rmdfunction = "sqrtcpm.limma.createRmd", 34 | output.directory = tmpdir, norm.method = "TMM") 35 | } 36 | \references{ 37 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 38 | 39 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 40 | 41 | Robinson MD and Oshlack A (2010): A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11:R25 42 | } 43 | \author{ 44 | Charlotte Soneson 45 | } 46 | -------------------------------------------------------------------------------- /man/summarizeSyntheticDataSet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateSyntheticData.R 3 | \name{summarizeSyntheticDataSet} 4 | \alias{summarizeSyntheticDataSet} 5 | \title{Summarize a synthetic data set by some diagnostic plots} 6 | \usage{ 7 | summarizeSyntheticDataSet(data.set, output.filename) 8 | } 9 | \arguments{ 10 | \item{data.set}{A data set, either a \code{\link{compData}} object or a path to an \code{.rds} file where such an object is stored.} 11 | 12 | \item{output.filename}{The filename of the resulting html report (including the path).} 13 | } 14 | \description{ 15 | Summarize a synthetic data set (generated by \code{\link{generateSyntheticData}}) by some diagnostic plots. 16 | } 17 | \examples{ 18 | tmpdir <- normalizePath(tempdir(), winslash = "/") 19 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 20 | samples.per.cond = 5, n.diffexp = 100, 21 | output.file = file.path(tmpdir, "mydata.rds")) 22 | if (interactive()) { 23 | summarizeSyntheticDataSet(data.set = file.path(tmpdir, "mydata.rds"), 24 | output.filename = file.path(tmpdir, "mydata_check.html")) 25 | } 26 | } 27 | \author{ 28 | Charlotte Soneson 29 | } 30 | -------------------------------------------------------------------------------- /man/ttest.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{ttest.createRmd} 4 | \alias{ttest.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with a t-test} 6 | \usage{ 7 | ttest.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) using a t-test, applied to the normalized counts. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{edgeR} package and the corresponding publications. 26 | } 27 | \examples{ 28 | try( 29 | if (require(genefilter)) { 30 | tmpdir <- normalizePath(tempdir(), winslash = "/") 31 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 32 | samples.per.cond = 5, n.diffexp = 100, 33 | output.file = file.path(tmpdir, "mydata.rds")) 34 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "ttest", 35 | Rmdfunction = "ttest.createRmd", 36 | output.directory = tmpdir, norm.method = "TMM") 37 | }) 38 | } 39 | \references{ 40 | Robinson MD, McCarthy DJ and Smyth GK (2010): edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26, 139-140 41 | 42 | Robinson MD and Oshlack A (2010): A scaling normalization method for differential expression analysis of RNA-seq data. Genome Biology 11:R25 43 | } 44 | \author{ 45 | Charlotte Soneson 46 | } 47 | -------------------------------------------------------------------------------- /man/voom.limma.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{voom.limma.createRmd} 4 | \alias{voom.limma.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with voom+limma} 6 | \usage{ 7 | voom.limma.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} of the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) by applying the voom transformation (from the limma package) followed by differential expression analysis with limma. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{limma} package and the corresponding publications. 26 | } 27 | \examples{ 28 | tmpdir <- normalizePath(tempdir(), winslash = "/") 29 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 30 | samples.per.cond = 5, n.diffexp = 100, 31 | output.file = file.path(tmpdir, "mydata.rds")) 32 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.limma", 33 | Rmdfunction = "voom.limma.createRmd", 34 | output.directory = tmpdir, norm.method = "TMM") 35 | } 36 | \references{ 37 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 38 | 39 | Law CW, Chen Y, Shi W and Smyth GK (2014): voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology 15, R29 40 | } 41 | \author{ 42 | Charlotte Soneson 43 | } 44 | -------------------------------------------------------------------------------- /man/voom.ttest.createRmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generateRmdCodeDiffExp.R 3 | \name{voom.ttest.createRmd} 4 | \alias{voom.ttest.createRmd} 5 | \title{Generate a \code{.Rmd} file containing code to perform differential expression analysis with voom+t-test} 6 | \usage{ 7 | voom.ttest.createRmd(data.path, result.path, codefile, norm.method) 8 | } 9 | \arguments{ 10 | \item{data.path}{The path to a .rds file containing the \code{compData} object that will be used for the differential expression analysis.} 11 | 12 | \item{result.path}{The path to the file where the result object will be saved.} 13 | 14 | \item{codefile}{The path to the file where the code will be written.} 15 | 16 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} function from the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}.} 17 | } 18 | \value{ 19 | The function generates a \code{.Rmd} file containing the code for performing the differential expression analysis. This file can be executed using e.g. the \code{knitr} package. 20 | } 21 | \description{ 22 | A function to generate code that can be run to perform differential expression analysis of RNAseq data (comparing two conditions) by applying the voom transformation (from the \code{limma} package) followed by differential expression analysis with a t-test. The code is written to a \code{.Rmd} file. This function is generally not called by the user, the main interface for performing differential expression analysis is the \code{\link{runDiffExp}} function. 23 | } 24 | \details{ 25 | For more information about the methods and the interpretation of the parameters, see the \code{limma} and \code{edgeR} packages and the corresponding publications. 26 | } 27 | \examples{ 28 | try( 29 | if (require(genefilter)) { 30 | tmpdir <- normalizePath(tempdir(), winslash = "/") 31 | mydata.obj <- generateSyntheticData(dataset = "mydata", n.vars = 1000, 32 | samples.per.cond = 5, n.diffexp = 100, 33 | output.file = file.path(tmpdir, "mydata.rds")) 34 | runDiffExp(data.file = file.path(tmpdir, "mydata.rds"), result.extent = "voom.ttest", 35 | Rmdfunction = "voom.ttest.createRmd", 36 | output.directory = tmpdir, norm.method = "TMM") 37 | }) 38 | } 39 | \references{ 40 | Smyth GK (2005): Limma: linear models for microarray data. In: 'Bioinformatics and Computational Biology Solutions using R and Bioconductor'. R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds), Springer, New York, pages 397-420 41 | 42 | Law CW, Chen Y, Shi W and Smyth GK (2014): voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology 15, R29 43 | } 44 | \author{ 45 | Charlotte Soneson 46 | } 47 | -------------------------------------------------------------------------------- /man/writeNormalization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/phylolmMethods.R 3 | \name{writeNormalization} 4 | \alias{writeNormalization} 5 | \title{Generate a \code{.Rmd} file containing code to normalize data.} 6 | \usage{ 7 | writeNormalization( 8 | norm.method, 9 | length.normalization, 10 | data.transformation, 11 | codefile 12 | ) 13 | } 14 | \arguments{ 15 | \item{norm.method}{The between-sample normalization method used to compensate for varying library sizes and composition in the differential expression analysis. The normalization factors are calculated using the \code{calcNormFactors} of the \code{edgeR} package. Possible values are \code{"TMM"}, \code{"RLE"}, \code{"upperquartile"} and \code{"none"}} 16 | 17 | \item{length.normalization}{one of "none" (no correction), "TPM", "RPKM" (default). See details.} 18 | 19 | \item{data.transformation}{one of "log2", "asin(sqrt)" or "sqrt." Data transformation to apply to the normalized data.} 20 | 21 | \item{codefile}{} 22 | } 23 | \description{ 24 | Generate a \code{.Rmd} file containing code to normalize data. 25 | } 26 | \details{ 27 | The \code{length.matrix} field of the \code{phyloCompData} 28 | object is used to normalize the counts. 29 | \describe{ 30 | \item{\code{none}:}{No length normalization.} 31 | \item{\code{TPM}:}{The raw counts are divided by the length of their associated genes before normalization by \code{voom}.} 32 | \item{\code{RPKM}:}{The log2 length is substracted to the log2 CPM computed by \code{voom} for each gene and sample.} 33 | } 34 | } 35 | \keyword{internal} 36 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | if (requireNamespace("testthat", quietly = TRUE)) { 2 | 3 | library(testthat) 4 | library(compcodeR) 5 | 6 | test_check("compcodeR") 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tests/testthat/testEffectiveSampleSize.R: -------------------------------------------------------------------------------- 1 | context("Effective Sample Size") 2 | 3 | test_that("Errors", { 4 | 5 | ############################################################################## 6 | ### Errors 7 | ntips <- 20 8 | id_cond_3 <- sample(0:2, ntips, replace = TRUE) 9 | expect_error(nEffPhylolm(NULL, id_cond_3, "BM", 0), "only two conditions") 10 | 11 | }) 12 | 13 | test_that("Naive vs phylolm", { 14 | skip_if_not_installed("phylolm") 15 | skip_if_not_installed("phytools") 16 | 17 | ## Tree 18 | set.seed(1289) 19 | ntips <- 20 20 | tree <- ape::rphylo(ntips, 0.1, 0) 21 | id_cond <- sample(c(0, 1), ntips, replace = TRUE) 22 | names(id_cond) <- tree$tip.label 23 | 24 | ## Replicates 25 | r <- 3 26 | tree_rep <- add_replicates(tree, r) 27 | id_cond_rep <- rep(id_cond, each = r) 28 | names(id_cond_rep) <- as.vector(sapply(names(id_cond), function(x) paste(x, 1:3, sep = "_"))) 29 | 30 | ############################################################################## 31 | ### BM 32 | 33 | expect_equal(nEffNaive(tree, id_cond, "BM", 0), 34 | nEffPhylolm(tree, id_cond, "BM", 0)) 35 | 36 | expect_equal(nEffNaive(tree, id_cond, "BM", 0), 37 | nEffSchur(tree, id_cond, "BM", 0)) 38 | 39 | # microbenchmark::microbenchmark(nEffNaive(tree, id_cond, "BM", 0), 40 | # nEffPhylolm(tree, id_cond, "BM", 0), 41 | # nEffSchur(tree, id_cond, "BM", 0)) 42 | # The three are equivalent. 43 | 44 | expect_equal(tree$edge.length, prune_tree_one_obs(tree_rep)$edge.length) 45 | 46 | expect_warning(expect_equal(nEffNaive(tree_rep, id_cond_rep, "BM", 0), 47 | nEffNaive(tree, id_cond, "BM", 0)), 48 | "not sorted in the correct order") 49 | 50 | ############################################################################## 51 | ### OU 52 | 53 | expect_equal(nEffNaive(tree, id_cond, "OU", 3), 54 | nEffPhylolm(tree, id_cond, "OU", 3)) 55 | 56 | expect_equal(nEffNaive(tree, id_cond, "OU", 3), 57 | nEffSchur(tree, id_cond, "OU", 3)) 58 | 59 | # microbenchmark::microbenchmark(nEffNaive(tree, id_cond, "OU", 3), 60 | # nEffPhylolm(tree, id_cond, "OU", 3), 61 | # nEffSchur(tree, id_cond, "OU", 3)) 62 | 63 | expect_equal(tree$edge.length, prune_tree_one_obs(tree_rep)$edge.length) 64 | 65 | expect_warning(expect_equal(nEffNaive(tree_rep, id_cond_rep, "OU", 3), 66 | nEffNaive(tree, id_cond, "OU", 3)), 67 | "not sorted in the correct order") 68 | 69 | }) 70 | 71 | test_that("nEff Ratio", { 72 | skip_if_not_installed("phylolm") 73 | 74 | ## Trees 75 | set.seed(1289) 76 | ntips <- 2^5 77 | tree <- ape::stree(ntips, "balanced") 78 | star_tree <- ape::stree(ntips, "star") 79 | tree <- ape::compute.brlen(tree) 80 | star_tree <- ape::compute.brlen(star_tree) 81 | 82 | ## Alt cond : nEff greater than 1 83 | id_cond <- rep(rep(0:1, each = 2), ntips / 4) 84 | names(id_cond) <- tree$tip.label 85 | expect_true(nEffRatio(tree, id_cond, "BM", 0) > 1.0) 86 | expect_equal(nEffRatio(star_tree, id_cond, "BM", 0), 1.0) 87 | expect_equal(nEffRatio(NULL, id_cond, "BM", 0), 1.0) 88 | 89 | ## Bloc cond : nEff smaller than 1 90 | id_cond <- rep(0:1, each = ntips / 2) 91 | names(id_cond) <- tree$tip.label 92 | expect_true(nEffRatio(tree, id_cond, "BM", 0) < 1.0) 93 | expect_equal(nEffRatio(star_tree, id_cond, "BM", 0), 1.0) 94 | expect_equal(nEffRatio(NULL, id_cond, "BM", 0), 1.0) 95 | 96 | }) 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /tests/testthat/test_length_factors.R: -------------------------------------------------------------------------------- 1 | context("Lengths and length factors") 2 | 3 | test_that("computeFactorLengths is equivalent to trueProba", { 4 | set.seed(20200430) 5 | 6 | n.sample <- 3 7 | n.vars <- 5 8 | 9 | ## Mock data 10 | count.matrix <- matrix(c(5,3,8,17,23,42,10,13,27,752,615,1203,1507,1225,2455), ncol = n.sample, byrow = T) 11 | truemeans <- rowMeans(count.matrix) 12 | leng <- matrix(c(rep(1000, 2 * n.vars - 1), 2000, 1:n.vars*1000), ncol = n.sample, byrow = F) 13 | 14 | ## True proba 15 | trueMeansLeng <- diag(truemeans) %*% leng 16 | trueProbas <- trueMeansLeng %*% diag(1 / colSums(trueMeansLeng)) 17 | 18 | ## nfact 19 | lfact <- computeFactorLengths(leng, truemeans, sum(truemeans)) 20 | 21 | ## Equal 22 | expect_equal(trueProbas, diag(truemeans / sum(truemeans)) %*% lfact) 23 | 24 | ## Sequencing depths 25 | seqdepth <- 2500 26 | nfacts <- runif(n.sample, min = 0.7, max = 1.4) 27 | seq.depths <- nfacts * seqdepth 28 | 29 | ## expectations 30 | exp_1 <- trueProbas %*% diag(seq.depths) 31 | expect_equal(colSums(exp_1), seq.depths) 32 | 33 | exp_2 <- diag(truemeans / sum(truemeans)) %*% lfact %*% diag(seq.depths) 34 | expect_equal(exp_1, exp_2) 35 | }) 36 | 37 | test_that("computeFactorLengths is equivalent to trueProba", { 38 | skip_if_not_installed("phytools") 39 | set.seed(20200430) 40 | 41 | ntaxa <- 10 42 | nrep <- 3 43 | n.sample <- ntaxa * nrep 44 | n.vars <- 50 45 | 46 | ## Mock tree 47 | set.seed("17900714") 48 | tree <- ape::rphylo(ntaxa, birth = 0.1, death = 0) 49 | # rescale to unit height 50 | tree$edge.length <- tree$edge.length / max(ape::node.depth.edgelength(tree)) 51 | # rename tims 52 | tree$tip.label <- paste0("t", 1:ntaxa) 53 | tree <- add_replicates(tree, nrep) 54 | 55 | id.species <- rep(1:ntaxa, each = nrep) 56 | names(id.species) <- tree$tip.label 57 | id.species <- as.factor(id.species) 58 | 59 | id.species <- checkSpecies(id.species, "id.species", tree, 1e-10, TRUE) 60 | 61 | ## Mock data 62 | count.matrix <- matrix(rpois(n.sample * n.vars, 1:10 * 10), ncol = n.sample, byrow = T) 63 | truemeans <- rowMeans(count.matrix) 64 | leng <- matrix(c(rep(1000, 2 * n.vars - 1), 2000, 1:n.vars*1000), ncol = n.sample, byrow = F) 65 | lengths.relmeans <- 1:n.vars * 1000 66 | lengths.dispersions <- 1:n.vars / 10 67 | leng <- generateLengths(id.species, lengths.relmeans, lengths.dispersions) 68 | 69 | expect_equal(leng[, 1], leng[, 2]) 70 | expect_equal(leng[, 4], leng[, 5]) 71 | 72 | ## True proba 73 | trueMeansLeng <- diag(truemeans) %*% leng 74 | trueProbas <- trueMeansLeng %*% diag(1 / colSums(trueMeansLeng)) 75 | 76 | ## nfact 77 | lfact <- computeFactorLengths(leng, truemeans, sum(truemeans)) 78 | 79 | ## Equal 80 | expect_equal(trueProbas, diag(truemeans / sum(truemeans)) %*% lfact) 81 | 82 | ## Sequencing depths 83 | seqdepth <- 2500 84 | nfacts <- runif(n.sample, min = 0.7, max = 1.4) 85 | seq.depths <- nfacts * seqdepth 86 | 87 | ## expectations 88 | exp_1 <- trueProbas %*% diag(seq.depths) 89 | expect_equal(colSums(exp_1), seq.depths) 90 | 91 | exp_2 <- diag(truemeans / sum(truemeans)) %*% lfact %*% diag(seq.depths) 92 | expect_equal(exp_1, exp_2) 93 | }) -------------------------------------------------------------------------------- /vignettes/compcodeR-concordance.tex: -------------------------------------------------------------------------------- 1 | \Sconcordance{concordance:compcodeR.tex:compcodeR.Rnw:% 2 | 1 14 1 49 0 35 1 1 0 1 2 15 1 5 0 4 1 10 0 5 1 6 % 3 | 0 18 1 11 0 5 1 27 0 11 1 6 0 38 1 5 0 18 1 4 0 % 4 | 16 1 8 0 77 1 5 0 166 1 21 0 3 1} 5 | -------------------------------------------------------------------------------- /vignettes/compcodeR.bib: -------------------------------------------------------------------------------- 1 | @ARTICLE{Soneson2013, 2 | title = "A comparison of methods for differential expression analysis of 3 | {RNA-seq} data", 4 | author = "Soneson, Charlotte and Delorenzi, Mauro", 5 | journal = "BMC Bioinformatics", 6 | volume = 14, 7 | pages = "91", 8 | year = 2013 9 | } 10 | 11 | @Article{Stern2017, 12 | author = {Stern, David B. and Breinholt, Jesse and Pedraza-Lara, Carlos and López-Mejía, Marilú and Owen, Christopher L. and Bracken-Grissom, Heather and Fetzner, James W. and Crandall, Keith A.}, 13 | journal = {Evolution}, 14 | title = {Phylogenetic evidence from freshwater crayfishes that cave adaptation is not an evolutionary dead-end}, 15 | year = {2017}, 16 | issn = {1558-5646}, 17 | number = {10}, 18 | pages = {2522--2532}, 19 | volume = {71}, 20 | doi = {10.1111/evo.13326} 21 | } 22 | 23 | 24 | @Article{Stern2018, 25 | author = {Stern, David B. and Crandall, Keith A.}, 26 | journal = {Molecular Biology and Evolution}, 27 | title = {The Evolution of Gene Expression Underlying Vision Loss in Cave Animals}, 28 | year = {2018}, 29 | number = {8}, 30 | pages = {2005--2014}, 31 | volume = {35}, 32 | doi = {10.1093/molbev/msy106} 33 | } 34 | 35 | @Article{Bastide2022, 36 | author = {Bastide, Paul and Soneson, Charlotte and Lespinet, Olivier and Gallopin, Mélina}, 37 | title = {Benchmark of Differential Gene Expression Analysis Methods for Inter-species RNA-Seq Data using a Phylogenetic Simulation Framework}, 38 | year = {2022}, 39 | journal = {bioRxiv preprint}, 40 | doi = {10.1101/2022.01.21.476612} 41 | } 42 | -------------------------------------------------------------------------------- /vignettes/compcodeR_check_figure/logfoldchanges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_check_figure/logfoldchanges.png -------------------------------------------------------------------------------- /vignettes/compcodeR_check_figure/maplot-nbroutliers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_check_figure/maplot-nbroutliers.png -------------------------------------------------------------------------------- /vignettes/compcodeR_check_figure/maplot-trueDEstatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_check_figure/maplot-trueDEstatus.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/auc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/auc.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/correlation-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/correlation-11.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/correlation-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/correlation-12.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/fdcall-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/fdcall-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/fdcone-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/fdcone-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/fdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/fdr.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/fdrvsexpr-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/fdrvsexpr-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/fracsign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/fracsign.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/maplot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/maplot-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/rocall-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/rocall-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/rocone-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/rocone-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/scorevsexpr-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/scorevsexpr-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/scorevsoutlier-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/scorevsoutlier-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/scorevssignal-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/scorevssignal-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/sorensen-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/sorensen-1.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/tpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/tpr.png -------------------------------------------------------------------------------- /vignettes/compcodeR_figure/typeIerror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_figure/typeIerror.png -------------------------------------------------------------------------------- /vignettes/compcodeR_parameters_2014-04-02-11-00-28.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/compcodeR_parameters_2014-04-02-11-00-28.rds -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/lengths-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/lengths-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/logfoldchanges-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/logfoldchanges-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/logfoldchanges-logTPM-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/logfoldchanges-logTPM-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/maplot-corHeatmap-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/maplot-corHeatmap-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/maplot-nbroutliers-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/maplot-nbroutliers-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/maplot-phyloHeatmap-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/maplot-phyloHeatmap-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/maplot-trueDEstatus-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/maplot-trueDEstatus-1.png -------------------------------------------------------------------------------- /vignettes/phylocompcodeR_check_figure/maplot-trueDEstatus-logTPM-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/phylocompcodeR_check_figure/maplot-trueDEstatus-logTPM-1.png -------------------------------------------------------------------------------- /vignettes/screenshot-gui-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/screenshot-gui-1.png -------------------------------------------------------------------------------- /vignettes/screenshot-gui-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csoneson/compcodeR/c96a99ce1c31acbfea6d5739a120f8fad4933a7d/vignettes/screenshot-gui-2.png --------------------------------------------------------------------------------