richelbilderbeek / pirouette

R package that estimates the error BEAST2 makes from a given phylogeny
GNU General Public License v3.0
3 stars 2 forks source link

'init_pir_params' must replace '$(tree)' by filename that has the same path as the other files #397

Closed richelbilderbeek closed 4 years ago

richelbilderbeek commented 4 years ago

Describe the bug

Currently, 'init_pir_params' replace '$(tree)' by a local filename, e.g. 'alignment.log:

  if (is.na(tracelog_filename)) {
    experiment$inference_model$mcmc$tracelog$filename <-
    paste0(
      beautier::get_alignment_id(alignment_params$fasta_filename),
      ".log"
    )
  }

This is fine, iff the other files (treelog, screenlog) are also local. Usually, this is not the case, so these three files end up in different folders.

To Reproduce Script to reproduce the behavior:

pirouette::get_pir_params_filenames(pirouette::create_test_pir_params())
 [1] "/home/richel/GitHubs/pirouette_example_30/example_30_314/alignment_147a6f5d1426_twin.trees" 
 [2] "/home/richel/GitHubs/pirouette_example_30/example_30_314/beast2_147a4be322e4_twin.xml.state"
 [3] "/home/richel/GitHubs/pirouette_example_30/example_30_314/beast2_147a680a0575_twin.xml.state"
 [4] "/home/richel/GitHubs/pirouette_example_30/example_30_314/beast2_147add2aee5_twin.xml"       
 [5] "/home/richel/GitHubs/pirouette_example_30/example_30_314/beast2_147ae39e19e_twin.xml"       
 [6] "/home/richel/GitHubs/pirouette_example_30/example_30_314/errors_147a467938ca_twin.csv"      
 [7] "/home/richel/GitHubs/pirouette_example_30/example_30_314/errors_147a7ce0e1f_twin.csv"       
 [8] "~/GitHubs/pirouette_example_30/example_30_314/alignment_147a40eef2dd_twin.fasta"            
 [9] "~/GitHubs/pirouette_example_30/example_30_314/alignment_147a6f5d1426.fasta"                 
[10] "~/GitHubs/pirouette_example_30/example_30_314/alignment_147a6f5d1426.trees"                 
[11] "~/GitHubs/pirouette_example_30/example_30_314/beast2_147a4be322e4.xml.state"                
[12] "~/GitHubs/pirouette_example_30/example_30_314/beast2_147a680a0575.xml.state"                
[13] "~/GitHubs/pirouette_example_30/example_30_314/beast2_147add2aee5.xml"                       
[14] "~/GitHubs/pirouette_example_30/example_30_314/beast2_147ae39e19e.xml"                       
[15] "~/GitHubs/pirouette_example_30/example_30_314/errors_147a467938ca.csv"                      
[16] "~/GitHubs/pirouette_example_30/example_30_314/errors_147a7ce0e1f.csv"                       
[17] "~/GitHubs/pirouette_example_30/example_30_314/evidence_147a52187ed8_twin.csv"               
[18] "~/GitHubs/pirouette_example_30/example_30_314/evidence_147ad830312.csv"                     
[19] "~/GitHubs/pirouette_example_30/example_30_314/tree_147ab22f45f_twin.newick"                 
[20] "alignment_147a6f5d1426_twin.log"                                                            
[21] "alignment_147a6f5d1426.log" 

Expected behavior A clear and concise description of what you expected to happen.

I expect the last two filesnames

[20] "alignment_147a6f5d1426_twin.log"                                                            
[21] "alignment_147a6f5d1426.log" 

to be

[20] "~/GitHubs/pirouette_example_30/example_30_314/alignment_147a6f5d1426_twin.log"                                                            
[21] "~/GitHubs/pirouette_example_30/example_30_314/alignment_147a6f5d1426.log" 

Screenshots

NA

Environment: Show the results of running the following script:

library(mcbette)
mcbette::mcbette_report()
> mcbette::mcbette_report()
***********
* mcbette *
***********
Can run mcbette: TRUE
OS: unix
****************
* Dependencies *
****************
beautier version: 2.3.4
tracerer version: 2.0.4
beastier version: 2.1.2
mauricer version: 2.0.6
babette version: 2.1.2
**********
* BEAST2 *
**********
Java version: 11.0.6+10-post-Ubuntu-1ubuntu119.10.1
Is BEAST2 installed: TRUE
BEAST2 version: 2.6.1
BEAST2 default path: /home/richel/.local/share/beast/bin/beast
*******************
* BEAST2 packages *
*******************
Is BEAST2 NS package installed: TRUE
BEAST2 NS installed version: 1.1.0
BEAST2 NS latest version: 1.1.0
***************
* sessionInfo *
***************
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.10

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=nl_NL.UTF-8          LC_NAME=nl_NL.UTF-8          
 [9] LC_ADDRESS=nl_NL.UTF-8        LC_TELEPHONE=nl_NL.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=nl_NL.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.6.1 magrittr_1.5   tools_3.6.1    curl_4.3       rappdirs_0.3.1
 [6] beautier_2.3.4 mcbette_1.8.2  mauricer_2.0.6 stringi_1.4.6  beastier_2.1.2
[11] stringr_1.4.0  testit_0.11    rJava_0.9-11  

Additional context

None

richelbilderbeek commented 4 years ago

Done!