roblanf / MixtureModelHMM

Post-processes the output of phylogenetic mixture models using HMMs
GNU General Public License v2.0
0 stars 1 forks source link

plot_scatter gsub breaks file paths in run_HMM #18

Open fredjaya opened 2 years ago

fredjaya commented 2 years ago

It seems like the gsub breaks the file path and plot_scatter() can no longer find the original site_info file. This only occurs when running run_HMM() due to the gsub.

It first didn't work when calling a symlink for site_info, but managed to reproduce this error without symlinks when site_info is a .sitelh file.

https://github.com/roblanf/MixtureModelHMM/blob/98f7ff69b1ddb9757b038fa2d1a4d019a307f9cc/R/BW-models.R#L148

Command: (All files and R script in the same directory)

library(MixtureModelHMM)
run_HMM(site_info = "toy.sitelh", aln_info = "toy.alninfo")

Error message:

[1] "# Loading input files"
[1] "# Initialising HMM"
[1] "Model 4 - 3 additional emission for constant site, non-informative sites and same parsimony"
[1] "The probability of these addtional emissions is equal for all classes"
[1] "Sites emitted from each class"
seq
  E1   E2   E3   E4 
 550 1187 2944  319 
[1] "# Training HMM"
[1] "# Running viterbi algorithm"
[1] "# Making alignment plot"
Error in if (file.info(input_filepath)$size > 1e+05) { : 
  missing value where TRUE/FALSE needed

Minimum reproducible (hopefully) example attached