printInformationSelect: Display information on connected features of selected...

View source: R/shinyApp.R

printInformationSelectR Documentation

Display information on connected features of selected features

Description

Displays information on connected features of selected features.

Usage

printInformationSelect(
  select,
  sps = NULL,
  linkDfInd,
  linkDf,
  similarityMatrix,
  roundDigits = 2
)

Arguments

select

character, obtained from groupname, character of selected feature

sps

Spectra object containing spectra that are compared in similarityMatrix

linkDfInd

numeric indices of selected features

linkDf

data.frame that contains information of linked features for given thresholds

similarityMatrix

matrix that is used to get information on the degree of similarity, similarityMatrix is an ordered version of a similarity matrix, see ?orderSimilarityMatrix

roundDigits

numeric(1), how many digits should be displayed?

Details

printInformationSelect is for internal use.

Value

character that is in HTML format

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

data("spectra", package = "MetCirc")
sps_tissue@metadata$names <- rep("Unknown", 259)
sps_tissue@metadata$information <- rep("Unknown", 259)
sps_tissue@metadata$classes <- rep("Unknown", 259)
sps_tissue@metadata$adduct <- rep("Unknown", 259)
similarityMat <- Spectra::compareSpectra(sps_tissue[1:10],
    FUN = MsCoreUtils::ndotproduct, ppm = 20, m = 0.5, n = 2)
rownames(similarityMat) <- colnames(similarityMat) <- sps_tissue$name[1:10]
linkDf <- createLinkDf(similarityMatrix = similarityMat,
    sps = sps_tissue[1:10], 
    condition = c("SPL", "LIM", "ANT", "STY"), lower = 0.01, upper = 1)
    
## cut link data.frame (here: only display links between groups)
linkDf_cut <- cutLinkDf(linkDf, type = "inter")
groupname <- c(as.character(linkDf_cut[, "spectrum1"]),
            as.character(linkDf_cut[, "spectrum2"]))
groupname <- unique(groupname)

## arbitrarily select a feature
ind <- 2
linkDfInds <- getLinkDfIndices(groupname[ind], linkDf_cut)
MetCirc:::printInformationSelect(select = groupname[ind], 
    sps = sps_tissue[1:10], linkDfInd = linkDfInds, 
    linkDf = linkDf_cut, similarityMatrix = similarityMat)


tnaake/MetCirc documentation built on Nov. 3, 2024, 11:16 a.m.