Skip to content

Commit

Permalink
fixed order detailed plot; mVar for co-orthologs
Browse files Browse the repository at this point in the history
  • Loading branch information
trvinh committed Feb 1, 2024
1 parent 1447caa commit c89fc24
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: PhyloProfile
Version: 1.17.0
Date: 2023-09-12
Version: 1.17.1
Date: 2024-02-01
Title: PhyloProfile
Authors@R: c(
person("Vinh", "Tran", role = c("aut", "cre"), email = "[email protected]", comment=c(ORCID="0000-0001-6772-7595")),
Expand Down
7 changes: 5 additions & 2 deletions R/parsePhyloProfile.R
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,14 @@ reduceProfile <- function(filteredProfile) {
if (length(unique(levels(as.factor(filteredProfile$numberSpec)))) == 1) {
if (unique(levels(as.factor(filteredProfile$numberSpec))) == 1) {
superDfExt <- filteredProfile[, c(
"geneID", "supertaxon", "supertaxonID",
"var1", "presSpec", "category", "orthoID", "var2", "paralog"
"geneID", "supertaxon", "supertaxonID", "orthoID", "category",
"presSpec", "paralog", "mVar1", "mVar2"
)]
superDfExt$presentTaxa <- 1
superDfExt$totalTaxa <- 1
# rename mVar to var
names(superDfExt)[names(superDfExt) == "mVar1"] <- "var1"
names(superDfExt)[names(superDfExt) == "mVar2"] <- "var2"
flag <- 0
}
}
Expand Down
7 changes: 6 additions & 1 deletion inst/PhyloProfile/R/createDetailedPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ createDetailedPlot <- function(
return(pointInfoDetail)
}

prepareDf <- function(selDf) {
selDf <- selDf[with(dataframe, order(fullName, orthoID)),]
selDf$xLabel <- paste(selDf$orthoID, " (", selDf$fullName, ")", sep = "")
return(selDf)
}

#' create detailed plot
#' @param selDf data for plotting (from reactive fn "detailPlotDt")
Expand Down Expand Up @@ -177,7 +182,7 @@ detailPlot <- function(selDf, detailedText, var1ID, var2ID){
}

# keep order of ID (xLabel)
# detailedDf$id <- factor(detailedDf$id, levels = unique(detailedDf$id))
detailedDf$id <- factor(detailedDf$id, levels = unique(detailedDf$id))

# create plot
gp <- ggplot(detailedDf, aes(y = score, x = id, fill = var)) +
Expand Down

0 comments on commit c89fc24

Please sign in to comment.