brookemdavis / Salmon_MSE_Figure_Gallery

Figure gallery for Salmon MSE working group. Upload and browse related figures.
0 stars 2 forks source link

Four Panel Trajectory Plots: Required Libraries? #1

Open SOLV-Code opened 5 years ago

SOLV-Code commented 5 years ago

ISSUE

In this code to create the 4-panel trajectories, I don't recognize the BLOB construct.

SUGGESTIONS

brookemdavis commented 5 years ago

Thanks Gottfried. I debugged the code and added some description in the R script -- do you think this is the best place for us to include a description/preamble?

In short -- a Blob is just an arbitrary name we use for a list that stores all inputs and outputs to a given simulation run. There shouldn't be any libraries to load, and I the script should now be able to run as a standalone piece of code, with the given inputs in the DataIn folder (1 .csv and 13 .rds files).

SOLV-Code commented 5 years ago

Thank, this helps. I ended up here and tried to make sense of it...

Yes, I think the actual code script is the best place for this kind of additional info. It keeps everything together.

I'll test the code when I get a chance, and let you know.

However, now I got a follow-up question about using *.rds files. Does this help with memory size? We've been using the {SOAR} package to handle large amounts of FRSSI output by caching each object as a .RData file, but there is a noticable slow-down when it caches or loads one of the objects. I'm curious if maybe the *.rds options works faster....

brookemdavis commented 5 years ago

I believe RDS could help with your slow loading. I started using RDS files instead of Rdata files on one of my master's projects where I was writing and reading back in large arrays of mcmc outputs, and saw improvement in writing and reading speed switching to RDS. There are a few differences in functionality though, the most noticeable ones for me are that with saveRDS() and readRDS() you can assign the object a new name when you read it back in. You can see this functionality when I read the set of "blobs" back in, I can assign each one to an element of a list. So for example if, in a simulation, you write a bunch of .RDS files called Blob1, Blob2 etc you can read them in as Blobs <- list() BlobNames <- c("Blob1", "Blob2", ...) for(bb in 1:length(BlobNames){ Blobs[[bb]] <- readRDS(paste("BlobNames[bb], ".RDS", sep="") } This is a functionality that can be useful in certain situations.

The other difference to note is that an RDS file can only hold a single object. So each .RDS file holds one "Blob" list.

From: SOLV-Code [mailto:notifications@github.com] Sent: October-03-18 1:03 PM To: brookemdavis/Salmon_MSE_Figure_Gallery Cc: Davis, Brooke; Comment Subject: Re: [brookemdavis/Salmon_MSE_Figure_Gallery] Four Panel Trajectory Plots: Required Libraries? (#1)

Thank, this helps. I ended up herehttps://github.com/tidyverse/blob and tried to make sense of it...

Yes, I think the actual code script is the best place for this kind of additional info. It keeps everything together.

I'll test the code when I get a chance, and let you know.

However, now I got a follow-up question about using .rds files. Does this help with memory size? We've been using the {SOAR} package to handle large amounts of FRSSI output by caching each object as a .RData file, but there is a noticable slow-down when it caches or loads one of the objects. I'm curious if maybe the .rds options works faster....

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/brookemdavis/Salmon_MSE_Figure_Gallery/issues/1#issuecomment-426780754, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHb5lYuw-XaGW3zv3bMUZx7RKCHGuZt0ks5uhRgGgaJpZM4XFUAl.

SOLV-Code commented 5 years ago

Thank you again. That helps a lot. When I get a chance, I will do a speed comparison and let you know.

SOLV-Code commented 5 years ago

Just forked the repo and then ran your code. Works perfectly. So I think this set-up can work out.