Closed lizzyjoan closed 2 years ago
Hi, I've been trying to reproduce the error with different combinations of TFs and databases but so far I've not been able to, so more context would be appreciated.
Are you using the default database, or one of the larger ones available in the downloads repository? is GSEA_run() being run inside a function?
This error is usually triggered when there's a difference between the database chip_index was built with and the database available in GSEA_run()'s environment. All the functions in TFEA.ChIP that require to use the ChIP-gene databases will expect them to be defined in the global environment, and if not, use the internal database of the package (which is considerably smaller due to the space limits in Bioconductor). This differences in environments often happen when running TFEA.ChIP inside another function, and that's why we added the function set_user_data(), that assigns a ChIP-gene database and associated metadata to the global environment.
An example of the difference, let's define two functions:
example_Function <- function( tf ){
# load large DB
load("ReMap2022+EnsTSS+GH.Rdata")
nrow( get_chip_index( TFfilter = tf, encodeFilter = T ) )
}
example_Function_2 <- function( tf ){
# load large DB
load("ReMap2022+EnsTSS+GH.Rdata")
set_user_data( MetaData, ChIPDB ) # assign objects to the global envir.
nrow( get_chip_index( TFfilter = tf, encodeFilter = T ) )
}
When we run the two:
> example_Function( tf=c( "ATF1", "CTCF" ) )
[1] 32
> example_Function_2( tf=c( "ATF1", "CTCF" ) )
[1] 282
Please get back to me if this isn't the issue you're having. Cheers
Thank you for all your help and suggestions! It looks like it's working. I appreciate it!
Hello, We've been running into an error while using your package and hoped you could help. When running the GSEA_run() function, we keep getting this error
Even when using the toy data from the vignette, if get_chip_index(encodeFilter = TRUE) or other sets of TF's other than the 3 listed in the vignette, we still get this error (just with varying numbers for the differing number of rows.)
A labmate tracked down the issue to line 1317 here of the GSEA_run function, where it's trying to build a dataframe from calculated variables just above, and one does not have the same dimensions as the others, which we believe is leading to this error.
Please let me know if you have any suggestions or need any other information. Thank you for your time!