Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
trvinh committed Jun 22, 2021
1 parent 4568fc5 commit 661331d
Show file tree
Hide file tree
Showing 44 changed files with 44,833 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
49 changes: 24 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
inst/doc
inst/PhyloProfile/data/rankList.txt
inst/PhyloProfile/data/idList.txt
inst/PhyloProfile/data/taxonomyMatrix.txt
inst/PhyloProfile/data/taxonNamesReduced.txt
inst/PhyloProfile/data/taxonNamesFull.txt
inst/PhyloProfile/data/preProcessedTaxonomy.txt
inst/PhyloProfile/data/newTaxa.txt
tests/testthat/Rplots.pdf

rsconnect/
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

*.Rproj
*.rproj
*.Rproj.user/
*.rproj.user
*.Rproj.user
*.rprofile
# produced vignettes
vignettes/*.html
vignettes/*.pdf

vignettes/*.R
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# DS_Store
**/.DS_Store
data/.DS_Store
data/demo/.DS_Store

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron
.renviron
.Rproj.user
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## How-To Contribute

![](http://www.sharegif.com/wp-content/uploads/2014/03/giphy41.gif)

Thank you so much for your interest in contributing to *PhyloProfile*! 🎉👍🍾

Contributions to *PhyloProfile* can take many forms. If you are

**biologist**, you can
* [report bugs](https://github.com/BIONF/PhyloProfile/issues/new) for both online & standalone version,
* [tell us about what features you would love to see](https://github.com/BIONF/PhyloProfile/issues/new),
* improve our documentation, both [in the Wiki](https://github.com/BIONF/PhyloProfile/wiki) and in our [README](https://github.com/BIONF/PhyloProfile/blob/master/README.md),
* discuss about [non-coding issues](https://github.com/BIONF/PhyloProfile/issues?q=is%3Aissue+is%3Aopen+label%3Anon-coding)

**biologist and love coding**, you can
* [fix existing bugs](https://github.com/BIONF/PhyloProfile/issues/),
* or add new features. Some things we'd love to see are
* add scripts to add out-of-the-box support for further orthology prediction tools,
* increasing the test coverage from 0% to something above that,
* or basically whatever great idea you have!
* and all points for non-coding contributors as well :)

**not biologist but can code**, it would be great if you can
* test the tool in different environments (Windows, Linux, Mac - Firefox, Chrome, IE, Safari,...)
* suggest a better user interface
* improve the code quality

Don't hesitate to get in touch with us if you have any questions. You can contact us at [[email protected]](mailto:[email protected])

### Contributors
* [Vinh Tran](https://github.com/trvinh)
* [Bastian Greshake Tzovaras](https://github.com/gedankenstuecke)
* [Carla Moelbert](https://github.com/CarlaMoelbert)
25 changes: 25 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Package: PhyloProfileRibi
Version: 1.0.0
Date: 2021-06-22
Title: PhyloProfileRibi
Authors@R: c(
person("Vinh", "Tran", role = c("aut", "cre"), email = "[email protected]"),
person("Bastian", "Greshake Tzovaras", role = "aut", email = "[email protected]"),
person("Ingo", "Ebersberger", role = "aut", email = "[email protected]"),
person("Carla", "Mölbert", role = "ctb", email = "[email protected]"))
Description: PhyloProfile is a tool for exploring complex phylogenetic profiles. Phylogenetic profiles, presence/absence patterns of genes over a set of species, are commonly used to trace the functional and evolutionary history of genes across species and time. With PhyloProfile we can enrich regular phylogenetic profiles with further data like sequence/structure similarity, to make phylogenetic profiling more meaningful. Besides the interactive visualisation powered by R-Shiny, the package offers a set of further analysis features to gain insights like the gene age estimation or core gene identification.
URL: https://github.com/BIONF/PhyloProfileRibi/
BugReports: https://github.com/BIONF/PhyloProfileRibi/issues
License: MIT + file LICENSE
Depends: R (>= 4.0.0)
Encoding: UTF-8
biocViews: Software, Visualization, DataRepresentation, MultipleComparison, FunctionalPrediction
Imports:
BiocStyle, colourpicker, data.table, DT, energy, ggplot2, shinyBS,
shinyjs, PhyloProfile (>= 1.6.4)
RoxygenNote: 7.1.1
Suggests:
knitr, rmarkdown, testthat,
ape, bioDist, Biostrings, data.table,
gridExtra, pbapply, RColorBrewer, shiny, OmaDB, plyr, xml2, zoo
VignetteBuilder: knitr
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2021 Vinh Tran
Copyright (c) 2016 Vinh Tran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 17 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by roxygen2: do not edit by hand

export(getInputTaxaNameCr)
export(getNameListCr)
export(getSelectedTaxonNamesCr)
export(getTaxonomyMatrixCr)
export(highlightProfilePlotCr)
export(runPhyloProfileRibi)
export(sortInputTaxaCr)
import(BiocStyle)
import(DT)
import(RCurl, except = reset)
import(energy)
import(ggplot2)
import(shinyBS)
import(shinyjs, except = colourInput)
importFrom(colourpicker,colourInput)
77 changes: 77 additions & 0 deletions R/createProfilePlot.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#' Highlight gene and/or taxon of interest on the phylogenetic profile plot
#' @export
#' @usage highlightProfilePlotCr(data, plotParameter = NULL, taxonHighlight =
#' "none", rankName = "none", geneHighlight = "none")
#' @param data dataframe for plotting the heatmap phylogentic profile (either
#' full or subset profiles)
#' @param plotParameter plot parameters, including (1) type of x-axis "taxa" or
#' "genes" - default = "taxa"; (2+3) names of 2 variables var1ID and var2ID -
#' default = "var1" & "var2"; (4) color for lowest var1 - default = "#FF8C00";
#' (5) color for highest var1 - default = "#4682B4"; (6) color for lowest var2 -
#' default = "#FFFFFF", (7) color for highest var2 - default = "#F0E68C", (8)
#' color of co-orthologs - default = "#07D000"; (9+10+11) text sizes for x, y
#' axis and legend - default = 9 for each; (12) legend position "top", "bottom",
#' "right", "left" or "none" - default = "top"; (13) zoom ratio of the
#' co-ortholog dots from -1 to 3 - default = 0; (14) angle of x-axis from 0 to
#' 90 - default = 60; (14) show/hide separate line for reference taxon 1/0 -
#' default = 0; (15) enable/disable coloring gene categories TRUE/FALSE -
#' default = FALSE). NOTE: Leave blank or NULL to use default values.
#' @param taxonHighlight taxon of interst. Default = "none".
#' @param rankName working taxonomy rank (needed only for highlight taxon).
#' @param geneHighlight gene of interest. Default = "none".
#' @import ggplot2
#' @return A profile heatmap plot with highlighted gene and/or taxon of interest
#' as ggplot object.
#' @author Vinh Tran {[email protected]}
#' @seealso \code{\link{dataMainPlot}}, \code{\link{dataCustomizedPlot}}

highlightProfilePlotCr <- function(
data = NULL, plotParameter = NULL, taxonHighlight = "none",
rankName = "none", geneHighlight = "none"
){
if (is.null(data)) stop("Input data cannot be NULL!")
xmin <- xmax <- ymin <- ymax <- NULL
p <- PhyloProfile::heatmapPlotting(data, plotParameter)
# highlight taxon
if (taxonHighlight != "none") {
# get selected highlight taxon ID
nameReducedFile <- paste(
system.file(package = "PhyloProfileRibi"),
"PhyloProfile/data/taxonNamesReduced.txt", sep="/")
if (!file.exists(nameReducedFile)) {
taxonNamesReduced <- NULL
delayedAssign("taxName", taxonNamesReduced)
} else
taxName <- utils::read.table(nameReducedFile, sep="\t", header=TRUE)
taxonHighlightID <- taxName$ncbiID[
taxName$fullName == taxonHighlight & taxName$rank == rankName]
if (length(taxonHighlightID) == 0L)
taxonHighlightID <- taxName$ncbiID[taxName$fullName==taxonHighlight]
# get taxonID together with it sorted index
selTaxon <- toString(data[data$supertaxonID == taxonHighlightID, 2][1])
selIndex <- grep(selTaxon, levels(as.factor(data$supertaxon)))
if (plotParameter$xAxis == "taxa") {
rect <- data.frame(
xmin=selIndex-0.5, xmax = selIndex+0.5, ymin = -Inf, ymax = Inf)
} else
rect <- data.frame(
ymin=selIndex-0.5, ymax = selIndex+0.5, xmin = -Inf, xmax = Inf)
p <- PhyloProfile::heatmapPlotting(data, plotParameter) + geom_rect(
data = rect, color = "yellow", alpha = 0.3, inherit.aes = FALSE,
aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax))
}
# highlight gene
if (geneHighlight != "none") {
selIndex <- match(geneHighlight, levels(as.factor(data$geneID)))
if (plotParameter$xAxis == "taxa") {
rect <- data.frame(
ymin=selIndex-0.5, ymax = selIndex+0.5, xmin = -Inf, xmax = Inf)
} else
rect <- data.frame(
xmin=selIndex-0.5, xmax = selIndex+0.5, ymin = -Inf, ymax = Inf)
p <- PhyloProfile::heatmapPlotting(data, plotParameter) + geom_rect(
data = rect, color = "yellow", alpha = 0.3, inherit.aes = FALSE,
aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax))
}
return(p)
}
Loading

0 comments on commit 661331d

Please sign in to comment.