Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Optimizing a subset of antigens individually #85

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fe5a1cb
Function for optimizing a subset of antigens individually.
davipatti Feb 18, 2022
9428a86
optimizeSubsetAgsIndividually now returns all individual maps as well…
davipatti Feb 22, 2022
51b3662
Merge branch 'master' into optimize-subset-individually
davipatti Mar 9, 2022
f640466
Disconnected maps now return an error rather than a warning
shwilks Mar 9, 2022
75a40ed
`agStressPerTiter()` and `srStressPerTiter()` now return a matrix wit…
shwilks Mar 9, 2022
bb1148e
Corrected error when coloring maps by stress or showing error lines w…
shwilks Mar 9, 2022
3ad786f
If a titer table has column or row names but not sera or antigen name…
shwilks Mar 9, 2022
f0a451f
Add support for reading maps with brotli compression
shwilks Mar 9, 2022
0d6cca7
`agSequences()` and `srSequences()` now works when the stored sequenc…
shwilks Mar 9, 2022
6e3f5e5
Update antigen names
shwilks Mar 9, 2022
646d904
Correct incorrect usage of exclude_nd
shwilks Mar 9, 2022
0ea439d
Correct error where maps with duplicate antigen or serum names would …
shwilks Mar 9, 2022
8c46b5c
Merge pull request #99 from shwilks/master
shwilks Mar 9, 2022
6522e6a
Update version number
shwilks Mar 10, 2022
21fa543
Merge pull request #101 from shwilks/master
shwilks Mar 10, 2022
b216f2f
Add some basic support for viewing 1D maps
shwilks Mar 10, 2022
d0cc360
Fix an issue viewing sequence data where sequence data is not present…
shwilks Mar 10, 2022
c2df94b
Fix an issue viewing sequence data where sequence data is not present…
shwilks Mar 11, 2022
dfee709
Fix an error reoptimize merging maps with no optimizations
shwilks Mar 11, 2022
817f694
* Add verbosity argument to `mergeMaps()`
shwilks Mar 11, 2022
3c9fbfe
Merge pull request #105 from shwilks/master
shwilks Mar 11, 2022
dbcf4fb
Increment to 1.1.34
shwilks Mar 11, 2022
99de6a4
Add support for getting and setting serum species with `srSpecies()`
shwilks Mar 11, 2022
8e19818
Redundant attributes `agNamesAbbreviated`, `agNamesFull`, `srNamesAbb…
shwilks Mar 11, 2022
debb461
Merge pull request #107 from shwilks/master
shwilks Mar 12, 2022
efae691
Add attributes (#3)
drserajames Mar 12, 2022
4f29a86
Revert "Add attributes (#3)" (#4)
drserajames Mar 12, 2022
dc0da83
Add attributes (#5)
drserajames Mar 12, 2022
80b0222
Adding nucleotide sequence test & fix typo
drserajames Mar 13, 2022
cc38354
Merge pull request #6 from drserajames/nuc-sequence-fix
drserajames Mar 13, 2022
24064e1
Merge pull request #109 from drserajames/master
shwilks Mar 14, 2022
53bfc85
Add documentation (#7)
drserajames Mar 14, 2022
9ca81ad
Merge pull request #110 from drserajames/master
shwilks Mar 14, 2022
3c71cf6
Function for optimizing a subset of antigens individually.
davipatti Feb 18, 2022
bdafe05
optimizeSubsetAgsIndividually now returns all individual maps as well…
davipatti Feb 22, 2022
3870029
Merge branch 'optimize-subset-individually' of github.com:acorg/Racma…
davipatti Apr 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Racmacs
Type: Package
Title: R Antigenic Cartography Macros
Version: 1.1.30
Version: 1.1.35
Date: 2022-02-23
Author: Sam Wilks
Maintainer: Sam Wilks <[email protected]>
Expand All @@ -24,7 +24,8 @@ Imports:
ellipsis,
MASS,
lifecycle,
igraph
igraph,
brotli
LazyData: TRUE
Suggests:
testthat,
Expand Down
29 changes: 21 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,30 @@ export("agAnnotations<-")
export("agAspect<-")
export("agBaseCoords<-")
export("agClades<-")
export("agContinent<-")
export("agCoords<-")
export("agDates<-")
export("agExtra<-")
export("agFill<-")
export("agGroups<-")
export("agIDs<-")
export("agLabIDs<-")
export("agLineage<-")
export("agNames<-")
export("agNamesAbbreviated<-")
export("agNamesFull<-")
export("agNucleotideSequences<-")
export("agOpacity<-")
export("agOutline<-")
export("agOutlineWidth<-")
export("agPassage<-")
export("agReactivityAdjustments<-")
export("agReassortant<-")
export("agReference<-")
export("agRotation<-")
export("agSequences<-")
export("agShape<-")
export("agShown<-")
export("agSize<-")
export("agStrings<-")
export("dilutionStepsize<-")
export("fixedColBases<-")
export("layerNames<-")
Expand All @@ -52,19 +55,22 @@ export("srFill<-")
export("srGroups<-")
export("srHomologousAgs<-")
export("srIDs<-")
export("srLineage<-")
export("srNames<-")
export("srNamesAbbreviated<-")
export("srNamesFull<-")
export("srNucleotideSequences<-")
export("srOpacity<-")
export("srOutline<-")
export("srOutlineWidth<-")
export("srPassage<-")
export("srReassortant<-")
export("srReference<-")
export("srRotation<-")
export("srSequences<-")
export("srShape<-")
export("srShown<-")
export("srSize<-")
export("srSpecies<-")
export("srStrings<-")
export("titerTable<-")
export(RacMerge.options)
export(RacOptimizer.options)
Expand All @@ -82,6 +88,7 @@ export(agBootstrapBlob)
export(agBootstrapCoords)
export(agClades)
export(agCohesion)
export(agContinent)
export(agCoords)
export(agDates)
export(agExtra)
Expand All @@ -90,13 +97,14 @@ export(agGroups)
export(agIDs)
export(agLabIDs)
export(agLeverage)
export(agLineage)
export(agNames)
export(agNamesAbbreviated)
export(agNamesFull)
export(agNucleotideSequences)
export(agOutline)
export(agOutlineWidth)
export(agPassage)
export(agReactivityAdjustments)
export(agReassortant)
export(agReference)
export(agRotation)
export(agSequences)
Expand All @@ -106,6 +114,7 @@ export(agSize)
export(agStress)
export(agStressBlobSize)
export(agStressPerTiter)
export(agStrings)
export(agTriangulationBlobSize)
export(allMapDimensions)
export(allMapStresses)
Expand Down Expand Up @@ -163,6 +172,7 @@ export(numSera)
export(numSeraGroups)
export(optimizeAgReactivity)
export(optimizeMap)
export(optimizeSubsetAgsIndividually)
export(orderAntigens)
export(orderSera)
export(plot_map_table_distance)
Expand Down Expand Up @@ -209,21 +219,24 @@ export(srGroups)
export(srHomologousAgs)
export(srIDs)
export(srLeverage)
export(srLineage)
export(srNames)
export(srNamesAbbreviated)
export(srNamesFull)
export(srNucleotideSequences)
export(srOutline)
export(srOutlineWidth)
export(srPassage)
export(srReassortant)
export(srReference)
export(srRotation)
export(srSequences)
export(srShape)
export(srShown)
export(srSize)
export(srSpecies)
export(srStress)
export(srStressBlobSize)
export(srStressPerTiter)
export(srStrings)
export(srTriangulationBlobSize)
export(standardizeStrainNames)
export(stressBlobs)
Expand Down
25 changes: 25 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Racmacs 1.1.11
* Added a `NEWS.md` file to track changes to the package.
* Added test and correction for error where coordinates of under-constrained points were set to NaN for the first optimization run only, not all.
Expand Down Expand Up @@ -137,3 +138,27 @@
# Racmacs 1.1.31
* Added checks for disconnected groups of points and functions `mapCohesion()`, `agCohesion()`, `srCohesion()` to diagnose poorly connected groups of points
* Add support for point transparency set either through `agOpacity()` and `srOpacity()` or appropriate hex code to the point fill or outline attribute e.g. `"#FF000099"`.

# Racmacs 1.1.32
* Disconnected maps now return an error rather than a warning
* `agStressPerTiter()` and `srStressPerTiter()` now return a matrix with columns corresponding to stress per titer when nd values are excluded and when they are included
* Corrected error when coloring maps by stress or showing error lines with disconnected points
* If a titer table has column or row names but not sera or antigen names provided, names will be taken from the row and column names when creating a map.
* Add support for reading maps with brotli compression
* `agSequences()` and `srSequences()` now works when the stored sequences have different lengths or are missing for some points
* Correct error where maps with duplicate antigen or serum names would not optimize

# Racmacs 1.1.33
* Add some basic support for viewing 1D maps
* Fix an issue viewing sequence data where sequence data is not present for all antigens / sera
* Fix an error reoptimize merging maps with no optimizations
* Add verbosity argument to `mergeMaps()`
* Verbosity argument also suppresses optimization progress messages
* Issue a warning if duplicate antigen or serum names are found when creating a map

# Racmacs 1.1.34
* Add support for getting and setting serum species with `srSpecies()`.
* Redundant attributes `agNamesAbbreviated`, `agNamesFull`, `srNamesAbbreviated`, `srNamesFull` removed

# Racmacs 1.1.35
* Add antigen and sera attributes: `agLineage()`, `srLineage()`, `agReassortant()`, `srReassortant()`, `agStrings()`, `srStrings()`, `agContinent()`, `agNucleotideSequences()`, `srNucleotideSequences()`
92 changes: 66 additions & 26 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,24 @@ ac_ag_get_name <- function(ag) {
.Call('_Racmacs_ac_ag_get_name', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_name_full <- function(ag) {
.Call('_Racmacs_ac_ag_get_name_full', PACKAGE = 'Racmacs', ag)
ac_ag_get_extra <- function(ag) {
.Call('_Racmacs_ac_ag_get_extra', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_name_abbreviated <- function(ag) {
.Call('_Racmacs_ac_ag_get_name_abbreviated', PACKAGE = 'Racmacs', ag)
ac_ag_get_lineage <- function(ag) {
.Call('_Racmacs_ac_ag_get_lineage', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_extra <- function(ag) {
.Call('_Racmacs_ac_ag_get_extra', PACKAGE = 'Racmacs', ag)
ac_ag_get_reassortant <- function(ag) {
.Call('_Racmacs_ac_ag_get_reassortant', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_strings <- function(ag) {
.Call('_Racmacs_ac_ag_get_strings', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_continent <- function(ag) {
.Call('_Racmacs_ac_ag_get_continent', PACKAGE = 'Racmacs', ag)
}

ac_ag_get_match_id <- function(ag) {
Expand Down Expand Up @@ -149,16 +157,24 @@ ac_ag_set_name <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_name', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_name_full <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_name_full', PACKAGE = 'Racmacs', ag, value)
ac_ag_set_extra <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_extra', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_lineage <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_lineage', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_name_abbreviated <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_name_abbreviated', PACKAGE = 'Racmacs', ag, value)
ac_ag_set_reassortant <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_reassortant', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_extra <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_extra', PACKAGE = 'Racmacs', ag, value)
ac_ag_set_strings <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_strings', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_continent <- function(ag, value) {
.Call('_Racmacs_ac_ag_set_continent', PACKAGE = 'Racmacs', ag, value)
}

ac_ag_set_group <- function(ag, value) {
Expand Down Expand Up @@ -345,6 +361,10 @@ ac_sr_get_passage <- function(sr) {
.Call('_Racmacs_ac_sr_get_passage', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_species <- function(sr) {
.Call('_Racmacs_ac_sr_get_species', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_clade <- function(sr) {
.Call('_Racmacs_ac_sr_get_clade', PACKAGE = 'Racmacs', sr)
}
Expand All @@ -357,16 +377,24 @@ ac_sr_get_name <- function(sr) {
.Call('_Racmacs_ac_sr_get_name', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_name_full <- function(sr) {
.Call('_Racmacs_ac_sr_get_name_full', PACKAGE = 'Racmacs', sr)
ac_sr_get_extra <- function(sr) {
.Call('_Racmacs_ac_sr_get_extra', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_name_abbreviated <- function(sr) {
.Call('_Racmacs_ac_sr_get_name_abbreviated', PACKAGE = 'Racmacs', sr)
ac_sr_get_lineage <- function(sr) {
.Call('_Racmacs_ac_sr_get_lineage', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_extra <- function(sr) {
.Call('_Racmacs_ac_sr_get_extra', PACKAGE = 'Racmacs', sr)
ac_sr_get_reassortant <- function(sr) {
.Call('_Racmacs_ac_sr_get_reassortant', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_strings <- function(sr) {
.Call('_Racmacs_ac_sr_get_strings', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_continent <- function(sr) {
.Call('_Racmacs_ac_sr_get_continent', PACKAGE = 'Racmacs', sr)
}

ac_sr_get_match_id <- function(sr) {
Expand Down Expand Up @@ -401,6 +429,10 @@ ac_sr_set_passage <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_passage', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_species <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_species', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_clade <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_clade', PACKAGE = 'Racmacs', sr, value)
}
Expand All @@ -413,16 +445,24 @@ ac_sr_set_name <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_name', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_name_full <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_name_full', PACKAGE = 'Racmacs', sr, value)
ac_sr_set_extra <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_extra', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_name_abbreviated <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_name_abbreviated', PACKAGE = 'Racmacs', sr, value)
ac_sr_set_lineage <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_lineage', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_extra <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_extra', PACKAGE = 'Racmacs', sr, value)
ac_sr_set_reassortant <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_reassortant', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_strings <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_strings', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_continent <- function(sr, value) {
.Call('_Racmacs_ac_sr_set_continent', PACKAGE = 'Racmacs', sr, value)
}

ac_sr_set_homologous_ags <- function(sr, value) {
Expand Down Expand Up @@ -469,8 +509,8 @@ ac_merge_tables <- function(maps, merge_options) {
.Call('_Racmacs_ac_merge_tables', PACKAGE = 'Racmacs', maps, merge_options)
}

ac_merge_reoptimized <- function(maps, num_dims, num_optimizations, optimizer_options, merge_options) {
.Call('_Racmacs_ac_merge_reoptimized', PACKAGE = 'Racmacs', maps, num_dims, num_optimizations, optimizer_options, merge_options)
ac_merge_reoptimized <- function(maps, num_dims, num_optimizations, min_col_basis, optimizer_options, merge_options) {
.Call('_Racmacs_ac_merge_reoptimized', PACKAGE = 'Racmacs', maps, num_dims, num_optimizations, min_col_basis, optimizer_options, merge_options)
}

ac_merge_frozen_overlay <- function(maps, merge_options) {
Expand Down
19 changes: 18 additions & 1 deletion R/map_loadsave.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ read.acmap <- function(

# Read the data from the file
jsondata <- paste(readLines(filename, warn = FALSE), collapse = "\n")
map <- json_to_acmap(jsondata)
map <- tryCatch(
json_to_acmap(jsondata),
error = function(e) {
tryCatch(
read_brotli(filename),
error = function(e) {
stop("File '", filename, "' could not be parsed", call. = FALSE)
}
)
}
)

# Apply arguments
if (!is.null(optimization_number)) {
Expand All @@ -48,6 +58,13 @@ read.acmap <- function(

}

# Function to read brotli compressed maps
read_brotli <- function(filepath) {
bin_file <- readBin(filepath, "raw", file.info(filepath)$size)
bin_uncompressed <- brotli::brotli_decompress(bin_file)
json_to_acmap(rawToChar(bin_uncompressed))
}


#' Save acmap data to a file
#'
Expand Down
Loading