-
Notifications
You must be signed in to change notification settings - Fork 1
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
vignette update + function addition #19
base: main
Are you sure you want to change the base?
Conversation
- updated vignette to reflect wording change from "caucasian" to "european" - added example usage of the predictPreeclampsia.R function to vignette - posted code for the predictPreeclampsia.R function
Hey @iciarfernandez thanks for the PR! I made some changes onto main:
|
Here is some code to use your model data I uploaded onto bioconductor. Note that you will need to install and use bioconductor devel
So those objects will be made available in the environment after loading with the code above. Other things to do:
After that I will take a more in depth review before merging. Let me know if you have any questions or want help! |
Hey, Thanks for the code! So it's working to load exactly what you copy-pasted above, but when I actually try to retrieve the eoPredModel object by running
Not sure if we need to fix something in the hub package before going forward then? Moreover, I was just wondering how to then load the data from ExperimentHub into the function - is the idea to include
at the start of the code (within the function itself) to basically serve the same purpose as If that's the case I think I can figure out the rest by myself but I'll let you know if I have any more questions. Thank you, |
Hey try downgrade bioconductor to 3.17:
Yes I think so |
I relabelled "Caucasian" to "European" so now vignette continuesup to eoPred section: processing file: planet.Rmd Quitting from lines 333-366 [unnamed-chunk-12] (planet.Rmd)
|
I updated the function to include the code where I load the model object (which yes, I think it basically replaces the equivalent of `data(ethnicityCpGs, envir=environment())` in the ethnicity function) and to require the mixOmics and ExperimentHub packages, ran `devtools::document()`, then `devtools::check()`. I think everything with the function is working now - the error that I am getting now with `devtools::check()` is about the vignette; `valMeta` in the vignette is supposed to be the pData of the `val` object, but we didn't actually upload it to the ExperimentHub so I can't load it. If you could update the ExperimentHub to 1) include the `valMeta` object, which I have added [to the dropbox](https://www.dropbox.com/scl/fi/byok0mkwl7iqwssexg5d2/valMeta.csv?rlkey=c0hle2lwgost83u6o6u4iwzku&dl=0) and 2) delete the `x_test` object and instead include a new `val` object valBMIQ, also [now in the dropbox](https://www.dropbox.com/scl/fi/uteq2joahew6wm9i0wl35/valBMIQ.rds?rlkey=er4trp4bg4xkskvey4yihgw4d&dl=0), then I can try running `devtools::check()` again and hopefully everything works! Last but not least, I downgraded to Bioconductor 3.17 but still getting this warning when I try to load the data from ExperimentHub() > Warning message: > package ‘eoPredData’ is not available for Bioconductor version '3.17' Even though it does seem to install - i.e., I am able to run `mod = eh[["EH8090"]]` and it works to load the data. Anyway, it doesn't seem to be a problem?
I updated the function to include the code where I load the model object (which yes, I think it basically replaces the equivalent of I think everything with the function is working now - the error that I am getting now with If you could update the ExperimentHub to 1) include the Last but not least, I downgraded to Bioconductor 3.17 but still getting this warning when I try to load the data from ExperimentHub()
Even though it does seem to install - i.e., I am able to run |
One more thing - it was discussed at lab meeting that instead of |
R/predictPreeclampsia.R
Outdated
print(paste0("Input data must be a matrix or an array")) | ||
} | ||
|
||
subset <- betas[,colnames(betas) %in% trainCpGs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider renaming "subset" to something else, since subset
is a base R function
R/predictPreeclampsia.R
Outdated
CP <- as.data.frame(CP) %>% tibble::rownames_to_column("Sample_ID") | ||
CP$Pred_Class <- CP$comp1 | ||
CP <- CP %>% | ||
dplyr::mutate(Pred_Class = dplyr::case_when(EOPE > 0.55 ~ "EOPE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming Pred_Class
to something more informative related to PE (e.g. eoPred_class
, predicted_pe
, pe_status
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - will make this change too!
.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's delete this
Hi Iciar! Thanks for comments. Let me know if I'm understanding correctly:
So if this is the new plan, then we don't need the experimentHub package for the function to work. If this is true, then we need the following r objects to be added to the R package itself as sysdata.rda (internal, not available to user) or as rds objects:
But need to ensure that they are the under the size limit -- the model object was over limit hence the original plan to use the experimenthub pretrained model object. Let's also just focus on the function for now, and worry about vignette after. I suggest maybe setting the code chunks in vignette to eval = FALSE for now to get the checks to run through |
I am moving this to a new issue to organize our discussions more |
It does! Not sure if it didn't push correctly, but from my end this is the code I am seeing for the start of the
The issue I am having that I described here is that I need a few objects updated in the ExperimentHub package to fix the errors that |
Ah I was looking at the wrong branch! Can you set the vignette to code chunks to false for now so we can focus on the function and related check errors? In the meantime I'll add those objects to experimenthub and remove x_test, it will require bioconductor to give us access. |
R/predictPreeclampsia.R
Outdated
#' @import mixOmics | ||
#' @import ExperimentHub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to import the whole packages, can we remove these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how to fix the error that the devtools check was throwing other than by adding these as imports, is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's fixed by importing the whole package, then likely there is some mixOmics function that ins't being called without double colons e.g. should be dplyr::slice
instead of just slice
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think taking dependency on mixomics and experimenthub is overkill -> particularly mixomics seems like a large package and my worry is that it will 1) if mixomics has dependencies itself then many more subdependencies will be created
I can take a look
EDIT: basically I'm asking to remove these two import lines, and then add mixOmics::FUNCTION / ExperimentHub::FUNCTION whenever they are needed, then run the checks to see if any warnings / errors still there. If not then great.
R/predictPreeclampsia.R
Outdated
#' To predict early preeclampsia on 450k/850k samples | ||
#' | ||
#' Load data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need comments (hashes #) or will cause errors
#' # Load Data
not
#' Load Data
vignettes/planet.Rmd
Outdated
other threshold, different labels can be assigned based on the output | ||
probabilities. | ||
|
||
```{r include=FALSE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, we can set these to FALSE, and focus on vignette in a different PR / branch
In response to everything:
The warning is
and the notes are
On the other hand,
Let me know what you think! |
the parameter
Am not sure if Notes need to be addressed for bioconductor/cran. I recall that they are ok to have but can you check?
Let's see if this is still there after addressing the examples error for predictPreclampsia.
Done. Reminds me, can you add yourself as a contributor or author to DESCRIPTION? |
Hi Victor, Sorry that I dropped the ball on this, I got distracted with finishing projects and thesis writing - I think I made all the changes you requested. Please let me know of anything else I need to get done on my end and hopefully we can get this working soon! Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look and see what I can finish
R/predictPreeclampsia.R
Outdated
predictPreeclampsia <- function(betas, ...){ | ||
|
||
# read in data to generate model | ||
eh = ExperimentHub() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing ::
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this file / add to gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, added to gitignore
R/predictPreeclampsia.R
Outdated
#' @import mixOmics | ||
#' @import ExperimentHub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think taking dependency on mixomics and experimenthub is overkill -> particularly mixomics seems like a large package and my worry is that it will 1) if mixomics has dependencies itself then many more subdependencies will be created
I can take a look
EDIT: basically I'm asking to remove these two import lines, and then add mixOmics::FUNCTION / ExperimentHub::FUNCTION whenever they are needed, then run the checks to see if any warnings / errors still there. If not then great.
The email I have right now for you is
|
I implemented the requested changes and check() didn't throw any errors or warnings. Re: your last comment, if you could change my email to iciarfernandez@outlook.com instead that would be great - I signed up to the support site with that email. Thank you! |
Some merge conflicts, need to pull branch main into branch eoPred and locally fix merge conflicts |
updated vignette to reflect wording change from "caucasian" to "european"
added example usage of the predictPreeclampsia.R function to vignette
posted code for the predictPreeclampsia.R function