computeNodeWordCloud: Compute wordCloud of the input entities

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

compute wordCloud of the list of entities. The function wraps around the main steps of tm to wordCloud.

Usage

1
computeNodeWordCloud(txtinput, nodetype, annotation, internalid)

Arguments

txtinput

a character vector of entities e.g. c('pubchemId1', 'pubchemId2'). The value can be neo4j ids or grinn ids, see details and see convertId for how to convert ids. For Mesh annotation, PubChem CIDs are required.

nodetype

a string specifying a node type. It can be one of compound (default), protein, gene, pathway, rna, dna.

annotation

a string specifying the annotation type e.g. pathway (default) and mesh. Pathway annotation requires the database. Mesh annotation doesn't require the database but it is available for PubChem compounds only.

internalid

a logical value indicating whether txtinput is the neo4j id, if TRUE (default). If not, txtinput is expected to be the grinn id or PubChem CID. See details and see convertId for how to convert ids. It has no effect on Mesh annotation.

Details

The database uses two id systems. The neo4j id is a numeric, internal id automatically generated by the database system. The grinn id (gid) is an id system of Grinn database that uses main ids of standard resources i.e. ENSEMBL for genes (e.g.ENSG00000139618), UniProt for proteins (e.g.P0C9J6), PubChem CID for compounds (e.g.5793), KEGG for pathways (e.g.hsa00010).

Value

list of data frame of nodes, edges and wordcloud. The nodes data frame contains input attributes. The edges data frame contains annotation pairs. The data frame of wordcloud contains the following components:

rank = rank sort by freq

id = annotation id or annotation neo4j id

gid = annotation id or annotation grinn id

nodename = annotation name

nodelabel = annotation type

nodexref = cross references

freq = frequency or number of input entities in each annotation term

member = list of members of the annotation term

Return list of empty data frame if error or found nothing.

Author(s)

Kwanjeera W kwanich@ucdavis.edu

References

http://www.sthda.com/english/wiki/text-mining-and-word-cloud-fundamentals-in-r-5-simple-steps-you-should-know

See Also

tm, wordcloud

Examples

1
2
3
4
#txtinput <- c(1110,10413,196,51,311,43,764,790) #compute wordCloud for given pubchem compounds
#result <- computeNodeWordCloud(txtinput=txtinput, nodetype="compound", annotation="mesh", internalid=FALSE)
#wordcloud::wordcloud(words = result$wordcloud$nodename, freq = result$wordcloud$freq, scale=c(2,.1),min.freq = 1,max.words=50, random.order=FALSE, rot.per=0.5, colors=RColorBrewer::brewer.pal(8, "Dark2"))
#barplot(result$wordcloud$freq[1:10], las = 2, names.arg = result$wordcloud$nodename[1:10], col ="lightblue", main ="Most frequent words", ylab = "Word frequencies")

kwanjeeraw/metabox documentation built on May 20, 2019, 7:07 p.m.