snp_linkage: Calculate linkage around SNP of interest.

snp_linkageR Documentation

Calculate linkage around SNP of interest.

Description

Calculate linkage around SNP of interest.

Usage

snp_linkage(
  gwas_table,
  rank,
  anchored = FALSE,
  plot = FALSE,
  SNPmatrix = NULL,
  nuc_range = 50000,
  ld_depth = 1000,
  ld_stats = "LLR",
  ld_symmetric = FALSE,
  ld_cutoff = 10,
  ld_legend = FALSE,
  add_ld_band = FALSE,
  use_phenotype_table = NULL,
  acc_col = "ACC_ID",
  use_all_acc = FALSE,
  data_only = FALSE
)

Arguments

gwas_table

Object returned from format_gwas function

rank

Rank of the SNP of interest

anchored

Perform anchored analysis. If TRUE Linkage will only be estimated for the SNP of interest, and the surrounding ones, but not between surrounding SNPs.

plot

Default FALSE. Should a plot be returned, instead of the table? Only supported for anchored = T

SNPmatrix

default NULL. Needs to provided as a path to an fst file. Will be used instead of polymorph.

nuc_range

Range of nucleotides that will be analyzed (total, split evenly up and downstream of the SNP)

ld_depth

Maximum SNP distance to calculate LD for (only relevant when anchored = FALSE)

ld_stats

The LD statistics, see SNPStats::ld. Default is LLR

ld_symmetric

Should a symmetric matrix be returned? see SNPStats::ld

ld_cutoff

Only SNPs that have an LD values >= this will be plotted (default 10)

ld_legend

Toggle color legend for LD. Off by default.

add_ld_band

add a layer showing the LD as a lot of lines. (default FALSE)

use_phenotype_table

If supplied: Genotypes listed here will be used for linkage analysis. Otherwise, all accessions that carry this SNP will be included.

acc_col

Name of the column containing accession identifiers in the phenotype table

use_all_acc

If true, will override use_phenotype_table and use all 1135 sequenced accessions.

data_only

Return the data used for plotting, instead of the plot, defaults to FALSE.

Details

This function calculates LD in a specific region.

The SNPs per accession in the region are retrieved from polymorph or from a provided SNPmatrix.

Sometimes, the ld function produces no result, especially when used with anchored = T.

anchored analysis will use one SNP can compute LD of that SNP against a region.

Default settings return the LD table.


Gregor-Mendel-Institute/gwaR documentation built on Feb. 8, 2023, 8:34 p.m.