This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R interface to the Enrichr - Error in scan

Dear all,

Ive been using R interface to the Enrichr tool. It works well, but for some (very few) gene-list - database combinations I get errors:

Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
  line yyy did not have zzz elements

with yyy being for example 1 or 109 and zzz - 2 or 9. After removing offending database from query, everything goes well.

Due to random nature of the errors, I dont think my input or database itself is a problem.

Here is a function that I am using: https://github.com/AdrianS85/varia/blob/temp4/Working_with_RRBS_data.r#L109-L158 and an exemplary input file: https://github.com/AdrianS85/varia/blob/master/i_vs_rest_overview_placenta_enrich_gene_list.txt

Does anyone have any ideas?

Best, Adrian

enrichr enrichment

This error of scan means that you are scanning a "data.frame" like object, but the offending lines have not the right number of elements (or columns). It happens usually when some of the values in some rows are missing (or less frequently if some rows contain more values than the header)

Could you post just the relevant part of the code, with a minimal input data to reproduce the error?

1 answer

After some testing I found out that the error is generated when input gene list is very large (e.g. ~13 000 gene ids provided in this input data: https://github.com/AdrianS85/varia/blob/master/enrichr_R_interface_example_input)

This code reproduces the problem:

install.packages("enrichR")

x <- read.table(### https://github.com/AdrianS85/varia/blob/master/enrichr_R_interface_example_input ###, stringsAsFactors = F)

enrichR::enrichr(x$V1, "GO_Molecular_Function_2018")

Log in to answer this question.