ranksim: Rank ultrasound profiles by similarity

View source: R/MPMcore.R

ranksimR Documentation

Rank ultrasound profiles by similarity

Description

Filter, rank, and return the k top-similar ultrasound profiles respect to the input one, by searchin across a reference dataset. This function implements the similarity profiling module (Moprhonode-SP).

Usage

ranksim(
  u,
  v = NULL,
  x = mpm.us,
  k = 5,
  p = 0.7,
  j = 2:15,
  d = c(2:6, 9, 10, 11),
  signature = NULL,
  check.data = TRUE,
  orderbyDistance = FALSE,
  ...
)

Arguments

u

An ultrasound vector generated by set.rfcdata.

v

An ultrasound profile generated by set.rbmdata (default = NULL). If this argument is not NULL, the core similarity function will be switched from "cosine" to "jaccard".

x

Reference ultrasound data.frame. If no reference is specified, the default simulated dataset (object mpm.us) will be used.

k

Numeric value defining the number of top-k profiles to return after similarity ranking (default = 5).

p

Continuous value from 0 to 1 representing the minimum similarity value for an ultrasound profile to be included in the output (default = 0.7).

j

Indices of the features (columns) in x used to compute profile similarity (default = 2:15).

d

Indices of the features (columns) in x used to compute euclidean distance (default = c(2:6, 9, 10, 11)).

signature

One among "LMR", "MMR", "HMR", "MET" (default = NULL). Resctrict the similarity search to a given metastatic risk signature (if NULL, no signature restriction is applied).

check.data

Logical value. If TRUE (default), the input data type is checked.

orderbyDistance

Logical value. If TRUE, the k top-similar profiles are finally ordered by increasing euclidean distance (default = FALSE).

...

Currently ignored.

Details

The input ultrasound profile is compared to each entry in the reference dataset by computing pairwise similarity. By default, cosine similarity is used, while jaccard similarity is enabled if a binary vector is given. The hits are then filtered by minimum similarity (by default, > 0.7) and pairwise euclidean distance between them is computed. Results are then ranked by either decreasing similarity (default) or increasing distance.

Value

A list of 4 objects:

  1. "signature", metastatic risk signature (MRS);

  2. "p", MRS-associated malignancy risk (evaluated as positive predictive value, according to Fragomeni et al. 2022);

  3. "ci95", 95

  4. "y.uss", naive guess of the outcome (0: non-malignant, 1: malignant), based on the MRS (this will be less accurate than the RFC-based prediction).

Author(s)

Fernando Palluzzi fernando.palluzzi@gmail.com

References

Fragomeni SM, Moro F, Palluzzi F, Mascilini F, Rufini V, Collarino A, Inzani F, Giacò L, Scambia G, Testa AC, Garganese G (2022). Evaluating the risk of inguinal lymph node metastases before surgery using the Morphonode Predictive Model: a prospective diagnostic study. Ultrasound xx Xxxxxxxxxx xxx Xxxxxxxxxx. 00(0):000-000. <https://doi.org/00.0000/00000000000000000000>

Leydesdorff L (2005). Similarity Measures, Author Cocitation Analysis,and Information Theory. In: JASIST 56(7), pp.769-772. <https://doi.org/10.48550/arXiv.0911.4292>

See Also

See us.predict to launch all morphonode modules at once. See also topsim for a simple similarity search.

Examples


# Prepare a simulated malignant ultrasound profile
x <- new.profile(us.simulate(y = 1))
u <- set.rfcdata(x, ref = mpm.us[, 2:15], levels = mpm.levels)
v <- set.rbmdata(x, ref = mpm.us[, 2:15], levels = mpm.levels)
print(u)
print(v)

# Rank using cosine similarity and the default simulated reference
Rc <- ranksim(u$ultrasound)

# Rank using jaccard similarity and the default simulated reference
Rj <- ranksim(u$ultrasound, v$ultrasound)

# Compare the two rankings
print(Rc)
print(Rj)


Morphonodepredictivemodel/morphonode documentation built on Feb. 15, 2023, 4:51 a.m.