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

Version bug with addLogo function giving wrong logo URLs #36

Open
ycl6 opened this issue Oct 17, 2023 · 1 comment
Open

Version bug with addLogo function giving wrong logo URLs #36

ycl6 opened this issue Oct 17, 2023 · 1 comment

Comments

@ycl6
Copy link

ycl6 commented Oct 17, 2023

There's a bug with the addLogo function were the dbVersion always ended up with v10 and not the previous v9 when old version of the database is used.

addLogo <- function(motifEnrDT, addHTML=TRUE, dbVersion=NULL, motifCol="motif")
{
# Depending on whether it is the motif enrichment or annotation file:
annotationVersion <- attr(motifEnrDT, "annotationVersion")
if(is.null(annotationVersion)) annotationVersion <- attr(motifEnrDT, "SourceFileName")
if(is.null(annotationVersion))
{
warning("There is no annotation version attribute in the input table ",
"(it has probably been loaded with an older version of the package).",
"'v9' will be used as it was the old default,",
"but we recommend to re-load the annotations and/or re-run the enrichment to make sure everything is consistent.")
dbVersion <- 'v9'
}
if(is.null(dbVersion))
{
if(grepl('v10|10nr', annotationVersion)) dbVersion <- 'v10nr_clust'
if(grepl('v8|mc8nr', annotationVersion)) dbVersion <- 'v8'
if(grepl('v9|mc9nr', annotationVersion)) dbVersion <- 'v9'
}else{
dbVersion <- 'v10nr_clust'
}

In Line 28-35, the code already assigned v9 to dbVersion if previous version is detected.

if(is.null(annotationVersion))
{
warning("There is no annotation version attribute in the input table ",
"(it has probably been loaded with an older version of the package).",
"'v9' will be used as it was the old default,",
"but we recommend to re-load the annotations and/or re-run the enrichment to make sure everything is consistent.")
dbVersion <- 'v9'
}

But the next if/else reset it back to v10nr_clust because dbVersion is not NULL.
The lead to wrong URLs to the motif logos embedded in the HTML.

if(is.null(dbVersion))
{
if(grepl('v10|10nr', annotationVersion)) dbVersion <- 'v10nr_clust'
if(grepl('v8|mc8nr', annotationVersion)) dbVersion <- 'v8'
if(grepl('v9|mc9nr', annotationVersion)) dbVersion <- 'v9'
}else{
dbVersion <- 'v10nr_clust'
}

@ycl6 ycl6 changed the title Version bug with addLogo function given wrong logo URL Version bug with addLogo function giving wrong logo URLs Oct 17, 2023
@YachengPan
Copy link

Do you have any methods to solve this bug? I encounter the same bug. Look forword to your reply.

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