├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ ├── R-CMD-check.yaml │ └── pkgdown.yaml ├── .gitignore ├── .lintr ├── CRAN-SUBMISSION ├── DESCRIPTION ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── GUI.R ├── GUImini.R ├── RacViewer.R ├── Racmacs-package.R ├── RcppExports.R ├── acmacs_placeAbvs.R ├── map_blobs.R ├── map_diagnostics_bootstrap.R ├── map_diagnostics_bootstrap_blobs.R ├── map_diagnostics_dimtest.R ├── map_diagnostics_leverage.R ├── map_diagnostics_triangulation_blobs.R ├── map_edit_names.R ├── map_ggplot.R ├── map_info_long.R ├── map_legend.R ├── map_loadsave.R ├── map_merge.R ├── map_merge_report.R ├── map_methods.R ├── map_new.R ├── map_optimizations.R ├── map_optimize.R ├── map_optimize_reactivity.R ├── map_plot.R ├── map_plotspec.R ├── map_point_coords.R ├── map_point_matching.R ├── map_procrustes.R ├── map_props.R ├── map_props_diagnostics.R ├── map_props_optimizations.R ├── map_props_plotspec.R ├── map_props_points_antigens.R ├── map_props_points_sera.R ├── map_reactivity_adjusts.R ├── map_sequences.R ├── map_stress.R ├── map_subset.R ├── map_transformation.R ├── map_viewer.R ├── plot_diagnostics.R ├── rac_blobs.R ├── rac_normaliseNames.R ├── rac_process_titers.R ├── shiny_diagnostics.R ├── shiny_gadget.R ├── shiny_load.R ├── shiny_optimizations.R ├── shiny_optimize.R ├── shiny_relax.R ├── shiny_save.R ├── shiny_server.R ├── shiny_ui.R ├── shiny_utils.R ├── utils_blobs.R ├── utils_documentation.R ├── utils_geometry.R ├── utils_matrix_getters.R ├── utils_messages.R ├── utils_plotting.R ├── utils_progress.R ├── utils_r3js.R ├── utils_rotation.R ├── utils_tests.R └── utils_type_checking.R ├── README.md ├── Racmacs.Rproj ├── cran-comments.md ├── inst ├── WORDLIST ├── extdata │ ├── ferret_ag_dictionary.csv │ ├── h3map2004.ace │ ├── h3map2004_hitable.csv │ ├── h3map2004_sequences_ag.csv │ ├── h3map2004_sequences_sr.csv │ ├── h3map2004_subset.ace │ └── icons │ │ └── buttons │ │ ├── controls.svg │ │ ├── sequences.svg │ │ └── view-table.svg ├── htmlwidgets │ ├── .gitignore │ ├── RacViewer.js │ ├── RacViewer.yaml │ └── RacViewer │ │ ├── .gitignore │ │ └── lib │ │ ├── functions │ │ ├── agreactivity.js │ │ ├── agsr.js │ │ ├── animation.js │ │ ├── api.js │ │ ├── blobs.js │ │ ├── bootstrap.js │ │ ├── browser.js │ │ ├── buttons.js │ │ ├── connections.js │ │ ├── controls.js │ │ ├── data.js │ │ ├── diagnostics.js │ │ ├── dimensions.js │ │ ├── drag.js │ │ ├── elements.js │ │ ├── filters.js │ │ ├── graphics.js │ │ ├── grid.js │ │ ├── hemisphering.js │ │ ├── icons.js │ │ ├── legend.js │ │ ├── load.js │ │ ├── optimization.js │ │ ├── points.js │ │ ├── procrustes.js │ │ ├── projections.js │ │ ├── save.js │ │ ├── selections.js │ │ ├── sequences.js │ │ ├── shortcuts.js │ │ ├── stress.js │ │ ├── table.js │ │ └── utils.js │ │ ├── init.js │ │ ├── jscolor │ │ └── jscolor.min.js │ │ ├── optimization │ │ └── optimization.js │ │ ├── r3js │ │ └── lib │ │ │ ├── functions │ │ │ ├── api.js │ │ │ ├── buttons.js │ │ │ ├── camera.js │ │ │ ├── colors.js │ │ │ ├── dynamic.js │ │ │ ├── element.js │ │ │ ├── element_arrow.js │ │ │ ├── element_glarrow.js │ │ │ ├── element_gllines.js │ │ │ ├── element_glpoints.js │ │ │ ├── element_grid.js │ │ │ ├── element_light.js │ │ │ ├── element_lines.js │ │ │ ├── element_points.js │ │ │ ├── element_polygon.js │ │ │ ├── element_sphere.js │ │ │ ├── element_surface.js │ │ │ ├── element_text.js │ │ │ ├── element_triangles.js │ │ │ ├── events.js │ │ │ ├── highlight.js │ │ │ ├── icons.js │ │ │ ├── legend.js │ │ │ ├── load.js │ │ │ ├── navigation.js │ │ │ ├── plotting.js │ │ │ ├── raytrace.js │ │ │ ├── renderer.js │ │ │ ├── save_img.js │ │ │ ├── scene.js │ │ │ ├── selection.js │ │ │ ├── shaders.js │ │ │ ├── sprites.js │ │ │ ├── toggle.js │ │ │ ├── utils.js │ │ │ └── viewport.js │ │ │ ├── init.js │ │ │ ├── styles │ │ │ └── r3js.css │ │ │ └── threejs │ │ │ ├── LICENSE │ │ │ ├── fonts │ │ │ └── helvetiker_regular.typeface.js │ │ │ ├── lines │ │ │ ├── Line2.js │ │ │ ├── LineGeometry.js │ │ │ ├── LineMaterial.js │ │ │ ├── LineSegments2.js │ │ │ ├── LineSegmentsGeometry.js │ │ │ ├── Wireframe.js │ │ │ └── WireframeGeometry2.js │ │ │ ├── plugins │ │ │ ├── ColladaLoader.js │ │ │ ├── Detector.js │ │ │ ├── GLTFExporter.js │ │ │ ├── PLYExporter.js │ │ │ └── THREE.MeshLine.js │ │ │ ├── renderers │ │ │ ├── CSS2DRenderer.js │ │ │ ├── CSS2DRenderer_r3js.js │ │ │ ├── CSS2DRenderer_r3js_old.js │ │ │ ├── CSS3DRenderer.js │ │ │ ├── Projector.js │ │ │ └── SVGRenderer.js │ │ │ ├── three.min.js │ │ │ └── utils │ │ │ ├── BufferGeometryUtils.js │ │ │ └── SceneUtils.js │ │ ├── styles │ │ ├── blobs.css │ │ ├── browser.css │ │ ├── checkbox.css │ │ ├── controlpanel.css │ │ ├── diagnostics.css │ │ ├── drag.css │ │ ├── hitable.css │ │ ├── load.css │ │ ├── procrustes.css │ │ ├── projections.css │ │ └── racViewer.css │ │ └── textures │ │ └── sprites │ │ ├── ball.png │ │ ├── circle.png │ │ ├── circle2.png │ │ ├── disc.png │ │ ├── ring.png │ │ └── sprites.afdesign ├── shinyapps │ └── RacmacsGUI │ │ ├── app.R │ │ ├── tests │ │ ├── testdata │ │ │ └── testmap.ace │ │ ├── testthat.R │ │ └── testthat │ │ │ └── test-server.R │ │ └── www │ │ ├── acorg_logo.png │ │ ├── browser.css │ │ ├── filter.css │ │ ├── gui_title.png │ │ ├── racmacs.css │ │ └── racmacs.js └── templates │ └── diagnostics_page.Rmd ├── man ├── RacMerge.options.Rd ├── RacOptimizer.options.Rd ├── RacViewer-shiny.Rd ├── RacViewer.Rd ├── RacViewer.options.Rd ├── Racmacs-package.Rd ├── acmap.Rd ├── acmapAttributes.Rd ├── addOptimization.Rd ├── adjustedLogTiterTable.Rd ├── adjustedTiterTable.Rd ├── agAttributes.Rd ├── agGroups.Rd ├── agHomologousSr.Rd ├── agLabIDs.Rd ├── agReactivityAdjustments.Rd ├── agSequences.Rd ├── applyMapTransform.Rd ├── applyPlotspec.Rd ├── as.json.Rd ├── blob.Rd ├── blobsize.Rd ├── bootstrapBlobs.Rd ├── bootstrapMap.Rd ├── checkHemisphering.Rd ├── colBases.Rd ├── deprecated_functions.Rd ├── dilutionStepsize.Rd ├── dimensionTestMap.Rd ├── edit_agNames.Rd ├── edit_srNames.Rd ├── export_viewer.Rd ├── figures │ ├── lifecycle-archived.svg │ ├── lifecycle-defunct.svg │ ├── lifecycle-deprecated.svg │ ├── lifecycle-experimental.svg │ ├── lifecycle-maturing.svg │ ├── lifecycle-questioning.svg │ ├── lifecycle-stable.svg │ ├── lifecycle-superseded.svg │ └── logo.png ├── getOptimization.Rd ├── ggplot.acmap.Rd ├── htmlAdjustedTiterTable.Rd ├── htmlMergeReport.Rd ├── htmlTiterTable.Rd ├── keepBestOptimization.Rd ├── keepOptimizations.Rd ├── keepSingleOptimization.Rd ├── layerNames.Rd ├── listOptimizations.Rd ├── logtiterTable.Rd ├── logtiterTableLayers.Rd ├── make.acmap.Rd ├── map-table-distances.Rd ├── mapBootstrapCoords.Rd ├── mapCohesion.Rd ├── mapComment.Rd ├── mapDescription.Rd ├── mapDimensions.Rd ├── mapDistances.Rd ├── mapGadget.Rd ├── mapName.Rd ├── mapRelaxed.Rd ├── mapResiduals.Rd ├── mapStress.Rd ├── mapTransformation.Rd ├── matchStrains.Rd ├── mergeMaps.Rd ├── mergeReport.Rd ├── moveTrappedPoints.Rd ├── optimizationProperties.Rd ├── optimizeAgReactivity.Rd ├── optimizeMap.Rd ├── orderPoints.Rd ├── plot.acmap.Rd ├── pointStress.Rd ├── procrustesData.Rd ├── procrustesMap.Rd ├── ptAnnotations.Rd ├── ptBaseCoords.Rd ├── ptBootstrapBlob.Rd ├── ptBootstrapCoords.Rd ├── ptClades.Rd ├── ptCoords.Rd ├── ptDrawingOrder.Rd ├── ptLeverage.Rd ├── ptOpacity.Rd ├── ptStyles.Rd ├── ptTriangulationBlob.Rd ├── randomizeCoords.Rd ├── read.acmap.Rd ├── read.titerTable.Rd ├── realignMap.Rd ├── realignOptimizations.Rd ├── recalculateStress.Rd ├── reflectMap.Rd ├── relaxMap.Rd ├── relaxMapOneStep.Rd ├── removeOptimizations.Rd ├── removePoints.Rd ├── rotateMap.Rd ├── runGUI.Rd ├── save.acmap.Rd ├── save.coords.Rd ├── save.titerTable.Rd ├── setLegend.Rd ├── sortOptimizations.Rd ├── splitTiterLayers.Rd ├── srAttributes.Rd ├── srGroups.Rd ├── srHomologousAgs.Rd ├── srSequences.Rd ├── standardizeStrainNames.Rd ├── stressTable.Rd ├── subsetCommonPoints.Rd ├── subsetMap.Rd ├── tableColbases.Rd ├── tableDistances.Rd ├── titerTable.Rd ├── titerTableFlat.Rd ├── titerTableLayers.Rd ├── translateMap.Rd ├── triangulationBlobs.Rd ├── unstableMaps.Rd ├── update_ferret_seraNames.Rd ├── view.Rd ├── view.acmap.Rd └── view.default.Rd ├── pkgdown ├── _pkgdown.yml ├── extra.css └── favicon │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── src ├── .gitignore ├── Makevars ├── Makevars.win ├── Racmacs_types.h ├── Racmacs_wrappers.cpp ├── Racmacs_wrappers_antigens.cpp ├── Racmacs_wrappers_optimizations.cpp ├── Racmacs_wrappers_plotspec.cpp ├── Racmacs_wrappers_sera.cpp ├── RcppExports.cpp ├── ac_bootstrap.cpp ├── ac_bootstrap.h ├── ac_bootstrap_output.h ├── ac_coords_stress.h ├── ac_dimension_test.cpp ├── ac_dimension_test.h ├── ac_errorlines.cpp ├── ac_errorlines.h ├── ac_hemi_test.cpp ├── ac_hemi_test.h ├── ac_matching.cpp ├── ac_matching.h ├── ac_merge.cpp ├── ac_merge.h ├── ac_move_trapped_points.cpp ├── ac_optim_map_stress.cpp ├── ac_optim_map_stress.h ├── ac_optimization.cpp ├── ac_optimization.h ├── ac_optimize_ag_reactivity.cpp ├── ac_optimizer_options.h ├── ac_relax_coords.h ├── ac_stress.cpp ├── ac_stress.h ├── ac_stress_blobs.cpp ├── ac_stress_blobs.h ├── ac_titers.cpp ├── ac_titers.h ├── ac_utils.cpp ├── acmap_diagnostics.h ├── acmap_map.cpp ├── acmap_map.h ├── acmap_optimization.cpp ├── acmap_optimization.h ├── acmap_plotspec.h ├── acmap_point.cpp ├── acmap_point.h ├── acmap_sequences.h ├── acmap_titers.cpp ├── acmap_titers.h ├── json_assert.cpp ├── json_assert.h ├── json_read_to_acmap.cpp ├── json_read_to_acmap.h ├── json_write_from_acmap.cpp ├── json_write_from_acmap.h ├── procrustes.cpp ├── procrustes.h ├── utils.cpp ├── utils.h ├── utils_error.cpp ├── utils_error.h ├── utils_euc_dist.cpp ├── utils_geometry.cpp ├── utils_interpolation.cpp ├── utils_progress.h ├── utils_transformation.cpp └── utils_transformation.h ├── tests ├── testdata │ ├── test_mergemap1.ace │ ├── test_mergemap2.ace │ ├── test_mergemap3.ace │ ├── testmap.ace │ ├── testmap_h3subset.ace │ ├── testmap_h3subset3d.ace │ ├── testmap_h3subset3d_1000bootstraps.ace │ ├── testmap_h3subset_sequences.csv │ ├── testmap_h3subset_srsequences.csv │ ├── testmap_large.ace │ ├── testmap_merge.ace │ ├── testmap_small.ace │ └── titer_tables │ │ ├── titer_table1.RData │ │ ├── titer_table1.csv │ │ ├── titer_table1.xlsx │ │ ├── titer_table2.RData │ │ ├── titer_table2.txt │ │ ├── titer_table3.RData │ │ ├── titer_table3_asterisk.csv │ │ ├── titer_table4.RData │ │ ├── titer_table4_blank.csv │ │ └── titer_table5_underconstrained.csv ├── testthat.R └── testthat │ ├── .gitignore │ ├── test-ac_procrustes.R │ ├── test-colbases.R │ ├── test-diagnostic_plotting.R │ ├── test-diagnostics_bootstrap.R │ ├── test-diagnostics_dimTesting.R │ ├── test-diagnostics_stress.R │ ├── test-diagnostics_stressblobs.R │ ├── test-errors.R │ ├── test-gui.R │ ├── test-map_creation.R │ ├── test-map_editing.R │ ├── test-map_loading.R │ ├── test-map_merging.R │ ├── test-map_methods.R │ ├── test-map_optimization.R │ ├── test-map_optimizations.R │ ├── test-map_plotspec.R │ ├── test-map_procrustes.R │ ├── test-map_saving.R │ ├── test-map_sequences.R │ ├── test-map_strains.R │ ├── test-map_subset.R │ ├── test-map_transformation.R │ ├── test-map_viewer_settings.R │ ├── test-merging.R │ ├── test-methods.R │ ├── test-name_parser.R │ ├── test-plot_map.R │ ├── test-r3js.R │ ├── test-reading_HI_table.R │ ├── test-stability.R │ ├── test-underconstrained_positions.R │ ├── test-view_map.R │ └── test-view_procrustes.R └── vignettes ├── .gitignore ├── adding-sequences.Rmd ├── assessing_map_uncertainty.Rmd ├── comparing-maps.Rmd ├── customising-map-appearance.Rmd ├── figures ├── intro_fig1.png ├── intro_fig2.png ├── intro_fig3.png ├── intro_fig4.png ├── intro_fig5.png ├── intro_fig6.png ├── intro_fig7.png └── intro_h3n2map.png ├── intro-to-antigenic-cartography.Rmd ├── making-a-map-from-scratch.Rmd └── merging-maps.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^.*\.code-workspace$ 3 | ^\.Rproj\.user$ 4 | ^doc$ 5 | ^Meta$ 6 | ^_pkgdown\.yml$ 7 | ^src/.clang-format$ 8 | ^docs$ 9 | ^pkgdown$ 10 | ^LICENSE\.md$ 11 | ^index\.md$ 12 | ^.*\.vscode$ 13 | ^\.github$ 14 | ^\.lintr$ 15 | ^tests/testoutput$ 16 | ^builds$ 17 | ^CRAN-SUBMISSION$ 18 | ^cran-comments\.md$ 19 | ^vignettes/figures$ 20 | ^vignettes/intro-to-antigenic-cartography\.Rmd$ 21 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macos-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} 24 | - {os: ubuntu-latest, r: 'release'} 25 | - {os: ubuntu-latest, r: 'oldrel-1'} 26 | 27 | env: 28 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 29 | R_KEEP_PKG_SOURCE: yes 30 | 31 | steps: 32 | - uses: actions/checkout@v4 33 | 34 | - uses: r-lib/actions/setup-pandoc@v2 35 | 36 | - uses: r-lib/actions/setup-r@v2 37 | with: 38 | r-version: ${{ matrix.config.r }} 39 | http-user-agent: ${{ matrix.config.http-user-agent }} 40 | use-public-rspm: true 41 | 42 | - uses: r-lib/actions/setup-r-dependencies@v2 43 | with: 44 | extra-packages: any::rcmdcheck 45 | needs: check 46 | 47 | - uses: r-lib/actions/check-r-package@v2 48 | with: 49 | upload-snapshots: true 50 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | steps: 23 | - uses: actions/checkout@v4 24 | 25 | - uses: r-lib/actions/setup-pandoc@v2 26 | 27 | - uses: r-lib/actions/setup-r@v2 28 | with: 29 | use-public-rspm: true 30 | 31 | - uses: r-lib/actions/setup-r-dependencies@v2 32 | with: 33 | extra-packages: any::pkgdown, local::. 34 | needs: website 35 | 36 | - name: Build site 37 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 38 | shell: Rscript {0} 39 | 40 | - name: Deploy to GitHub pages 🚀 41 | if: github.event_name != 'pull_request' 42 | uses: JamesIves/github-pages-deploy-action@v4.5.0 43 | with: 44 | clean: false 45 | branch: gh-pages 46 | folder: docs 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Renviron 2 | .Rproj.user 3 | .Rhistory 4 | .RData 5 | .Rapp.history 6 | .DS_Store 7 | .clang-format 8 | *.sublime-project 9 | *.sublime-workspace 10 | *.o 11 | *.o.tmp 12 | *.code-workspace 13 | .vscode* 14 | doc 15 | inst/doc 16 | Meta 17 | tests/testoutput/* 18 | docs 19 | /doc/ 20 | /Meta/ 21 | -------------------------------------------------------------------------------- /.lintr: -------------------------------------------------------------------------------- 1 | linters: with_defaults( 2 | line_length_linter(120), 3 | object_name_linter = NULL 4 | ) 5 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 1.2.9 2 | Date: 2023-11-30 11:13:00 UTC 3 | SHA: c52195bcd9da3469170ba38e65de34840b0e34d1 4 | -------------------------------------------------------------------------------- /R/GUI.R: -------------------------------------------------------------------------------- 1 | 2 | #' Open the Racmacs GUI 3 | #' 4 | #' This function opens the Racmacs GUI in a new window 5 | #' 6 | #' @family shiny app functions 7 | #' @export 8 | #' @returns Nothing returned, called only for the side effect of starting the viewer. 9 | runGUI <- function() { 10 | shiny::runApp(system.file("shinyapps/RacmacsGUI", package = "Racmacs")) 11 | } 12 | -------------------------------------------------------------------------------- /R/GUImini.R: -------------------------------------------------------------------------------- 1 | 2 | mapGUI <- function( 3 | map, 4 | jsinit = NULL, 5 | serverfn = NULL, 6 | height = NULL, 7 | width = NULL, 8 | ...) { 9 | 10 | # Check RStudio is running 11 | if (!rstudioapi::isAvailable()) { 12 | stop("This code must be run from within RStudio.") 13 | } 14 | 15 | # Prepare UI elements 16 | ui_elements <- list() 17 | ui_elements[[1]] <- RacViewerOutput("racViewer", height = "100%") 18 | 19 | # If javascript provided, include it with extendShinyjs 20 | if (!is.null(jsinit)) { 21 | ui_elements[[2]] <- shinyjs::useShinyjs() 22 | ui_elements[[3]] <- shinyjs::extendShinyjs(text = jsinit) 23 | } 24 | 25 | # Generate UI 26 | ui <- do.call(shiny::fillPage, ui_elements) 27 | 28 | # Make server 29 | server <- function(input, output, session, ...) { 30 | 31 | # Render the map in the viewer 32 | output$racViewer <- renderRacViewer({ 33 | RacViewer(map) 34 | }) 35 | 36 | # Run any additional server functions provided 37 | if (!is.null(serverfn)) { 38 | serverfn(input, output, ...) 39 | } 40 | 41 | } 42 | 43 | # Decide where to open the viewer 44 | if (is.null(height) && is.null(width)) { 45 | viewer <- shiny::paneViewer() 46 | } else if (!is.null(height) && !is.null(width)) { 47 | viewer <- shiny::dialogViewer("Mini viewer", width, height) 48 | } else { 49 | stop("Either neither or both of 'height' and 'width' must be provided.") 50 | } 51 | 52 | # Open the viewer 53 | suppressMessages({ 54 | shiny::runGadget( 55 | app = ui, 56 | server = server, 57 | viewer = viewer 58 | ) 59 | }) 60 | 61 | } 62 | -------------------------------------------------------------------------------- /R/map_plotspec.R: -------------------------------------------------------------------------------- 1 | 2 | #' Apply a plotspec from another acmap 3 | #' 4 | #' Copy point style from matching antigens and sera in another acmap 5 | #' 6 | #' @param map The acmap object 7 | #' @param source_map An acmap object from which to copy point styles 8 | #' 9 | #' @returns Returns the acmap object with updated point styles (unmatched point 10 | #' styles unchanged) 11 | #' @export 12 | #' @family map point style functions 13 | #' 14 | applyPlotspec <- function( 15 | map, 16 | source_map 17 | ) { 18 | 19 | ag_match <- match_mapAntigens(map, source_map) 20 | sr_match <- match_mapSera(map, source_map) 21 | 22 | for (i in which(!is.na(ag_match))) { 23 | map$antigens[[i]]$plotspec <- source_map$antigens[[ag_match[i]]]$plotspec 24 | } 25 | for (i in which(!is.na(sr_match))) { 26 | map$sera[[i]]$plotspec <- source_map$sera[[sr_match[i]]]$plotspec 27 | } 28 | 29 | map 30 | 31 | } 32 | -------------------------------------------------------------------------------- /R/map_point_matching.R: -------------------------------------------------------------------------------- 1 | 2 | #' Find matching antigens or sera between 2 maps 3 | #' 4 | #' @param map1 The map to match names from. 5 | #' @param map2 The map to match names to. 6 | #' 7 | #' @returns Returns the indices of matching strains in map 2, or NA in the 8 | #' position of strains not found. 9 | #' 10 | #' @family functions to compare maps 11 | #' @name matchStrains 12 | NULL 13 | 14 | 15 | #' @rdname matchStrains 16 | #' @export 17 | match_mapAntigens <- function( 18 | map1, 19 | map2 20 | ) { 21 | 22 | # Convert indices 23 | indices <- ac_match_map_ags(map1, map2) 24 | indices[indices < 0] <- NA 25 | as.vector(indices + 1) 26 | 27 | } 28 | 29 | 30 | #' @rdname matchStrains 31 | #' @export 32 | match_mapSera <- function( 33 | map1, 34 | map2 35 | ) { 36 | 37 | # Convert indices 38 | indices <- ac_match_map_sr(map1, map2) 39 | indices[indices < 0] <- NA 40 | as.vector(indices + 1) 41 | 42 | } 43 | -------------------------------------------------------------------------------- /R/map_props_diagnostics.R: -------------------------------------------------------------------------------- 1 | 2 | agDiagnostics <- function( 3 | map, 4 | optimization_number = 1 5 | ) { 6 | 7 | out <- map$optimizations[[optimization_number]]$ag_diagnostics 8 | if (is.null(out)) out <- lapply(seq_len(numAntigens(map)), function(x) NULL) 9 | out 10 | 11 | } 12 | 13 | `agDiagnostics<-` <- function( 14 | map, 15 | optimization_number = 1, 16 | value 17 | ) { 18 | 19 | map$optimizations[[optimization_number]]$ag_diagnostics <- value 20 | map 21 | 22 | } 23 | 24 | srDiagnostics <- function( 25 | map, 26 | optimization_number = 1 27 | ) { 28 | 29 | out <- map$optimizations[[optimization_number]]$sr_diagnostics 30 | if (is.null(out)) out <- lapply(seq_len(numSera(map)), function(x) NULL) 31 | out 32 | 33 | } 34 | 35 | `srDiagnostics<-` <- function( 36 | map, 37 | optimization_number = 1, 38 | value 39 | ) { 40 | 41 | map$optimizations[[optimization_number]]$sr_diagnostics <- value 42 | map 43 | 44 | } 45 | 46 | ptDiagnostics <- function(map, optimization_number = 1) { 47 | c(agDiagnostics(map, optimization_number), srDiagnostics(map, optimization_number)) 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /R/map_sequences.R: -------------------------------------------------------------------------------- 1 | 2 | # Function for processing sequences and insertions 3 | get_pts_sequence_matrix <- function(points, missing_value) { 4 | 5 | rbind_list_to_matrix( 6 | lapply(points, function(pt) { 7 | 8 | seq_vector <- strsplit(pt$sequence, "")[[1]] 9 | seq_insertion_positions <- vapply(pt$sequence_insertions, function(x) x[[1]], numeric(1)) 10 | seq_insertions <- vapply(pt$sequence_insertions, function(x) x[[2]], character(1)) 11 | seq_vector[seq_insertion_positions] <- paste0( 12 | seq_vector[seq_insertion_positions], 13 | seq_insertions 14 | ) 15 | seq_vector 16 | 17 | }), 18 | missing_value 19 | ) 20 | 21 | } 22 | 23 | # Function for setting sequences and insertions 24 | set_pts_sequence_matrix <- function(points, seq_matrix) { 25 | 26 | # Update the points 27 | for (i in seq_along(points)) { 28 | 29 | # Get point sequence 30 | pt_sequence <- seq_matrix[i, ] 31 | 32 | # Find any insertions 33 | pt_insertion_positions <- which(nchar(pt_sequence) > 1) 34 | pt_insertions <- substr(pt_sequence[pt_insertion_positions], 2, nchar(pt_sequence[pt_insertion_positions])) 35 | 36 | # Remove insertions from main sequence 37 | pt_sequence[pt_insertion_positions] <- substr(pt_sequence[pt_insertion_positions], 1, 1) 38 | 39 | # Save data 40 | points[[i]]$sequence <- paste0(pt_sequence, collapse = "") 41 | points[[i]]$sequence_insertions <- lapply( 42 | seq_along(pt_insertion_positions), function(i) { 43 | list( 44 | pt_insertion_positions[i], 45 | pt_insertions[i] 46 | ) 47 | } 48 | ) 49 | 50 | } 51 | 52 | # Return the updated points 53 | points 54 | 55 | } 56 | 57 | -------------------------------------------------------------------------------- /R/rac_blobs.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /R/shiny_gadget.R: -------------------------------------------------------------------------------- 1 | 2 | #' Open a shiny gadget to view the map 3 | #' 4 | #' This function is equivalent to running `runGUI()` and loading a map file, but this 5 | #' takes the acmap object to open as an input argument. 6 | #' 7 | #' @param map The acmap object to open in the GUI 8 | #' 9 | #' @returns No value returned, called for the side effect of starting the gadget. 10 | #' 11 | #' @family functions to view maps 12 | #' @export 13 | #' 14 | mapGadget <- function(map) { 15 | 16 | check.acmap(map) 17 | ui <- mapGUI_ui() 18 | server <- mapGUI_server(map) 19 | shiny::runGadget(ui, server) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /R/shiny_optimize.R: -------------------------------------------------------------------------------- 1 | 2 | # Running optimizations 3 | server_runOptimizations <- function(env) { 4 | 5 | shiny::showNotification( 6 | ui = "Optimizing map...", 7 | duration = NULL, 8 | closeButton = FALSE, 9 | id = "optimizing", 10 | type = "message", 11 | session = env$session 12 | ) 13 | 14 | # Optimise the map 15 | env$storage$map <- optimizeMap( 16 | map = env$storage$map, 17 | number_of_dimensions = as.numeric(env$input$runOptimizations$numdims), 18 | number_of_optimizations = as.numeric(env$input$runOptimizations$numruns), 19 | minimum_column_basis = env$input$runOptimizations$mincolbasis, 20 | # discard_previous_optimizations = FALSE, 21 | sort_optimizations = TRUE 22 | ) 23 | 24 | shiny::showNotification( 25 | ui = "Optimizing map... complete.", 26 | duration = 1, 27 | closeButton = FALSE, 28 | id = "optimizing", 29 | type = "message", 30 | session = env$session 31 | ) 32 | 33 | # Reload the map 34 | env$session$sendCustomMessage("loadMapData", as.json(env$storage$map)) 35 | 36 | } 37 | -------------------------------------------------------------------------------- /R/shiny_ui.R: -------------------------------------------------------------------------------- 1 | 2 | mapGUI_ui <- function() { 3 | 4 | shiny::fillPage( 5 | bootstrap = TRUE, 6 | shiny::includeScript(system.file("shinyapps/RacmacsGUI/www/racmacs.js", package = "Racmacs")), 7 | RacViewerOutput("racViewer"), 8 | shiny::div( 9 | shiny::fileInput(inputId = "mapDataLoaded", label = "mapDataLoaded", accept = ".ace"), 10 | shiny::fileInput(inputId = "tableDataLoaded", label = "tableDataLoaded", accept = ".csv,.txt"), 11 | shiny::fileInput(inputId = "procrustesDataLoaded", label = "procrustesDataLoaded", accept = ".ace"), 12 | shiny::fileInput(inputId = "pointStyleDataLoaded", label = "pointStyleDataLoaded", accept = ".ace"), 13 | shinyFiles::shinySaveButton(id = "mapDataSaved", label = "", title = "", filename = "acmap", list(ace = ".ace")), 14 | shinyFiles::shinySaveButton(id = "tableDataSaved", label = "", title = "", filename = "table", list(csv = ".csv")), 15 | shinyFiles::shinySaveButton(id = "coordsDataSaved", label = "", title = "", filename = "coords", list(csv = ".csv")), 16 | style = "display: none;" 17 | ) 18 | ) 19 | 20 | } 21 | -------------------------------------------------------------------------------- /R/shiny_utils.R: -------------------------------------------------------------------------------- 1 | 2 | # Utility functions for the GUI 3 | # Convert a list of lists to a matrix 4 | list2matrix <- function(x) { 5 | do.call(rbind, lapply(x, unlist)) 6 | } 7 | 8 | 9 | # Convert data to json format 10 | data2json <- function(x) { 11 | jsonlite::toJSON(x) 12 | } 13 | 14 | 15 | # Convert point selections into TRUE, FALSE or base 1 indices 16 | convertSelectedPoints <- function(selections, map) { 17 | 18 | antigens <- unique(unlist(selections$antigens) + 1) 19 | sera <- unique(unlist(selections$sera) + 1) 20 | 21 | if (length(antigens) == 0 && length(sera) == 0) { 22 | antigens <- seq_len(numAntigens(map)) 23 | sera <- seq_len(numSera(map)) 24 | } 25 | 26 | list( 27 | antigens = antigens, 28 | sera = sera 29 | ) 30 | 31 | } 32 | 33 | # Require that a map is relaxed, otherwise stop execution of reactive function 34 | reqRelaxed <- function(map, optimization_num, session) { 35 | 36 | relaxed <- mapRelaxed(map, optimization_num) 37 | if (!relaxed) { 38 | shiny::showNotification( 39 | "The map is not fully relaxed", 40 | closeButton = FALSE, 41 | duration = 1, 42 | type = "error", 43 | session = session 44 | ) 45 | shiny::req(relaxed) 46 | } 47 | 48 | } 49 | 50 | # Require that a map has optimizations, otherwise stop execution of a reactive function 51 | reqOptimizations <- function( 52 | map, 53 | session 54 | ) { 55 | 56 | has_optimizations <- numOptimizations(map) > 0 57 | if (!has_optimizations) { 58 | shiny::showNotification( 59 | "The map has no optimizations", 60 | closeButton = FALSE, 61 | duration = 1, 62 | type = "error", 63 | session = session 64 | ) 65 | shiny::req(has_optimizations) 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /R/utils_geometry.R: -------------------------------------------------------------------------------- 1 | 2 | separate_meshes <- function(mesh) { 3 | 4 | graph <- igraph::graph_from_edgelist( 5 | rbind(mesh$faces[,1:2], mesh$faces[,2:3]) + 1, 6 | directed = F 7 | ) 8 | components <- igraph::components(graph, mode = "strong") 9 | face_membership <- components$membership[mesh$faces[,1]] 10 | lapply(unique(components$membership), function(i) { 11 | list( 12 | vertices = mesh$vertices, 13 | faces = mesh$faces[face_membership == i, , drop = F], 14 | normals = mesh$normals 15 | ) 16 | }) 17 | 18 | } 19 | -------------------------------------------------------------------------------- /R/utils_messages.R: -------------------------------------------------------------------------------- 1 | 2 | ## Some utility functions for outputting errors, warnings and messages 3 | 4 | # Remove new lines from a multiline string 5 | singleline <- function(x) { 6 | x <- gsub("\n", "", x) 7 | x <- gsub(" +", " ", x) 8 | x 9 | } 10 | 11 | # Output an error that refers to a list of strains 12 | strain_list_error <- function(error, strains) { 13 | 14 | stop( 15 | paste0( 16 | error, "\n\n'", 17 | paste(strains, collapse = "'\n'"), 18 | "'\n" 19 | ), 20 | call. = FALSE 21 | ) 22 | 23 | } 24 | 25 | # Output a warning that refers to a list of strains 26 | strain_list_warning <- function(warning, strains) { 27 | 28 | warning( 29 | paste0( 30 | warning, "\n\n'", 31 | paste(strains, collapse = "'\n'"), 32 | "'\n" 33 | ), 34 | call. = FALSE 35 | ) 36 | 37 | } 38 | 39 | # Small function to output a message or not depending on a 'verbose' argument 40 | vmessage <- function(verbose, ...) { 41 | if (verbose) message(...) 42 | } 43 | 44 | 45 | #' Deprecated functions 46 | #' 47 | #' These functions still work but have been deprecated in favour of another function. Arguments will be passed onto the new function with a warning. 48 | #' 49 | #' @param ... Arguments to pass to the new function 50 | #' 51 | #' @returns Values from the new function 52 | #' 53 | #' @name deprecated_functions 54 | #' 55 | NULL 56 | 57 | # Indicate a function is deprecated 58 | deprecated_fn <- function(fn) { 59 | fn_name <- as.character(match.call())[2] 60 | function(...) { 61 | warning(sprintf("This function has been deprecated in favor of %s()", fn_name)) 62 | fn(...) 63 | } 64 | } 65 | 66 | #' @rdname deprecated_functions 67 | #' @export 68 | stressBlobs <- deprecated_fn(triangulationBlobs) 69 | -------------------------------------------------------------------------------- /R/utils_progress.R: -------------------------------------------------------------------------------- 1 | 2 | ## Utility functions to show progress 3 | 4 | # Create a progress bar 5 | ac_progress_bar <- function( 6 | size, 7 | width = getOption("width") 8 | ) { 9 | 10 | message(rep("-", width), appendLF = FALSE) 11 | list( 12 | size = size, 13 | width = width 14 | ) 15 | 16 | } 17 | 18 | # Update a progress bar created with ac_progress_bar() 19 | ac_update_progress <- function( 20 | progressbar, 21 | progress 22 | ) { 23 | 24 | progress_width <- round((progress / progressbar$size) * progressbar$width) 25 | message("\r", appendLF = FALSE) 26 | message( 27 | rep("=", progress_width), 28 | appendLF = progress == progressbar$size 29 | ) 30 | 31 | } 32 | -------------------------------------------------------------------------------- /R/utils_r3js.R: -------------------------------------------------------------------------------- 1 | 2 | # A function to add a map grid to a map plot, one that exists in the scene and 3 | # rotates along with it, used when viewing a 3d map with a rotating grid 4 | addMapGrid <- function(map, grid.col) { 5 | 6 | # Simply return the map unchanged unless it has 3 dimensions 7 | if (mapDimensions(map) != 3) return(map) 8 | 9 | # Fetch the map lims 10 | lims <- mapLims(map) 11 | 12 | # Function to calculate where the tick marks should be 13 | calc_axis_ticks <- function(x) { 14 | m <- mean(x) 15 | d <- ceiling(diff(x)) + 2 16 | (m - d / 2):(m + d / 2) 17 | } 18 | 19 | axis_ticks <- list( 20 | x = calc_axis_ticks(lims$xlim), 21 | y = calc_axis_ticks(lims$ylim), 22 | z = calc_axis_ticks(lims$zlim) 23 | ) 24 | map$lims <- lapply(axis_ticks, range) 25 | 26 | # Add the grid 27 | r3js::grid3js( 28 | map, 29 | at = axis_ticks, 30 | lwd = 1, 31 | col = grid.col 32 | ) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /R/utils_tests.R: -------------------------------------------------------------------------------- 1 | 2 | # Function to export a plot to the testoutput folder 3 | export.plot.test <- function(code, filename, plotwidth = 8, plotheight = 8) { 4 | 5 | testthat::expect_true(1 == 1) 6 | 7 | } 8 | 9 | 10 | # Function to export a plotly widget to a test page 11 | export.plotly.test <- function(widget, filename) { 12 | 13 | testthat::expect_true(inherits(widget, "plotly")) 14 | 15 | } 16 | 17 | 18 | # Function to export a viewer widget instance as a plot to the testoutput folder 19 | # it also replaces library paths in each file to match library paths in the 20 | # package to help with debugging 21 | export.viewer.test <- function(widget, filename, widgetname = "RacViewer") { 22 | 23 | # Expect widget created successfully 24 | testthat::expect_true(inherits(widget, "htmlwidget")) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Racmacs.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## R CMD check results 2 | 3 | 0 errors | 0 warnings | 1 note 4 | 5 | Resubmission to fix failing CRAN checks: 6 | 7 | - One test is skipped if pandoc is not available on the test system 8 | - Vignettes only evaluate code if pandoc is available 9 | - Some changes made to try and address the warning "format string is not a 10 | string literal (potentially insecure) [-Wformat-security]", although note 11 | that Rcpp also currently throws this warning on 12 | r-devel-linux-x86_64-fedora-clang and r-devel-linux-x86_64-debian-clang 13 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | Armijo 2 | BN 3 | CMD 4 | Color 5 | Coudert 6 | Frankensteining 7 | HAUs 8 | HK 9 | MDS 10 | OpenMP 11 | RBCs 12 | Rac 13 | RacOptimizer 14 | RacViewer 15 | Relatedly 16 | Rmd 17 | Sera 18 | Titer 19 | acmacs 20 | acmap 21 | acmaps 22 | ag 23 | alt 24 | antigenically 25 | bayesian 26 | bootstrapBlobs 27 | brotli 28 | color 29 | colored 30 | coloring 31 | colors 32 | conf 33 | coords 34 | csv 35 | devtools 36 | dilutionStepsize 37 | dirichilet 38 | div 39 | doi 40 | ensmallen 41 | etc 42 | fortran 43 | frac 44 | gcc 45 | ggplot 46 | github 47 | hemisphering 48 | htmlAdjustedTiterTable 49 | htmlwidget 50 | int 51 | intel 52 | javascript 53 | js 54 | jsCode 55 | json 56 | kde 57 | kernal 58 | ks 59 | labeled 60 | labeling 61 | lessthan 62 | linewidth 63 | linux 64 | lispmds 65 | listmds 66 | logtiter 67 | nd 68 | nondetectable 69 | nows 70 | num 71 | optimizeAgReactivity 72 | org 73 | os 74 | parameterised 75 | plotspec 76 | procrusted 77 | procrustes 78 | racmap 79 | racviewer 80 | rapidjson 81 | reactivities 82 | reoptimization 83 | reoptimizations 84 | reoptimize 85 | reoptimized 86 | reoptimizing 87 | rmsd 88 | rmse 89 | sd 90 | sera 91 | sr 92 | standalone 93 | threejs 94 | tibble 95 | titer 96 | titerTable 97 | titers 98 | triangulationBlobs 99 | var 100 | webgl 101 | xlim 102 | xls 103 | xz 104 | ylim 105 | -------------------------------------------------------------------------------- /inst/extdata/h3map2004.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/inst/extdata/h3map2004.ace -------------------------------------------------------------------------------- /inst/extdata/h3map2004_subset.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/inst/extdata/h3map2004_subset.ace -------------------------------------------------------------------------------- /inst/extdata/icons/buttons/controls.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /inst/extdata/icons/buttons/view-table.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /inst/htmlwidgets/.gitignore: -------------------------------------------------------------------------------- 1 | rac_viewer.html 2 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer.js: -------------------------------------------------------------------------------- 1 | 2 | HTMLWidgets.widget({ 3 | 4 | name: 'RacViewer', 5 | 6 | type: 'output', 7 | 8 | factory: function(el, width, height) { 9 | 10 | // Create an empty viewer object 11 | var viewer = new Racmacs.Viewer(el); 12 | 13 | return { 14 | 15 | renderValue: function(x) { 16 | 17 | // Code to render the widget 18 | var mapdata = JSON.parse(x.mapData); 19 | viewer.load( 20 | mapdata, 21 | x.options, 22 | x.plotdata, 23 | x.light 24 | ); 25 | 26 | }, 27 | 28 | // A resize function 29 | resize: function(width, height) { 30 | viewer.viewport.onwindowresize(); 31 | }, 32 | 33 | // A method to expose our viewer to the outside 34 | getViewer: function(){ 35 | return viewer; 36 | }, 37 | 38 | rac: el 39 | 40 | }; 41 | } 42 | }); 43 | 44 | 45 | function getRacViewer(id){ 46 | 47 | // Get the HTMLWidgets object 48 | var htmlWidgetsObj = HTMLWidgets.find("#" + id); 49 | 50 | // Get the underlying viewer 51 | var racViewer = htmlWidgetsObj.getViewer(); 52 | 53 | return(racViewer); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/.gitignore: -------------------------------------------------------------------------------- 1 | tests 2 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/functions/agreactivity.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/inst/htmlwidgets/RacViewer/lib/functions/agreactivity.js -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/functions/save.js: -------------------------------------------------------------------------------- 1 | 2 | Racmacs.SavePanel = class SavePanel { 3 | 4 | constructor(viewer){ 5 | 6 | // Link to viewer 7 | this.viewer = viewer; 8 | viewer.savepanel = this; 9 | 10 | this.div = document.createElement("div"); 11 | this.div.classList.add("load-tab"); 12 | this.div.classList.add("shiny-element"); 13 | 14 | // Add save map button 15 | var savemap = new Racmacs.utils.Button({ 16 | label: "Save map", 17 | fn: function(){ viewer.onSaveMap() } 18 | }); 19 | this.div.appendChild(savemap.div); 20 | 21 | // Add save table button 22 | var savetable = new Racmacs.utils.Button({ 23 | label: "Save table", 24 | fn: function(){ viewer.onSaveTable() } 25 | }); 26 | this.div.appendChild(savetable.div); 27 | 28 | // Add save coords button 29 | var savecoords = new Racmacs.utils.Button({ 30 | label: "Save coords", 31 | fn: function(){ viewer.onSaveCoords() } 32 | }); 33 | this.div.appendChild(savecoords.div); 34 | 35 | } 36 | 37 | } 38 | 39 | 40 | Racmacs.App.prototype.saveMap = function(){ 41 | 42 | var data = this.data.outputAce(); 43 | var filename = this.data.tableName(); 44 | if(filename === "") filename = "map" 45 | filename += ".ace"; 46 | var blob = new Blob([data], {type: 'text/ace'}); 47 | 48 | if(window.navigator.msSaveOrOpenBlob) { 49 | window.navigator.msSaveBlob(blob, filename); 50 | } 51 | else{ 52 | var elem = window.document.createElement('a'); 53 | elem.href = window.URL.createObjectURL(blob); 54 | elem.download = filename; 55 | document.body.appendChild(elem); 56 | elem.click(); 57 | document.body.removeChild(elem); 58 | } 59 | 60 | } 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/functions/shortcuts.js: -------------------------------------------------------------------------------- 1 | 2 | // function bind_shortcuts(viewport){ 3 | 4 | // // Set the exit all function 5 | // viewport.exit_all = function(){ 6 | 7 | // this.deselect_all(); 8 | // this.end_dragMode(); 9 | // this.hide_connectionLines(); 10 | // this.hide_errorLines(); 11 | // this.removeBlobs(); 12 | 13 | // } 14 | 15 | // // Add key event listeners 16 | // window.addEventListener('keypress', function(event){ 17 | 18 | // // End any rectangular selection 19 | // viewport.end_rect_select(viewport); 20 | 21 | // // If escape then deselect everything 22 | // if(event.key == "Escape"){ 23 | // viewport.exit_all(); 24 | // } 25 | 26 | // // Select all points 27 | // if(event.key == "a" && event.metaKey){ 28 | // event.preventDefault(); 29 | // viewport.select_all(); 30 | // } 31 | 32 | // // Deselect all points 33 | // if(event.key == "d" && event.metaKey){ 34 | // event.preventDefault(); 35 | // viewport.deselect_all(); 36 | // } 37 | 38 | // }); 39 | 40 | // } 41 | 42 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/r3js/lib/functions/api.js: -------------------------------------------------------------------------------- 1 | 2 | R3JS.Viewer.prototype.rotateSceneEuclidean = function(rotation){ 3 | 4 | this.scene.rotateEuclidean(rotation); 5 | // this.scene.showhideDynamics( viewport.camera ); 6 | this.render(); 7 | } 8 | 9 | R3JS.Viewer.prototype.setBackground = function(color){ 10 | 11 | this.scene.scene.background = new THREE.Color(color); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/r3js/lib/functions/element_light.js: -------------------------------------------------------------------------------- 1 | 2 | // Make a light source 3 | R3JS.element.Light = class Light extends R3JS.element.base { 4 | 5 | constructor(args = {}){ 6 | 7 | super(); 8 | 9 | // Set defaults 10 | if(!args.intensity) args.intensity = 1.0; 11 | if(!args.color) { 12 | args.color = 0xe0e0e0; 13 | } else { 14 | args.color = new THREE.Color(args.color.r[0], args.color.g[0], args.color.b[0]); 15 | } 16 | 17 | if(args.lighttype == "directional"){ 18 | var object = new THREE.DirectionalLight(args.color); 19 | object.position.set( 20 | args.position[0], 21 | args.position[1], 22 | args.position[2] 23 | ).normalize(); 24 | } else if(args.lighttype == "point") { 25 | var object = new THREE.PointLight(args.color); 26 | object.position.set( 27 | args.position[0], 28 | args.position[1], 29 | args.position[2] 30 | ); 31 | } else { 32 | var object = new THREE.AmbientLight(args.color); 33 | } 34 | 35 | // Set light intensity 36 | object.intensity = args.intensity; 37 | 38 | this.object = object; 39 | object.element = this; 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/r3js/lib/functions/element_sphere.js: -------------------------------------------------------------------------------- 1 | 2 | // Sphere constructor 3 | R3JS.element.constructors.sphere = function( 4 | plotobj, 5 | plotdims 6 | ){ 7 | 8 | // Make the object 9 | var element = new R3JS.element.sphere({ 10 | radius : plotobj.radius, 11 | coords : plotobj.position, 12 | properties : plotobj.properties 13 | }); 14 | 15 | // Return the object 16 | return(element); 17 | 18 | } 19 | 20 | 21 | // Sphere object 22 | R3JS.element.sphere = class Sphere extends R3JS.element.base { 23 | 24 | // Object constructor 25 | constructor(args){ 26 | 27 | super(); 28 | 29 | // Check arguments 30 | if(typeof(args.radius) === "undefined") { 31 | throw("Radius must be specified"); 32 | } 33 | 34 | // Set default properties 35 | if(!args.properties){ 36 | args.properties = { 37 | mat : "phong", 38 | color : [0,1,0] 39 | }; 40 | } 41 | 42 | // Make geometry 43 | var geometry = new THREE.SphereBufferGeometry(args.radius, 32, 32); 44 | 45 | // Set material 46 | var material = R3JS.Material(args.properties); 47 | 48 | // Make object 49 | this.object = new THREE.Mesh(geometry, material); 50 | this.object.element = this; 51 | 52 | // Set position 53 | this.object.position.set( 54 | args.coords[0], 55 | args.coords[1], 56 | args.coords[2] 57 | ); 58 | 59 | } 60 | 61 | } 62 | 63 | -------------------------------------------------------------------------------- /inst/htmlwidgets/RacViewer/lib/r3js/lib/functions/highlight.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | R3JS.Viewer.prototype.clickBackground = function(elements){ 4 | 5 | } 6 | 7 | R3JS.Viewer.prototype.clickElements = function(elements, event){ 8 | 9 | for(var i=0; i") 23 | cat("Run 1 to run 2
") 24 | view(procrustesMap(map, map, comparison_optimization_number = 2)) 25 | cat("") 26 | cat("
") 27 | cat("Run 1 to run 3
") 28 | view(procrustesMap(map, map, comparison_optimization_number = 3)) 29 | cat("
") 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /man/RacViewer-shiny.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RacViewer.R 3 | \name{RacViewer-shiny} 4 | \alias{RacViewer-shiny} 5 | \alias{RacViewerOutput} 6 | \alias{renderRacViewer} 7 | \title{Shiny bindings for RacViewer} 8 | \usage{ 9 | RacViewerOutput(outputId, width = "100\%", height = "100\%") 10 | 11 | renderRacViewer(expr, env = parent.frame(), quoted = FALSE) 12 | } 13 | \arguments{ 14 | \item{outputId}{output variable to read from} 15 | 16 | \item{width, height}{Must be a valid CSS unit (like \code{'100\%'}, 17 | \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a 18 | string and have \code{'px'} appended.} 19 | 20 | \item{expr}{An expression that generates a RacViewer} 21 | 22 | \item{env}{The environment in which to evaluate \code{expr}.} 23 | 24 | \item{quoted}{Is \code{expr} a quoted expression (with \code{quote()})? This 25 | is useful if you want to save an expression in a variable.} 26 | } 27 | \value{ 28 | An output or render function that enables the use of the widget 29 | within Shiny applications. 30 | } 31 | \description{ 32 | Output and render functions for using RacViewer within Shiny 33 | applications and interactive Rmd documents. 34 | } 35 | \seealso{ 36 | Other shiny app functions: 37 | \code{\link{runGUI}()}, 38 | \code{\link{view.acmap}()} 39 | } 40 | \concept{shiny app functions} 41 | -------------------------------------------------------------------------------- /man/RacViewer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RacViewer.R 3 | \name{RacViewer} 4 | \alias{RacViewer} 5 | \title{Create a RacViewer widget} 6 | \usage{ 7 | RacViewer( 8 | map, 9 | show_procrustes = FALSE, 10 | show_group_legend = FALSE, 11 | options = list(), 12 | width = NULL, 13 | height = NULL, 14 | elementId = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{map}{The map data object} 19 | 20 | \item{show_procrustes}{should procrustes lines be shown} 21 | 22 | \item{show_group_legend}{Show an interactive legend detailing different 23 | groups as set by \code{agGroups()} and \code{srGroups()}} 24 | 25 | \item{options}{A named list of viewer options supplied to 26 | \code{racviewer.options()}} 27 | 28 | \item{width}{Width of the widget} 29 | 30 | \item{height}{Height of the widget} 31 | 32 | \item{elementId}{DOM element ID} 33 | } 34 | \value{ 35 | An object of class htmlwidget that will intelligently print itself 36 | into HTML in a variety of contexts including the R console, within R 37 | Markdown documents, and within Shiny output bindings. 38 | } 39 | \description{ 40 | This creates an html widget for viewing antigenic maps. 41 | } 42 | \seealso{ 43 | Other functions to view maps: 44 | \code{\link{RacViewer.options}()}, 45 | \code{\link{export_viewer}()}, 46 | \code{\link{ggplot.acmap}()}, 47 | \code{\link{mapGadget}()}, 48 | \code{\link{plot.acmap}()}, 49 | \code{\link{setLegend}()}, 50 | \code{\link{view.acmap}()}, 51 | \code{\link{view.default}()}, 52 | \code{\link{view}()} 53 | } 54 | \concept{functions to view maps} 55 | -------------------------------------------------------------------------------- /man/acmapAttributes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{acmapAttributes} 4 | \alias{acmapAttributes} 5 | \alias{numAntigens} 6 | \alias{numSera} 7 | \alias{numSeraGroups} 8 | \alias{numPoints} 9 | \alias{numOptimizations} 10 | \alias{numLayers} 11 | \title{Get acmap attributes} 12 | \usage{ 13 | numAntigens(map) 14 | 15 | numSera(map) 16 | 17 | numSeraGroups(map) 18 | 19 | numPoints(map) 20 | 21 | numOptimizations(map) 22 | 23 | numLayers(map) 24 | } 25 | \arguments{ 26 | \item{map}{The acmap data object} 27 | } 28 | \value{ 29 | A number relating to the attribute 30 | } 31 | \description{ 32 | Functions to get various attributes about an acmap object. 33 | } 34 | \seealso{ 35 | Other map attribute functions: 36 | \code{\link{adjustedLogTiterTable}()}, 37 | \code{\link{adjustedTiterTable}()}, 38 | \code{\link{dilutionStepsize}()}, 39 | \code{\link{logtiterTableLayers}()}, 40 | \code{\link{mapDescription}()}, 41 | \code{\link{mapName}()}, 42 | \code{\link{titerTableFlat}()}, 43 | \code{\link{titerTableLayers}()}, 44 | \code{\link{titerTable}()} 45 | } 46 | \concept{map attribute functions} 47 | -------------------------------------------------------------------------------- /man/adjustedLogTiterTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_reactivity_adjusts.R 3 | \name{adjustedLogTiterTable} 4 | \alias{adjustedLogTiterTable} 5 | \title{Get the reactivity adjusted log titer table} 6 | \usage{ 7 | adjustedLogTiterTable(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object} 11 | 12 | \item{optimization_number}{The optimization number from which 13 | to take any antigen reactivity adjustments} 14 | } 15 | \value{ 16 | A numeric matrix of adjusted log titers. 17 | } 18 | \description{ 19 | Return the log titer table plus any antigen reactivity adjustments. 20 | } 21 | \seealso{ 22 | Other map attribute functions: 23 | \code{\link{acmapAttributes}}, 24 | \code{\link{adjustedTiterTable}()}, 25 | \code{\link{dilutionStepsize}()}, 26 | \code{\link{logtiterTableLayers}()}, 27 | \code{\link{mapDescription}()}, 28 | \code{\link{mapName}()}, 29 | \code{\link{titerTableFlat}()}, 30 | \code{\link{titerTableLayers}()}, 31 | \code{\link{titerTable}()} 32 | } 33 | \concept{map attribute functions} 34 | -------------------------------------------------------------------------------- /man/adjustedTiterTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_reactivity_adjusts.R 3 | \name{adjustedTiterTable} 4 | \alias{adjustedTiterTable} 5 | \title{Get the reactivity adjusted titer table} 6 | \usage{ 7 | adjustedTiterTable(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object} 11 | 12 | \item{optimization_number}{The optimization number from which 13 | to take any antigen reactivity adjustments} 14 | } 15 | \value{ 16 | A character matrix of titers. 17 | } 18 | \description{ 19 | Return the titer table plus any antigen reactivity adjustments. 20 | } 21 | \seealso{ 22 | \code{\link[=htmlAdjustedTiterTable]{htmlAdjustedTiterTable()}} 23 | 24 | Other map attribute functions: 25 | \code{\link{acmapAttributes}}, 26 | \code{\link{adjustedLogTiterTable}()}, 27 | \code{\link{dilutionStepsize}()}, 28 | \code{\link{logtiterTableLayers}()}, 29 | \code{\link{mapDescription}()}, 30 | \code{\link{mapName}()}, 31 | \code{\link{titerTableFlat}()}, 32 | \code{\link{titerTableLayers}()}, 33 | \code{\link{titerTable}()} 34 | } 35 | \concept{map attribute functions} 36 | -------------------------------------------------------------------------------- /man/agGroups.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_antigens.R 3 | \name{agGroups} 4 | \alias{agGroups} 5 | \alias{agGroups<-} 6 | \title{Getting and setting antigen groups} 7 | \usage{ 8 | agGroups(map) 9 | 10 | agGroups(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A character or factor vector of groupings to apply to the 16 | antigens} 17 | } 18 | \value{ 19 | A factor vector of groupings. 20 | } 21 | \description{ 22 | These functions get and set the antigen groupings for a map. 23 | } 24 | \seealso{ 25 | Other antigen and sera attribute functions: 26 | \code{\link{agAttributes}}, 27 | \code{\link{agHomologousSr}()}, 28 | \code{\link{agLabIDs}()}, 29 | \code{\link{agSequences}()}, 30 | \code{\link{ptAnnotations}}, 31 | \code{\link{ptClades}}, 32 | \code{\link{srAttributes}}, 33 | \code{\link{srGroups}()}, 34 | \code{\link{srHomologousAgs}()}, 35 | \code{\link{srSequences}()} 36 | } 37 | \concept{antigen and sera attribute functions} 38 | -------------------------------------------------------------------------------- /man/agHomologousSr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_sera.R 3 | \name{agHomologousSr} 4 | \alias{agHomologousSr} 5 | \title{Get homologous sera for each antigen} 6 | \usage{ 7 | agHomologousSr(map) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object} 11 | } 12 | \value{ 13 | A list, where each entry is a vector of indices for homologous 14 | sera, or a length 0 vector where no homologous serum is present 15 | } 16 | \description{ 17 | Gets the indices of homologous sera for each antigen in an antigenic map. 18 | See also the function \code{srHomologousAgs()} for getting and setting the 19 | homologous antigens reciprocally. 20 | } 21 | \seealso{ 22 | Other antigen and sera attribute functions: 23 | \code{\link{agAttributes}}, 24 | \code{\link{agGroups}()}, 25 | \code{\link{agLabIDs}()}, 26 | \code{\link{agSequences}()}, 27 | \code{\link{ptAnnotations}}, 28 | \code{\link{ptClades}}, 29 | \code{\link{srAttributes}}, 30 | \code{\link{srGroups}()}, 31 | \code{\link{srHomologousAgs}()}, 32 | \code{\link{srSequences}()} 33 | } 34 | \concept{antigen and sera attribute functions} 35 | -------------------------------------------------------------------------------- /man/agLabIDs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_antigens.R 3 | \name{agLabIDs} 4 | \alias{agLabIDs} 5 | \alias{agLabIDs<-} 6 | \title{Getting and setting antigen lab id information} 7 | \usage{ 8 | agLabIDs(map) 9 | 10 | agLabIDs(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap data object} 14 | 15 | \item{value}{A list of character vectors with lab ids information for each 16 | point} 17 | } 18 | \value{ 19 | A character vector of antigen laboratory IDs 20 | } 21 | \description{ 22 | Getting and setting antigen lab id information 23 | } 24 | \seealso{ 25 | Other antigen and sera attribute functions: 26 | \code{\link{agAttributes}}, 27 | \code{\link{agGroups}()}, 28 | \code{\link{agHomologousSr}()}, 29 | \code{\link{agSequences}()}, 30 | \code{\link{ptAnnotations}}, 31 | \code{\link{ptClades}}, 32 | \code{\link{srAttributes}}, 33 | \code{\link{srGroups}()}, 34 | \code{\link{srHomologousAgs}()}, 35 | \code{\link{srSequences}()} 36 | } 37 | \concept{antigen and sera attribute functions} 38 | -------------------------------------------------------------------------------- /man/agReactivityAdjustments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{agReactivityAdjustments} 4 | \alias{agReactivityAdjustments} 5 | \alias{agReactivityAdjustments<-} 6 | \title{Get and set antigen reactivity adjustments} 7 | \usage{ 8 | agReactivityAdjustments(map) 9 | 10 | agReactivityAdjustments(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A vector of antigen reactivity adjustments to apply} 16 | } 17 | \value{ 18 | A numeric vector of antigen reactivity adjustments 19 | } 20 | \description{ 21 | Get and set antigen reactivity adjustments 22 | } 23 | \seealso{ 24 | Other functions for working with map data: 25 | \code{\link{acmap}()}, 26 | \code{\link{addOptimization}()}, 27 | \code{\link{as.json}()}, 28 | \code{\link{edit_agNames}()}, 29 | \code{\link{edit_srNames}()}, 30 | \code{\link{keepBestOptimization}()}, 31 | \code{\link{keepSingleOptimization}()}, 32 | \code{\link{layerNames}()}, 33 | \code{\link{orderPoints}}, 34 | \code{\link{read.acmap}()}, 35 | \code{\link{read.titerTable}()}, 36 | \code{\link{removePoints}}, 37 | \code{\link{save.acmap}()}, 38 | \code{\link{save.coords}()}, 39 | \code{\link{save.titerTable}()}, 40 | \code{\link{subsetCommonPoints}}, 41 | \code{\link{subsetMap}()} 42 | } 43 | \concept{functions for working with map data} 44 | -------------------------------------------------------------------------------- /man/agSequences.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_antigens.R 3 | \name{agSequences} 4 | \alias{agSequences} 5 | \alias{agSequences<-} 6 | \alias{agNucleotideSequences} 7 | \alias{agNucleotideSequences<-} 8 | \title{Getting and setting antigen sequence information} 9 | \usage{ 10 | agSequences(map, missing_value = ".") 11 | 12 | agSequences(map) <- value 13 | 14 | agNucleotideSequences(map, missing_value = ".") 15 | 16 | agNucleotideSequences(map) <- value 17 | } 18 | \arguments{ 19 | \item{map}{The acmap data object} 20 | 21 | \item{missing_value}{Character to use to fill in portions of the sequence matrix 22 | where sequence data is missing.} 23 | 24 | \item{value}{A character matrix of sequences with rows equal to the number of 25 | antigens} 26 | } 27 | \value{ 28 | A character matrix of sequences, where each row represents an antigen. 29 | } 30 | \description{ 31 | Getting and setting antigen sequence information 32 | } 33 | \seealso{ 34 | Other antigen and sera attribute functions: 35 | \code{\link{agAttributes}}, 36 | \code{\link{agGroups}()}, 37 | \code{\link{agHomologousSr}()}, 38 | \code{\link{agLabIDs}()}, 39 | \code{\link{ptAnnotations}}, 40 | \code{\link{ptClades}}, 41 | \code{\link{srAttributes}}, 42 | \code{\link{srGroups}()}, 43 | \code{\link{srHomologousAgs}()}, 44 | \code{\link{srSequences}()} 45 | } 46 | \concept{antigen and sera attribute functions} 47 | -------------------------------------------------------------------------------- /man/applyMapTransform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_transformation.R 3 | \name{applyMapTransform} 4 | \alias{applyMapTransform} 5 | \title{Apply the current map transformation} 6 | \usage{ 7 | applyMapTransform(coords, map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{coords}{Coordinates to transform} 11 | 12 | \item{map}{The acmap object} 13 | 14 | \item{optimization_number}{The optimization number} 15 | } 16 | \value{ 17 | An acmap object with transformation applied 18 | } 19 | \description{ 20 | Applies the map transformation associated with a selected optimization run to 21 | a set of coordinates. 22 | } 23 | \seealso{ 24 | Other functions relating to map transformation: 25 | \code{\link{reflectMap}()}, 26 | \code{\link{rotateMap}()}, 27 | \code{\link{translateMap}()} 28 | } 29 | \concept{functions relating to map transformation} 30 | -------------------------------------------------------------------------------- /man/applyPlotspec.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_plotspec.R 3 | \name{applyPlotspec} 4 | \alias{applyPlotspec} 5 | \title{Apply a plotspec from another acmap} 6 | \usage{ 7 | applyPlotspec(map, source_map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{source_map}{An acmap object from which to copy point styles} 13 | } 14 | \value{ 15 | Returns the acmap object with updated point styles (unmatched point 16 | styles unchanged) 17 | } 18 | \description{ 19 | Copy point style from matching antigens and sera in another acmap 20 | } 21 | \seealso{ 22 | Other map point style functions: 23 | \code{\link{ptDrawingOrder}()}, 24 | \code{\link{ptOpacity}}, 25 | \code{\link{ptStyles}} 26 | } 27 | \concept{map point style functions} 28 | -------------------------------------------------------------------------------- /man/as.json.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_loadsave.R 3 | \name{as.json} 4 | \alias{as.json} 5 | \title{Convert map to json format} 6 | \usage{ 7 | as.json(map, pretty = FALSE, round_titers = FALSE) 8 | } 9 | \arguments{ 10 | \item{map}{The map data object} 11 | 12 | \item{pretty}{Should json be output prettily with new lines and indentation?} 13 | 14 | \item{round_titers}{Should titers be rounded to the nearest integer before outputting} 15 | } 16 | \value{ 17 | Returns map data as .ace json format 18 | } 19 | \description{ 20 | Convert map to json format 21 | } 22 | \seealso{ 23 | Other functions for working with map data: 24 | \code{\link{acmap}()}, 25 | \code{\link{addOptimization}()}, 26 | \code{\link{agReactivityAdjustments}()}, 27 | \code{\link{edit_agNames}()}, 28 | \code{\link{edit_srNames}()}, 29 | \code{\link{keepBestOptimization}()}, 30 | \code{\link{keepSingleOptimization}()}, 31 | \code{\link{layerNames}()}, 32 | \code{\link{orderPoints}}, 33 | \code{\link{read.acmap}()}, 34 | \code{\link{read.titerTable}()}, 35 | \code{\link{removePoints}}, 36 | \code{\link{save.acmap}()}, 37 | \code{\link{save.coords}()}, 38 | \code{\link{save.titerTable}()}, 39 | \code{\link{subsetCommonPoints}}, 40 | \code{\link{subsetMap}()} 41 | } 42 | \concept{functions for working with map data} 43 | -------------------------------------------------------------------------------- /man/blob.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_plot.R 3 | \name{blob} 4 | \alias{blob} 5 | \title{Plot a blob object} 6 | \usage{ 7 | blob(x, col, border, lwd, alpha = 1, ...) 8 | } 9 | \arguments{ 10 | \item{x}{The blob object to plot} 11 | 12 | \item{col}{Color for the blob fill} 13 | 14 | \item{border}{Color for the blob outline} 15 | 16 | \item{lwd}{Line width for the blob outline} 17 | 18 | \item{alpha}{Blob opacity} 19 | 20 | \item{...}{Additional arguments to pass to \code{polygon()}} 21 | } 22 | \value{ 23 | No return value, called for the side effect of plotting the blobs. 24 | } 25 | \description{ 26 | Plot a blob object such as that return from \code{agBootstrapBlob()} using the 27 | \code{polygon()} function. 28 | } 29 | \seealso{ 30 | Other additional plotting functions: 31 | \code{\link{blobsize}()} 32 | } 33 | \concept{additional plotting functions} 34 | -------------------------------------------------------------------------------- /man/blobsize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_blobs.R 3 | \name{blobsize} 4 | \alias{blobsize} 5 | \title{Calculate size of a blob object} 6 | \usage{ 7 | blobsize(blob) 8 | } 9 | \arguments{ 10 | \item{blob}{The blob object} 11 | } 12 | \value{ 13 | A numeric vector 14 | } 15 | \description{ 16 | Returns either the area (for 2D blobs) or volume (for 3D blobs) 17 | } 18 | \seealso{ 19 | Other additional plotting functions: 20 | \code{\link{blob}()} 21 | } 22 | \concept{additional plotting functions} 23 | -------------------------------------------------------------------------------- /man/checkHemisphering.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimize.R 3 | \name{checkHemisphering} 4 | \alias{checkHemisphering} 5 | \title{Check for hemisphering or trapped points} 6 | \usage{ 7 | checkHemisphering( 8 | map, 9 | optimization_number = 1, 10 | grid_spacing = 0.25, 11 | stress_lim = 0.1, 12 | options = list() 13 | ) 14 | } 15 | \arguments{ 16 | \item{map}{The acmap data object} 17 | 18 | \item{optimization_number}{The map optimization number} 19 | 20 | \item{grid_spacing}{When doing a grid search of more optimal point positions 21 | the grid spacing to use} 22 | 23 | \item{stress_lim}{The stress difference to use when classifying a point as 24 | "hemisphering" or not} 25 | 26 | \item{options}{A named list of options to pass to \code{RacOptimizer.options()}} 27 | } 28 | \value{ 29 | Returns a data frame with information on any points that were found 30 | to be hemisphering or trapped. 31 | } 32 | \description{ 33 | Check for hemisphering or trapped points 34 | } 35 | \seealso{ 36 | Other map diagnostic functions: 37 | \code{\link{agCohesion}()}, 38 | \code{\link{bootstrapBlobs}()}, 39 | \code{\link{bootstrapMap}()}, 40 | \code{\link{dimensionTestMap}()}, 41 | \code{\link{logtiterTable}()}, 42 | \code{\link{map-table-distances}}, 43 | \code{\link{mapBootstrapCoords}}, 44 | \code{\link{mapDistances}()}, 45 | \code{\link{mapRelaxed}()}, 46 | \code{\link{mapResiduals}()}, 47 | \code{\link{pointStress}}, 48 | \code{\link{ptBootstrapBlob}}, 49 | \code{\link{ptBootstrapCoords}()}, 50 | \code{\link{ptLeverage}}, 51 | \code{\link{ptTriangulationBlob}}, 52 | \code{\link{recalculateStress}()}, 53 | \code{\link{stressTable}()}, 54 | \code{\link{tableColbases}()}, 55 | \code{\link{tableDistances}()}, 56 | \code{\link{triangulationBlobs}()}, 57 | \code{\link{unstableMaps}} 58 | } 59 | \concept{map diagnostic functions} 60 | -------------------------------------------------------------------------------- /man/deprecated_functions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_messages.R 3 | \name{deprecated_functions} 4 | \alias{deprecated_functions} 5 | \alias{stressBlobs} 6 | \title{Deprecated functions} 7 | \usage{ 8 | stressBlobs(...) 9 | } 10 | \arguments{ 11 | \item{...}{Arguments to pass to the new function} 12 | } 13 | \value{ 14 | Values from the new function 15 | } 16 | \description{ 17 | These functions still work but have been deprecated in favour of another function. Arguments will be passed onto the new function with a warning. 18 | } 19 | -------------------------------------------------------------------------------- /man/edit_agNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_edit_names.R 3 | \name{edit_agNames} 4 | \alias{edit_agNames} 5 | \title{Edit antigen names in an acmap} 6 | \usage{ 7 | edit_agNames(map, old_names, new_names) 8 | } 9 | \arguments{ 10 | \item{map}{The map data object to be updated} 11 | 12 | \item{old_names}{Old names to be replaced} 13 | 14 | \item{new_names}{Replacement for old names} 15 | } 16 | \value{ 17 | Returns the acmap object with antigen names updated. 18 | } 19 | \description{ 20 | Edit antigen names in an acmap 21 | } 22 | \seealso{ 23 | Other functions for working with map data: 24 | \code{\link{acmap}()}, 25 | \code{\link{addOptimization}()}, 26 | \code{\link{agReactivityAdjustments}()}, 27 | \code{\link{as.json}()}, 28 | \code{\link{edit_srNames}()}, 29 | \code{\link{keepBestOptimization}()}, 30 | \code{\link{keepSingleOptimization}()}, 31 | \code{\link{layerNames}()}, 32 | \code{\link{orderPoints}}, 33 | \code{\link{read.acmap}()}, 34 | \code{\link{read.titerTable}()}, 35 | \code{\link{removePoints}}, 36 | \code{\link{save.acmap}()}, 37 | \code{\link{save.coords}()}, 38 | \code{\link{save.titerTable}()}, 39 | \code{\link{subsetCommonPoints}}, 40 | \code{\link{subsetMap}()} 41 | } 42 | \concept{functions for working with map data} 43 | -------------------------------------------------------------------------------- /man/edit_srNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_edit_names.R 3 | \name{edit_srNames} 4 | \alias{edit_srNames} 5 | \title{Edit sera names in an acmap} 6 | \usage{ 7 | edit_srNames(map, old_names, new_names) 8 | } 9 | \arguments{ 10 | \item{map}{The map data object to be updated} 11 | 12 | \item{old_names}{Old names to be replaced} 13 | 14 | \item{new_names}{Replacement for old names} 15 | } 16 | \value{ 17 | Returns the acmap object with sera names updated. 18 | } 19 | \description{ 20 | Edit sera names in an acmap 21 | } 22 | \seealso{ 23 | Other functions for working with map data: 24 | \code{\link{acmap}()}, 25 | \code{\link{addOptimization}()}, 26 | \code{\link{agReactivityAdjustments}()}, 27 | \code{\link{as.json}()}, 28 | \code{\link{edit_agNames}()}, 29 | \code{\link{keepBestOptimization}()}, 30 | \code{\link{keepSingleOptimization}()}, 31 | \code{\link{layerNames}()}, 32 | \code{\link{orderPoints}}, 33 | \code{\link{read.acmap}()}, 34 | \code{\link{read.titerTable}()}, 35 | \code{\link{removePoints}}, 36 | \code{\link{save.acmap}()}, 37 | \code{\link{save.coords}()}, 38 | \code{\link{save.titerTable}()}, 39 | \code{\link{subsetCommonPoints}}, 40 | \code{\link{subsetMap}()} 41 | } 42 | \concept{functions for working with map data} 43 | -------------------------------------------------------------------------------- /man/export_viewer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_viewer.R 3 | \name{export_viewer} 4 | \alias{export_viewer} 5 | \title{Export the map viewer} 6 | \usage{ 7 | export_viewer(map, file, selfcontained = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{file}{File to save HTML into} 13 | 14 | \item{selfcontained}{Whether to save the HTML as a single self-contained file 15 | (with external resources base64 encoded) or a file with external resources 16 | placed in an adjacent directory.} 17 | 18 | \item{...}{Further parameters to \code{view()}} 19 | } 20 | \value{ 21 | Called for the side effect of saving the viewer to an html file but 22 | invisibly returns the map viewer htmlwidget. 23 | } 24 | \description{ 25 | Export a map in a standalone html viewer 26 | } 27 | \seealso{ 28 | Other functions to view maps: 29 | \code{\link{RacViewer.options}()}, 30 | \code{\link{RacViewer}()}, 31 | \code{\link{ggplot.acmap}()}, 32 | \code{\link{mapGadget}()}, 33 | \code{\link{plot.acmap}()}, 34 | \code{\link{setLegend}()}, 35 | \code{\link{view.acmap}()}, 36 | \code{\link{view.default}()}, 37 | \code{\link{view}()} 38 | } 39 | \concept{functions to view maps} 40 | -------------------------------------------------------------------------------- /man/figures/lifecycle-archived.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecyclearchivedarchived -------------------------------------------------------------------------------- /man/figures/lifecycle-defunct.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecycledefunctdefunct -------------------------------------------------------------------------------- /man/figures/lifecycle-deprecated.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecycledeprecateddeprecated -------------------------------------------------------------------------------- /man/figures/lifecycle-experimental.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecycleexperimentalexperimental -------------------------------------------------------------------------------- /man/figures/lifecycle-maturing.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecyclematuringmaturing -------------------------------------------------------------------------------- /man/figures/lifecycle-questioning.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecyclequestioningquestioning -------------------------------------------------------------------------------- /man/figures/lifecycle-stable.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecyclestablestable -------------------------------------------------------------------------------- /man/figures/lifecycle-superseded.svg: -------------------------------------------------------------------------------- 1 | lifecyclelifecyclesupersededsuperseded -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/man/figures/logo.png -------------------------------------------------------------------------------- /man/getOptimization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimizations.R 3 | \name{getOptimization} 4 | \alias{getOptimization} 5 | \title{Get optimization details from an acmap object} 6 | \usage{ 7 | getOptimization(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The optimization data to access} 13 | } 14 | \value{ 15 | Returns a list with information about the optimization 16 | } 17 | \description{ 18 | Gets the details associated with the currently selected or specified acmap 19 | optimization as a list. 20 | } 21 | \seealso{ 22 | See \code{listOptimizations()} for getting information about all 23 | optimizations. 24 | } 25 | -------------------------------------------------------------------------------- /man/htmlAdjustedTiterTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_merge_report.R 3 | \name{htmlAdjustedTiterTable} 4 | \alias{htmlAdjustedTiterTable} 5 | \title{Return an html formatted titer table with antigen reactivity adjustments applied} 6 | \usage{ 7 | htmlAdjustedTiterTable(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object} 11 | 12 | \item{optimization_number}{The optimization number from which to take the 13 | antigen reactivity adjustments.} 14 | } 15 | \value{ 16 | A list() with a Rac_html_merge_report and shiny.tag class that can 17 | be converted into an HTML string via as.character() and saved to a file 18 | with save_html(). 19 | } 20 | \description{ 21 | Prints an html formatted titer table, visualising 22 | with colors things like which titers are the maximum for each sera. 23 | } 24 | -------------------------------------------------------------------------------- /man/htmlMergeReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_merge_report.R 3 | \name{htmlMergeReport} 4 | \alias{htmlMergeReport} 5 | \title{Return an html formatted merge report} 6 | \usage{ 7 | htmlMergeReport(map) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object that was the result of merging several maps} 11 | } 12 | \value{ 13 | A list() with a Rac_html_merge_report and shiny.tag class that can 14 | be converted into an HTML string via as.character() and saved to a file 15 | with save_html(). 16 | } 17 | \description{ 18 | Prints an html formatted table merge report of a set of merged maps, visualising 19 | with colors how different titers have been merged together. 20 | } 21 | \seealso{ 22 | Other map merging functions: 23 | \code{\link{RacMerge.options}()}, 24 | \code{\link{mergeMaps}()}, 25 | \code{\link{mergeReport}()}, 26 | \code{\link{splitTiterLayers}()} 27 | } 28 | \concept{map merging functions} 29 | -------------------------------------------------------------------------------- /man/htmlTiterTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_merge_report.R 3 | \name{htmlTiterTable} 4 | \alias{htmlTiterTable} 5 | \title{Return an html formatted titer table} 6 | \usage{ 7 | htmlTiterTable(map) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object} 11 | } 12 | \value{ 13 | A list() with a Rac_html_merge_report and shiny.tag class that can 14 | be converted into an HTML string via as.character() and saved to a file 15 | with save_html(). 16 | } 17 | \description{ 18 | Prints an html formatted titer table, visualising 19 | with colors things like which titers are the maximum for each sera. 20 | } 21 | \seealso{ 22 | htmlAdjustedTiterTable 23 | } 24 | -------------------------------------------------------------------------------- /man/keepBestOptimization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{keepBestOptimization} 4 | \alias{keepBestOptimization} 5 | \title{Keep only the lowest stress map optimization} 6 | \usage{ 7 | keepBestOptimization(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | } 12 | \value{ 13 | An acmap object with only the lowest stress optimization kept 14 | } 15 | \description{ 16 | Keep only the lowest stress map optimization 17 | } 18 | \seealso{ 19 | Other functions for working with map data: 20 | \code{\link{acmap}()}, 21 | \code{\link{addOptimization}()}, 22 | \code{\link{agReactivityAdjustments}()}, 23 | \code{\link{as.json}()}, 24 | \code{\link{edit_agNames}()}, 25 | \code{\link{edit_srNames}()}, 26 | \code{\link{keepSingleOptimization}()}, 27 | \code{\link{layerNames}()}, 28 | \code{\link{orderPoints}}, 29 | \code{\link{read.acmap}()}, 30 | \code{\link{read.titerTable}()}, 31 | \code{\link{removePoints}}, 32 | \code{\link{save.acmap}()}, 33 | \code{\link{save.coords}()}, 34 | \code{\link{save.titerTable}()}, 35 | \code{\link{subsetCommonPoints}}, 36 | \code{\link{subsetMap}()} 37 | } 38 | \concept{functions for working with map data} 39 | -------------------------------------------------------------------------------- /man/keepOptimizations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{keepOptimizations} 4 | \alias{keepOptimizations} 5 | \title{Keep specified optimization runs} 6 | \usage{ 7 | keepOptimizations(map, optimization_numbers) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{optimization_numbers}{Optimizations to keep} 13 | } 14 | \value{ 15 | Returns the updated acmap object 16 | } 17 | \description{ 18 | Keep only data from specified optimization runs. 19 | } 20 | \seealso{ 21 | Other functions to work with map optimizations: 22 | \code{\link{optimizationProperties}}, 23 | \code{\link{removeOptimizations}()}, 24 | \code{\link{sortOptimizations}()} 25 | } 26 | \concept{functions to work with map optimizations} 27 | -------------------------------------------------------------------------------- /man/keepSingleOptimization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{keepSingleOptimization} 4 | \alias{keepSingleOptimization} 5 | \title{Keep only a single optimization run} 6 | \usage{ 7 | keepSingleOptimization(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{optimization_number}{The optimization run to keep} 13 | } 14 | \value{ 15 | An acmap object with only one optimization kept 16 | } 17 | \description{ 18 | Keep only a single optimization run 19 | } 20 | \seealso{ 21 | Other functions for working with map data: 22 | \code{\link{acmap}()}, 23 | \code{\link{addOptimization}()}, 24 | \code{\link{agReactivityAdjustments}()}, 25 | \code{\link{as.json}()}, 26 | \code{\link{edit_agNames}()}, 27 | \code{\link{edit_srNames}()}, 28 | \code{\link{keepBestOptimization}()}, 29 | \code{\link{layerNames}()}, 30 | \code{\link{orderPoints}}, 31 | \code{\link{read.acmap}()}, 32 | \code{\link{read.titerTable}()}, 33 | \code{\link{removePoints}}, 34 | \code{\link{save.acmap}()}, 35 | \code{\link{save.coords}()}, 36 | \code{\link{save.titerTable}()}, 37 | \code{\link{subsetCommonPoints}}, 38 | \code{\link{subsetMap}()} 39 | } 40 | \concept{functions for working with map data} 41 | -------------------------------------------------------------------------------- /man/layerNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{layerNames} 4 | \alias{layerNames} 5 | \alias{layerNames<-} 6 | \title{Get and set map layer names} 7 | \usage{ 8 | layerNames(map) 9 | 10 | layerNames(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A vector of new layer names to apply to the map} 16 | } 17 | \value{ 18 | A character vector of layer names 19 | } 20 | \description{ 21 | Get and set map layer names 22 | } 23 | \seealso{ 24 | Other functions for working with map data: 25 | \code{\link{acmap}()}, 26 | \code{\link{addOptimization}()}, 27 | \code{\link{agReactivityAdjustments}()}, 28 | \code{\link{as.json}()}, 29 | \code{\link{edit_agNames}()}, 30 | \code{\link{edit_srNames}()}, 31 | \code{\link{keepBestOptimization}()}, 32 | \code{\link{keepSingleOptimization}()}, 33 | \code{\link{orderPoints}}, 34 | \code{\link{read.acmap}()}, 35 | \code{\link{read.titerTable}()}, 36 | \code{\link{removePoints}}, 37 | \code{\link{save.acmap}()}, 38 | \code{\link{save.coords}()}, 39 | \code{\link{save.titerTable}()}, 40 | \code{\link{subsetCommonPoints}}, 41 | \code{\link{subsetMap}()} 42 | } 43 | \concept{functions for working with map data} 44 | -------------------------------------------------------------------------------- /man/listOptimizations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimizations.R 3 | \name{listOptimizations} 4 | \alias{listOptimizations} 5 | \title{Get all optimization details from an acmap object} 6 | \usage{ 7 | listOptimizations(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | } 12 | \value{ 13 | Returns a list of lists with information about the optimizations 14 | } 15 | \description{ 16 | Gets the details associated with the all the optimizations of an acmap object 17 | as a list. 18 | } 19 | \seealso{ 20 | See \code{getOptimization()} for getting information about a single 21 | optimization. 22 | } 23 | -------------------------------------------------------------------------------- /man/logtiterTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_stress.R 3 | \name{logtiterTable} 4 | \alias{logtiterTable} 5 | \title{Get the log titers from an acmap} 6 | \usage{ 7 | logtiterTable(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | } 12 | \value{ 13 | Returns a matrix of titers converted to the log scale 14 | } 15 | \description{ 16 | Converts titers to the log scale via via the transformation 17 | $log2(x/10)$, lessthan values are reduced by 1 on the log scale and greater 18 | than values are increased by 1, hence <10 => -1 and >1280 => 8 19 | } 20 | \seealso{ 21 | Other map diagnostic functions: 22 | \code{\link{agCohesion}()}, 23 | \code{\link{bootstrapBlobs}()}, 24 | \code{\link{bootstrapMap}()}, 25 | \code{\link{checkHemisphering}()}, 26 | \code{\link{dimensionTestMap}()}, 27 | \code{\link{map-table-distances}}, 28 | \code{\link{mapBootstrapCoords}}, 29 | \code{\link{mapDistances}()}, 30 | \code{\link{mapRelaxed}()}, 31 | \code{\link{mapResiduals}()}, 32 | \code{\link{pointStress}}, 33 | \code{\link{ptBootstrapBlob}}, 34 | \code{\link{ptBootstrapCoords}()}, 35 | \code{\link{ptLeverage}}, 36 | \code{\link{ptTriangulationBlob}}, 37 | \code{\link{recalculateStress}()}, 38 | \code{\link{stressTable}()}, 39 | \code{\link{tableColbases}()}, 40 | \code{\link{tableDistances}()}, 41 | \code{\link{triangulationBlobs}()}, 42 | \code{\link{unstableMaps}} 43 | 44 | Other functions relating to map stress calculation: 45 | \code{\link{mapDistances}()}, 46 | \code{\link{mapResiduals}()}, 47 | \code{\link{pointStress}}, 48 | \code{\link{recalculateStress}()}, 49 | \code{\link{stressTable}()}, 50 | \code{\link{tableColbases}()}, 51 | \code{\link{tableDistances}()} 52 | } 53 | \concept{functions relating to map stress calculation} 54 | \concept{map diagnostic functions} 55 | -------------------------------------------------------------------------------- /man/logtiterTableLayers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{logtiterTableLayers} 4 | \alias{logtiterTableLayers} 5 | \title{Return a list of logtiter table layers} 6 | \usage{ 7 | logtiterTableLayers(map) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap data object} 11 | } 12 | \value{ 13 | A list of numeric matrices with logtiter values 14 | } 15 | \description{ 16 | Return a list of logtiter table layers 17 | } 18 | \seealso{ 19 | Other map attribute functions: 20 | \code{\link{acmapAttributes}}, 21 | \code{\link{adjustedLogTiterTable}()}, 22 | \code{\link{adjustedTiterTable}()}, 23 | \code{\link{dilutionStepsize}()}, 24 | \code{\link{mapDescription}()}, 25 | \code{\link{mapName}()}, 26 | \code{\link{titerTableFlat}()}, 27 | \code{\link{titerTableLayers}()}, 28 | \code{\link{titerTable}()} 29 | } 30 | \concept{map attribute functions} 31 | -------------------------------------------------------------------------------- /man/map-table-distances.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_diagnostics.R 3 | \name{map-table-distances} 4 | \alias{map-table-distances} 5 | \alias{plot_map_table_distance} 6 | \alias{plotly_map_table_distance} 7 | \title{Plot map vs table distances} 8 | \usage{ 9 | plot_map_table_distance( 10 | map, 11 | optimization_number = 1, 12 | xlim, 13 | ylim, 14 | line_of_equality = TRUE 15 | ) 16 | 17 | plotly_map_table_distance( 18 | map, 19 | optimization_number = 1, 20 | xlim, 21 | ylim, 22 | line_of_equality = TRUE 23 | ) 24 | } 25 | \arguments{ 26 | \item{map}{The acmap data object} 27 | 28 | \item{optimization_number}{The optimization number from which to take map and 29 | table distances} 30 | 31 | \item{xlim}{The x limits of the plot} 32 | 33 | \item{ylim}{The y limits of the plot} 34 | 35 | \item{line_of_equality}{Should the line x=y be added} 36 | } 37 | \value{ 38 | Returns the ggplot2 object 39 | } 40 | \description{ 41 | Plot map vs table distances 42 | } 43 | \seealso{ 44 | Other map diagnostic functions: 45 | \code{\link{agCohesion}()}, 46 | \code{\link{bootstrapBlobs}()}, 47 | \code{\link{bootstrapMap}()}, 48 | \code{\link{checkHemisphering}()}, 49 | \code{\link{dimensionTestMap}()}, 50 | \code{\link{logtiterTable}()}, 51 | \code{\link{mapBootstrapCoords}}, 52 | \code{\link{mapDistances}()}, 53 | \code{\link{mapRelaxed}()}, 54 | \code{\link{mapResiduals}()}, 55 | \code{\link{pointStress}}, 56 | \code{\link{ptBootstrapBlob}}, 57 | \code{\link{ptBootstrapCoords}()}, 58 | \code{\link{ptLeverage}}, 59 | \code{\link{ptTriangulationBlob}}, 60 | \code{\link{recalculateStress}()}, 61 | \code{\link{stressTable}()}, 62 | \code{\link{tableColbases}()}, 63 | \code{\link{tableDistances}()}, 64 | \code{\link{triangulationBlobs}()}, 65 | \code{\link{unstableMaps}} 66 | } 67 | \concept{map diagnostic functions} 68 | -------------------------------------------------------------------------------- /man/mapBootstrapCoords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_diagnostics_bootstrap.R 3 | \name{mapBootstrapCoords} 4 | \alias{mapBootstrapCoords} 5 | \alias{mapBootstrap_ptBaseCoords} 6 | \alias{mapBootstrap_agCoords} 7 | \alias{mapBootstrap_srCoords} 8 | \title{Get bootstrap coordinates associated with a map} 9 | \usage{ 10 | mapBootstrap_ptBaseCoords(map) 11 | 12 | mapBootstrap_agCoords(map) 13 | 14 | mapBootstrap_srCoords(map) 15 | } 16 | \arguments{ 17 | \item{map}{The map object} 18 | } 19 | \value{ 20 | Returns a list of coordinate matrices for the points in each of 21 | the bootstrap runs 22 | } 23 | \description{ 24 | This can be used to get information about the bootstrap run results 25 | after \code{bootstrapMap()} has been run. 26 | } 27 | \seealso{ 28 | Other map diagnostic functions: 29 | \code{\link{agCohesion}()}, 30 | \code{\link{bootstrapBlobs}()}, 31 | \code{\link{bootstrapMap}()}, 32 | \code{\link{checkHemisphering}()}, 33 | \code{\link{dimensionTestMap}()}, 34 | \code{\link{logtiterTable}()}, 35 | \code{\link{map-table-distances}}, 36 | \code{\link{mapDistances}()}, 37 | \code{\link{mapRelaxed}()}, 38 | \code{\link{mapResiduals}()}, 39 | \code{\link{pointStress}}, 40 | \code{\link{ptBootstrapBlob}}, 41 | \code{\link{ptBootstrapCoords}()}, 42 | \code{\link{ptLeverage}}, 43 | \code{\link{ptTriangulationBlob}}, 44 | \code{\link{recalculateStress}()}, 45 | \code{\link{stressTable}()}, 46 | \code{\link{tableColbases}()}, 47 | \code{\link{tableDistances}()}, 48 | \code{\link{triangulationBlobs}()}, 49 | \code{\link{unstableMaps}} 50 | } 51 | \concept{map diagnostic functions} 52 | -------------------------------------------------------------------------------- /man/mapComment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_optimizations.R 3 | \name{mapComment} 4 | \alias{mapComment} 5 | \alias{mapComment<-} 6 | \title{Get or set an optimization run comment} 7 | \usage{ 8 | mapComment(map, optimization_number = 1) 9 | mapComment(map, optimization_number = 1) <- value 10 | } 11 | \arguments{ 12 | \item{map}{The acmap data object} 13 | 14 | \item{optimization_number}{The optimization run from which to get / set the data} 15 | 16 | \item{value}{New value to set} 17 | } 18 | \value{ 19 | Gets or sets map comments for the optimization run. 20 | } 21 | \description{ 22 | Get or set an optimization run comment 23 | } 24 | \seealso{ 25 | Other map optimization attribute functions: 26 | \code{\link{colBases}()}, 27 | \code{\link{mapDimensions}()}, 28 | \code{\link{mapStress}()}, 29 | \code{\link{mapTransformation}()}, 30 | \code{\link{ptBaseCoords}()}, 31 | \code{\link{ptCoords}()} 32 | } 33 | \concept{map optimization attribute functions} 34 | -------------------------------------------------------------------------------- /man/mapDescription.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{mapDescription} 4 | \alias{mapDescription} 5 | \alias{mapDescription<-} 6 | \title{Getting and setting the map description} 7 | \usage{ 8 | mapDescription(map) 9 | mapDescription(map) <- value 10 | } 11 | \arguments{ 12 | \item{map}{The acmap data object} 13 | 14 | \item{value}{New value to set} 15 | } 16 | \value{ 17 | Returns either the requested attribute when using a getter function or 18 | 19 | the updated acmap object when using the setter function. 20 | } 21 | \description{ 22 | Getting and setting the map description 23 | } 24 | \seealso{ 25 | Other map attribute functions: 26 | \code{\link{acmapAttributes}}, 27 | \code{\link{adjustedLogTiterTable}()}, 28 | \code{\link{adjustedTiterTable}()}, 29 | \code{\link{dilutionStepsize}()}, 30 | \code{\link{logtiterTableLayers}()}, 31 | \code{\link{mapName}()}, 32 | \code{\link{titerTableFlat}()}, 33 | \code{\link{titerTableLayers}()}, 34 | \code{\link{titerTable}()} 35 | } 36 | \concept{map attribute functions} 37 | -------------------------------------------------------------------------------- /man/mapDimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_optimizations.R 3 | \name{mapDimensions} 4 | \alias{mapDimensions} 5 | \title{Get the current map dimensions} 6 | \usage{ 7 | mapDimensions(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The optimization run from which to get / set the data} 13 | } 14 | \value{ 15 | Returns the number of dimensions for the optimization run. 16 | } 17 | \description{ 18 | Get the current map dimensions 19 | } 20 | \seealso{ 21 | Other map optimization attribute functions: 22 | \code{\link{colBases}()}, 23 | \code{\link{mapComment}()}, 24 | \code{\link{mapStress}()}, 25 | \code{\link{mapTransformation}()}, 26 | \code{\link{ptBaseCoords}()}, 27 | \code{\link{ptCoords}()} 28 | } 29 | \concept{map optimization attribute functions} 30 | -------------------------------------------------------------------------------- /man/mapDistances.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_stress.R 3 | \name{mapDistances} 4 | \alias{mapDistances} 5 | \title{Return calculated map distances for an acmap} 6 | \usage{ 7 | mapDistances(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The optimization number} 13 | } 14 | \value{ 15 | Returns a matrix of map distances with antigens as rows and sera as 16 | columns. 17 | } 18 | \description{ 19 | Takes the acmap object and calculates euclidean distances between antigens 20 | and sera for the currently selected or specified optimization. 21 | } 22 | \seealso{ 23 | Other map diagnostic functions: 24 | \code{\link{agCohesion}()}, 25 | \code{\link{bootstrapBlobs}()}, 26 | \code{\link{bootstrapMap}()}, 27 | \code{\link{checkHemisphering}()}, 28 | \code{\link{dimensionTestMap}()}, 29 | \code{\link{logtiterTable}()}, 30 | \code{\link{map-table-distances}}, 31 | \code{\link{mapBootstrapCoords}}, 32 | \code{\link{mapRelaxed}()}, 33 | \code{\link{mapResiduals}()}, 34 | \code{\link{pointStress}}, 35 | \code{\link{ptBootstrapBlob}}, 36 | \code{\link{ptBootstrapCoords}()}, 37 | \code{\link{ptLeverage}}, 38 | \code{\link{ptTriangulationBlob}}, 39 | \code{\link{recalculateStress}()}, 40 | \code{\link{stressTable}()}, 41 | \code{\link{tableColbases}()}, 42 | \code{\link{tableDistances}()}, 43 | \code{\link{triangulationBlobs}()}, 44 | \code{\link{unstableMaps}} 45 | 46 | Other functions relating to map stress calculation: 47 | \code{\link{logtiterTable}()}, 48 | \code{\link{mapResiduals}()}, 49 | \code{\link{pointStress}}, 50 | \code{\link{recalculateStress}()}, 51 | \code{\link{stressTable}()}, 52 | \code{\link{tableColbases}()}, 53 | \code{\link{tableDistances}()} 54 | } 55 | \concept{functions relating to map stress calculation} 56 | \concept{map diagnostic functions} 57 | -------------------------------------------------------------------------------- /man/mapGadget.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shiny_gadget.R 3 | \name{mapGadget} 4 | \alias{mapGadget} 5 | \title{Open a shiny gadget to view the map} 6 | \usage{ 7 | mapGadget(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object to open in the GUI} 11 | } 12 | \value{ 13 | No value returned, called for the side effect of starting the gadget. 14 | } 15 | \description{ 16 | This function is equivalent to running \code{runGUI()} and loading a map file, but this 17 | takes the acmap object to open as an input argument. 18 | } 19 | \seealso{ 20 | Other functions to view maps: 21 | \code{\link{RacViewer.options}()}, 22 | \code{\link{RacViewer}()}, 23 | \code{\link{export_viewer}()}, 24 | \code{\link{ggplot.acmap}()}, 25 | \code{\link{plot.acmap}()}, 26 | \code{\link{setLegend}()}, 27 | \code{\link{view.acmap}()}, 28 | \code{\link{view.default}()}, 29 | \code{\link{view}()} 30 | } 31 | \concept{functions to view maps} 32 | -------------------------------------------------------------------------------- /man/mapName.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{mapName} 4 | \alias{mapName} 5 | \alias{mapName<-} 6 | \title{Getting and setting the map name} 7 | \usage{ 8 | mapName(map) 9 | mapName(map) <- value 10 | } 11 | \arguments{ 12 | \item{map}{The acmap data object} 13 | 14 | \item{value}{New value to set} 15 | } 16 | \value{ 17 | Returns either the requested attribute when using a getter function or 18 | 19 | the updated acmap object when using the setter function. 20 | } 21 | \description{ 22 | Getting and setting the map name 23 | } 24 | \seealso{ 25 | Other map attribute functions: 26 | \code{\link{acmapAttributes}}, 27 | \code{\link{adjustedLogTiterTable}()}, 28 | \code{\link{adjustedTiterTable}()}, 29 | \code{\link{dilutionStepsize}()}, 30 | \code{\link{logtiterTableLayers}()}, 31 | \code{\link{mapDescription}()}, 32 | \code{\link{titerTableFlat}()}, 33 | \code{\link{titerTableLayers}()}, 34 | \code{\link{titerTable}()} 35 | } 36 | \concept{map attribute functions} 37 | -------------------------------------------------------------------------------- /man/mapRelaxed.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimize.R 3 | \name{mapRelaxed} 4 | \alias{mapRelaxed} 5 | \title{Check if a map has been fully relaxed} 6 | \usage{ 7 | mapRelaxed(map, optimization_number = 1, options = list()) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The map optimization number} 13 | 14 | \item{options}{List of named optimizer options, see \code{RacOptimizer.options()}} 15 | } 16 | \value{ 17 | Returns TRUE or FALSE 18 | } 19 | \description{ 20 | Checks if the map optimization run can be relaxed further. 21 | } 22 | \seealso{ 23 | Other map diagnostic functions: 24 | \code{\link{agCohesion}()}, 25 | \code{\link{bootstrapBlobs}()}, 26 | \code{\link{bootstrapMap}()}, 27 | \code{\link{checkHemisphering}()}, 28 | \code{\link{dimensionTestMap}()}, 29 | \code{\link{logtiterTable}()}, 30 | \code{\link{map-table-distances}}, 31 | \code{\link{mapBootstrapCoords}}, 32 | \code{\link{mapDistances}()}, 33 | \code{\link{mapResiduals}()}, 34 | \code{\link{pointStress}}, 35 | \code{\link{ptBootstrapBlob}}, 36 | \code{\link{ptBootstrapCoords}()}, 37 | \code{\link{ptLeverage}}, 38 | \code{\link{ptTriangulationBlob}}, 39 | \code{\link{recalculateStress}()}, 40 | \code{\link{stressTable}()}, 41 | \code{\link{tableColbases}()}, 42 | \code{\link{tableDistances}()}, 43 | \code{\link{triangulationBlobs}()}, 44 | \code{\link{unstableMaps}} 45 | } 46 | \concept{map diagnostic functions} 47 | -------------------------------------------------------------------------------- /man/mapStress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_optimizations.R 3 | \name{mapStress} 4 | \alias{mapStress} 5 | \title{Calculate the current map stress} 6 | \usage{ 7 | mapStress(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{optimization_number}{The optimization number for which to calculate stress} 13 | } 14 | \value{ 15 | A number giving the map stress 16 | } 17 | \description{ 18 | Calculate the current map stress 19 | } 20 | \seealso{ 21 | Other map optimization attribute functions: 22 | \code{\link{colBases}()}, 23 | \code{\link{mapComment}()}, 24 | \code{\link{mapDimensions}()}, 25 | \code{\link{mapTransformation}()}, 26 | \code{\link{ptBaseCoords}()}, 27 | \code{\link{ptCoords}()} 28 | } 29 | \concept{map optimization attribute functions} 30 | -------------------------------------------------------------------------------- /man/mapTransformation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_optimizations.R 3 | \name{mapTransformation} 4 | \alias{mapTransformation} 5 | \alias{mapTransformation<-} 6 | \alias{mapTranslation} 7 | \alias{mapTranslation<-} 8 | \title{Reading map transformation data} 9 | \usage{ 10 | mapTransformation(map, optimization_number = 1) 11 | mapTransformation(map, optimization_number = 1) <- value 12 | mapTranslation(map, optimization_number = 1) 13 | mapTranslation(map, optimization_number = 1) <- value 14 | } 15 | \arguments{ 16 | \item{map}{The acmap data object} 17 | 18 | \item{optimization_number}{The optimization run from which to get / set the data} 19 | 20 | \item{value}{New value to set} 21 | } 22 | \value{ 23 | Returns either the requested attribute when using a getter function or 24 | 25 | the updated acmap object when using the setter function. 26 | } 27 | \description{ 28 | These functions can be used to query and if necessary set the map 29 | transformation and map translation attributes for a given optimization run. 30 | } 31 | \seealso{ 32 | Other map optimization attribute functions: 33 | \code{\link{colBases}()}, 34 | \code{\link{mapComment}()}, 35 | \code{\link{mapDimensions}()}, 36 | \code{\link{mapStress}()}, 37 | \code{\link{ptBaseCoords}()}, 38 | \code{\link{ptCoords}()} 39 | } 40 | \concept{map optimization attribute functions} 41 | -------------------------------------------------------------------------------- /man/matchStrains.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_point_matching.R 3 | \name{matchStrains} 4 | \alias{matchStrains} 5 | \alias{match_mapAntigens} 6 | \alias{match_mapSera} 7 | \title{Find matching antigens or sera between 2 maps} 8 | \usage{ 9 | match_mapAntigens(map1, map2) 10 | 11 | match_mapSera(map1, map2) 12 | } 13 | \arguments{ 14 | \item{map1}{The map to match names from.} 15 | 16 | \item{map2}{The map to match names to.} 17 | } 18 | \value{ 19 | Returns the indices of matching strains in map 2, or NA in the 20 | position of strains not found. 21 | } 22 | \description{ 23 | Find matching antigens or sera between 2 maps 24 | } 25 | \seealso{ 26 | Other functions to compare maps: 27 | \code{\link{procrustesData}()}, 28 | \code{\link{procrustesMap}()}, 29 | \code{\link{realignMap}()}, 30 | \code{\link{realignOptimizations}()} 31 | } 32 | \concept{functions to compare maps} 33 | -------------------------------------------------------------------------------- /man/mergeReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_merge_report.R 3 | \name{mergeReport} 4 | \alias{mergeReport} 5 | \title{Return a merge report} 6 | \usage{ 7 | mergeReport(map) 8 | } 9 | \arguments{ 10 | \item{map}{An acmap object that was the result of merging several maps} 11 | } 12 | \value{ 13 | Returns a character matrix of information on merged titers. 14 | } 15 | \description{ 16 | Prints a raw text merge report from merging two map tables. 17 | } 18 | \seealso{ 19 | Other map merging functions: 20 | \code{\link{RacMerge.options}()}, 21 | \code{\link{htmlMergeReport}()}, 22 | \code{\link{mergeMaps}()}, 23 | \code{\link{splitTiterLayers}()} 24 | } 25 | \concept{map merging functions} 26 | -------------------------------------------------------------------------------- /man/optimizationProperties.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{optimizationProperties} 4 | \alias{optimizationProperties} 5 | \alias{allMapStresses} 6 | \alias{allMapDimensions} 7 | \title{Get optimization properties} 8 | \usage{ 9 | allMapStresses(map) 10 | 11 | allMapDimensions(map) 12 | } 13 | \arguments{ 14 | \item{map}{The acmap object} 15 | } 16 | \value{ 17 | A numeric vector of values 18 | } 19 | \description{ 20 | Utility functions to get a vector of all the map optimization 21 | properties. 22 | } 23 | \seealso{ 24 | Other functions to work with map optimizations: 25 | \code{\link{keepOptimizations}()}, 26 | \code{\link{removeOptimizations}()}, 27 | \code{\link{sortOptimizations}()} 28 | } 29 | \concept{functions to work with map optimizations} 30 | -------------------------------------------------------------------------------- /man/orderPoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_subset.R 3 | \name{orderPoints} 4 | \alias{orderPoints} 5 | \alias{orderAntigens} 6 | \alias{orderSera} 7 | \title{Order antigens and sera} 8 | \usage{ 9 | orderAntigens(map, order) 10 | 11 | orderSera(map, order) 12 | } 13 | \arguments{ 14 | \item{map}{The map data object} 15 | 16 | \item{order}{The new order of points} 17 | } 18 | \value{ 19 | An acmap object with points reordered 20 | } 21 | \description{ 22 | Functions to change the order of antigens and sera in a map 23 | } 24 | \seealso{ 25 | Other functions for working with map data: 26 | \code{\link{acmap}()}, 27 | \code{\link{addOptimization}()}, 28 | \code{\link{agReactivityAdjustments}()}, 29 | \code{\link{as.json}()}, 30 | \code{\link{edit_agNames}()}, 31 | \code{\link{edit_srNames}()}, 32 | \code{\link{keepBestOptimization}()}, 33 | \code{\link{keepSingleOptimization}()}, 34 | \code{\link{layerNames}()}, 35 | \code{\link{read.acmap}()}, 36 | \code{\link{read.titerTable}()}, 37 | \code{\link{removePoints}}, 38 | \code{\link{save.acmap}()}, 39 | \code{\link{save.coords}()}, 40 | \code{\link{save.titerTable}()}, 41 | \code{\link{subsetCommonPoints}}, 42 | \code{\link{subsetMap}()} 43 | } 44 | \concept{functions for working with map data} 45 | -------------------------------------------------------------------------------- /man/ptAnnotations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_antigens.R 3 | \name{ptAnnotations} 4 | \alias{ptAnnotations} 5 | \alias{agAnnotations} 6 | \alias{srAnnotations} 7 | \alias{agAnnotations<-} 8 | \alias{srAnnotations<-} 9 | \title{Getting and setting point annotation information} 10 | \usage{ 11 | agAnnotations(map) 12 | 13 | srAnnotations(map) 14 | 15 | agAnnotations(map) <- value 16 | 17 | srAnnotations(map) <- value 18 | } 19 | \arguments{ 20 | \item{map}{The acmap data object} 21 | 22 | \item{value}{A list of character vectors with annotations information for each 23 | point} 24 | } 25 | \value{ 26 | A character vector of point annotations. 27 | } 28 | \description{ 29 | Getting and setting point annotation information 30 | } 31 | \seealso{ 32 | Other antigen and sera attribute functions: 33 | \code{\link{agAttributes}}, 34 | \code{\link{agGroups}()}, 35 | \code{\link{agHomologousSr}()}, 36 | \code{\link{agLabIDs}()}, 37 | \code{\link{agSequences}()}, 38 | \code{\link{ptClades}}, 39 | \code{\link{srAttributes}}, 40 | \code{\link{srGroups}()}, 41 | \code{\link{srHomologousAgs}()}, 42 | \code{\link{srSequences}()} 43 | } 44 | \concept{antigen and sera attribute functions} 45 | -------------------------------------------------------------------------------- /man/ptBaseCoords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_optimizations.R 3 | \name{ptBaseCoords} 4 | \alias{ptBaseCoords} 5 | \alias{agBaseCoords} 6 | \alias{agBaseCoords<-} 7 | \alias{srBaseCoords} 8 | \alias{srBaseCoords<-} 9 | \title{Getting and setting base coordinates} 10 | \usage{ 11 | ptBaseCoords(map, optimization_number = 1) 12 | agBaseCoords(map, optimization_number = 1) 13 | agBaseCoords(map, optimization_number = 1) <- value 14 | srBaseCoords(map, optimization_number = 1) 15 | srBaseCoords(map, optimization_number = 1) <- value 16 | } 17 | \arguments{ 18 | \item{map}{The acmap data object} 19 | 20 | \item{optimization_number}{The optimization run from which to get / set the data} 21 | 22 | \item{value}{New value to set} 23 | } 24 | \value{ 25 | Returns either the requested attribute when using a getter function or 26 | 27 | the updated acmap object when using the setter function. 28 | } 29 | \description{ 30 | These functions get and set the base coordinates for a given optimization 31 | run. 32 | } 33 | \seealso{ 34 | \code{agCoords()} 35 | \code{srCoords()} 36 | 37 | Other map optimization attribute functions: 38 | \code{\link{colBases}()}, 39 | \code{\link{mapComment}()}, 40 | \code{\link{mapDimensions}()}, 41 | \code{\link{mapStress}()}, 42 | \code{\link{mapTransformation}()}, 43 | \code{\link{ptCoords}()} 44 | } 45 | \concept{map optimization attribute functions} 46 | -------------------------------------------------------------------------------- /man/ptBootstrapCoords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_diagnostics_bootstrap.R 3 | \name{ptBootstrapCoords} 4 | \alias{ptBootstrapCoords} 5 | \alias{agBootstrapCoords} 6 | \alias{srBootstrapCoords} 7 | \title{Get antigen or serum bootstrap coordinates information} 8 | \usage{ 9 | ptBootstrapCoords(map, point) 10 | 11 | agBootstrapCoords(map, antigen) 12 | 13 | srBootstrapCoords(map, serum) 14 | } 15 | \arguments{ 16 | \item{map}{An acmap object} 17 | 18 | \item{point}{The point from which to get the bootstrap coords (numbered 19 | antigens then sera)} 20 | 21 | \item{antigen}{The antigen to get the bootstrap coords} 22 | 23 | \item{serum}{The serum from which to get the bootstrap coords} 24 | } 25 | \value{ 26 | Returns a matrix of coordinates for the point in each of the 27 | bootstrap runs 28 | } 29 | \description{ 30 | Get antigen or serum bootstrap coordinates information 31 | } 32 | \seealso{ 33 | Other map diagnostic functions: 34 | \code{\link{agCohesion}()}, 35 | \code{\link{bootstrapBlobs}()}, 36 | \code{\link{bootstrapMap}()}, 37 | \code{\link{checkHemisphering}()}, 38 | \code{\link{dimensionTestMap}()}, 39 | \code{\link{logtiterTable}()}, 40 | \code{\link{map-table-distances}}, 41 | \code{\link{mapBootstrapCoords}}, 42 | \code{\link{mapDistances}()}, 43 | \code{\link{mapRelaxed}()}, 44 | \code{\link{mapResiduals}()}, 45 | \code{\link{pointStress}}, 46 | \code{\link{ptBootstrapBlob}}, 47 | \code{\link{ptLeverage}}, 48 | \code{\link{ptTriangulationBlob}}, 49 | \code{\link{recalculateStress}()}, 50 | \code{\link{stressTable}()}, 51 | \code{\link{tableColbases}()}, 52 | \code{\link{tableDistances}()}, 53 | \code{\link{triangulationBlobs}()}, 54 | \code{\link{unstableMaps}} 55 | } 56 | \concept{map diagnostic functions} 57 | -------------------------------------------------------------------------------- /man/ptClades.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_antigens.R 3 | \name{ptClades} 4 | \alias{ptClades} 5 | \alias{agClades} 6 | \alias{srClades} 7 | \alias{agClades<-} 8 | \alias{srClades<-} 9 | \title{Getting and setting point clade information} 10 | \usage{ 11 | agClades(map) 12 | 13 | srClades(map) 14 | 15 | agClades(map) <- value 16 | 17 | srClades(map) <- value 18 | } 19 | \arguments{ 20 | \item{map}{The acmap data object} 21 | 22 | \item{value}{A list of character vectors with clade information for each 23 | point} 24 | } 25 | \value{ 26 | A character vector of clade information. 27 | } 28 | \description{ 29 | Getting and setting point clade information 30 | } 31 | \seealso{ 32 | Other antigen and sera attribute functions: 33 | \code{\link{agAttributes}}, 34 | \code{\link{agGroups}()}, 35 | \code{\link{agHomologousSr}()}, 36 | \code{\link{agLabIDs}()}, 37 | \code{\link{agSequences}()}, 38 | \code{\link{ptAnnotations}}, 39 | \code{\link{srAttributes}}, 40 | \code{\link{srGroups}()}, 41 | \code{\link{srHomologousAgs}()}, 42 | \code{\link{srSequences}()} 43 | } 44 | \concept{antigen and sera attribute functions} 45 | -------------------------------------------------------------------------------- /man/ptDrawingOrder.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_plotspec.R 3 | \name{ptDrawingOrder} 4 | \alias{ptDrawingOrder} 5 | \alias{ptDrawingOrder<-} 6 | \title{Get and set point drawing order in map} 7 | \usage{ 8 | ptDrawingOrder(map) 9 | 10 | ptDrawingOrder(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{An acmap object} 14 | 15 | \item{value}{The point drawing order} 16 | } 17 | \value{ 18 | A numeric vector of point drawing order information 19 | } 20 | \description{ 21 | Point drawing order is a vector of indices defining the order in 22 | which points should be draw when plotting or viewing a map. Points 23 | are indexed in the same order as antigens then followed by 24 | sera. 25 | } 26 | \seealso{ 27 | Other map point style functions: 28 | \code{\link{applyPlotspec}()}, 29 | \code{\link{ptOpacity}}, 30 | \code{\link{ptStyles}} 31 | } 32 | \concept{map point style functions} 33 | -------------------------------------------------------------------------------- /man/ptOpacity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_plotspec.R 3 | \name{ptOpacity} 4 | \alias{ptOpacity} 5 | \alias{agOpacity<-} 6 | \alias{srOpacity<-} 7 | \title{Set point opacity in a map} 8 | \usage{ 9 | agOpacity(map) <- value 10 | 11 | srOpacity(map) <- value 12 | } 13 | \arguments{ 14 | \item{map}{An acmap object} 15 | 16 | \item{value}{A vector of opacities} 17 | } 18 | \value{ 19 | A numeric vector of point opacities. 20 | } 21 | \description{ 22 | These are helper functions to quickly set the opacity of points in a map, 23 | they set both the fill and outline color opacity by modifying the fill 24 | and outline colors to include an alpha channel for opacity. If you need 25 | more control, for example different opacities for the fill and outline 26 | colors, you alter the fill and outline opacities yourself, for example 27 | with the \code{grDevices::adjustcolor()} function. 28 | } 29 | \seealso{ 30 | Other map point style functions: 31 | \code{\link{applyPlotspec}()}, 32 | \code{\link{ptDrawingOrder}()}, 33 | \code{\link{ptStyles}} 34 | } 35 | \concept{map point style functions} 36 | -------------------------------------------------------------------------------- /man/randomizeCoords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimize.R 3 | \name{randomizeCoords} 4 | \alias{randomizeCoords} 5 | \title{Randomize map coordinates} 6 | \usage{ 7 | randomizeCoords(map, optimization_number = 1, table_dist_factor = 2) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The map optimization number to randomize} 13 | 14 | \item{table_dist_factor}{The expansion factor for the box size in which 15 | points are randomized.} 16 | } 17 | \value{ 18 | Returns an updated map object 19 | } 20 | \description{ 21 | Moves map coordinates back into random starting conditions, as performed 22 | before each optimization run. The maximum table distance is calculated 23 | then points are randomized in a box with side length equal to maximum 24 | table distance multiplied by \code{table_dist_factor} 25 | } 26 | \seealso{ 27 | Other map optimization functions: 28 | \code{\link{RacOptimizer.options}()}, 29 | \code{\link{make.acmap}()}, 30 | \code{\link{moveTrappedPoints}()}, 31 | \code{\link{optimizeMap}()}, 32 | \code{\link{relaxMapOneStep}()}, 33 | \code{\link{relaxMap}()} 34 | } 35 | \concept{map optimization functions} 36 | -------------------------------------------------------------------------------- /man/read.acmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_loadsave.R 3 | \name{read.acmap} 4 | \alias{read.acmap} 5 | \title{Read in acmap data from a file} 6 | \usage{ 7 | read.acmap( 8 | filename, 9 | optimization_number = NULL, 10 | sort_optimizations = FALSE, 11 | align_optimizations = FALSE 12 | ) 13 | } 14 | \arguments{ 15 | \item{filename}{Path to the file.} 16 | 17 | \item{optimization_number}{Numeric vector of optimization runs to keep, the 18 | default, NULL, keeps information on all optimization runs} 19 | 20 | \item{sort_optimizations}{Should optimizations be sorted in order of stress 21 | when the map data is read?} 22 | 23 | \item{align_optimizations}{Should optimizations be rotated and translated to 24 | match the orientation of the first optimization as closely as possible?} 25 | } 26 | \value{ 27 | Returns the acmap data object. 28 | } 29 | \description{ 30 | Reads an antigenic map file and converts it into an acmap data object. 31 | } 32 | \seealso{ 33 | Other functions for working with map data: 34 | \code{\link{acmap}()}, 35 | \code{\link{addOptimization}()}, 36 | \code{\link{agReactivityAdjustments}()}, 37 | \code{\link{as.json}()}, 38 | \code{\link{edit_agNames}()}, 39 | \code{\link{edit_srNames}()}, 40 | \code{\link{keepBestOptimization}()}, 41 | \code{\link{keepSingleOptimization}()}, 42 | \code{\link{layerNames}()}, 43 | \code{\link{orderPoints}}, 44 | \code{\link{read.titerTable}()}, 45 | \code{\link{removePoints}}, 46 | \code{\link{save.acmap}()}, 47 | \code{\link{save.coords}()}, 48 | \code{\link{save.titerTable}()}, 49 | \code{\link{subsetCommonPoints}}, 50 | \code{\link{subsetMap}()} 51 | } 52 | \concept{functions for working with map data} 53 | -------------------------------------------------------------------------------- /man/read.titerTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rac_process_titers.R 3 | \name{read.titerTable} 4 | \alias{read.titerTable} 5 | \title{Read in a table of titer data} 6 | \usage{ 7 | read.titerTable(filepath) 8 | } 9 | \arguments{ 10 | \item{filepath}{Path to the table of titer data} 11 | } 12 | \value{ 13 | Returns a matrix of titers. 14 | } 15 | \description{ 16 | Reads in a table of titer data, converting it to a matrix of titers with 17 | labelled column and row names. Missing titers should be represented by an 18 | asterisk character. 19 | } 20 | \details{ 21 | Currently supported file formats are .csv and .xls and .txt 22 | } 23 | \seealso{ 24 | Other functions for working with map data: 25 | \code{\link{acmap}()}, 26 | \code{\link{addOptimization}()}, 27 | \code{\link{agReactivityAdjustments}()}, 28 | \code{\link{as.json}()}, 29 | \code{\link{edit_agNames}()}, 30 | \code{\link{edit_srNames}()}, 31 | \code{\link{keepBestOptimization}()}, 32 | \code{\link{keepSingleOptimization}()}, 33 | \code{\link{layerNames}()}, 34 | \code{\link{orderPoints}}, 35 | \code{\link{read.acmap}()}, 36 | \code{\link{removePoints}}, 37 | \code{\link{save.acmap}()}, 38 | \code{\link{save.coords}()}, 39 | \code{\link{save.titerTable}()}, 40 | \code{\link{subsetCommonPoints}}, 41 | \code{\link{subsetMap}()} 42 | } 43 | \concept{functions for working with map data} 44 | -------------------------------------------------------------------------------- /man/realignMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_procrustes.R 3 | \name{realignMap} 4 | \alias{realignMap} 5 | \title{Realign map to match another} 6 | \usage{ 7 | realignMap(map, target_map, translation = TRUE, scaling = FALSE) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap to realign.} 11 | 12 | \item{target_map}{The acmap to realign to.} 13 | 14 | \item{translation}{Should translation be allowed} 15 | 16 | \item{scaling}{Should scaling be allowed (generally not recommended unless 17 | comparing maps made with different assays)} 18 | } 19 | \value{ 20 | Returns a map object aligned to the target map 21 | } 22 | \description{ 23 | Realigns the coordinates of a map to match a target map as closely as 24 | possible, based on a 25 | \href{https://en.wikipedia.org/wiki/Procrustes_analysis}{procrustes analysis}. 26 | Note that all optimization runs will be separately aligned to match as 27 | closely as possible the first optimization run of the target map. 28 | } 29 | \seealso{ 30 | Other functions to compare maps: 31 | \code{\link{matchStrains}}, 32 | \code{\link{procrustesData}()}, 33 | \code{\link{procrustesMap}()}, 34 | \code{\link{realignOptimizations}()} 35 | } 36 | \concept{functions to compare maps} 37 | -------------------------------------------------------------------------------- /man/realignOptimizations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_procrustes.R 3 | \name{realignOptimizations} 4 | \alias{realignOptimizations} 5 | \title{Realigns optimizations in the map} 6 | \usage{ 7 | realignOptimizations(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | } 12 | \value{ 13 | Returns the map with realigned optimizations 14 | } 15 | \description{ 16 | Realigns all map optimizations through rotation and translation to match 17 | point positions as closely as possible to the first optimization run. This 18 | is done by default when optimizing a map and makes comparing point positions 19 | in each optimization run much easier to do by eye. 20 | } 21 | \seealso{ 22 | Other functions to compare maps: 23 | \code{\link{matchStrains}}, 24 | \code{\link{procrustesData}()}, 25 | \code{\link{procrustesMap}()}, 26 | \code{\link{realignMap}()} 27 | } 28 | \concept{functions to compare maps} 29 | -------------------------------------------------------------------------------- /man/recalculateStress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_stress.R 3 | \name{recalculateStress} 4 | \alias{recalculateStress} 5 | \title{Recalculate the stress associated with an acmap optimization} 6 | \usage{ 7 | recalculateStress(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object} 11 | 12 | \item{optimization_number}{The optimization number} 13 | } 14 | \value{ 15 | Returns the recalculated map stress for a given optimization 16 | } 17 | \description{ 18 | Recalculates the stress associated with the currently selected or 19 | user-specified optimization. 20 | } 21 | \seealso{ 22 | See \code{pointStress()} for getting the stress of individual points. 23 | 24 | Other map diagnostic functions: 25 | \code{\link{agCohesion}()}, 26 | \code{\link{bootstrapBlobs}()}, 27 | \code{\link{bootstrapMap}()}, 28 | \code{\link{checkHemisphering}()}, 29 | \code{\link{dimensionTestMap}()}, 30 | \code{\link{logtiterTable}()}, 31 | \code{\link{map-table-distances}}, 32 | \code{\link{mapBootstrapCoords}}, 33 | \code{\link{mapDistances}()}, 34 | \code{\link{mapRelaxed}()}, 35 | \code{\link{mapResiduals}()}, 36 | \code{\link{pointStress}}, 37 | \code{\link{ptBootstrapBlob}}, 38 | \code{\link{ptBootstrapCoords}()}, 39 | \code{\link{ptLeverage}}, 40 | \code{\link{ptTriangulationBlob}}, 41 | \code{\link{stressTable}()}, 42 | \code{\link{tableColbases}()}, 43 | \code{\link{tableDistances}()}, 44 | \code{\link{triangulationBlobs}()}, 45 | \code{\link{unstableMaps}} 46 | 47 | Other functions relating to map stress calculation: 48 | \code{\link{logtiterTable}()}, 49 | \code{\link{mapDistances}()}, 50 | \code{\link{mapResiduals}()}, 51 | \code{\link{pointStress}}, 52 | \code{\link{stressTable}()}, 53 | \code{\link{tableColbases}()}, 54 | \code{\link{tableDistances}()} 55 | } 56 | \concept{functions relating to map stress calculation} 57 | \concept{map diagnostic functions} 58 | -------------------------------------------------------------------------------- /man/reflectMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_transformation.R 3 | \name{reflectMap} 4 | \alias{reflectMap} 5 | \title{Reflect a map} 6 | \usage{ 7 | reflectMap(map, axis = "x", optimization_number = NULL) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{axis}{Axis of reflection} 13 | 14 | \item{optimization_number}{The optimization number (or NULL to apply to all 15 | optimizations)} 16 | } 17 | \value{ 18 | An acmap object with reflection applied 19 | } 20 | \description{ 21 | Reflects map coordinates 22 | } 23 | \seealso{ 24 | Other functions relating to map transformation: 25 | \code{\link{applyMapTransform}()}, 26 | \code{\link{rotateMap}()}, 27 | \code{\link{translateMap}()} 28 | } 29 | \concept{functions relating to map transformation} 30 | -------------------------------------------------------------------------------- /man/relaxMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimize.R 3 | \name{relaxMap} 4 | \alias{relaxMap} 5 | \title{Relax a map} 6 | \usage{ 7 | relaxMap( 8 | map, 9 | optimization_number = 1, 10 | fixed_antigens = FALSE, 11 | fixed_sera = FALSE, 12 | titer_weights = NULL, 13 | options = list() 14 | ) 15 | } 16 | \arguments{ 17 | \item{map}{The acmap object} 18 | 19 | \item{optimization_number}{The optimization number to relax} 20 | 21 | \item{fixed_antigens}{Antigens to set fixed positions for when relaxing} 22 | 23 | \item{fixed_sera}{Sera to set fixed positions for when relaxing} 24 | 25 | \item{titer_weights}{An optional matrix of weights to assign each titer when optimizing} 26 | 27 | \item{options}{List of named optimizer options, see \code{RacOptimizer.options()}} 28 | } 29 | \value{ 30 | Returns an acmap object with the optimization relaxed. 31 | } 32 | \description{ 33 | Optimize antigen and serum positions starting from their current coordinates 34 | in the selected or specified optimization. 35 | } 36 | \seealso{ 37 | See \code{optimizeMap()} for performing new optimization runs from random 38 | starting coordinates. 39 | 40 | Other map optimization functions: 41 | \code{\link{RacOptimizer.options}()}, 42 | \code{\link{make.acmap}()}, 43 | \code{\link{moveTrappedPoints}()}, 44 | \code{\link{optimizeMap}()}, 45 | \code{\link{randomizeCoords}()}, 46 | \code{\link{relaxMapOneStep}()} 47 | } 48 | \concept{map optimization functions} 49 | -------------------------------------------------------------------------------- /man/relaxMapOneStep.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_optimize.R 3 | \name{relaxMapOneStep} 4 | \alias{relaxMapOneStep} 5 | \title{Relax a map one step in the optimiser} 6 | \usage{ 7 | relaxMapOneStep( 8 | map, 9 | optimization_number = 1, 10 | fixed_antigens = FALSE, 11 | fixed_sera = FALSE, 12 | options = list() 13 | ) 14 | } 15 | \arguments{ 16 | \item{map}{The acmap data object} 17 | 18 | \item{optimization_number}{The map optimization number} 19 | 20 | \item{fixed_antigens}{Antigens to set fixed positions for when relaxing} 21 | 22 | \item{fixed_sera}{Sera to set fixed positions for when relaxing} 23 | 24 | \item{options}{List of named optimizer options, see \code{RacOptimizer.options()}} 25 | } 26 | \value{ 27 | Returns an updated map object 28 | } 29 | \description{ 30 | Relax a map one step in the optimiser 31 | } 32 | \seealso{ 33 | Other map optimization functions: 34 | \code{\link{RacOptimizer.options}()}, 35 | \code{\link{make.acmap}()}, 36 | \code{\link{moveTrappedPoints}()}, 37 | \code{\link{optimizeMap}()}, 38 | \code{\link{randomizeCoords}()}, 39 | \code{\link{relaxMap}()} 40 | } 41 | \concept{map optimization functions} 42 | -------------------------------------------------------------------------------- /man/removeOptimizations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{removeOptimizations} 4 | \alias{removeOptimizations} 5 | \title{Remove map optimizations} 6 | \usage{ 7 | removeOptimizations(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | } 12 | \value{ 13 | An acmap object with all optimizations removed 14 | } 15 | \description{ 16 | Remove all optimization run data from a map object 17 | } 18 | \seealso{ 19 | Other functions to work with map optimizations: 20 | \code{\link{keepOptimizations}()}, 21 | \code{\link{optimizationProperties}}, 22 | \code{\link{sortOptimizations}()} 23 | } 24 | \concept{functions to work with map optimizations} 25 | -------------------------------------------------------------------------------- /man/removePoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_subset.R 3 | \name{removePoints} 4 | \alias{removePoints} 5 | \alias{removeAntigens} 6 | \alias{removeSera} 7 | \title{Remove antigens and sera} 8 | \usage{ 9 | removeAntigens(map, antigens) 10 | 11 | removeSera(map, sera) 12 | } 13 | \arguments{ 14 | \item{map}{The map data object} 15 | 16 | \item{antigens}{Antigens to remove (specified by name or index)} 17 | 18 | \item{sera}{Sera to remove (specified by name or index)} 19 | } 20 | \value{ 21 | An acmap object with points removed 22 | } 23 | \description{ 24 | Functions to remove antigens and sera from a map 25 | } 26 | \seealso{ 27 | Other functions for working with map data: 28 | \code{\link{acmap}()}, 29 | \code{\link{addOptimization}()}, 30 | \code{\link{agReactivityAdjustments}()}, 31 | \code{\link{as.json}()}, 32 | \code{\link{edit_agNames}()}, 33 | \code{\link{edit_srNames}()}, 34 | \code{\link{keepBestOptimization}()}, 35 | \code{\link{keepSingleOptimization}()}, 36 | \code{\link{layerNames}()}, 37 | \code{\link{orderPoints}}, 38 | \code{\link{read.acmap}()}, 39 | \code{\link{read.titerTable}()}, 40 | \code{\link{save.acmap}()}, 41 | \code{\link{save.coords}()}, 42 | \code{\link{save.titerTable}()}, 43 | \code{\link{subsetCommonPoints}}, 44 | \code{\link{subsetMap}()} 45 | } 46 | \concept{functions for working with map data} 47 | -------------------------------------------------------------------------------- /man/rotateMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_transformation.R 3 | \name{rotateMap} 4 | \alias{rotateMap} 5 | \title{Rotate a map} 6 | \usage{ 7 | rotateMap(map, degrees, axis = NULL, optimization_number = NULL) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{degrees}{Degrees of rotation} 13 | 14 | \item{axis}{Axis of rotation (if 3D), specified as "x", "y", or "z"} 15 | 16 | \item{optimization_number}{The optimization number (or NULL to apply to all 17 | optimizations)} 18 | } 19 | \value{ 20 | An acmap object with rotation applied 21 | } 22 | \description{ 23 | Apply a rotation to an antigenic map 24 | } 25 | \seealso{ 26 | Other functions relating to map transformation: 27 | \code{\link{applyMapTransform}()}, 28 | \code{\link{reflectMap}()}, 29 | \code{\link{translateMap}()} 30 | } 31 | \concept{functions relating to map transformation} 32 | -------------------------------------------------------------------------------- /man/runGUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GUI.R 3 | \name{runGUI} 4 | \alias{runGUI} 5 | \title{Open the Racmacs GUI} 6 | \usage{ 7 | runGUI() 8 | } 9 | \value{ 10 | Nothing returned, called only for the side effect of starting the viewer. 11 | } 12 | \description{ 13 | This function opens the Racmacs GUI in a new window 14 | } 15 | \seealso{ 16 | Other shiny app functions: 17 | \code{\link{RacViewer-shiny}}, 18 | \code{\link{view.acmap}()} 19 | } 20 | \concept{shiny app functions} 21 | -------------------------------------------------------------------------------- /man/save.acmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_loadsave.R 3 | \name{save.acmap} 4 | \alias{save.acmap} 5 | \title{Save acmap data to a file} 6 | \usage{ 7 | save.acmap( 8 | map, 9 | filename, 10 | compress = FALSE, 11 | pretty = !compress, 12 | round_titers = FALSE 13 | ) 14 | } 15 | \arguments{ 16 | \item{map}{The acmap data object.} 17 | 18 | \item{filename}{Path to the file.} 19 | 20 | \item{compress}{Should the file be xz compressed} 21 | 22 | \item{pretty}{Should json be output prettily with new lines and indentation} 23 | 24 | \item{round_titers}{Should titers be rounded when outputted (this is needed 25 | for acmacs web and lispmds compatibility)} 26 | } 27 | \value{ 28 | No return value, called for the side effect of saving the map data 29 | to the file. 30 | } 31 | \description{ 32 | Save acmap data to a file. The preferred extension is ".ace", although 33 | the format of the file will be a json file of map data compressed using 34 | 'xz' compression. 35 | } 36 | \seealso{ 37 | Other functions for working with map data: 38 | \code{\link{acmap}()}, 39 | \code{\link{addOptimization}()}, 40 | \code{\link{agReactivityAdjustments}()}, 41 | \code{\link{as.json}()}, 42 | \code{\link{edit_agNames}()}, 43 | \code{\link{edit_srNames}()}, 44 | \code{\link{keepBestOptimization}()}, 45 | \code{\link{keepSingleOptimization}()}, 46 | \code{\link{layerNames}()}, 47 | \code{\link{orderPoints}}, 48 | \code{\link{read.acmap}()}, 49 | \code{\link{read.titerTable}()}, 50 | \code{\link{removePoints}}, 51 | \code{\link{save.coords}()}, 52 | \code{\link{save.titerTable}()}, 53 | \code{\link{subsetCommonPoints}}, 54 | \code{\link{subsetMap}()} 55 | } 56 | \concept{functions for working with map data} 57 | -------------------------------------------------------------------------------- /man/save.coords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_loadsave.R 3 | \name{save.coords} 4 | \alias{save.coords} 5 | \title{Save acmap coordinate data to a file} 6 | \usage{ 7 | save.coords( 8 | map, 9 | filename, 10 | optimization_number = 1, 11 | antigens = TRUE, 12 | sera = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{map}{The acmap data object.} 17 | 18 | \item{filename}{Path to the file.} 19 | 20 | \item{optimization_number}{Optimization number from which to take coordinates} 21 | 22 | \item{antigens}{Antigens to include, either as a numeric vector of indices or 23 | character vector of names.} 24 | 25 | \item{sera}{Sera to include, either as a numeric vector of indices or 26 | character vector of names.} 27 | } 28 | \value{ 29 | No return value, called for the side effect of saving the 30 | coordinate data. 31 | } 32 | \description{ 33 | Saves acmap coordinate data of all or specified antigens and sera to a .csv 34 | file. 35 | } 36 | \seealso{ 37 | Other functions for working with map data: 38 | \code{\link{acmap}()}, 39 | \code{\link{addOptimization}()}, 40 | \code{\link{agReactivityAdjustments}()}, 41 | \code{\link{as.json}()}, 42 | \code{\link{edit_agNames}()}, 43 | \code{\link{edit_srNames}()}, 44 | \code{\link{keepBestOptimization}()}, 45 | \code{\link{keepSingleOptimization}()}, 46 | \code{\link{layerNames}()}, 47 | \code{\link{orderPoints}}, 48 | \code{\link{read.acmap}()}, 49 | \code{\link{read.titerTable}()}, 50 | \code{\link{removePoints}}, 51 | \code{\link{save.acmap}()}, 52 | \code{\link{save.titerTable}()}, 53 | \code{\link{subsetCommonPoints}}, 54 | \code{\link{subsetMap}()} 55 | } 56 | \concept{functions for working with map data} 57 | -------------------------------------------------------------------------------- /man/save.titerTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_loadsave.R 3 | \name{save.titerTable} 4 | \alias{save.titerTable} 5 | \title{Save titer data to a file} 6 | \usage{ 7 | save.titerTable(map, filename, antigens = TRUE, sera = TRUE) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap data object.} 11 | 12 | \item{filename}{Path to the file.} 13 | 14 | \item{antigens}{Antigens to include, either as a numeric vector of indices or 15 | character vector of names.} 16 | 17 | \item{sera}{Sera to include, either as a numeric vector of indices or 18 | character vector of names.} 19 | } 20 | \value{ 21 | No return value, called for the side effect of saving the titer 22 | data to the file. 23 | } 24 | \description{ 25 | Saves titer data of all or specified antigens and sera to a .csv file. 26 | } 27 | \seealso{ 28 | Other functions for working with map data: 29 | \code{\link{acmap}()}, 30 | \code{\link{addOptimization}()}, 31 | \code{\link{agReactivityAdjustments}()}, 32 | \code{\link{as.json}()}, 33 | \code{\link{edit_agNames}()}, 34 | \code{\link{edit_srNames}()}, 35 | \code{\link{keepBestOptimization}()}, 36 | \code{\link{keepSingleOptimization}()}, 37 | \code{\link{layerNames}()}, 38 | \code{\link{orderPoints}}, 39 | \code{\link{read.acmap}()}, 40 | \code{\link{read.titerTable}()}, 41 | \code{\link{removePoints}}, 42 | \code{\link{save.acmap}()}, 43 | \code{\link{save.coords}()}, 44 | \code{\link{subsetCommonPoints}}, 45 | \code{\link{subsetMap}()} 46 | } 47 | \concept{functions for working with map data} 48 | -------------------------------------------------------------------------------- /man/setLegend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_legend.R 3 | \name{setLegend} 4 | \alias{setLegend} 5 | \title{Set acmap legend} 6 | \usage{ 7 | setLegend(map, legend, fill, style.bottom = "8px", style.right = "8px") 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{legend}{A character vector of legend labels} 13 | 14 | \item{fill}{The fill color to be used with the boxes that appear alongside 15 | the legend labels} 16 | 17 | \item{style.bottom}{"bottom" style of the div, specifying how far from the 18 | bottom of the viewport the bottom of the legend is spaced.} 19 | 20 | \item{style.right}{"right" style of the div, specifying how far from the 21 | right of the viewport the bottom of the legend is spaced.} 22 | } 23 | \value{ 24 | Returns the updated acmap object 25 | } 26 | \description{ 27 | This sets the acmap legend used when viewing a map for example. 28 | } 29 | \seealso{ 30 | Other functions to view maps: 31 | \code{\link{RacViewer.options}()}, 32 | \code{\link{RacViewer}()}, 33 | \code{\link{export_viewer}()}, 34 | \code{\link{ggplot.acmap}()}, 35 | \code{\link{mapGadget}()}, 36 | \code{\link{plot.acmap}()}, 37 | \code{\link{view.acmap}()}, 38 | \code{\link{view.default}()}, 39 | \code{\link{view}()} 40 | } 41 | \concept{functions to view maps} 42 | -------------------------------------------------------------------------------- /man/sortOptimizations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{sortOptimizations} 4 | \alias{sortOptimizations} 5 | \title{Sort optimizations by stress} 6 | \usage{ 7 | sortOptimizations(map) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | } 12 | \value{ 13 | An acmap object with optimizations sorted by stress. 14 | } 15 | \description{ 16 | Sorts all the optimization runs for a given map object by stress 17 | (lowest to highest). Note that this is done by default when running 18 | \code{optimizeMap()}. 19 | } 20 | \seealso{ 21 | Other functions to work with map optimizations: 22 | \code{\link{keepOptimizations}()}, 23 | \code{\link{optimizationProperties}}, 24 | \code{\link{removeOptimizations}()} 25 | } 26 | \concept{functions to work with map optimizations} 27 | -------------------------------------------------------------------------------- /man/splitTiterLayers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_merge.R 3 | \name{splitTiterLayers} 4 | \alias{splitTiterLayers} 5 | \title{Split a map made up from titer layers into a list of separate maps each with a titer table 6 | corresponding to one of the layers} 7 | \usage{ 8 | splitTiterLayers(map) 9 | } 10 | \arguments{ 11 | \item{map}{An acmap object with titer table layers} 12 | } 13 | \value{ 14 | A list of acmap objects 15 | } 16 | \description{ 17 | Split a map made up from titer layers into a list of separate maps each with a titer table 18 | corresponding to one of the layers 19 | } 20 | \seealso{ 21 | Other map merging functions: 22 | \code{\link{RacMerge.options}()}, 23 | \code{\link{htmlMergeReport}()}, 24 | \code{\link{mergeMaps}()}, 25 | \code{\link{mergeReport}()} 26 | } 27 | \concept{map merging functions} 28 | -------------------------------------------------------------------------------- /man/srGroups.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_sera.R 3 | \name{srGroups} 4 | \alias{srGroups} 5 | \alias{srGroups<-} 6 | \title{Getting and setting sera groups} 7 | \usage{ 8 | srGroups(map) 9 | 10 | srGroups(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A character or factor vector of groupings to apply to the sera} 16 | } 17 | \value{ 18 | A factor vector of serum groups 19 | } 20 | \description{ 21 | These functions get and set the sera groupings for a map. 22 | } 23 | \seealso{ 24 | Other antigen and sera attribute functions: 25 | \code{\link{agAttributes}}, 26 | \code{\link{agGroups}()}, 27 | \code{\link{agHomologousSr}()}, 28 | \code{\link{agLabIDs}()}, 29 | \code{\link{agSequences}()}, 30 | \code{\link{ptAnnotations}}, 31 | \code{\link{ptClades}}, 32 | \code{\link{srAttributes}}, 33 | \code{\link{srHomologousAgs}()}, 34 | \code{\link{srSequences}()} 35 | } 36 | \concept{antigen and sera attribute functions} 37 | -------------------------------------------------------------------------------- /man/srHomologousAgs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_sera.R 3 | \name{srHomologousAgs} 4 | \alias{srHomologousAgs} 5 | \alias{srHomologousAgs<-} 6 | \title{Get and set homologous antigens for sera} 7 | \usage{ 8 | srHomologousAgs(map) 9 | 10 | srHomologousAgs(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{An acmap object} 14 | 15 | \item{value}{A list, where each entry is a vector of indices for homologous 16 | antigens, or a length 0 vector where no homologous antigen is present} 17 | } 18 | \value{ 19 | A list, where each entry is a vector of indices for homologous 20 | antigens, or a length 0 vector where no homologous antigen is present. 21 | } 22 | \description{ 23 | Get and set indices of homologous antigens to sera in an antigenic map 24 | } 25 | \seealso{ 26 | Other antigen and sera attribute functions: 27 | \code{\link{agAttributes}}, 28 | \code{\link{agGroups}()}, 29 | \code{\link{agHomologousSr}()}, 30 | \code{\link{agLabIDs}()}, 31 | \code{\link{agSequences}()}, 32 | \code{\link{ptAnnotations}}, 33 | \code{\link{ptClades}}, 34 | \code{\link{srAttributes}}, 35 | \code{\link{srGroups}()}, 36 | \code{\link{srSequences}()} 37 | } 38 | \concept{antigen and sera attribute functions} 39 | -------------------------------------------------------------------------------- /man/srSequences.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props_points_sera.R 3 | \name{srSequences} 4 | \alias{srSequences} 5 | \alias{srSequences<-} 6 | \alias{srNucleotideSequences} 7 | \alias{srNucleotideSequences<-} 8 | \title{Getting and setting sera sequence information} 9 | \usage{ 10 | srSequences(map, missing_value = ".") 11 | 12 | srSequences(map) <- value 13 | 14 | srNucleotideSequences(map, missing_value = ".") 15 | 16 | srNucleotideSequences(map) <- value 17 | } 18 | \arguments{ 19 | \item{map}{The acmap data object} 20 | 21 | \item{missing_value}{Character to use to fill in portions of the sequence matrix 22 | where sequence data is missing.} 23 | 24 | \item{value}{A character matrix of sequences with rows equal to the number of 25 | sera} 26 | } 27 | \value{ 28 | A character matrix of sequences with rows equal to the number of 29 | sera. 30 | } 31 | \description{ 32 | Getting and setting sera sequence information 33 | } 34 | \seealso{ 35 | Other antigen and sera attribute functions: 36 | \code{\link{agAttributes}}, 37 | \code{\link{agGroups}()}, 38 | \code{\link{agHomologousSr}()}, 39 | \code{\link{agLabIDs}()}, 40 | \code{\link{agSequences}()}, 41 | \code{\link{ptAnnotations}}, 42 | \code{\link{ptClades}}, 43 | \code{\link{srAttributes}}, 44 | \code{\link{srGroups}()}, 45 | \code{\link{srHomologousAgs}()} 46 | } 47 | \concept{antigen and sera attribute functions} 48 | -------------------------------------------------------------------------------- /man/standardizeStrainNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rac_normaliseNames.R 3 | \name{standardizeStrainNames} 4 | \alias{standardizeStrainNames} 5 | \title{Standardize strain names} 6 | \usage{ 7 | standardizeStrainNames( 8 | names, 9 | default_species = NA, 10 | default_virus_type = "A", 11 | default_virus_subtype = "HXNX" 12 | ) 13 | } 14 | \arguments{ 15 | \item{names}{Strain names to be standardised} 16 | 17 | \item{default_species}{Are the strains isolated from a particular species?} 18 | 19 | \item{default_virus_type}{Default virus type to be used (if no type found in 20 | name)} 21 | 22 | \item{default_virus_subtype}{Default virus subtype to be used (if no subtype 23 | found in name)} 24 | } 25 | \value{ 26 | Returns a tibble of standardised names and extracted information 27 | } 28 | \description{ 29 | This is a utility function to help standardise antigen names into a more 30 | consistent format, also attempting to break apart different components 31 | of the name. 32 | } 33 | -------------------------------------------------------------------------------- /man/stressTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_stress.R 3 | \name{stressTable} 4 | \alias{stressTable} 5 | \title{Get a stress table from an acmap} 6 | \usage{ 7 | stressTable(map, optimization_number = 1) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{optimization_number}{The optimization number for which to calculate 13 | stresses} 14 | } 15 | \value{ 16 | Returns a matrix of stresses, showing how much each antigen and sera 17 | measurement contributes to stress in the selected or specified 18 | optimization. 19 | } 20 | \description{ 21 | Get a stress table from an acmap 22 | } 23 | \seealso{ 24 | Other map diagnostic functions: 25 | \code{\link{agCohesion}()}, 26 | \code{\link{bootstrapBlobs}()}, 27 | \code{\link{bootstrapMap}()}, 28 | \code{\link{checkHemisphering}()}, 29 | \code{\link{dimensionTestMap}()}, 30 | \code{\link{logtiterTable}()}, 31 | \code{\link{map-table-distances}}, 32 | \code{\link{mapBootstrapCoords}}, 33 | \code{\link{mapDistances}()}, 34 | \code{\link{mapRelaxed}()}, 35 | \code{\link{mapResiduals}()}, 36 | \code{\link{pointStress}}, 37 | \code{\link{ptBootstrapBlob}}, 38 | \code{\link{ptBootstrapCoords}()}, 39 | \code{\link{ptLeverage}}, 40 | \code{\link{ptTriangulationBlob}}, 41 | \code{\link{recalculateStress}()}, 42 | \code{\link{tableColbases}()}, 43 | \code{\link{tableDistances}()}, 44 | \code{\link{triangulationBlobs}()}, 45 | \code{\link{unstableMaps}} 46 | 47 | Other functions relating to map stress calculation: 48 | \code{\link{logtiterTable}()}, 49 | \code{\link{mapDistances}()}, 50 | \code{\link{mapResiduals}()}, 51 | \code{\link{pointStress}}, 52 | \code{\link{recalculateStress}()}, 53 | \code{\link{tableColbases}()}, 54 | \code{\link{tableDistances}()} 55 | } 56 | \concept{functions relating to map stress calculation} 57 | \concept{map diagnostic functions} 58 | -------------------------------------------------------------------------------- /man/subsetCommonPoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_subset.R 3 | \name{subsetCommonPoints} 4 | \alias{subsetCommonPoints} 5 | \alias{subsetCommonAgs} 6 | \alias{subsetCommonSrGroups} 7 | \title{Remove antigens and sera} 8 | \usage{ 9 | subsetCommonAgs(maps) 10 | 11 | subsetCommonSrGroups(maps) 12 | } 13 | \arguments{ 14 | \item{maps}{A list of map data objects} 15 | } 16 | \description{ 17 | Functions to subset a list of maps to include only antigens, antigen groups, sera 18 | or serum groups that are in common between them. 19 | } 20 | \seealso{ 21 | Other functions for working with map data: 22 | \code{\link{acmap}()}, 23 | \code{\link{addOptimization}()}, 24 | \code{\link{agReactivityAdjustments}()}, 25 | \code{\link{as.json}()}, 26 | \code{\link{edit_agNames}()}, 27 | \code{\link{edit_srNames}()}, 28 | \code{\link{keepBestOptimization}()}, 29 | \code{\link{keepSingleOptimization}()}, 30 | \code{\link{layerNames}()}, 31 | \code{\link{orderPoints}}, 32 | \code{\link{read.acmap}()}, 33 | \code{\link{read.titerTable}()}, 34 | \code{\link{removePoints}}, 35 | \code{\link{save.acmap}()}, 36 | \code{\link{save.coords}()}, 37 | \code{\link{save.titerTable}()}, 38 | \code{\link{subsetMap}()} 39 | } 40 | \concept{functions for working with map data} 41 | -------------------------------------------------------------------------------- /man/subsetMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_subset.R 3 | \name{subsetMap} 4 | \alias{subsetMap} 5 | \title{Subset an antigenic map} 6 | \usage{ 7 | subsetMap(map, antigens = TRUE, sera = TRUE) 8 | } 9 | \arguments{ 10 | \item{map}{The antigenic map object} 11 | 12 | \item{antigens}{Antigens to keep, defaults to all.} 13 | 14 | \item{sera}{Sera to keep, defaults to all.} 15 | } 16 | \value{ 17 | Returns a new antigenic map containing only match antigens and sera 18 | } 19 | \description{ 20 | Subset an antigenic map to contain only specified antigens and sera 21 | } 22 | \seealso{ 23 | Other functions for working with map data: 24 | \code{\link{acmap}()}, 25 | \code{\link{addOptimization}()}, 26 | \code{\link{agReactivityAdjustments}()}, 27 | \code{\link{as.json}()}, 28 | \code{\link{edit_agNames}()}, 29 | \code{\link{edit_srNames}()}, 30 | \code{\link{keepBestOptimization}()}, 31 | \code{\link{keepSingleOptimization}()}, 32 | \code{\link{layerNames}()}, 33 | \code{\link{orderPoints}}, 34 | \code{\link{read.acmap}()}, 35 | \code{\link{read.titerTable}()}, 36 | \code{\link{removePoints}}, 37 | \code{\link{save.acmap}()}, 38 | \code{\link{save.coords}()}, 39 | \code{\link{save.titerTable}()}, 40 | \code{\link{subsetCommonPoints}} 41 | } 42 | \concept{functions for working with map data} 43 | -------------------------------------------------------------------------------- /man/titerTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{titerTable} 4 | \alias{titerTable} 5 | \alias{titerTable<-} 6 | \title{Getting and setting map titers} 7 | \usage{ 8 | titerTable(map) 9 | 10 | titerTable(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A character matrix of titers to set} 16 | } 17 | \value{ 18 | Returns a character matrix of titers. 19 | } 20 | \description{ 21 | Functions to get and set the map titer table. Note that when setting the 22 | titer table like this any titer table layer information is lost, this is 23 | normally not a problem unless the map is a result of merging two titer tables 24 | together previously and you then go on the merge the titers again. 25 | } 26 | \seealso{ 27 | \code{\link[=adjustedTiterTable]{adjustedTiterTable()}}, \code{\link[=htmlTiterTable]{htmlTiterTable()}} 28 | 29 | Other map attribute functions: 30 | \code{\link{acmapAttributes}}, 31 | \code{\link{adjustedLogTiterTable}()}, 32 | \code{\link{adjustedTiterTable}()}, 33 | \code{\link{dilutionStepsize}()}, 34 | \code{\link{logtiterTableLayers}()}, 35 | \code{\link{mapDescription}()}, 36 | \code{\link{mapName}()}, 37 | \code{\link{titerTableFlat}()}, 38 | \code{\link{titerTableLayers}()} 39 | } 40 | \concept{map attribute functions} 41 | -------------------------------------------------------------------------------- /man/titerTableFlat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{titerTableFlat} 4 | \alias{titerTableFlat} 5 | \alias{titerTableFlat<-} 6 | \title{Getting and setting the flat titer table} 7 | \usage{ 8 | titerTableFlat(map) 9 | 10 | titerTableFlat(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A character matrix of titers to set} 16 | } 17 | \value{ 18 | Returns a character matrix of titers. 19 | } 20 | \description{ 21 | These are underlying functions to get and set the "flat" version of the titer 22 | table only. When a map is merged, the titer tables are merged but a record of 23 | the original titers associated with each map are kept as titer table layers 24 | so that information on the original set of titers that made up the merge is 25 | not lost. At the same time, the merged titer version of the titer table is 26 | created and saved as the titer_table_flat attribute. When you access titers 27 | through the \code{titerTable()} function, the flat version of the titer table is 28 | retrieved (only really a relevant distinction for merged maps). When you set 29 | titers through \verb{titerTable<-()} titer table layers are lost. These functions 30 | allow you to manipulate the flat version without affecting the titer table 31 | layers information. 32 | } 33 | \seealso{ 34 | Other map attribute functions: 35 | \code{\link{acmapAttributes}}, 36 | \code{\link{adjustedLogTiterTable}()}, 37 | \code{\link{adjustedTiterTable}()}, 38 | \code{\link{dilutionStepsize}()}, 39 | \code{\link{logtiterTableLayers}()}, 40 | \code{\link{mapDescription}()}, 41 | \code{\link{mapName}()}, 42 | \code{\link{titerTableLayers}()}, 43 | \code{\link{titerTable}()} 44 | } 45 | \concept{map attribute functions} 46 | -------------------------------------------------------------------------------- /man/titerTableLayers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_props.R 3 | \name{titerTableLayers} 4 | \alias{titerTableLayers} 5 | \alias{titerTableLayers<-} 6 | \title{Getting and setting titer table layers} 7 | \usage{ 8 | titerTableLayers(map) 9 | 10 | titerTableLayers(map) <- value 11 | } 12 | \arguments{ 13 | \item{map}{The acmap object} 14 | 15 | \item{value}{A list of titer table character vectors to set} 16 | } 17 | \value{ 18 | A list of character matrices of titers. 19 | } 20 | \description{ 21 | Functions to get and set the underlying titer table layers of a map (see 22 | details). 23 | } 24 | \details{ 25 | When you merge maps with \code{mergeMaps()} repeated antigen - serum 26 | titers are merged to create a new titer table but information on the 27 | original titers is not lost. The original titer tables, aligned to their 28 | new positions in the merged table, are kept as separate layers that can be 29 | accessed with these functions. If you have merged a whole bunch of 30 | different maps, these functions can be useful to check for example, 31 | variation in titer seen between a single antigen and serum pair. 32 | } 33 | \seealso{ 34 | Other map attribute functions: 35 | \code{\link{acmapAttributes}}, 36 | \code{\link{adjustedLogTiterTable}()}, 37 | \code{\link{adjustedTiterTable}()}, 38 | \code{\link{dilutionStepsize}()}, 39 | \code{\link{logtiterTableLayers}()}, 40 | \code{\link{mapDescription}()}, 41 | \code{\link{mapName}()}, 42 | \code{\link{titerTableFlat}()}, 43 | \code{\link{titerTable}()} 44 | } 45 | \concept{map attribute functions} 46 | -------------------------------------------------------------------------------- /man/translateMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_transformation.R 3 | \name{translateMap} 4 | \alias{translateMap} 5 | \title{Translate a map} 6 | \usage{ 7 | translateMap(map, translation, optimization_number = NULL) 8 | } 9 | \arguments{ 10 | \item{map}{The acmap object} 11 | 12 | \item{translation}{Translation to apply (as vector or n x 1 matrix)} 13 | 14 | \item{optimization_number}{The optimization number (or NULL to apply to all 15 | optimizations)} 16 | } 17 | \value{ 18 | An acmap object with transformation applied 19 | } 20 | \description{ 21 | Translates map coordinates 22 | } 23 | \seealso{ 24 | Other functions relating to map transformation: 25 | \code{\link{applyMapTransform}()}, 26 | \code{\link{reflectMap}()}, 27 | \code{\link{rotateMap}()} 28 | } 29 | \concept{functions relating to map transformation} 30 | -------------------------------------------------------------------------------- /man/update_ferret_seraNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_edit_names.R 3 | \name{update_ferret_seraNames} 4 | \alias{update_ferret_seraNames} 5 | \title{Update the ferret serum names to match antigens} 6 | \usage{ 7 | update_ferret_seraNames(map, dictionary_file = NULL) 8 | } 9 | \arguments{ 10 | \item{map}{The map data object} 11 | 12 | \item{dictionary_file}{The path to the dictionary file you want to use 13 | (should be .csv). If not supplied then the default dictionary that comes 14 | with Racmacs will be used.} 15 | } 16 | \value{ 17 | Returns the updated map data object 18 | } 19 | \description{ 20 | Update the ferret serum names to match antigens 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/view.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_methods.R 3 | \name{view} 4 | \alias{view} 5 | \title{S3 method for viewing objects} 6 | \usage{ 7 | view(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{The object to view} 11 | 12 | \item{...}{Additional arguments, not used.} 13 | } 14 | \value{ 15 | When called on an acmap object, returns an htmlwidget object that 16 | can be used to interactively view the map. Otherwise by default it 17 | simply calls the print method of the respective object with no return 18 | value. 19 | } 20 | \description{ 21 | S3 method for viewing objects 22 | } 23 | \seealso{ 24 | Other functions to view maps: 25 | \code{\link{RacViewer.options}()}, 26 | \code{\link{RacViewer}()}, 27 | \code{\link{export_viewer}()}, 28 | \code{\link{ggplot.acmap}()}, 29 | \code{\link{mapGadget}()}, 30 | \code{\link{plot.acmap}()}, 31 | \code{\link{setLegend}()}, 32 | \code{\link{view.acmap}()}, 33 | \code{\link{view.default}()} 34 | } 35 | \concept{functions to view maps} 36 | -------------------------------------------------------------------------------- /man/view.default.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_methods.R 3 | \name{view.default} 4 | \alias{view.default} 5 | \title{Default method for viewing objects} 6 | \usage{ 7 | \method{view}{default}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{The object to view} 11 | 12 | \item{...}{Additional arguments, passed to print.} 13 | } 14 | \value{ 15 | No value returned, simply calls the print method on the object 16 | } 17 | \description{ 18 | Default method for viewing objects 19 | } 20 | \seealso{ 21 | Other functions to view maps: 22 | \code{\link{RacViewer.options}()}, 23 | \code{\link{RacViewer}()}, 24 | \code{\link{export_viewer}()}, 25 | \code{\link{ggplot.acmap}()}, 26 | \code{\link{mapGadget}()}, 27 | \code{\link{plot.acmap}()}, 28 | \code{\link{setLegend}()}, 29 | \code{\link{view.acmap}()}, 30 | \code{\link{view}()} 31 | } 32 | \concept{functions to view maps} 33 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | 2 | .template-article-index dd { 3 | margin-left: 0; 4 | } 5 | 6 | /*.ref-index code{ 7 | display: block; 8 | width: max-content; 9 | } 10 | 11 | .ref-index code+code { 12 | margin-top: 4px; 13 | }*/ 14 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dll 4 | -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | 2 | PKG_CPPFLAGS = -DSTRICT_R_HEADERS 3 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 4 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 5 | -------------------------------------------------------------------------------- /src/Makevars.win: -------------------------------------------------------------------------------- 1 | 2 | PKG_CPPFLAGS = -DSTRICT_R_HEADERS 3 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 4 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 5 | -------------------------------------------------------------------------------- /src/ac_bootstrap.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_titers.h" 4 | #include "ac_optimizer_options.h" 5 | #include "acmap_map.h" 6 | #include "ac_bootstrap_output.h" 7 | 8 | #ifndef Racmacs__ac_bootstrap__h 9 | #define Racmacs__ac_bootstrap__h 10 | 11 | BootstrapOutput ac_bootstrap_map( 12 | AcMap map, 13 | std::string method, 14 | bool bootstrap_ags, 15 | bool bootstrap_sr, 16 | bool reoptimize, 17 | double ag_noise_sd, 18 | double titer_noise_sd, 19 | std::string minimum_column_basis, 20 | arma::vec fixed_column_bases, 21 | arma::vec ag_reactivity_adjustments, 22 | int num_optimizations, 23 | int num_dimensions, 24 | AcOptimizerOptions options 25 | ); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/ac_bootstrap_output.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__ac_bootstrap_output__h 5 | #define Racmacs__ac_bootstrap_output__h 6 | 7 | struct BootstrapOutput 8 | { 9 | arma::vec sampling; 10 | arma::mat coords; 11 | double stress; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/ac_coords_stress.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_titers.h" 4 | 5 | #ifndef Racmacs__ac_coords_stress__h 6 | #define Racmacs__ac_coords_stress__h 7 | 8 | // Calculating stress 9 | double ac_coords_stress( 10 | const AcTiterTable &titers, 11 | const std::string &min_colbasis, 12 | const arma::vec &fixed_colbases, 13 | const arma::vec &ag_reactivity_adjustments, 14 | arma::mat &ag_coords, 15 | arma::mat &sr_coords, 16 | double dilution_stepsize 17 | ); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/ac_dimension_test.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_titers.h" 4 | #include "ac_optimizer_options.h" 5 | 6 | #ifndef Racmacs__ac_dimension_test__h 7 | #define Racmacs__ac_dimension_test__h 8 | 9 | struct DimTestOutput 10 | { 11 | arma::uvec test_indices; 12 | arma::uvec dim; 13 | std::vector coords; 14 | std::vector predictions; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/ac_errorlines.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__ac_errorlines__h 5 | #define Racmacs__ac_errorlines__h 6 | 7 | struct ErrorLineData 8 | { 9 | arma::vec x; 10 | arma::vec xend; 11 | arma::vec y; 12 | arma::vec yend; 13 | arma::uvec color; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/ac_hemi_test.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_titers.h" 4 | #include "ac_optimizer_options.h" 5 | 6 | #ifndef Racmacs__ac_hemi_test__h 7 | #define Racmacs__ac_hemi_test__h 8 | 9 | class HemiDiagnosis 10 | { 11 | 12 | public: 13 | std::string diagnosis; 14 | arma::vec coords; 15 | 16 | }; 17 | 18 | class HemiData 19 | { 20 | 21 | public: 22 | arma::uword index; 23 | std::vector diagnoses; 24 | 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/ac_matching.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_map.h" 4 | 5 | template 6 | arma::ivec ac_match_points( 7 | T const& points1, 8 | T const& points2 9 | ){ 10 | 11 | arma::ivec matches(points1.size()); 12 | matches.fill(-1); 13 | 14 | for(arma::uword i=0; i 3 | 4 | #ifndef Racmacs__ac_matching__h 5 | #define Racmacs__ac_matching__h 6 | 7 | template 8 | arma::ivec ac_match_points( 9 | T const& points1, 10 | T const& points2 11 | ); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/ac_merge.h: -------------------------------------------------------------------------------- 1 | 2 | #include "acmap_titers.h" 3 | 4 | #ifndef Racmacs__ac_merge__h 5 | #define Racmacs__ac_merge__h 6 | 7 | 8 | // Merge options 9 | struct AcMergeOptions { 10 | double sd_limit; 11 | double dilution_stepsize; 12 | Rcpp::Function merge_function; 13 | std::string method; 14 | }; 15 | 16 | 17 | // Merge titers 18 | AcTiter ac_merge_titers( 19 | const std::vector& titers, 20 | const AcMergeOptions& options 21 | ); 22 | 23 | 24 | // Merge titer layers 25 | AcTiterTable ac_merge_titer_layers( 26 | const std::vector& titer_layers, 27 | const AcMergeOptions& options 28 | ); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/ac_optim_map_stress.h: -------------------------------------------------------------------------------- 1 | 2 | # include 3 | # include "acmap_map.h" 4 | # include "ac_optimizer_options.h" 5 | 6 | #ifndef Racmacs__ac_optim_map_stress__h 7 | #define Racmacs__ac_optim_map_stress__h 8 | 9 | // Generating optimizations with randomised coords 10 | std::vector ac_generateOptimizations( 11 | const arma::mat &tabledist_matrix, 12 | const arma::imat &titertype_matrix, 13 | const std::string &min_colbasis, 14 | const arma::vec &fixed_colbases, 15 | const arma::vec &ag_reactivity_adjustments, 16 | const int &num_dims, 17 | const int &num_optimizations, 18 | const AcOptimizerOptions &options, 19 | const double &dilution_stepsize = 1.0 20 | ); 21 | 22 | // Relaxing optimizations 23 | void ac_relaxOptimizations( 24 | std::vector& optimizations, 25 | arma::uword num_dims, 26 | const arma::mat &tabledist_matrix, 27 | const arma::imat &titertype_matrix, 28 | const AcOptimizerOptions &options, 29 | const arma::mat &titer_weights = arma::mat(), 30 | const double &dilution_stepsize = 1.0 31 | ); 32 | 33 | // Running optimizations 34 | std::vector ac_runOptimizations( 35 | const AcTiterTable &titertable, 36 | const std::string &min_colbasis, 37 | const arma::vec &fixed_colbases, 38 | const arma::vec &ag_reactivity_adjustments, 39 | const arma::uword &num_dims, 40 | const arma::uword &num_optimizations, 41 | const AcOptimizerOptions &options, 42 | const arma::mat &titer_weights = arma::mat(), 43 | const double &dilution_stepsize = 1.0 44 | ); 45 | 46 | // Sorting optimizations by stress 47 | void sort_optimizations_by_stress( 48 | std::vector &optimizations 49 | ); 50 | 51 | // Calculating residual error 52 | arma::mat ac_point_residuals( 53 | const AcMap &map, 54 | const arma::uword &optimization_number 55 | ); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/ac_optimization.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "acmap_optimization.h" 4 | 5 | // For optimization sorting 6 | bool compare_optimization_stress( 7 | AcOptimization opt1, 8 | AcOptimization opt2 9 | ){ 10 | if(!std::isfinite(opt1.stress)){ 11 | return false; 12 | } 13 | if(!std::isfinite(opt2.stress)){ 14 | return true; 15 | } 16 | return (opt1.stress < opt2.stress); 17 | } 18 | 19 | void sort_optimizations_by_stress( 20 | std::vector &optimizations 21 | ){ 22 | 23 | sort( 24 | optimizations.begin(), 25 | optimizations.end(), 26 | compare_optimization_stress 27 | ); 28 | 29 | } 30 | 31 | 32 | // For optimization alignment 33 | void align_optimizations( 34 | std::vector &optimizations 35 | ){ 36 | 37 | if(optimizations.size() > 1){ 38 | for(arma::uword i=1; i 3 | #include "acmap_optimization.h" 4 | 5 | #ifndef Racmacs__ac_optimization__h 6 | #define Racmacs__ac_optimization__h 7 | 8 | void sort_optimizations_by_stress( 9 | std::vector &optimizations 10 | ); 11 | 12 | 13 | // For optimization alignment 14 | void align_optimizations( 15 | std::vector &optimizations 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/ac_optimizer_options.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Racmacs__ac_optimizer_options__h 3 | #define Racmacs__ac_optimizer_options__h 4 | 5 | // Optimizer options 6 | struct AcOptimizerOptions { 7 | 8 | bool dim_annealing; 9 | std::string method; 10 | int maxit; 11 | int num_basis; 12 | double armijo_constant; 13 | double wolfe; 14 | double min_gradient_norm; 15 | double factr; 16 | int max_line_search_trials; 17 | double min_step; 18 | double max_step; 19 | int num_cores; 20 | bool report_progress; 21 | int progress_bar_length; 22 | 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/ac_relax_coords.h: -------------------------------------------------------------------------------- 1 | 2 | # include 3 | # include "ac_optimizer_options.h" 4 | 5 | #ifndef Racmacs__ac_relax_coords__h 6 | #define Racmacs__ac_relax_coords__h 7 | 8 | double ac_relax_coords( 9 | const arma::mat &tabledist_matrix, 10 | const arma::imat &titertype_matrix, 11 | arma::mat &ag_coords, 12 | arma::mat &sr_coords, 13 | const AcOptimizerOptions &options, 14 | const arma::uvec &fixed_antigens = arma::uvec(), 15 | const arma::uvec &fixed_sera = arma::uvec(), 16 | const arma::mat &titer_weights = arma::mat(), 17 | const double &dilution_stepsize = 1.0 18 | ); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/ac_stress.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__ac_stress__h 5 | #define Racmacs__ac_stress__h 6 | 7 | // The threshold penalty function 8 | double sigmoid(double &x); 9 | 10 | // The derivative of the threshold penalty function 11 | double d_sigmoid(double &x); 12 | 13 | // This is the point stress function 14 | double ac_ptStress( 15 | double &map_dist, 16 | double &table_dist, 17 | arma::sword &titer_type, 18 | double &dilution_stepsize 19 | ); 20 | 21 | // This is the point residual function 22 | double ac_ptResidual( 23 | double &map_dist, 24 | double &table_dist, 25 | arma::sword &titer_type, 26 | double &dilution_stepsize 27 | ); 28 | 29 | // This is the inc_base function used in the stress gradient function 30 | double inc_base( 31 | double &map_dist, 32 | double &table_dist, 33 | arma::sword &titer_type, 34 | double &dilution_stepsize 35 | ); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/ac_stress_blobs.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__ac_stress_blobs__h 5 | #define Racmacs__ac_stress_blobs__h 6 | 7 | struct StressBlobGrid { 8 | arma::cube grid; 9 | arma::vec xcoords; 10 | arma::vec ycoords; 11 | arma::vec zcoords; 12 | double stress_lim; 13 | }; 14 | 15 | StressBlobGrid ac_stress_blob_grid( 16 | arma::vec testcoords, 17 | arma::mat coords, 18 | arma::vec tabledists, 19 | arma::ivec titertypes, 20 | double stress_lim = 1.0, 21 | double grid_spacing = 0.1, 22 | double dilution_stepsize = 1.0 23 | ); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/ac_titers.h: -------------------------------------------------------------------------------- 1 | 2 | #include "acmap_titers.h" 3 | 4 | #ifndef Racmacs__ac_titers__h 5 | #define Racmacs__ac_titers__h 6 | 7 | arma::vec numeric_titers( 8 | std::vector titers 9 | ); 10 | 11 | arma::vec log_titers( 12 | std::vector titers, 13 | double dilution_stepsize 14 | ); 15 | 16 | arma::ivec titer_types_int( 17 | std::vector titers 18 | ); 19 | 20 | void check_valid_titer( 21 | std::string titer 22 | ); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/ac_utils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | // Use principle component analysis to reduce coordinates to lower dimensions 5 | // [[Rcpp::export]] 6 | arma::mat reduce_matrix_dimensions( 7 | arma::mat m, 8 | int dim 9 | ){ 10 | 11 | arma::mat coeff = arma::princomp(m); 12 | return m*coeff.cols(0, dim); 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/acmap_diagnostics.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "ac_hemi_test.h" 4 | 5 | #ifndef Racmacs__acmap_diagnostics__h 6 | #define Racmacs__acmap_diagnostics__h 7 | 8 | class AcDiagnostics { 9 | 10 | public: 11 | std::vector hemi; 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/acmap_plotspec.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Racmacs__acmap_plotspec__h 3 | #define Racmacs__acmap_plotspec__h 4 | 5 | class AcPlotspec { 6 | 7 | protected: 8 | 9 | bool shown = true; 10 | double size = 5.0; 11 | std::string shape = "CIRCLE"; 12 | std::string fill = "green"; 13 | std::string outline = "black"; 14 | double outline_width = 1.0; 15 | double rotation = 0.0; 16 | double aspect = 1.0; 17 | 18 | public: 19 | 20 | // Plotspec details 21 | bool get_shown() const { return shown; }; 22 | double get_size() const { return size; }; 23 | std::string get_fill() const { return fill; }; 24 | std::string get_outline() const { return outline; }; 25 | double get_outline_width() const { return outline_width; }; 26 | double get_rotation() const { return rotation; }; 27 | double get_aspect() const { return aspect; }; 28 | std::string get_shape() const { return shape; }; 29 | 30 | void set_shown(bool shown_in){ shown = shown_in; }; 31 | void set_size(double size_in){ size = size_in; }; 32 | void set_fill(std::string fill_in){ fill = fill_in; }; 33 | void set_outline(std::string outline_in){ outline = outline_in; } 34 | void set_outline_width(double outline_width_in){ outline_width = outline_width_in; }; 35 | void set_rotation(double rotation_in){ rotation = rotation_in; }; 36 | void set_aspect(double aspect_in){ aspect = aspect_in; }; 37 | void set_shape(std::string shape_in){ shape = shape_in; }; 38 | 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/acmap_sequences.h: -------------------------------------------------------------------------------- 1 | 2 | #include "acmap_optimization.h" 3 | #include "acmap_titers.h" 4 | #include "acmap_plotspec.h" 5 | 6 | #ifndef Racmacs__acmap_sequences__h 7 | #define Racmacs__acmap_sequences__h 8 | 9 | // Define the generic point class 10 | class SeqInsertion { 11 | 12 | public: 13 | arma::uword position; 14 | std::string insertion; 15 | 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/json_assert.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | void ac_assert(bool x){ 5 | if(!x) Rf_error("Parsing failed"); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/json_assert.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Racmacs__json_assert__h 3 | #define Racmacs__json_assert__h 4 | 5 | // Define the rapid json assert macro 6 | void ac_assert(bool x); 7 | #define RAPIDJSON_ASSERT(x) ac_assert(x) 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /src/procrustes.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Racmacs__procrustes__h 3 | #define Racmacs__procrustes__h 4 | 5 | #include 6 | 7 | struct Procrustes 8 | { 9 | arma::mat R; 10 | arma::mat tt; 11 | double s; 12 | }; 13 | 14 | struct AcCoords 15 | { 16 | arma::mat ag_coords; 17 | arma::mat sr_coords; 18 | }; 19 | 20 | struct ProcrustesData 21 | { 22 | arma::vec ag_dists; 23 | arma::vec sr_dists; 24 | double ag_rmsd; 25 | double sr_rmsd; 26 | double total_rmsd; 27 | }; 28 | 29 | Procrustes ac_procrustes( 30 | arma::mat X, 31 | arma::mat Xstar, 32 | bool translation = true, 33 | bool dilation = false 34 | ); 35 | 36 | arma::mat transform_coords( 37 | const arma::mat &coords, 38 | const arma::mat &rotation, 39 | const arma::mat &translation, 40 | const double &scaling = 1 41 | ); 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /src/utils.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__utils__h 5 | #define Racmacs__utils__h 6 | 7 | double rmsd( 8 | const arma::vec &x 9 | ); 10 | 11 | double euc_dist( 12 | const arma::vec &x1, 13 | const arma::vec &x2 14 | ); 15 | 16 | arma::vec ac_coord_dists( 17 | arma::mat coords1, 18 | arma::mat coords2 19 | ); 20 | 21 | arma::mat subset_rows( 22 | const arma::mat &matrix, 23 | const arma::ivec &subset 24 | ); 25 | 26 | arma::uvec na_row_indices( 27 | const arma::mat &X 28 | ); 29 | 30 | arma::mat unique_rows( 31 | const arma::mat &m 32 | ); 33 | 34 | void uvec_push(arma::uvec &v, arma::uword value); 35 | 36 | // Template for subsetting a vector 37 | template 38 | std::vector subset_vector( 39 | std::vector vec, 40 | arma::uvec indices 41 | ){ 42 | 43 | std::vector subvec(indices.n_elem); 44 | for (arma::uword i=0; i < indices.n_elem; i++) { 45 | subvec[i] = vec[indices(i)]; 46 | } 47 | return subvec; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/utils_error.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | void ac_error( 5 | const char* msg 6 | ){ 7 | 8 | Rf_error("%s", msg); 9 | 10 | } 11 | 12 | void ac_error( 13 | const std::string msg 14 | ){ 15 | 16 | Rf_error("%s", msg.c_str()); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/utils_error.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #ifndef Racmacs__utils_error__h 5 | #define Racmacs__utils_error__h 6 | 7 | void ac_error( 8 | const char* msg 9 | ); 10 | 11 | void ac_error( 12 | const std::string msg 13 | ); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/utils_euc_dist.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | // [[Rcpp::export]] 5 | arma::mat ac_coordDistMatrix( 6 | arma::mat coords1, 7 | arma::mat coords2 8 | ){ 9 | 10 | arma::uword nrows = coords1.n_rows; 11 | arma::uword ncols = coords2.n_rows; 12 | arma::uword ndims = coords1.n_cols; 13 | 14 | arma::mat distmat( coords1.n_rows, coords2.n_rows ); 15 | for(arma::uword i=0; i 3 | 4 | double volume_of_tetrahedron( 5 | const arma::rowvec &p1, 6 | const arma::rowvec &p2, 7 | const arma::rowvec &p3 8 | ) { 9 | 10 | double v321 = p3[0]*p2[1]*p1[2]; 11 | double v231 = p2[0]*p3[1]*p1[2]; 12 | double v312 = p3[0]*p1[1]*p2[2]; 13 | double v132 = p1[0]*p3[1]*p2[2]; 14 | double v213 = p2[0]*p1[1]*p3[2]; 15 | double v123 = p1[0]*p2[1]*p3[2]; 16 | return (-v321 + v231 + v312 - v132 - v213 + v123) / 6; 17 | 18 | } 19 | 20 | 21 | // [[Rcpp::export]] 22 | double mesh_volume( 23 | const arma::umat &faces, 24 | const arma::mat &vertices 25 | ) { 26 | 27 | double volume = 0; 28 | arma::rowvec v1; 29 | arma::rowvec v2; 30 | arma::rowvec v3; 31 | 32 | for (arma::uword n = 0; n < faces.n_rows; n++) { 33 | 34 | v1 = vertices.row(faces(n, 0)); 35 | v2 = vertices.row(faces(n, 1)); 36 | v3 = vertices.row(faces(n, 2)); 37 | volume += volume_of_tetrahedron(v1, v2, v3); 38 | 39 | } 40 | 41 | return volume; 42 | 43 | } 44 | 45 | 46 | // [[Rcpp::export]] 47 | double polygon_area( 48 | const arma::vec &x, 49 | const arma::vec &y 50 | ) { 51 | 52 | double area = 0; 53 | arma::uword i0; 54 | for (arma::uword i = 0; i < x.n_elem; i++) { 55 | 56 | // Get previous vertex 57 | i == 0 ? i0 = x.n_elem - 1 : i0 = i - 1; 58 | area += (-x[i0]*y[i] + x[i]*y[i0]) / 2; 59 | 60 | } 61 | 62 | return area; 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/utils_progress.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #ifndef Racmacs__utils_progress__h 8 | #define Racmacs__utils_progress__h 9 | 10 | class AcProgressBar: public ProgressBar{ 11 | 12 | private: 13 | int barlength = 100; 14 | bool report; 15 | 16 | public: 17 | 18 | AcProgressBar( 19 | int length, 20 | bool reportprogress 21 | ){ 22 | _finalized = false; 23 | barlength = length; 24 | report = reportprogress; 25 | } 26 | 27 | ~AcProgressBar() {} 28 | 29 | void display() { 30 | if(!report) return; 31 | for(int i=0; i 3 | 4 | #ifndef Racmacs__utils_transformation__h 5 | #define Racmacs__utils_transformation__h 6 | 7 | // Transforming a transformation matrix 8 | void ac_transform_transformation( 9 | arma::mat& transform, 10 | arma::mat transformation 11 | ); 12 | 13 | // Transforming a translation matrix 14 | void ac_transform_translation( 15 | arma::mat& translate, 16 | arma::mat transformation 17 | ); 18 | 19 | // Translating a translation matrix 20 | void ac_translate_translation( 21 | arma::mat& translate, 22 | arma::mat translation 23 | ); 24 | 25 | // Creating a rotation transform matrix 26 | arma::mat ac_rotation_matrix( 27 | double degrees, 28 | arma::uword dims, 29 | arma::uword axis_num = 2 30 | ); 31 | 32 | // Creating a reflection transform matrix 33 | arma::mat ac_reflection_matrix( 34 | const arma::uword &dims, 35 | const arma::uword &axis_num 36 | ); 37 | 38 | // Creating a scaling transform matrix 39 | arma::mat ac_scaling_matrix( 40 | const arma::uword &dims, 41 | double scaling 42 | ); 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /tests/testdata/test_mergemap1.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/test_mergemap1.ace -------------------------------------------------------------------------------- /tests/testdata/test_mergemap2.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/test_mergemap2.ace -------------------------------------------------------------------------------- /tests/testdata/test_mergemap3.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/test_mergemap3.ace -------------------------------------------------------------------------------- /tests/testdata/testmap.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_h3subset.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_h3subset.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_h3subset3d.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_h3subset3d.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_h3subset3d_1000bootstraps.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_h3subset3d_1000bootstraps.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_large.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_large.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_merge.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_merge.ace -------------------------------------------------------------------------------- /tests/testdata/testmap_small.ace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/testmap_small.ace -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table1.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/titer_tables/titer_table1.RData -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table1.csv: -------------------------------------------------------------------------------- 1 | ,A/Hong Kong/7127/2014,A/Singapore/INFIMH-16-0019/2016,A/Osaka/163/2017,A/Shimane/112/2017,A/Yokohama/138/2017 2 | A/Hong Kong/7127/2014,320,80,160,80,80 3 | A/Singapore/INFIMH-16-0019/2016,320,160,160,160,160 4 | A/Gunma/140/2017,160,320,80,160,80 5 | A/Kagoshima/74146/2017,160,160,80,80,80 6 | A/Osaka/163/2017,80,40,320,40,40 7 | A/Yokohama/181/2017,80,160,80,80,80 8 | A/Yokohama/1/2018,160,160,80,80,80 9 | A/Yokohama/145/2017,80,160,80,80,80 10 | A/Shimane/112/2017,320,160,160,1280,160 11 | A/Yokohama/199/2017,640,320,160,2560,320 12 | A/Yokohama/14/2018,640,160,160,2560,160 13 | A/Yokohama/148/2017,160,320,160,160,80 14 | A/Yokohama/150/2017,320,160,160,320,80 15 | A/Yokohama/138/2017,320,320,160,80,640 16 | A/Aichi/343/2017,320,80,80,40,640 17 | A/Okinawa/64/2017,320,160,80,40,640 -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table1.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/titer_tables/titer_table1.xlsx -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table2.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/titer_tables/titer_table2.RData -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table3.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/titer_tables/titer_table3.RData -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table3_asterisk.csv: -------------------------------------------------------------------------------- 1 | ,S1,S2,S3 2 | A1,2,*,10 3 | A2,2,5,10 4 | A3,2,3,5 5 | -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table4.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/tests/testdata/titer_tables/titer_table4.RData -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table4_blank.csv: -------------------------------------------------------------------------------- 1 | ,S1,S2,S3 2 | A1,2,,10 3 | A2,2,5,10 4 | A3,2,3,5 5 | -------------------------------------------------------------------------------- /tests/testdata/titer_tables/titer_table5_underconstrained.csv: -------------------------------------------------------------------------------- 1 | , S1, S2, S3 2 | A1, 1280, 640, 640 3 | A2, 640, 1280, 453 4 | A3, 640, 453, 1280 5 | A4, * , 640, 640 6 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(Racmacs) 3 | 4 | test_check("Racmacs") 5 | -------------------------------------------------------------------------------- /tests/testthat/.gitignore: -------------------------------------------------------------------------------- 1 | Rplots.pdf 2 | -------------------------------------------------------------------------------- /tests/testthat/test-diagnostic_plotting.R: -------------------------------------------------------------------------------- 1 | 2 | library(testthat) 3 | library(Racmacs) 4 | context("Diagnostic plotting") 5 | 6 | map <- read.acmap(test_path("../testdata/testmap_h3subset.ace")) 7 | plot(map) 8 | test_that("plot a map", { 9 | 10 | export.plot.test( 11 | plot(map), 12 | "plot_map.pdf" 13 | ) 14 | 15 | }) 16 | 17 | test_that("plot map v table distances", { 18 | 19 | export.plot.test( 20 | plot_map_table_distance(map), 21 | "plot_map_table_distances.pdf" 22 | ) 23 | 24 | export.plotly.test( 25 | plotly_map_table_distance(map), 26 | "plot_map_table_distances.html" 27 | ) 28 | 29 | }) 30 | 31 | # plot_map_table_distance(map) 32 | # plotly_map_table_distance(map) 33 | 34 | # plot_ag_titers( 35 | # map = map, 36 | # antigen = "HK/434/96" 37 | # ) 38 | # 39 | # plotly_ag_titers( 40 | # map = map, 41 | # antigen = "HK/434/96" 42 | # ) 43 | 44 | # plot_sr_titers( 45 | # map = map, 46 | # serum = "BE/32V/92" 47 | # ) 48 | # 49 | # plotly_sr_titers( 50 | # map = map, 51 | # serum = "BE/32V/92" 52 | # ) 53 | # 54 | # plot_agStressPerTiter(map) 55 | # plotly_agStressPerTiter(map) 56 | # 57 | # plot_srStressPerTiter(map) 58 | # plotly_srStressPerTiter(map) 59 | -------------------------------------------------------------------------------- /tests/testthat/test-errors.R: -------------------------------------------------------------------------------- 1 | 2 | library(testthat) 3 | context("Test errors") 4 | 5 | map <- acmap( 6 | titer_table = matrix("20", 3, 3) 7 | ) 8 | 9 | test_that("errors when no optimizations are available", { 10 | 11 | expect_error( 12 | colBases(map), 13 | "Map has no optimization runs" 14 | ) 15 | 16 | }) 17 | -------------------------------------------------------------------------------- /tests/testthat/test-gui.R: -------------------------------------------------------------------------------- 1 | 2 | # This simply sources the tests in the shiny app folder 3 | source(system.file(package = "Racmacs", "shinyapps/RacmacsGUI/tests/testthat/test-server.R")) 4 | -------------------------------------------------------------------------------- /tests/testthat/test-map_loading.R: -------------------------------------------------------------------------------- 1 | 2 | library(Racmacs) 3 | library(testthat) 4 | context("Loading map data") 5 | 6 | save_file <- test_path("../testdata/testmap.ace") 7 | 8 | # Errors 9 | test_that("Errors reading in", { 10 | expect_error( 11 | read.acmap("filedoesntexist"), 12 | "File 'filedoesntexist' not found" 13 | ) 14 | }) 15 | 16 | # Loading full file 17 | map_full <- read.acmap(filename = save_file) 18 | 19 | test_that("Reading in", { 20 | expect_false(is.nan(optStress(map_full, 1))) 21 | expect_equal(numOptimizations(map_full), 3) 22 | }) 23 | 24 | # Loading stress ordered 25 | map_stress_ordered <- read.acmap( 26 | filename = save_file, 27 | sort_optimizations = TRUE 28 | ) 29 | 30 | test_that("Reading in stress ordered", { 31 | expect_equal( 32 | order(allMapStresses(map_stress_ordered)), 33 | seq_len(numOptimizations(map_full)) 34 | ) 35 | }) 36 | -------------------------------------------------------------------------------- /tests/testthat/test-methods.R: -------------------------------------------------------------------------------- 1 | 2 | library(Racmacs) 3 | library(testthat) 4 | context("Test map methods") 5 | 6 | # Load the map and the chart 7 | map <- read.acmap(filename = test_path("../testdata/testmap.ace")) 8 | 9 | # Test the print method 10 | expect_output(print(map)) 11 | -------------------------------------------------------------------------------- /tests/testthat/test-plot_map.R: -------------------------------------------------------------------------------- 1 | 2 | library(testthat) 3 | context("Plotting a map") 4 | 5 | test_that("Plotting a bare bones", { 6 | 7 | map <- acmap( 8 | ag_coords = matrix(1:10, 5), 9 | sr_coords = matrix(1:8, 4), 10 | minimum_column_basis = "none" 11 | ) 12 | 13 | x <- plot(map) 14 | expect_true(inherits(x, "acmap")) 15 | 16 | export.plot.test( 17 | plot(map), 18 | "simplemap.pdf", 19 | 8, 8 20 | ) 21 | 22 | }) 23 | 24 | # test_that("Plotting a 1D map", { 25 | # 26 | # map <- optimizeMap(map, 1, 2, "none", check_convergence = F) 27 | # export.plot.test( 28 | # plot(map), 29 | # "1dmap.pdf", 30 | # 8, 4 31 | # ) 32 | # 33 | # }) 34 | 35 | test_that("Plotting a map with error lines", { 36 | 37 | map <- read.acmap(test_path("../testdata/testmap.ace")) 38 | 39 | x <- plot(map, show_error_lines = TRUE) 40 | export.plot.test( 41 | plot(map), 42 | "simplemap.pdf", 43 | 8, 8 44 | ) 45 | 46 | }) 47 | -------------------------------------------------------------------------------- /tests/testthat/test-r3js.R: -------------------------------------------------------------------------------- 1 | 2 | # library(testthat) 3 | # context("Adding 3js features to the viewer") 4 | # 5 | # # Test the basic procrustes function 6 | # test_that("Add r3js features", { 7 | # 8 | # set.seed(100) 9 | # r3jsh5map <- h5map 10 | # for(x in 2:length(h5map$ag_names)) { 11 | # r3jsh5map <- r3js::lines3js(data3js = r3jsh5map, 12 | # x = c(h5map$ag_coords[x-1,1], h5map$ag_coords[x,1]), 13 | # y = c(h5map$ag_coords[x-1,2], h5map$ag_coords[x,2]), 14 | # z = c(h5map$ag_coords[x-1,3], h5map$ag_coords[x,3]), 15 | # lwd = 20, 16 | # col = h5map$ag_cols_fill[x]) 17 | # } 18 | # 19 | # }) 20 | -------------------------------------------------------------------------------- /tests/testthat/test-reading_HI_table.R: -------------------------------------------------------------------------------- 1 | 2 | library(Racmacs) 3 | library(testthat) 4 | context("Test reading HI tables") 5 | 6 | # Read a .txt file 7 | test_that("Reading a .txt table", { 8 | 9 | expect_known_output( 10 | read.titerTable(test_path("../testdata/titer_tables/titer_table2.txt")), 11 | test_path("../testdata/titer_tables/titer_table2.RData"), 12 | update = FALSE 13 | ) 14 | 15 | }) 16 | 17 | # Read a .csv file 18 | test_that("Reading a .csv table", { 19 | 20 | expect_known_output( 21 | read.titerTable(test_path("../testdata/titer_tables/titer_table1.csv")), 22 | test_path("../testdata/titer_tables/titer_table1.RData"), 23 | update = FALSE 24 | ) 25 | 26 | }) 27 | 28 | # Read an .xlsx file 29 | test_that("Reading an .xlsx file", { 30 | 31 | expect_equal( 32 | read.titerTable(test_path("../testdata/titer_tables/titer_table1.xlsx")), 33 | read.titerTable(test_path("../testdata/titer_tables/titer_table1.csv")) 34 | ) 35 | 36 | }) 37 | 38 | # Read file with asterisks 39 | test_that("Reading a table with asterisks", { 40 | 41 | expect_known_output( 42 | read.titerTable(test_path("../testdata/titer_tables/titer_table3_asterisk.csv")), 43 | test_path("../testdata/titer_tables/titer_table3.RData"), 44 | update = FALSE 45 | ) 46 | 47 | }) 48 | 49 | # Read file with blanks 50 | test_that("Reading a table with blanks", { 51 | 52 | expect_warning({ 53 | titer_table <- read.titerTable(test_path("../testdata/titer_tables/titer_table4_blank.csv")) 54 | }) 55 | expect_known_output( 56 | titer_table, 57 | test_path("../testdata/titer_tables/titer_table4.RData"), 58 | update = FALSE 59 | ) 60 | 61 | }) 62 | -------------------------------------------------------------------------------- /tests/testthat/test-stability.R: -------------------------------------------------------------------------------- 1 | 2 | library(Racmacs) 3 | library(testthat) 4 | 5 | # Check that all exported functions fail gracefully (not the bomb...!) 6 | context("Test function stability") 7 | 8 | 9 | # Get functions exported in the namespace 10 | ns <- readLines(system.file("NAMESPACE", package = "Racmacs")) 11 | ns <- ns[grepl("^export\\(", ns)] 12 | fns <- gsub("^export\\([\"]*", "", ns) 13 | fns <- gsub("[\"]*\\)$", "", fns) 14 | 15 | # Exclude some functions 16 | excluded_fns <- c( 17 | "runGUI", # Starts shiny app 18 | "RacViewerOutput", # Boilerplate function 19 | "view", # S3 method 20 | "agStressBlobSize", # Deprecated 21 | "srStressBlobSize", # Deprecated 22 | "stressBlobs" # Deprecated 23 | ) 24 | fns <- fns[!fns %in% excluded_fns] 25 | 26 | # Test each function 27 | for (fn_name in fns) { 28 | 29 | # if(fn_name == "titerTable<-") browser() 30 | test_that( 31 | sprintf("Function '%s' fails gracefully with incorrect input", fn_name), { 32 | 33 | # Check function 34 | fn <- get(fn_name) 35 | args <- names(formals(fn)) 36 | 37 | # Check NA 38 | vals <- as.list(rep(NA, length(args))) 39 | names(vals) <- args 40 | expect_error(do.call(fn, vals)) 41 | 42 | # Check NULL 43 | vals <- lapply(vals, function(x) NULL) 44 | expect_error(do.call(fn, vals)) 45 | 46 | } 47 | ) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /tests/testthat/test-underconstrained_positions.R: -------------------------------------------------------------------------------- 1 | 2 | library(testthat) 3 | library(Racmacs) 4 | context("Test underconstrained positions") 5 | 6 | # Read titer_table with missing data 7 | 8 | titertable <- read.titerTable(test_path("../testdata/titer_tables/titer_table5_underconstrained.csv")) 9 | map <- acmap(titer_table = titertable) 10 | 11 | test_that("Warn of undercontrained positions", { 12 | 13 | # Check for warning 14 | map <- expect_warning( 15 | optimizeMap( 16 | map = map, 17 | number_of_dimensions = 2, 18 | number_of_optimizations = 3, 19 | minimum_column_basis = "none", 20 | ), 21 | paste( 22 | "The following ANTIGENS have do not have enough titrations to position in 2 dimensions.", 23 | "Coordinates were still optimized but positions will be unreliable\n\n'A4'" 24 | ) 25 | ) 26 | 27 | # Check points were still positioned 28 | expect_false(anyNA(agBaseCoords(map))) 29 | expect_false(anyNA(agBaseCoords(map, 2))) 30 | expect_false(anyNA(agBaseCoords(map, 3))) 31 | 32 | }) 33 | 34 | 35 | test_that("Error for underconstrained points with infinite positions", { 36 | 37 | titerTable(map)[4, 2] <- "*" 38 | map <- expect_warning( 39 | optimizeMap( 40 | map = map, 41 | number_of_dimensions = 2, 42 | number_of_optimizations = 3, 43 | minimum_column_basis = "none", 44 | ), 45 | paste( 46 | "The following ANTIGENS are too underconstrained to position in 2 dimensions", 47 | "and coordinates have been set to NaN:\n\n'A4'" 48 | ) 49 | ) 50 | 51 | expect_equal(agCoords(map)[4,], c(NaN, NaN)) 52 | expect_equal(agCoords(map, 2)[4,], c(NaN, NaN)) 53 | expect_equal(agCoords(map, 3)[4,], c(NaN, NaN)) 54 | 55 | }) 56 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /vignettes/figures/intro_fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig1.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig2.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig3.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig4.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig5.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig6.png -------------------------------------------------------------------------------- /vignettes/figures/intro_fig7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_fig7.png -------------------------------------------------------------------------------- /vignettes/figures/intro_h3n2map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acorg/Racmacs/f75f9cd2d6b24f101ce71e39e2188490efa9ef1d/vignettes/figures/intro_h3n2map.png --------------------------------------------------------------------------------