Skip to content

Commit

Permalink
getter functions
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Feb 8, 2024
1 parent c41a2ad commit 2eae0a2
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Authors@R: person("Noriaki", "Sato", email = "[email protected]", role = c("cre", "aut
Depends: ggplot2, ggstar, ggraph, igraph
Imports: GetoptLong, BiocFileCache, RCurl, igraph, vegan, methods, data.table, phangorn, RColorBrewer, ggtree, circlize, ComplexHeatmap, ggkegg, ape, dplyr, exactRankTests, ggblend, ggh4x, scales, tidygraph, ggplotify, ggtreeExtra, ggnewscale, scico, MKmisc
Suggests: simplifyEnrichment, stringr, tidyr, Boruta, knitr, ggrepel
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export(genomeHeatmap)
export(getAdonis)
export(getCl)
export(getFasta)
export(getGeneID)
export(getID)
export(getKOID)
export(getSNVID)
export(getSlot)
export(getTree)
export(getTreePlot)
Expand All @@ -51,6 +54,7 @@ export(returnGenes)
export(reverseAnnot)
export(setAnnotation)
export(setGroup)
export(setMap)
export(setMetadata)
export(setTree)
export(strainClusterHeatmap)
Expand Down
39 changes: 39 additions & 0 deletions R/stana.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,45 @@ setGeneric("getCl",
setMethod("getCl", "stana",
function(x) attr(x, "cl"))

#' @export
setGeneric("getGeneID",
function(x, candSp) standardGeneric("getGeneID"))

setMethod("getGeneID", "stana",
function(x, candSp) {
if (is.null(stana@genes[[candSp]])) {
stop("No gene table available")
} else {
return(row.names(stana@genes[[candSp]]))
}
})

#' @export
setGeneric("getSNVID",
function(x, candSp) standardGeneric("getSNVID"))

setMethod("getSNVID", "stana",
function(x, candSp) {
if (is.null(stana@snps[[candSp]])) {
stop("No SNV table available")
} else {
return(row.names(stana@snps[[candSp]]))
}
})

#' @export
setGeneric("getKOID",
function(x, candSp) standardGeneric("getKOID"))

setMethod("getKOID", "stana",
function(x, candSp) {
if (is.null(stana@kos[[candSp]])) {
stop("No KO table available")
} else {
return(row.names(stana@kos[[candSp]]))
}
})

#' initializeStana
#' @noRd
initializeStana <- function(stana,cl) {
Expand Down
4 changes: 3 additions & 1 deletion man/calcKO.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/setMap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/stana-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2eae0a2

Please sign in to comment.