acorg / Racmacs

Racmacs R package for performing antigenic cartography
https://acorg.github.io/Racmacs/
GNU Affero General Public License v3.0
20 stars 9 forks source link

Starting coordinates are not good for some maps #123

Open drserajames opened 2 years ago

drserajames commented 2 years ago

My understanding is that the randomisation step before optimisation is the same as the default behaviour of randomizeCoords(); "The maximum table distance is calculated then points are randomized in a box with side length equal to maximum table distance multiplied by table_dist_factor" where table_dist_factor=2. I tried relaxing a map with different table_dist_factor and found that 2 was not good (both in terms of stress and how the map looks - I have some not very well coordinated points that were getting hemisphered). table_dist_factor=0.1 had the lowest stress. table_dist_factor=0.01 had the next lowest (0.2% higher) and the map looked more consistent.

opt_stress_table_dist_factor

My ideal behaviour would be allowing the user to set the table_dist_factor when running optimizeMap(), perhaps as part of RacOptimizer.options. I don't know if the default should change, or if it's particular to large maps/those with lots of missing titres/this map. I expect a default based on the average distance would be better, as the maximum is affected by outliers.