christianparobek / skeleSim

Null models, performance testing, and power estimation with population simulations
3 stars 6 forks source link

locus.param data.frame created with factor columns #66

Open EricArcher opened 7 years ago

EricArcher commented 7 years ago

A skeleSim user at a workshop I'm about to attend has identified a bug in writing SNP files with fastsimcoal. Her specific issue was that a mutation rate entered as 1e-08 was written as 1 in the fastsimcoal input file. Tracing it back (skeleSim ssClass object and fastsimcoal .par input in Archive.zip) showed that the locus.params data.frame was created such that all columns were factors and the input writing routine wrote the factor level rather than the value.

I have modified the writing in strataG to do an as.character() conversion which should solve this from the strataG side, but I wanted to give a heads-up in case the issue arises elsewhere. Perhaps adding a general options(stringsAsFactors = FALSE) would be prudent.