Function to perform SNP-set analysis using an entropy-based bivariate statistic
compute_association.RdCompute the association between SNPs in the given SNP-sets and the phenotype.
Usage
compute_association(
root_file_name,
pathpathways = paste(dirname(root_file_name), "/pathways/", sep = ""),
pathwaylistfile = paste(dirname(root_file_name), "/pathwaylist.txt", sep = ""),
nullhypmsfile = paste(dirname(root_file_name), "/nullhyp_ms.txt", sep = ""),
nullhyps2file = paste(dirname(root_file_name), "/nullhyp_s2.txt", sep = ""),
out_selected = paste(dirname(root_file_name), "/selected_snps.txt", sep = ""),
seed = 0,
alpha = 0.05,
B = 1,
min_snps = 1,
max_snps = 15000,
N_cores = 1,
n_rows = 1,
verbosity = 0,
mode = 0,
association_mode = "MAX"
)Arguments
- root_file_name
The full path to a triplet of plink .bim, .bed and .fam files, without extension.
- pathpathways
Directory containing one tab-delimited file per SNP-set. Each file must be named
<SNP_SET_NAME>.txt, contain no header, and store exactly 3 columns: SNP identifier, chromosome, and base-pair position. Example row:rs123<TAB>17<TAB>43044295. SNP identifiers must match the SNP IDs reported in the input.bimfile.- pathwaylistfile
Tab-delimited file describing which SNP-sets to analyse. It must contain one row per SNP-set, with no header, in the form
<SNP_SET_NAME><TAB><NUM_SNPS>, where<SNP_SET_NAME>matches the corresponding filename inpathpathwayswithout the.txtextension.- nullhypmsfile
The name of the file where to read the vector of samples from the statistic MS under the Null hypothesis.
- nullhyps2file
The name of the file where to read the vector of samples from the statistic S2 under the Null hypothesis.
- out_selected
The name of the file where to write the results.
- seed
The seed for the random number generator.
- alpha
The desired significance level for the single gene set.
- B
The number of bootstrap samples.
- min_snps
The minimum number of SNPs in a pathway.
- max_snps
The maximum number of SNPs in a pathway.
- N_cores
The number of cores to use for parallel computation.
- n_rows
The number of bivariate statistic rows to compute in parallel.
- verbosity
Integer verbosity level (0 = minimal output, higher values increase logging).
- mode
Compatibility parameter. Only
0(discrete phenotype) is supported.- association_mode
The mode of association. Allowed values are MAX, ALL.
Value
data.frame A data frame containing the results of the pathway analysis for each SNP-set.
Details
Function to perform SNP-set analysis using an entropy-based bivariate statistic.
The function reads the SNP-set files from the directory pathpathways and the list of SNP-sets
from the file pathwaylistfile. The function also reads the null hypothesis samples from the
files nullhypmsfile and nullhyps2file. The function writes the results to the file out_selected.
Examples
if (FALSE) { # \dontrun{
root <- tempfile("synthetic")
synthetic <- nebula::simulate_synthetic_genotype(
n_snps = 20,
n_individuals = 20,
n_causal_snps = 3
)
nebula::save_synthetic_genotype(synthetic, file = root)
nebula::generate_synthetic_snpsets(
input_file = paste0(root, ".bim"),
snps_per_set = 5,
num_sets = 4,
root_dir = dirname(root)
)
} # }