CosineDFV: calculate disease similarity by using feature vectors

Description Usage Arguments Value Author(s) References Examples

Description

given two (lists of) disease names, this function will calculate cosine similarity between these diseases' feature vectors.

Usage

1
CosineDFV(D1, D2, d2f, dcol = 2, fcol = 1, ccol = 3)

Arguments

D1

a vector consists of disease ids/names

D2

another vector consists of disease ids/names

d2f

data.frame, contains term co-occurrences between features and diseases

dcol

integer, disease column number in d2f

fcol

integer, feature column number in d2f

ccol

integer, co-occurrences column number in d2f

Value

a matrix of disease disease similarity which rownames and colnames are the disease names

Author(s)

Zhihui Fei, Peng Ni, Min Li

References

Zhou X Z, Menche J, Barabasi A L, et al. Human symptoms-disease network[J]. Nature communications, 2014, 5.

Van Driel M A, Bruggeman J, Vriend G, et al. A text-mining analysis of the human phenome[J]. European journal of human genetics, 2006, 14(5): 535-542.

Examples

1
2
3
4
5
### this is a disease-symptom-cooccurrence sample, if you want to use 
### the complete data, please use "data(d2s_hsdn)" command
data(d2s_hsdn_sample)
ds <- sample(unique(d2s_hsdn_sample[,2]), 10)
simmat <- CosineDFV(ds, ds, d2s_hsdn_sample)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union



preparing before calculating..
calculating symptom similarity of each disease pair.. this may take a while..
calculation completed..

dSimer documentation built on May 2, 2019, 12:40 a.m.