htrx_max {HTRX}R Documentation

Maximum independent features for HTRX

Description

The maximum number of independent features in principle from haplotypes (i.e. interactions between SNPs) generated by Haplotype Trend Regression with eXtra flexibility (HTRX).

Usage

htrx_max(nsnp, n_haps = NULL, cap = 40, max_int = NULL, htr = FALSE)

Arguments

nsnp

a positive integer giving the number of single nucleotide polymorphisms (SNPs) included in the haplotypes.

n_haps

a positive integer giving the number of haplotypes, which is also the number of columns of the HTRX or HTR matrix.

cap

a positive integer which manually sets the maximum number of independent features. By default, cap=40.

max_int

a positive integer which specifies the maximum number of SNPs that can interact. If no value is given (by default), interactions between all the SNPs will be considered.

htr

logical. If htr=TRUE, the functions returns the maximum number of independent features for HTR. By default, htr=FALSE.

Details

The maximum number of independent features in principle is 2nsnp-1 for haplotypes containing interactions between all different numbers of SNPs. However, if max_int < nsnp, i.e. only the interactions between at most max_int SNPs are investigated, there will be fewer maximum number of independent features. You can also manually set the upper limit of independent features (by setting cap) that can be included in the final HTRX or HTR model.

Value

htrx_max returns a positive integer giving the maximum number of independent features to be included in the analysis.

Examples

## the maximum number of independent haplotypes consisted of 4 SNPs from HTRX
htrx_max(nsnp=4,n_haps=(3^4-1))

[Package HTRX version 1.2.4 Index]