computeNwWordCloud: Compute wordCloud of the input network

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

Usage

1
computeNwWordCloud(edgelist, nodelist, annotation, internalid)

Arguments

edgelist

a data frame of edges contains at least a source column (1st column) and a target column (2nd column).

nodelist

a data frame of nodes contains at least two columns of node attributes. 1st column is id or neo4j id, 2nd column is id or grinn id. The 2nd column is used for Mesh annotation.

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 the network nodes are neo4j ids, if TRUE (default). If not, the network nodes are expected to be any ids. 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, wordcloud and pairs. The pairs 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
#simnw <- computeSimilarity(c(1110,10413,196,51,311,43,764,790)) #compute similarity network for given pubchem compounds
#result <- computeNwWordCloud(simnw$edges, simnw$nodes, 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.