Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 16 forks source link

`sumstatsColHeaders` variable missing #12

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

Can't seem to find where this is defined, unless the user defines it as a global beforehand.

Screenshot 2021-07-09 at 12 30 59

bschilder commented 3 years ago

ah i see, it's a data object included in MungeSumstats but not exposed to users. will clarify this with explicit syntax:

MungeSumstats:::sumstatsColHeaders

NOTE: Ended up removing this bc Check didn't like it.

bschilder commented 3 years ago

Functions that use sumstatsColHeaders now seem to be unable to find it despite it being a a built-in dataset. Resolving with data("sumstatsColHeaders") for now.

#' @keywords internal
#' @importFrom data.table setnames
standardise_sumstats_column_headers_crossplatform <-
  function(sumstats_dt, path) {
  message("Standardising column headers.")
  # sumstatsColHeaders <- MungeSumstats:::sumstatsColHeaders
  data("sumstatsColHeaders")
...
...
Al-Murphy commented 3 years ago

You can't use MungeSumstats:::sumstatsColHeaders as now CRAN/Bioconductor checks will pick that up as a internal package function call which isn't allowed. I actually think it's correct to just call the dataset by name like I had?

bschilder commented 3 years ago

@Al-Murphy I agree that the correct way should be the way you originally had it. But for some reason MungeSumstats couldnt find it at some point. Perhaps I should try again the old way and see if it's fixed itself.

Al-Murphy commented 3 years ago

It can't find it when you try run the functions separate to the package. This happens since the dataset is an internal one meaning it isn't open to the user. It will find the package when you call functions from within the package

bschilder commented 3 years ago

Oh i see, i must have been running the functions after sourcing them. I'll go ahead and remove the data("dataset") syntax then and put it back the way it was

bschilder commented 3 years ago

I just tried it the original way, and MungeSumstats fails the checks bc it can't find the object. I cleared my R session first so I can confirm it was not due to sourced functions overriding internal functions.

@Al-Murphy any idea what's going on?

Screenshot 2021-07-14 at 11 44 11

Al-Murphy commented 3 years ago

Have a look at the master branch to compare approach against what you have? It's working fine there

bschilder commented 3 years ago

Just found out this was totally my bad; i deleted sysdata.rda thinking it was a extra file i had accidentlaly created. Just re-downloaded it from master and add back into the dev branch:

https://github.com/neurogenomics/MungeSumstats/blob/master/R/sysdata.rda