Skip to content
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

Error if GRangesList has names #38

Open
j-lawson opened this issue May 27, 2020 · 2 comments
Open

Error if GRangesList has names #38

j-lawson opened this issue May 27, 2020 · 2 comments

Comments

@j-lawson
Copy link
Contributor

If the GRangesList that is given to runLOLA as part of the regionSetDB has names for each region set, an error results. This can be fixed by setting the names to NULL to trigger the code chunk referenced below. Suggested fix: make the conditional code chunk no longer conditional.

if (any(is.null(names(testSetsGRL)))) {

@nsheff
Copy link
Owner

nsheff commented May 27, 2020

I'm not sure why that would happen...you're suggesting throw away all names all the time? This appears to be only setting names if they aren't set.

it would be helpful if you paste the text of the error...

@j-lawson
Copy link
Contributor Author

Error:

Error in bmerge(i, x, leftcols, rightcols, roll, rollends, nomatch, mult, :
Incompatible join types: x.dbSet (factor) and i.dbSet (integer). Factor columns must join to factor or character columns.

When loading the LOLA region databases, the regionDB$regionGRL names are NULL by default so the function works. When regionDB$regionGRL has names that are not NULL the function errors. I think the problem comes from trying to merge based on columns of different classes (the merge in line 175): scoreTable = scoreTable[annotationDT]. In the first case (names are NULL), the class of both columns that are merged is integer. In the second case, the class of one column is integer and the other is factor (the regionGRL names).

Example:

dbPath = system.file("extdata", "hg19", package="LOLA")
regionDB = loadRegionDB(dbLocation=dbPath)
data("sample_universe", package="LOLA")
data("sample_input", package="LOLA")
names(regionDB$regionGRL) = paste0("dbGR", seq_along(regionDB$regionGRL))

res = runLOLA(userSets, userUniverse, regionDB, cores=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants