Giter VIP home page Giter VIP logo

Comments (14)

burrowsk avatar burrowsk commented on June 12, 2024 1

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

function call:

res <- run_eggla_lmm(
  data = fread(phenotypes_nopub.csv),
  id_variable = "ID",
  age_days_variable = "days",
  age_years_variable = "age",
  weight_kilograms_variable = "weight",
  height_centimetres_variable = "height",
  sex_variable = "sex",
  covariates = "sourceb",
  male_coded_zero = FALSE,
  random_complexity = 2,
  use_car1 = FALSE,
  parallel = TRUE,
  parallel_n_chunks = 5,
  working_directory = output_directory
)

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

Are the two archives still in the folder output_directory?

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

Yes the directories remain, they are just empty.

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

I meant the zip files?
The zip archives are created at the root of output_directory (in your case) using two sub-directories "male" and "female".
Only the zip archives are kept, while the two directories are deleted.
I can add an option to keep the directories with the outputs in addition to the archives (which contain the same thing).

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

Sorry! no they are not, actually they don't appear to be created.

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

So, you don't have zip archives.
If yes, then this is the real issue here.

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

@burrowsk I changed the way the archives were made.
Could you check if:

  1. You had the issue also with the example (code below).

    # pak::pkg_install("mcanouil/eggla@main")
    remotes::install_github("mcanouil/eggla@main")
    
    library(eggla)
    library(data.table)
    data("bmigrowth")
    fwrite(
      x = bmigrowth,
      file = file.path(tempdir(), "bmigrowth.csv")
    )
    res <- run_eggla_lmm(
      data = fread(file.path(tempdir(), "bmigrowth.csv")),
      id_variable = "ID",
      age_days_variable = NULL,
      age_years_variable = "age",
      weight_kilograms_variable = "weight",
      height_centimetres_variable = "height",
      sex_variable = "sex",
      covariates = NULL,
      random_complexity = 1,
      working_directory = tempdir()
    )
  2. You do not have the issue anymore with the code below (restart R before).

    # pak::pkg_install("mcanouil/eggla@mcanouil/issue41")
    remotes::install_github("mcanouil/eggla@mcanouil/issue41")
    
    library(eggla)
    library(data.table)
    data("bmigrowth")
    fwrite(
      x = bmigrowth,
      file = file.path(tempdir(), "bmigrowth.csv")
    )
    res <- run_eggla_lmm(
      data = fread(file.path(tempdir(), "bmigrowth.csv")),
      id_variable = "ID",
      age_days_variable = NULL,
      age_years_variable = "age",
      weight_kilograms_variable = "weight",
      height_centimetres_variable = "height",
      sex_variable = "sex",
      covariates = NULL,
      random_complexity = 1,
      working_directory = tempdir()
    )

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

With action 1:

  • Message upon completion of function about where the archive files are stored
    -- A temp directory is created in my [path]/AppData/Local/Temp/[Rtmp[xxxx]]
  • The male and female directories are created here.
  • The files are removed from these directories upon completion of the function.
  • There are no zip archives
  • .rds objects are present

With action 2:

  • No message upon completion of function about where the archive files are stored (though can find this myself anyway in AppData/)
  • The male and female directories are created in the Rtmp[xxxx] directory
  • The male and female directories contain the relevant files
  • There are no zip archives created
  • . rds objects are present

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

For safety/time, my changes included:

  • Messages now appeared only if the archives were not created.
  • Directories are not deleted if the archives do not exist.

Can you try a more simple example to identify why the archive is not created? I suspect it won't work for you for some reason.

dir.create(file.path(tempdir(), "test_archive"))
cat("text", file = file.path(tempdir(), "test_archive", "test.txt"))
utils::zip(
  zipfile = file.path(tempdir(), "test.zip"),
  files = list.files(file.path(tempdir(), "test_archive"), full.names = TRUE),
  flags = "-r9Xj"
)
#> updating: test.txt (stored 0%)
list.files(tempdir(), "\\.zip$")
#> [1] "test.zip"

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

You are right it did not work!
However, looking online it appears it may be due to Rtools. I put Rtools in my path as per https://cran.r-project.org/bin/windows/Rtools/rtools40.html
and now it works. I have just tested both actions from earlier and now I have the archives saved to my Rtmp directory. I've unzipped these and the relevant files are present.

Thanks very much for your help, Windows OS can be so awkward!

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

This is what I was thinking about.
To avoid any issues I made some additional changes (5dc0af6) which will allow eggla to work on Windows even without Rtools.
The users will have to archive the results themselves, without the model object.

from eggla.

burrowsk avatar burrowsk commented on June 12, 2024

Yes, I think that is the best approach. It will be easier for other cohort analysts to archive the results themselves than to mess around with Rtools.

from eggla.

mcanouil avatar mcanouil commented on June 12, 2024

I am merging #42

from eggla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.