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

Failed to run function getTable under certain condtion #2

Open
chengmingbo opened this issue Nov 5, 2019 · 7 comments
Open

Failed to run function getTable under certain condtion #2

chengmingbo opened this issue Nov 5, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@chengmingbo
Copy link

Hi there,

Under certain condition, getTable function will throw an error.
The problem emerges when machine[[i]] == character(0).
I just fixed the problem by changing the code here:

  tab = do.call(rbind, lapply(1:ncol(fc), function(i) {
    lastcol = colnames(gs$specScore)[i]
    if(length(machine[[i]]) <= 0){
      lastcol = character(0)
    }
    data.frame(fc[which(rownames(fc) %in% 
    machine[[i]]), i], pp$adjpval[which(rownames(pp$adjpval) %in% 
    machine[[i]]), i], gs$specScore[which(rownames(gs$specScore) %in% 
    machine[[i]]), i], lastcol)}))
@mahmoudibrahim
Copy link
Owner

Hi

awesome..thanks for finding and fixing this bug :)

let me know if you would like to make a pull request. Otherwise, I will incorporate the changes and release a new version in the next few days!

best wishes
Mahmoud

@mahmoudibrahim mahmoudibrahim added the bug Something isn't working label Nov 6, 2019
@mahmoudibrahim
Copy link
Owner

Hi @chengmingbo

I've actually noticed another additional bug with getTable. So I rewrote the function, fixed the bugs and also made it much faster.

The new release includes all the edits:
https://github.com/mahmoudibrahim/genesorteR/releases/tag/v0.4.0

best wishes
Mahmoud

@mahmoudibrahim
Copy link
Owner

hi again @chengmingbo

there was still a bug in there, not enough caffeine this morning :) - should be bug-free now as far as I can tell, but please let me know if it still breaks

https://github.com/mahmoudibrahim/genesorteR/releases/tag/v0.4.1

best wishes
Mahmoud

@chengmingbo
Copy link
Author

hi again @chengmingbo

there was still a bug in there, not enough caffeine this morning :) - should be bug-free now as far as I can tell, but please let me know if it still breaks

https://github.com/mahmoudibrahim/genesorteR/releases/tag/v0.4.1

best wishes
Mahmoud

Hi, Mahmoud,
Thanks for your information, it is good to know, I will try it later on.

@sidwekhande
Copy link

Hi Mahmoud,

This bug may not be from your side, but it is related to the getTable() function and this is just so you are aware of it:

When I run getTable(sg, pv), I get the following error -

getTable(sg, pv)
Error in isFALSE(fc_cutoff) : could not find function "isFALSE"

I did some digging, and it goes back to the R version (I am running 3.4.3). This issue (r-spatial/mapview#177) references it as well.
Using !is.null(x) && !isTRUE(x) is something you could consider so that you do not have to have the R version > 3.5 requirement :)

genesorteR is a great package, loved it!

@mahmoudibrahim
Copy link
Owner

Hi Siddarth

Thank you so much for looking into this, and for the suggestion! I wasn't aware of that R version issue.

I will implement the change and release a new version in the next couple of days. Will update this issue then.

best wishes
Mahmoud

@mahmoudibrahim
Copy link
Owner

Hi @sidwekhande

I've now released a new version without the dependency on isFALSE:

https://github.com/mahmoudibrahim/genesorteR/releases/tag/v0.4.2

if you are using an older version, please consider installing the newest version.

best wishes
Mahmoud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants