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

Cannot create treelog file 'NA' #63

Open
richelbilderbeek opened this issue May 9, 2022 · 5 comments
Open

Cannot create treelog file 'NA' #63

richelbilderbeek opened this issue May 9, 2022 · 5 comments

Comments

@richelbilderbeek
Copy link
Member

Describe the bug

I received this question/bug report by email:

I do successfully install beastier and test the function run_beast2 with the example file '2_4.xml'. But when I switch to my own file which is created by windows version of BEAUti2 and run it with run_beast2, the error message pop out: "Error in value[3L] : Cannot create treelog file 'NA'". I compared the structure of the example files and my file and cannot figure out where is the problem.

I check the version of BEAST2 install by beastier and my windows version of BEAST2. They are the same v2.6.0. So this should not be the problem.

The BEAUti file is attached:
Step_4_1_BEAUti_output.zip

To Reproduce

I guess running the XML with beastier, something like:

beastier::run_beast2_from_file("Step_4_1_BEAUti_output.xml")

Expected behavior

Does a BEAST2 run from the script

Screenshots

If applicable, add screenshots to help explain your problem.

Environment:
Show the results of running the following script:

library(beastier)
beastier::beastier_report()

Additional context
Add any other context about the problem here.

@richelbilderbeek
Copy link
Member Author

I predict that something like create_beast2_options_v2_6() must be run.

@richelbilderbeek richelbilderbeek changed the title Cannot create treelog file 'NA'" Cannot create treelog file 'NA' May 9, 2022
@richelbilderbeek
Copy link
Member Author

By email:

[...] I tried to creat the beast2 input file through the function 'create_beast2_input_file'. My code is:

> create_beast2_input_file(
  'Step 2.3 COI haplotype matrix.fasta',
  site_model = create_gtr_site_model(gamma_site_model = create_gamma_site_model()),
  output_filename = 'Step 4.1 BEAUti output by babette.xml',
  mcmc = create_mcmc(
    chain_length = 9e+07,
    store_every = -1,
    pre_burnin = 0,
    n_init_attempts = 10,
    sample_from_prior = FALSE,
    tracelog = create_tracelog(filename = "Step 4.2 COI BEAST output.log", log_every = 9000),
    screenlog = create_screenlog(log_every = 9000),
    treelog = create_treelog(filename = "Step 4.2 COI BEAST output.trees",log_every = 9000)),
    beauti_options = create_beauti_options_v2_6()
  )

BTW, I guess you mean beauti_options = create_beauti_options_v2_6() rather than beast2_options. Then I execute:

> run_beast2(input_filename = "Step 4.1 BEAUti output by babette.xml")
> run_beast2(input_filename = "Step 4.1 BEAUti output by BEAST v2.6.0.xml")

which give the same error message: "Error in value[[3L]](cond) : Cannot create treelog file 'NA'".

However, the above two xml are executable in BEAST v2.6.0 (see attached screenshot together with files that I have mentioned). Weird!

screenshot

@richelbilderbeek
Copy link
Member Author

My next hypothesis is that the filenames are not allowed to contain spaces. Let's see ...

@richelbilderbeek
Copy link
Member Author

It is the spaces that cause the error, as extract_treelog_filename_from_beast2_input_file has regexps that assume no spaces.

check_can_create_treelog_file <- function(
  beast2_options
) {
  # Extract the treelog file
  testthat::expect_true(file.exists(beast2_options$input_filename))
  treelog_filename <- beastier::extract_treelog_filename_from_beast2_input_file(
    input_filename = beast2_options$input_filename
  )

richelbilderbeek pushed a commit to ropensci/beautier that referenced this issue May 9, 2022
@richelbilderbeek
Copy link
Member Author

beautier no disallows spaces in filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant