save_LD_matrix: Save LD matrix

View source: R/save_LD_matrix.R

save_LD_matrixR Documentation

Save LD matrix

Description

Save an LD matrix after initial pre-processing.

Usage

save_LD_matrix(
  LD_matrix,
  dat,
  locus_dir,
  fillNA = 0,
  LD_reference,
  subset_common = TRUE,
  as_sparse = TRUE,
  verbose = TRUE
)

Arguments

locus_dir

Storage directory to use.

fillNA

Value to fill LD matrix NAs with.

LD_reference

LD reference to use:

  • "1KGphase1" : 1000 Genomes Project Phase 1 (genome build: hg19).

  • "1KGphase3" : 1000 Genomes Project Phase 3 (genome build: hg19).

  • "UKB" : Pre-computed LD from a British European-decent subset of UK Biobank. Genome build : hg19

  • "<vcf_path>" : User-supplied path to a custom VCF file to compute LD matrix from.
    Accepted formats: .vcf / .vcf.gz / .vcf.bgz
    Genome build : defined by user with target_genome.

  • "<matrix_path>" : User-supplied path to a pre-computed LD matrix Accepted formats: .rds / .rda / .csv / .tsv / .txt
    Genome build : defined by user with target_genome.

subset_common

Subset LD_matrix and dat to only the SNPs that are common to them both.

as_sparse

Convert the LD matrix to a sparse matrix.

verbose

Print messages.

Source

dat <- echodata::BST1 LD_matrix <- echodata::BST1_LD_matrix locus_dir <- file.path(tempdir(),echodata::locus_dir) LD_list <- echoLD:::save_LD_matrix( LD_matrix = LD_matrix, dat = dat locus_dir = locus_dir, LD_reference = "UKB") LD_list <- echoLD:::save_LD_matrix( LD_matrix = LD_matrix, dat = dat locus_dir = locus_dir, LD_reference = "custom_vcf")

See Also

Other LD: check_population_1kg(), compute_LD(), filter_LD(), get_LD(), get_LD_1KG(), get_LD_1KG_download_vcf(), get_LD_UKB(), get_LD_matrix(), get_LD_vcf(), get_locus_vcf_folder(), ldlinkr_ldproxy_batch(), plot_LD(), popDat_1KGphase1, popDat_1KGphase3, rds_to_npz(), saveSparse(), snpstats_get_MAF()


RajLabMSSM/echoLD documentation built on May 12, 2024, 3:23 a.m.