Skip to content

Version bug with addLogo function giving wrong logo URLs #36

@ycl6

Description

@ycl6

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'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions