InteractionClassification {qvirus}R Documentation

Classify HIV phenotype interactions using k-means clustering

Description

This function performs k-means clustering on the differences in viral load and CD4 counts to classify interaction types between HIV phenotypes. It returns an object of class InteractionClassification, a data.frame with classification labels.

Usage

InteractionClassification(cd_result, vl_result, k = 4, ns = 100, seed = 123)

Arguments

cd_result

A numeric vector of differences in CD4 T-cell counts.

vl_result

A numeric vector of differences in log viral load.

k

Integer. The number of clusters to use in k-means. Default is 4.

ns

Integer. Number of random initializations for the k-means algorithm. Default is 100.

seed

Integer. Seed for random number generation to ensure reproducibility. Default is 123.

Value

A data.frame of class InteractionClassification with three columns:

cds3_result

The CD4 count difference for each interaction.

vlogs3_result

The viral load difference (log scale) for each interaction.

classification

An integer label (1 to k) indicating the interaction cluster.

Examples

set.seed(42)
data(cd_3)
cd_data <- cd_3[,-1]
cd_result <- cds_diff(cd_data)
data(vl_3)
vl_data <- vl_3[,-1]
vl_result <- vlogs_diff(vl_data)
result <- InteractionClassification(cd_result = cd_result, vl_result = vl_result)

[Package qvirus version 0.0.4 Index]