run_calckinship: Calculate kinship matrix

View source: R/run_calckinship.R

run_calckinshipR Documentation

Calculate kinship matrix

Description

Calculate genetic similarity among individuals (kinship matrix) from conditional genotype probabilities.

Usage

run_calckinship(
  input_file,
  output_file,
  type = c("overall", "loco", "chr"),
  omit_x = FALSE,
  use_allele_probs = TRUE,
  cores = 1,
  compress = FALSE
)

Arguments

input_file

Input RDS file containing genotype or allele probabilities

output_file

Output RDS file for calculated kinship matrix

type

Indicates whether to calculate the overall kinship ("overall", using all chromosomes), the kinship matrix leaving out one chromosome at a time ("loco"), or the kinship matrix for each chromosome ("chr").

omit_x

If TRUE, only use the autosomes; ignored when type="chr".

use_allele_probs

If TRUE, assess similarity with allele probabilities (that is, first run qtl2::genoprob_to_alleleprob()); otherwise use the genotype probabilities.

cores

Number of CPU cores to use, for parallel calculations. (If 0, use parallel::detectCores().) Alternatively, this can be links to a set of cluster sockets, as produced by parallel::makeCluster().

compress

If TRUE, save a compressed RDS file (smaller but slower).

Examples

input_file <- paste0("https://github.com/rqtl/qtl2data/",
                     "blob/master/B6BTBR/b6btbr.zip")
## Not run: cross2rds(input_file, "b6btbr.rds")
## Not run: run_calcgenoprob("b6btbr.rds", "b6btbr_probs.rds")
## Not run: run_calckinship("b6btbr_probs.rds", "b6btbr_kinship.rds")

rqtl/qtl2cl documentation built on Oct. 13, 2024, 1:11 a.m.