calculateSzymkiewicz: Calculate Szymkiewicz-Simpson metric

View source: R/CNVMetricsOverlapInternalMethods.R

calculateSzymkiewiczR Documentation

Calculate Szymkiewicz-Simpson metric

Description

Calculate Szymkiewicz-Simpson metric using overlapping regions between two samples.

Usage

calculateSzymkiewicz(sample01, sample02)

Arguments

sample01

a GRanges which contains a collection of genomic ranges representing copy number events for the first sample.

sample02

a GRanges which contains a collection of genomic ranges representing copy number events for the second sample.

Details

The method calculates the Szymkiewicz-Simpson metric using overlapping regions between the samples. All regions present in both samples all used for the calculation of the metric.

The Szymkiewicz-Simpson metric is calculated by dividing the size of the intersection by the smaller of the size of the two sets. If one sample has a size of zero, the metric is not calculated; the value NA is returned instead. The strand of the regions is not taken into account while calculating the intersection.

Value

a numeric, the value of the Szymkiewicz-Simpson metric. If the metric cannot be calculated, NA is returned.

Author(s)

Astrid Deschênes

References

Vijaymeena, M. K, and Kavitha K. 2016. “A Survey on Similarity Measures in Text Mining.” Machine Learning and Applications: An International Journal 3 (1): 19–28. doi: https://doi.org/10.5121/mlaij.2016.3103

Examples


## Load required package to generate the two samples
require(GenomicRanges)

## Generate two samples with identical sequence levels
sample01 <- GRanges(seqnames="chr1", 
    ranges=IRanges(start=c(1905048, 4554832, 31686841), 
    end=c(2004603, 4577608, 31695808)), strand="*")
sample02 <- GRanges(seqnames="chr1", 
    ranges=IRanges(start=c(1995066, 31611222), 
    end=c(2204505, 31689898)), strand=c("+", "-"))

## Calculate Szymkiewicz-Simpson metric
CNVMetrics:::calculateSzymkiewicz(sample01=sample01, sample02=sample02)
    

KrasnitzLab/CNVMetrics documentation built on July 30, 2023, 2:22 p.m.